From: Vladimir Prus <vladimir@codesourcery.com>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [MI] -stack-list-variables
Date: Sun, 20 Sep 2009 06:18:00 -0000 [thread overview]
Message-ID: <200909201018.36901.vladimir@codesourcery.com> (raw)
In-Reply-To: <20090919224050.5DE89C164@totara>
On Sunday 20 September 2009 Nick Roberts wrote:
> > ...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"}]
Well, with values printed, the output is:
-stack-list-variables --thread 1 --frame 0 --all-values
^done,variables=[{name="x",value="11"},{name="s",value="{a = 1, b = 2}"}]
and is therefore OK. It's no-values case that takes shortcuts. However,
I plan a follow-up patch really soon now that will make -stack-list-variables
output a block where each variable defined. As result, there will be
two attributes for each variable, and the output above will be used in
all cases, regardless of whether printing of values was requested.
> 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"}]}
Why would frontend care about which are locals and which are arguments? I don't
think I saw any GUI than distinguish between those in variables view. Even
if we decide this information is necessary, would it not be better to present it
like this:
^done,variables=[{name="i", arg="1"},{name="asdf"}]
as this format is more extensible in case some other frontend might need
even more finer details?
- Volodya
next prev parent reply other threads:[~2009-09-20 6:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-19 10:12 Vladimir Prus
2009-09-19 10:13 ` Vladimir Prus
2009-09-19 10:38 ` Eli Zaretskii
2009-09-19 11:15 ` Vladimir Prus
2009-09-19 15:45 ` Joel Brobecker
2009-09-19 15:46 ` Joel Brobecker
2009-09-19 22:41 ` -stack-list-variables Nick Roberts
2009-09-20 6:18 ` Vladimir Prus [this message]
2009-09-20 22:05 ` [MI] -stack-list-variables Nick Roberts
2009-09-21 5:14 ` Vladimir Prus
2009-09-21 7:13 ` Nick Roberts
2009-09-21 7:39 ` Vladimir Prus
2009-09-21 15:29 ` Joel Brobecker
2009-09-21 16:02 ` Vladimir Prus
2009-09-21 16:27 ` Joel Brobecker
2009-09-21 16:54 ` Vladimir Prus
2009-09-21 17:04 ` Tom Tromey
2009-09-21 17:17 ` Vladimir Prus
2009-09-21 17:24 ` Tom Tromey
2009-09-21 17:03 ` Marc Khouzam
2009-09-21 22:10 ` Nick Roberts
2009-09-22 5:31 ` Vladimir Prus
2009-09-22 14:50 ` Daniel Jacobowitz
2009-09-29 6:35 ` Vladimir Prus
2009-09-29 23:27 ` Nick Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200909201018.36901.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox