Re: -stack-list-locals and children

Nick Roberts
2009-06-29T22:46:03Z

> No kidding! 2 more questions then:
>
> - does stack-list-args support the --simple-values option?

[-stack-list-arguments]

Not --simple-values directly but you can access it quite easily using the SHOW-VALUES
option which is really the PRINT-VALUES option of -stack-list-locals since the two
MI commands share the same code, namely, list_args_or_locals.

For example,

(gdb)
-stack-list-arguments 0 0 1
^done,stack-args=[frame={level="0",args=[name="i",name="j"]},frame={level="1",args=[name="argc",name="argv"]}]
(gdb)
-stack-list-arguments 1 0 1
^done,stack-args=[frame={level="0",args=[{name="i",value="0x7ffff7871c81"},{name="j",value="0"}]},frame={level="1",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffe7b8"}]}]
(gdb)
--stack-list-arguments 2 0 1
^done,stack-args=[frame={level="0",args=[{name="i",type="int *",value="0x7ffff7871c81"},{name="j",type="int",value="0"}]},frame={level="1",args=[{name="argc",type="int",value="1"},{name="argv",type="char **",value="0x7fffffffe7b8"}]}]
(gdb)

as SHOW-VALUES=2 corresponds to --simple-values.

> - how long has this feature been around?

Since GDB 6.1, which goes back to the start of 2004. I added --simple-values
(and documented it) for the locals buffer in Emacs but it's availability to
-stack-list-arguments was just a side effect, so I never documented that.

I think it would be quite easy to change -stack-list-arguments to accept
--no-values, --simple-values and --all-values if people want it.

--
Nick http://www.inet.net.nz/~nickrob