Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Marc Khouzam" <marc.khouzam@ericsson.com>
To: "Nick Roberts" <nickrob@snap.net.nz>, <gdb-patches@sourceware.org>
Subject: RE: [RFC] Variable objects for STL containers
Date: Fri, 15 Feb 2008 14:29:00 -0000	[thread overview]
Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04290EED@ecamlmw720.eamcs.ericsson.se> (raw)
In-Reply-To: <18354.25849.317151.537741@kahikatea.snap.net.nz>

Hi,

> Here's a sample transaction.  Currently the variable object must be created
> after initialisation, e.g.,
> 
> -var-create - * v
> ^done,name="var1",numchild="1",value="{...}",type="std::vector<int,std::allocator<int> >"
> (gdb) 
> -var-list-children --all-values var1
> ^done,numchild="4",children=[child={name="var1.0",exp="0",numchild="0",value="3",type="long"},child={name="var1.1",exp="1",numchild="0",value="0",type="int"},child={name="var1.2",exp="2",numchild="0",value="0",type="int"},child={name="var1.3",exp="3",numchild="0",value="0",type="int"}]
> 
> so that GDB doesn't find a ridiculous (uninitialised) number of children.
> Note there are four children.

Note that I didn't look at the details of the patch yet, so I may be missing some info.
I noticed that in the var-create response of the example above, the number of children
is only 1 instead of 4.  Is that just a typo?

Also I wanted to point out that with Eclipse, it may prove tricky to create
a variable object after initialization.  In eclipse, when starting a debugged program,
the user (most) often selects the "Stop at main" option; that means that the program
will start showing variables right at main().  Since the command
-stack-list-locals shows all locals, even if they have not been declared yet, we
don't know if that variable is initialized yet, and we'll do the var-create and
var-list-children right away.

Is there a way to know that a variable has not been declared yet?  Or maybe
we can add some support in GDB for this?

Marc


  reply	other threads:[~2008-02-15 14:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13  3:33 Nick Roberts
2008-02-15 14:29 ` Marc Khouzam [this message]
2008-02-15 14:42   ` Daniel Jacobowitz
2008-02-15 21:57   ` Nick Roberts
2008-02-17 13:36 ` Vladimir Prus
2008-02-17 20:18   ` Nick Roberts
2008-02-17 21:57     ` Doug Evans
2008-02-17 22:27       ` Nick Roberts
2008-02-26  2:34         ` Daniel Jacobowitz
2008-02-18  7:45       ` Vladimir Prus

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=6D19CA8D71C89C43A057926FE0D4ADAA04290EED@ecamlmw720.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nickrob@snap.net.nz \
    /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