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.

There were a few things I didn't understand here.

First, which part of the test case actually triggered the crash?
It isn't obvious from the PR or the patch submission or the test.

Keith> As a result, it strictly enforces that the immediate children of a
Keith> root varobj whose type is a class/struct must be one of the "fake"
Keith> children. When asking for an index greater than 2 (CPLUS_FAKE_CHILDren
Keith> are indices 0, 1, 2), the code asserts because of an unknown fake
Keith> child.

It seems strange to me that the dynamic varobj case would ever end up in
this code.  Perhaps dynamic varobjs should just dispatch to their own
"language_specific"-like object... or else it seems that all the
languages in the 'languages' array will need updates.

Keith> +static PyObject *
Keith> +get_pretty_printed_element_index (struct varobj *var, int index)
[...]
Keith> +  iter = PyObject_GetIter (children);

It seems like calling this could implicitly cause a varobj update.
But probably I just don't understand.

Keith> +	      if (cvalue != NULL && value != NULL)
Keith> +		*cvalue = v;

I didn't understand why the condition uses 'value' here but the
assignment uses 'v'.

Tom


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