NOTE:

• On the SPARC architecture, frame needs two addresses to select

 

an arbitrary frame: a frame pointer and a stack pointer.

 

• 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.

up n

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.

down n

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.

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 example:

((gdb)) up

#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc) at env.c:10

10 read_input_file (argv[i]);

After such a printout, the list command with no arguments prints ten lines centered on the point of execution in the frame. See “Printing source lines” (page 77).

up-silentlyn, These two commands are variants of up and down, down-silentlyn 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.

6.6 Information about a frame

The following commands are used to print information about the selected stack frame:

frame, f

When used without any argument, this command does not

 

change which frame is selected, but prints a brief description

 

of the currently selected stack frame. It can be abbreviated f.

 

With an argument, this command is used to select a stack

 

frame. See “Selecting a frame” (page 73).

74 Examining the Stack

Page 74
Image 74
HP gnu source-level debugger 5992-4701 manual Information about a frame, Have existed longer. n defaults to one