From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2908 invoked by alias); 6 Dec 2006 16:43:22 -0000 Received: (qmail 2781 invoked by uid 22791); 6 Dec 2006 16:43:20 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 06 Dec 2006 16:43:09 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GrzrM-0000Hg-Pa; Wed, 06 Dec 2006 11:43:04 -0500 Date: Wed, 06 Dec 2006 16:43:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: Jim Blandy , gdb-patches@sourceware.org, Vladimir Prus Subject: Re: [RFA][2/5] New port: Cell BE SPU (valops.c fix) Message-ID: <20061206164303.GA755@nevyn.them.org> Mail-Followup-To: Ulrich Weigand , Jim Blandy , gdb-patches@sourceware.org, Vladimir Prus References: <20061128000117.GA21865@nevyn.them.org> <200612061629.kB6GTROh021274@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200612061629.kB6GTROh021274@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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: 2006-12/txt/msg00065.txt.bz2 On Wed, Dec 06, 2006 at 05:29:27PM +0100, Ulrich Weigand wrote: > The patch I proposed to remember the type of the value residing > in the register would allow all the above cases to work without > changes to architecture code, and would in fact work correctly > with any conceivable implementation of the current r_t_v / v_t_r > interface. However, it does have the disadvantage of requiring > an additional field in struct value. (Maybe we can make up that > loss -- do we actually still require VALUE_ADDRESS for register > values?) > > Any suggestions? Vladimir has actually been working on a similar change for a different purpose. He added a "parent value" pointer to values; bitfields then are accessed by reading the enclosing structure and extracting bits from value_contents. I've been kind of waffling on Vladimir's patch because it has a nasty bug that I just can't find any way to fix. Adding pointers between values messes up release_value / value_free; either we leak values or we access uninitialized memory, or both. As Vladimir has pointed out several times, what we really need is a shared_ptr :-) What do you think? Would this solve the same problem as your patch? Any bright ideas on the memory management? We could always go whole hog and add a refcount... I realize now that if we only need to reference count one reference for whoever called release_value (or being on the value chain) and one per child field, it wouldn't be too hard. -- Daniel Jacobowitz CodeSourcery