Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: "gdb-patches\@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Fix varobj/15166
Date: Tue, 23 Jul 2013 20:32:00 -0000	[thread overview]
Message-ID: <87li4xxbjw.fsf@fleche.redhat.com> (raw)
In-Reply-To: <51DB3AA1.2060005@redhat.com> (Keith Seitz's message of "Mon, 08	Jul 2013 15:18:09 -0700")

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


  reply	other threads:[~2013-07-23 20:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 22:18 Keith Seitz
2013-07-23 20:32 ` Tom Tromey [this message]
2013-07-23 22:50   ` Keith Seitz
2013-08-07 20:23 ` 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=87li4xxbjw.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /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