From: Tom Tromey <tromey@redhat.com>
To: nickrob@snap.net.nz (Nick Roberts)
Cc: gdb-patches@sourceware.org
Subject: Re: Patch: implement new dynamic varobj spec
Date: Fri, 11 Sep 2009 19:41:00 -0000 [thread overview]
Message-ID: <m363bpgti0.fsf@fleche.redhat.com> (raw)
In-Reply-To: <19113.58116.381538.294631@totara.tehura.co.nz> (Nick Roberts's message of "Fri, 11 Sep 2009 17:41:24 +1200")
>>>>> "Nick" == Nick Roberts <nickrob@snap.net.nz> writes:
Nick> Dynamic variable objects seem to behave differently to the current
Nick> ones:
Yeah.
Nick> 1) Children are reported (and presumably created) in var-update
Nick> even though only a root variable object may have been created,
Nick> i.e., not -var-list-children has been invoked.
It should only report children if you previously requested them.
It may create a child at any time by asking the Python printer; but a
child created this way won't be reported. This is needed to properly
report has_more.
Nick> 2) -var-update seems to list changes to children of dynamic
Nick> objects in reverse numerical order.
Oh, odd. But not a bug, really, as the order is not specified.
Nick> Does -var-set-update-range only work for dynamic variable objects
Nick> - the documentation doesn't say but I couldn't get it to work with
Nick> current ones.
Yeah, I think it ought to work. I'm not sure how useful it is, though.
Nick> With dynamic variable objects I could restrict the
Nick> range but it didn't seem to match up (from seem to be ignored).
I will look into this.
Nick> The new FROM TO arguments for -var-list-children work with current
Nick> variable objects but it seems that GDB just restricts what it
Nick> prints but stores the whole vector which doesn't seem to save
Nick> memory. Would it not be better to create children in the range
Nick> specified since the array might be large and the front end only
Nick> needs the values it displays.
We designed a very simple Python API that does not support random
access. The reason for this is that a simple API is easier for users.
Naturally, this is an arguable decision.
The real intent for limiting the range is not to save memory but to
avoid problems printing uninitialized containers. I think a front end
ought to always restrict the range when fetching the children of a
dynamic varobj. I suppose I will update the documentation to say this.
For dynamic varobjs, we do save a bit of memory because the TO argument
limits how many children we compute.
Nick> Likewise with -var-set-update-range: does GDB track all changes
Nick> and just report a restricted set, or restrict what it tracks?
It always starts over at 0, and then filters on the low side after
computing differences. On the high side, TO (really TO+1, due to
has_more computation) limits how many children we fetch.
Nick> I have a few thoughts about the documentation:
Thanks, I'll fix these.
Nick> The field `displayhint' seems very useful with -var-create but
Nick> does it serve any purpose when output with -var-update?
It could change -- bizarre but in theory possible.
Nick> The field `has_more' seems to be overloaded depending on whether
Nick> its output from -var-create, -var-list-children or -var-update.
How do you mean? I think it means pretty much the same thing in all
cases: it is true if the object has children beyond what you've
requested.
Nick> Existing documentation uses @var for field names, while new uses @samp.
Yeah. @var seems clearly wrong there.
I will change the new code though.
Nick> I find varobj.c hard to read
Yes, me too.
Tom
next prev parent reply other threads:[~2009-09-11 19:41 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 [this message]
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
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=m363bpgti0.fsf@fleche.redhat.com \
--to=tromey@redhat.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