f78
Selecting a frame
f n
f addr
On the SPARCarchitecture,
On the MIPS and Alpha architecture, it needs two addresses: a stack pointer
and a program counter.
On the 29k architecture, it needs three addresses: a register stack pointer,
a program counter, and a memory stack pointer.
All of these commands end by printing two lines of output describing the
frame. The first line shows the frame number, the function name, the arguments, and
the source file and line number of execution in that frame. The second line
shows the text of that source line. For instance, use the following as an example.
down-silently n
Select frame number n. Recall that frame zero is the innermost (currently executing) frame, frame
one is the frame that called the innermost one, and so on. The highest-numbered
frame is the one for main.
Select the frame at address, addr. This is useful mainly if the chaining of stack frames has been damaged by a
bug, making it impossible for GDB to assign numbers properly to all frames. In
addition, this can be useful when your program has multiple stacks and switches
between them.
Move n frames up the stack. For positive numbers n, this advances toward the outermost frame, to higher frame numbers, to frames
that have existed longer. n defaults to one.
Move n frames down the stack. For positive numbers n, this advances toward the innermost frame, to lower frame numbers, to frames
that were created more recently. n defaults to one. You may abbreviate down as do.
#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc)
at env.c:10
10 read_input_file (argv[i]);
These two commands are variants of up and down, respectively; they differ in that they do their work silently, without
causing display of the new frame. They are intended primarily for use in GDB command
scripts, where the output might be unnecessary and distracting.