This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[mi] -stack-list-arguments --simple-values
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 2 Jul 2009 01:13:04 +1200
- Subject: [mi] -stack-list-arguments --simple-values
- References: <200906301339.30711.vladimir@codesourcery.com>
> This patch makes -stack-list-arguments --simple-values work.
> It looks like --simple-values (and friends) were accepted for
> -stack-list-locals, but not for -stack-list-arguments. While
> the utility of such human friendly spelling is unclear, for
> a machine interface, it's even more confusing having 1/2
> of relevant commands accept it.
It's not immediately clear from the manual that SHOW-VALUES from
-stack-list-arguments and PRINT-VALUES from -stack-list-locals are related.
-stack-list-arguments takes three arguments while -stack-list-locals only
takes -one. I think it would be nice to have one command,
-stack-list-locals-and-args say, that lists both the locals and the arguments
of the current frame:
The `-stack-list-locals-and-args' Command
--------------------------------
Synopsis
........
-stack-list-locals-and-args PRINT-VALUES
Display the local variable and argument names for the selected frame.
If PRINT-VALUES is 0 or `--no-values', print only the names of the
variables; if it is 1 or `--all-values', print also their values; and
if it is 2 or `--simple-values', print the name, type and value for
simple data types and the name and type for arrays, structures and
unions. In this last case, a frontend can immediately display the
value of simple data types and create variable objects for other data
types when the user wishes to explore their values in more detail.
GDB Command
...........
`info locals' and `info locals' in GDB.
Example
.......
(gdb)
-stack-list-locals-and-args 0
^done,vars={locals={name="A",name="B",name="C"},
args={name="arg1",name="arg2"}}
(gdb)
-stack-list-locals-and-args --all-values
^done,vars={locals={{name="A",value="1"},{name="B",value="2"},
{name="C",value="{1, 2, 3}"}},args={{name="arg1",value="5"},
{name="arg4",value="6.2"}}}
(gdb)
using curly brackets which appears to be more in keeping with the
JSON concept of an object.
--
Nick http://www.inet.net.nz/~nickrob