public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Project Archer <archer@sourceware.org>
Subject: [python] lazily fetch varobj children
Date: Thu, 09 Jul 2009 16:25:00 -0000	[thread overview]
Message-ID: <m3ws6hn7ry.fsf@fleche.redhat.com> (raw)

I'm checking this in on the python branch.

This changes the varobj code to lazily fetch dynamic children if a
child range has been selected.

This will yield some funny results.  For one thing it means the child
count of a varobj cannot be relied on -- it may change if you ask for
more children.  Perhaps we should add a "dynamic" flag to the varobj
output; this seems like something to discuss upstream.

Also, this change means that a well-behaved printer should not eagerly
fetch children.  Some of the existing printers do this to compute the
string form of a container.  I'll fix that, but only after some of
this goes upstream.

Tom

2009-07-09  Tom Tromey  <tromey@redhat.com>

	* varobj.c (update_dynamic_varobj_children): Terminate loop early
	if a child range is selected.

diff --git a/gdb/varobj.c b/gdb/varobj.c
index d068a6e..1412d43 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -879,7 +879,7 @@ update_dynamic_varobj_children (struct varobj *var,
     }
   make_cleanup_py_decref (iterator);
 
-  for (i = 0; ; ++i)
+  for (i = 0; var->to < 0 || i < var->to; ++i)
     {
       PyObject *item = PyIter_Next (iterator);
       PyObject *py_v;

                 reply	other threads:[~2009-07-09 16:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=m3ws6hn7ry.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=archer@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).