This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix varobj/15166


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]