This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix varobj/15166
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Wed, 07 Aug 2013 14:23:16 -0600
- Subject: Re: [RFA] Fix varobj/15166
- References: <51DB3AA1 dot 2060005 at redhat dot com>
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> $SUBJECT concerns an assertion failure that is triggered when using
Keith> pretty-printing with varobj. The cause of the problem is actually
Keith> pretty simple: cplus_describe_child knows nothing about pretty
Keith> printing.
I think your reply to me answered all my big questions about the patch.
Looking at it I have one other minor issue (in addition to the typo thing).
Keith> + item = NULL;
Keith> + while (index-- >= 0)
Keith> + {
Keith> + Py_XDECREF (item);
Keith> + item = PyIter_Next (iter);
Keith> +
Keith> + /* We should not be able to ask for an index for which we do not
Keith> + have a child varobj already! */
Keith> + gdb_assert (item != NULL);
I don't think this is ok to do. Iterators run Python code, which can do
anything.
This is why I was curious about value preservation and updating. It
seems like re-running the Python may yield different results from what
is "expected" (in the sense that the varobj's current state can be seen
as a snapshot of a particular inferior state -- even though we don't
actually store the bits making up this snapshot).
Anyway I think the checking here has to be more lenient, not an assert.
Tom