Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
The -stack-info-depth command
Synopsis
-stack-info-depth [ max-depth ]
Return the depth of the stack. If the integer argument max-depth is specified, do not count beyond
max-depth frames.
GDB command
There is no equivalent GDB command.
Example
For a stack with frame levels 0 through 11:
(gdb)
-stack-info-depth
^done,depth="12"
(gdb)
-stack-info-depth 4
^done,depth="4"
(gdb)
-stack-info-depth 12
^done,depth="12"
(gdb)
-stack-info-depth 11
^done,depth="11"
(gdb)
-stack-info-depth 13
^done,depth="12"
(gdb)
The -stack-list-arguments command
Synopsis
-stack-list-arguments show-values
[ low-frame high-frame ]
Display a list of the arguments for the frames between low-frame and high-frame (inclusive).
If low-frame and high-frame are not provided, list the arguments for the whole call stack.
The show-values argument must have a value of 0 or 1. A value of 0 means that only the names
of the arguments are listed, a value of 1 means that both names and values of the arguments are
printed.
GDB command
GDB does not have an equivalent command. gdbtk has a 'gdb_get_args' command which
partially overlaps with the functionality of '-stack-list-arguments'.
Example
(gdb)
-stack-list-frames
^done,
stack=[
frame={level="0 ",addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"},
frame={level="1 ",addr="0x0001076c",func="callee3",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"},
frame={level="2 ",addr="0x0001078c",func="callee2",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"},
GDB/MI Stack Manipulation Commands 261