Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "André Pönitz" <andre.poenitz@nokia.com>
To: gdb@sourceware.org
Subject: Re: -stack-list-locals and children
Date: Mon, 29 Jun 2009 08:37:00 -0000	[thread overview]
Message-ID: <200906291038.07907.andre.poenitz@nokia.com> (raw)
In-Reply-To: <19016.30632.619762.345807@totara.tehura.co.nz>

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.
 
> Remember that these aren't variable objects but in Emacs, at least, you can
> make variable objects from them simply by clicking mouse-2 on them in the
> locals buffer.
> 
> It can be expensive to make variable objects from all the locals every time
> the frame changes but this is what Insight does, and Apple GDB has MI code
> to do it.  So maybe Xcode does too.

Apple creates variables automatically and it is not slow.

Andre'



  reply	other threads:[~2009-06-29  8:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28 19:03 Niko Sams
2009-06-28 19:31 ` Vladimir Prus
2009-06-28 19:56   ` Niko Sams
2009-06-29  5:26     ` Vladimir Prus
2009-06-29  7:13       ` Niko Sams
     [not found]       ` <629542d40906290012p33c5504pde20ddcd7da3474a@mail.gmail.com>
2009-06-29  8:18         ` Vladimir Prus
2009-06-29  9:30           ` Niko Sams
2009-06-29  9:45             ` Vladimir Prus
2009-06-29 11:49             ` Nick Roberts
2009-06-29  7:42 ` André Pönitz
2009-06-29  8:13   ` Nick Roberts
2009-06-29  8:37     ` André Pönitz [this message]
2009-06-29  9:33       ` Niko Sams
2009-06-30 10:14       ` Nick Roberts
2009-06-29 15:34     ` Pawel Piech
2009-06-29 16:40       ` Vladimir Prus
2009-06-29 16:55         ` Vladimir Prus
2009-06-29 22:46       ` Nick Roberts
2009-06-29 23:07         ` Pawel Piech
2009-06-30  3:26           ` Pawel Piech
2009-06-29  8:59   ` Vladimir Prus
2009-06-29  9:32     ` André Pönitz
2009-06-29  9:39       ` Vladimir Prus
2009-06-29 10:13         ` André Pönitz
2009-06-30  9:42           ` Vladimir Prus
2009-06-29  9:36     ` Niko Sams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200906291038.07907.andre.poenitz@nokia.com \
    --to=andre.poenitz@nokia.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox