(gdb)

-stack-list-frames 3 3 ^done,stack=

[frame={level="3 ",addr="0x000107a4",func="foo", file="recursive2.c",line="14"}]

(gdb)

The -stack-list-locals command

Synopsis

-stack-list-locals print-values

Display the local variable names for the current frame. With an argument of 0 prints only the names of the variables, with argument of 1 prints also their values.

GDB command

'info locals' in GDB, 'gdb_get_locals' in gdbtk.

Example

(gdb)

-stack-list-locals 0 ^done,locals=[name="A",name="B",name="C"] (gdb)

-stack-list-locals 1 ^done,locals=[{name="A",value="1"},{name="B",value="2"}, {name="C",value="3"}]

(gdb)

The -stack-select-frame command

Synopsis

-stack-select-frame framenum

Change the current frame. Select a different frame framenum on the stack.

GDB command

The corresponding GDB commands are 'frame', 'up', 'down', 'select-frame','up-silent', and 'down-silent'.

Example

(gdb)

-stack-select-frame 2 ^done

(gdb)

21.9 GDB/MI Stack Manipulation Commands 345