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: -stack-list-locals and children


On Mon, Jun 29, 2009 at 10:38, André Pönitz<andre.poenitz@nokia.com> wrote:
> On Monday 29 June 2009 10:13:28 Nick Roberts wrote:
>> ?> > -stack-list-locals doesn't return an numchild element. How can the IDE
>> ?> > know if a local
>> ?> > is has children?
>> ?> >
>> ?> > If there are children, they are listed in value:
>> ?> > ^done,locals=[{name="list",value="QList = {[0] = \"hello\"}"}]
>> ?> >
>> ?> > Is it a good idea to parse the value with an regular expression to
>> ?> > find out if there are children?
>> ?>
>> ?> It would be really nice if 'type' and 'numchild' information was directly
>> ?> included in that "primary" output. The information is available on
>> ?> the gdb side, so parsing it from the 'value' field does not really look
>> ?> like a good solution in the long run.
>>
>> What would you do with this information?
>
> Use it in a GUI frontend to determine whether the item should be
> expandable or not.
>
>> Note that -stack-list-locals --simple-values _does_ give type information and,
>> if this is presented to the user, he can usually infer the number of children.
>> In the manual:
>>
>> ? ? ?-stack-list-locals --simple-values
>> ? ? ?^done,locals=[{name="A",type="int",value="1"},
>> ? ? ? ?{name="B",type="int",value="2"},{name="C",type="int [3]"}]
>> ? ? ?(gdb) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^^^^^^^
>>
>> C has three children.
>
> Sure I can filter out whatever information is implicitly provided in the output,
> and ask for more if needed. But as roundtrips through gdb are expensive
> time-wise It would be nicer though if all information necessary to build the
> top level of the typical "variable view" could be extracted from gdb in one go.
That would be very nice.

Additionally the arguments could show up in locals too - so
-stack-list-arguments can be skipped.

Niko


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