From: nickrob@snap.net.nz (Nick Roberts)
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Patch: implement new dynamic varobj spec
Date: Tue, 15 Sep 2009 22:28:00 -0000 [thread overview]
Message-ID: <19120.5383.874148.235514@totara.tehura.co.nz> (raw)
In-Reply-To: <m3r5u8z0b2.fsf@fleche.redhat.com>
> With a dynamic varobj you can tell if it has children by examining the
> has_more attribute.
The field has_more tells you if it _currently_ has children. If you create a
variable object of a STL container immediately after declaring an empty
container, e.g. after
map<string, int> m;
then has_more=0 yet the node for it would need to be expandable. In Emacs
this means there is a plus sign on the icon in the toolbar. Clicking on
it gives no immediate children but then as you proceed:
l.push_back (1);
l.push_back (2);
the additional children appear. With a string there are never any children
so you would not want an expandable node. AFAICS the only way the front end
can discriminate is through the displayhint field.
On that note, printers.py in libstdc++ doesn't have a displayhint function for
StdListPrinter.
Also there appears to be something wrong with the python class
StdVectorPrinter because if you create a variable object immediately after
declaring it, e.g. after
vector<int> v(4); // create vector of integers with 4 elts
then do -var-list-children, GDB hangs:
-var-create - * v
^done,name="var1",numchild="0",value="{...}",type="std::vector<int, std::allocator<int> >",thread-id="1",dynamic="1",has_more="1"
(gdb)
-var-list-children var1
p v gives:
p v
&"p v\n"
~"$1 = std::vector of length -17178288109, capacity 35167192218076 = {"
&"Cannot access memory at address 0x1000000006\n"
^error,msg="Cannot access memory at address 0x1000000006"
(gdb)
while a similar declaration for list just prints with uninitialised values.
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2009-09-15 22:28 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-10 20:58 Tom Tromey
2009-09-11 5:41 ` Nick Roberts
2009-09-11 19:41 ` Tom Tromey
2009-09-11 20:49 ` Eli Zaretskii
2009-09-11 21:12 ` Tom Tromey
2009-09-12 8:08 ` Eli Zaretskii
2009-09-11 23:55 ` Nick Roberts
2009-09-14 19:59 ` Tom Tromey
2009-09-14 22:55 ` Nick Roberts
2009-09-15 15:37 ` Tom Tromey
2009-09-15 22:28 ` Nick Roberts [this message]
2009-09-16 5:45 ` Vladimir Prus
2009-09-16 9:56 ` Nick Roberts
2009-09-16 17:12 ` Tom Tromey
2009-09-16 22:26 ` Nick Roberts
2009-09-15 22:43 ` Nick Roberts
2009-09-16 5:39 ` Vladimir Prus
2009-09-16 9:36 ` Nick Roberts
2009-09-16 5:44 ` Vladimir Prus
2009-09-16 23:52 ` RFA: mark -enable-pretty-printing as experimental (Was: Patch: implement new dynamic varobj spec) Tom Tromey
[not found] ` <h8vk80$fqc$2@ger.gmane.org>
2009-09-18 10:02 ` Eli Zaretskii
2009-09-18 18:01 ` RFA: mark -enable-pretty-printing as experimental Tom Tromey
2009-09-14 19:56 ` Patch: implement new dynamic varobj spec Tom Tromey
2009-09-12 9:18 ` Eli Zaretskii
2009-09-14 20:03 ` Tom Tromey
2009-09-14 20:22 ` Eli Zaretskii
2009-09-14 21:29 ` Tom Tromey
2009-09-15 3:06 ` Eli Zaretskii
2009-09-14 11:24 ` Vladimir Prus
2009-09-16 23:53 ` Tom Tromey
2009-09-16 5:46 ` Vladimir Prus
2009-09-19 12:01 ` Matt Rice
2009-09-19 15:59 ` Joel Brobecker
2009-09-14 20:05 ` Tom Tromey
2009-09-14 20:24 ` Eli Zaretskii
2009-09-14 23:58 ` Nick Roberts
2009-09-18 9:29 ` Vladimir Prus
2009-09-18 18:25 ` Tom Tromey
2009-09-19 12:57 ` Vladimir Prus
2009-09-13 2:41 Nick Roberts
2009-09-14 20:12 ` Tom Tromey
2009-09-14 20:21 ` Tom Tromey
2009-09-15 0:03 ` Nick Roberts
2009-09-14 23:48 ` Nick Roberts
2009-09-15 15:38 ` Tom Tromey
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=19120.5383.874148.235514@totara.tehura.co.nz \
--to=nickrob@snap.net.nz \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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