From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31818 invoked by alias); 28 Nov 2001 21:31:50 -0000 Mailing-List: contact gdb-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31700 invoked from network); 28 Nov 2001 21:31:39 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by hostedprojects.ges.redhat.com with SMTP; 28 Nov 2001 21:31:39 -0000 Received: from drow by nevyn.them.org with local (Exim 3.32 #1 (Debian)) id 169CJD-00018Z-00; Wed, 28 Nov 2001 16:31:59 -0500 Date: Thu, 22 Nov 2001 00:13:00 -0000 From: Daniel Jacobowitz To: Jason Merrill Cc: libstdc++@gcc.gnu.org, gdb@sources.redhat.com Subject: Re: C++ debugging progress Message-ID: <20011128163159.A3256@nevyn.them.org> Mail-Followup-To: Jason Merrill , libstdc++@gcc.gnu.org, gdb@sources.redhat.com References: <20011128020256.A9688@nevyn.them.org> <20011128124118.A23447@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2001-11/txt/msg00219.txt.bz2 On Wed, Nov 28, 2001 at 09:03:04PM +0000, Jason Merrill wrote: > >>>>> "Jason" == Jason Merrill writes: > > > Yep. Since Base is a virtual base of Left, the DW_AT_data_member_location > > here should be a complex expression telling the debugger to go through the > > vtable. I'll get on it. > > > I'll also change the stabs output to give the offset within the vtable > > rather than the offset of the base in a complete object; gdb will still > > need to be clever enough to know what to do with it. > > Please give this a spin; gdb doesn't like it, but I think it's correct. > Note that the offset given in the stabs output should be treated as > negative, so for V3 objects, > > BaseAddr = LeftAddr + *((*LeftAddr) - Offset) > > The dwarf2 output is the above encoded in reverse Polish notation. I > suppose we could rely on gdb to know the equation for dwarf, too, but that > would be nonconforming and only saves four bytes. > > 2001-11-28 Jason Merrill > > * dwarf2out.c (add_data_member_location_attribute): Do the > right thing for virtual bases. > * dbxout.c (dbxout_type): For a virtual base, print the offset > within the vtable. I haven't looked at the Dwarf parts - I need to get my current stabs project sorted out first - but with the removed minus sign, this simplifies my stabs code tremendously and works just fine. Any chance of getting this into 3.0.3 also, or should I just maintain a local patch? As for the Dwarf bits, what I'll probably do for now is recognize this specific form of expression and just stash the negative offset, so that only the debug readers need to know how I got it. That will be a bit of a hack, but I've done worse, and conforming has some uses :) -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Jason Merrill Cc: libstdc++@gcc.gnu.org, gdb@sources.redhat.com Subject: Re: C++ debugging progress Date: Wed, 28 Nov 2001 13:31:00 -0000 Message-ID: <20011128163159.A3256@nevyn.them.org> References: <20011128020256.A9688@nevyn.them.org> <20011128124118.A23447@nevyn.them.org> X-SW-Source: 2001-11/msg00326.html Message-ID: <20011128133100.9CxOy5Wpj6XnlMYlhFjTZyOCh4EMSlu05jJpooI9LEw@z> On Wed, Nov 28, 2001 at 09:03:04PM +0000, Jason Merrill wrote: > >>>>> "Jason" == Jason Merrill writes: > > > Yep. Since Base is a virtual base of Left, the DW_AT_data_member_location > > here should be a complex expression telling the debugger to go through the > > vtable. I'll get on it. > > > I'll also change the stabs output to give the offset within the vtable > > rather than the offset of the base in a complete object; gdb will still > > need to be clever enough to know what to do with it. > > Please give this a spin; gdb doesn't like it, but I think it's correct. > Note that the offset given in the stabs output should be treated as > negative, so for V3 objects, > > BaseAddr = LeftAddr + *((*LeftAddr) - Offset) > > The dwarf2 output is the above encoded in reverse Polish notation. I > suppose we could rely on gdb to know the equation for dwarf, too, but that > would be nonconforming and only saves four bytes. > > 2001-11-28 Jason Merrill > > * dwarf2out.c (add_data_member_location_attribute): Do the > right thing for virtual bases. > * dbxout.c (dbxout_type): For a virtual base, print the offset > within the vtable. I haven't looked at the Dwarf parts - I need to get my current stabs project sorted out first - but with the removed minus sign, this simplifies my stabs code tremendously and works just fine. Any chance of getting this into 3.0.3 also, or should I just maintain a local patch? As for the Dwarf bits, what I'll probably do for now is recognize this specific form of expression and just stash the negative offset, so that only the debug readers need to know how I got it. That will be a bit of a hack, but I've done worse, and conforming has some uses :) -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer