Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: [mi] -stack-list-arguments --simple-values
Date: Wed, 01 Jul 2009 13:13:00 -0000	[thread overview]
Message-ID: <19019.24800.902658.94531@totara.tehura.co.nz> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2009-07-01 13:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30  9:39 Vladimir Prus
2009-06-30 13:59 ` Daniel Jacobowitz
2009-07-01 13:13 ` Nick Roberts [this message]
2009-07-01 17:34   ` Vladimir Prus
2009-07-01 17:45     ` Niko Sams
2009-07-02  8:05       ` André Pönitz
2009-07-02  8:13         ` Niko Sams
2009-07-02  9:37         ` Nick Roberts
2009-07-02 10:30           ` Vladimir Prus
2009-07-03  8:33             ` Nick Roberts
2009-07-24 22:07               ` Tom Tromey
2009-07-25  7:21                 ` Vladimir Prus
2009-07-26 11:42                 ` 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=19019.24800.902658.94531@totara.tehura.co.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sources.redhat.com \
    --cc=vladimir@codesourcery.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