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:59, Vladimir Prus<vladimir@codesourcery.com> wrote:
> André Pönitz wrote:
>
>> On Sunday 28 June 2009 21:03:01 Niko Sams wrote:
>>> Hi,
>>>
>>> -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.
>
> As I mention in other email, getting the number of children is in general
> impossible. Maybe, "has_children" flag would be more appropriate -- this
> is somewhat more likely to be computable.
pretty printers could have an additional method to get numchild directly
without iterating over them.
But for a Tree-View has_children would be enough of course.

> I am not sure it was you, but there was an IRC discussion about making
> -stack-list-locals also print type of things -- can you describe exactly
> how you gonna use that information, so that I have a chance to implement
> that properly?
We don't show a type column in KDevelop, but for example QtCreator does.


Niko


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