This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re:[MI] -stack-list-variables
- From: nickrob at snap dot net dot nz (Nick Roberts)
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 20 Sep 2009 10:40:50 +1200 (NZST)
- Subject: Re:[MI] -stack-list-variables
- References: <200909191412.37692.vladimir@codesourcery.com>
> ...The new command is called -stack-list-variables,
> and it's checked in into CVS HEAD.
I don't like this patch/commit for a couple of reasons. One reason I
proposed such a command was to move away from the loose syntax that MI
uses. In particular to move away from:
`LIST ==>'
` "[]" | "[" VALUE ( "," VALUE )* "]" | "[" RESULT ( "," RESULT )* "]" '
to
`LIST ==>'
` "[]" | "[" VALUE ( "," VALUE )* "]" '
to provide a more JSON-like syntax.
As with -stack-list-locals, the new output can give something like:
-stack-list-variables --no-values
^done,variables=[name="i",name="j",name="asdf",name="m",name="zxcv",name="qwert"]
but to keep JSON-like syntax, this needs to be:
-stack-list-variables --no-values
^done,variables=[{name="i"},{name="j"},{name="asdf"},{name="m"},{name="zxcv"},{name="qwert"}]
which leads to my second point:
Which `variables' are the arguments and which are locals?
Arguments might be a kind of local but they're not identical.
How about the format below?:
-stack-list-variables --no-values
^done,variables={args=[{name="i"},{name="j"}],
locals=[{name="asdf"},{name="m"},{name="zxcv"},{name="qwert"}]}
--
Nick http://www.inet.net.nz/~nickrob