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 Interface - interpretation of value returned by -stack-list-locals (C++)


On Saturday 26 March 2011 17:36:23 ext BarrRobot wrote:
> 
> The value returned by "-stack-list-locals 1" (inter alia) is of the form:
> 
> ^done,locals=[{name="variable",value="a quoted string"}....]
> 
> i.e. a List of Tuples containing Results. 
> 
> When "variable" of the first Result is a 'complex' type - typically an
> instantiated class, the quoted string Value of the second appears to be
> exactly the same (with allowance for escaped characters) as that produced by
> the equivalent console interface (CLI) command and whilst parts of it
> conform to the MI output specification, other parts - I am thinking of the
> representation of arrays - do not. Is there an intention to present the
> entire output of these commands in the defined MI output syntax, and if not,
> what is the recommended way to handle this part of the output, i.e. is it
> the expectation to present it 'as is' to the user, or is it safe to attempt
> to parse out the component parts and their values with rules derived from
> the CLI output?

[I am only a user of MI, so that's not an authoritative answer.]

I think the idea is to present the data to your users in a way you (or
even they ;-}) see fit. If that requires extra formatting or "enrichment"
on top of what is provided by default gdb output it's the task of the MI
"consumer" to create this - possibly by additional communication with gdb.

There will be always special wishes regarding formatting or display layout,
and the gdb side cannot be expected to hardcode all of them. The only
scalable solution is providing hooks for user defined functionality, and for
that gdb already provides Python based scripting. 

Andre'


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