From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31260 invoked by alias); 7 Aug 2013 20:23:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31243 invoked by uid 89); 7 Aug 2013 20:23:25 -0000 X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 07 Aug 2013 20:23:25 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r77KNHMx031070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 Aug 2013 16:23:18 -0400 Received: from barimba (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r77KNGku025045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 7 Aug 2013 16:23:17 -0400 From: Tom Tromey To: Keith Seitz Cc: "gdb-patches\@sourceware.org ml" Subject: Re: [RFA] Fix varobj/15166 References: <51DB3AA1.2060005@redhat.com> Date: Wed, 07 Aug 2013 20:23:00 -0000 In-Reply-To: <51DB3AA1.2060005@redhat.com> (Keith Seitz's message of "Mon, 08 Jul 2013 15:18:09 -0700") Message-ID: <87k3jx5jyj.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-08/txt/msg00215.txt.bz2 >>>>> "Keith" == Keith Seitz 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