From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23955 invoked by alias); 2 Jul 2009 10:09:49 -0000 Received: (qmail 23947 invoked by uid 22791); 2 Jul 2009 10:09:49 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_32,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Jul 2009 10:09:43 +0000 Received: (qmail 18379 invoked from network); 2 Jul 2009 10:09:40 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Jul 2009 10:09:40 -0000 From: Vladimir Prus To: Jan Kratochvil Subject: Re: [patch 4/8] Types GC [varobj_list to all_root_varobjs] Date: Thu, 02 Jul 2009 10:09:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) Cc: Tom Tromey , gdb-patches@sourceware.org References: <20090525080233.GD13323@host0.dyn.jankratochvil.net> <20090702083705.GA14783@host0.dyn.jankratochvil.net> In-Reply-To: <20090702083705.GA14783@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200907021409.39886.vladimir@codesourcery.com> 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 X-SW-Source: 2009-07/txt/msg00060.txt.bz2 On Thursday 02 July 2009 Jan Kratochvil wrote: > On Tue, 09 Jun 2009 22:50:42 +0200, Tom Tromey wrote: > > >>>>> "Jan" == Jan Kratochvil writes: > > > > Jan> I find the callback based iterator easier to use, > [...] > > It seems reasonable to me, though it would be nice to have Volodya's > > approval. > > Is it OK to check it in, Vladimir? The patch would go in unchanged: > http://sourceware.org/ml/gdb-patches/2009-05/msg00547.html > > Regression re-tested now on {x86_64,i686}-fedora-linux-gnu. Is this cleanup-only patch? I am a bit concerned that it appears to increase code size, and all it does it changes explicit iteration to callback iteration. Can we just make varobj.c expose vector of varobjs? > > Jan> in fact there were bugs due to the > > Jan> current calling semantics (`floating' lockup, memory leaks). > > > > Details on the bugs that this fixes would be nice. > > A test case would also be nice, assuming these are testable. > > The `floating' lockup will get fixed by a later patch using this new > all_root_varobjs function. A testcase for it was in a now-obsolete patch: > [patch] Fix gdb.mi hang on floating VAROBJs > http://sourceware.org/ml/gdb-patches/2009-05/msg00433.html > This patch itself still does not fix it. IIUC, the varobj_invalidate problem can be fixed with a small patch below. Am I missing something? If no, such a patch is not in any way made easier by callback iteration. - Volodya Index: gdb/varobj.c =================================================================== RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.137 diff -u -p -r1.137 varobj.c --- gdb/varobj.c 30 Jun 2009 09:24:47 -0000 1.137 +++ gdb/varobj.c 2 Jul 2009 10:08:22 -0000 @@ -3225,8 +3225,10 @@ varobj_invalidate (void) /* Floating varobjs are reparsed on each stop, so we don't care if the presently parsed expression refers to something that's gone. */ - if ((*varp)->root->floating) + if ((*varp)->root->floating) { + varp++; continue; + } /* global var must be re-evaluated. */ if ((*varp)->root->valid_block == NULL)