This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[mi] -stack-list-arguments --simple-values


 > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]