Debugging with GDB (September 2007)
54 Debugging with GDB
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 Section 7.1 [Printing source lines], page 57.
up-silently n
down-silently n
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.
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 Section 6.5 [Selecting a frame], page 53.
info frame
info f This command prints a verbose description of the selected stack frame, includ-
ing:
• the address of the frame
• the address of the next frame down (called by this frame)
• the address of the next frame up (caller of this frame)
• the language in which the s ource code c orresponding to this frame is written
• the address of the frame’s arguments
• the address of the frame’s local variables
• the program counter saved in it (the address of execution in the caller
frame)
• which registers were saved in the frame
The verbose description is useful when something has gone wrong that has made
the stack format fail to fit the usual conventions.
info frame addr
info f addr
Print a verbose description of the frame at address addr, without selecting that
frame. The selected frame remains unchanged by this command. This requires