This is the mail archive of the gdb@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]

Re: MI: type prefixes for values


 > > > Also, I note that gdb is currently inconsitent even within itself:
 > > >
 > > >     (gdb)
 > > >     -thread-select 2
 > > >     ^done,new-thread-id="2",frame={level="0",func="thread",
 > > >     args=[{name="p",value="0x0"}],..........
 > > >    (gdb)
 > > >    -stack-list-arguments 1 0 0
 > > >    ^done,stack-args=[frame={level="0",
 > > >    args=[{name="p",value="(void *) 0x0"}]}]
 > > >
 > > > Note that first output has "0x0" as value of 'p', and the second has
 > > > "(void *)0x0".
 > >
 > > Also, the first one shows the func= part, the second doesn't.  
 > 
 > Heh, the second is not supposed to show func= part at all. MI does not have a 
 > command equivalent to "backtrace". One has to list -stack-list-frames (that 
 > does include func=) and -stack-list-arguments (that includes only argument). 
 > BTW, not very convenient.
 > 
 > > Looks 
 > > like a bug to me: those two should both use the same code.
 > 
 > Should I file a bug?

Looking at the code -thread-select uses common_val_print which calls
val_print, while -stack-list-arguments uses print_variable_value which calls
value_print. -stack-list-arguments shares code with -stack-list-locals which
can print type information anyway, so if a common style is agreed, I would
prefer the former.  Perhaps the call to print_variable_value in
list_args_or_locals can just be replaced to a call to common_val_print.

But there are probably many more inconsistencies and missing or redundant
fields.  It won't be possible to add all these in a piecemeal fashion without
repeatedly breaking an existing frontend. I think that a branch is needed so
that the collective changes can be merged into mainline in one go.  I have
already stated that I want to create a branch for the asynchronous stuff.
Perhaps the changes could go there (I'm still waiting for Emacs 22 to be
released to avoid to much dilution of effort).


-- 
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]