From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [MI] -stack-list-variables
Date: Sat, 19 Sep 2009 10:13:00 -0000 [thread overview]
Message-ID: <h92as6$bn2$1@ger.gmane.org> (raw)
In-Reply-To: <200909191412.37692.vladimir@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 728 bytes --]
Vladimir Prus wrote:
>
> MI presently have two separate commands to list locals and arguments in
> the current frame. Most often than not, frontend need both, so having
> to emit two commands is inconvenience and and extra roundtrip. I believe
> Nick has suggested having a single command, and Andre is in favour of
> this idea, and I also think it's good. I actually recall than Nick planned
> to write a patch, but I did not saw any, and this is fairly trivial
> change, so here it goes. The new command is called -stack-list-variables,
> and it's checked in into CVS HEAD.
>
> I'll post doc patch shortly; I will also merge this to 7.0 after a couple
> of days, if no issues appear.
And here's the doc patch.
- Volodya
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: stack-list-variables-docs.diff --]
[-- Type: text/x-diff; name="stack-list-variables-docs.diff", Size: 2061 bytes --]
? ChangeLog.lines
? ChangeLog.my
? all
? my
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.626
diff -u -p -r1.626 gdb.texinfo
--- gdb.texinfo 18 Sep 2009 18:03:45 -0000 1.626
+++ gdb.texinfo 19 Sep 2009 10:10:47 -0000
@@ -23130,6 +23130,9 @@ The @var{show-values} argument must have
0 means that only the names of the arguments are listed, a value of 1
means that both names and values of the arguments are printed.
+Use of this command to obtain arguments in a single frame is
+deprecated in favor of the @samp{-stack-list-variables} command.
+
@subsubheading @value{GDBN} Command
@value{GDBN} does not have an equivalent command. @code{gdbtk} has a
@@ -23314,6 +23317,9 @@ display the value of simple data types a
other data types when the user wishes to explore their values in
more detail.
+This command is deprecated in favor of the
+@samp{-stack-list-variables} command.
+
@subsubheading @value{GDBN} Command
@samp{info locals} in @value{GDBN}, @samp{gdb_get_locals} in @code{gdbtk}.
@@ -23334,6 +23340,31 @@ more detail.
(gdb)
@end smallexample
+@subheading The @code{-stack-list-variables} Command
+@findex -stack-list-variables
+
+@subsubheading Synopsis
+
+@smallexample
+ -stack-list-variables @var{print-values}
+@end smallexample
+
+Display the names of local variables and function arguments for the selected frame. If
+@var{print-values} is 0 or @code{--no-values}, print only the names of
+the variables; if it is 1 or @code{--all-values}, print also their
+values; and if it is 2 or @code{--simple-values}, print the name,
+type and value for simple data types and the name and type for arrays,
+structures and unions.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-stack-list-variables --thread 1 --frame 0 --all-values
+^done,variables=[{name="x",value="11"},{name="s",value="{a = 1, b = 2}"}]
+(gdb)
+@end smallexample
+
@subheading The @code{-stack-select-frame} Command
@findex -stack-select-frame
next prev parent reply other threads:[~2009-09-19 10:13 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 [this message]
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 ` [MI] -stack-list-variables Vladimir Prus
2009-09-20 22:05 ` 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='h92as6$bn2$1@ger.gmane.org' \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
/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