From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20934 invoked by alias); 28 Nov 2001 18:36:35 -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 20814 invoked from network); 28 Nov 2001 18:36:34 -0000 Received: from unknown (HELO www.cgsoftware.com) (208.155.65.221) by hostedprojects.ges.redhat.com with SMTP; 28 Nov 2001 18:36:34 -0000 Received: from localhost (localhost [127.0.0.1]) by www.cgsoftware.com (8.9.3/8.9.3) with ESMTP id NAA13401; Wed, 28 Nov 2001 13:36:28 -0500 Date: Wed, 21 Nov 2001 05:06:00 -0000 From: Daniel Berlin To: Daniel Jacobowitz cc: Jason Merrill , , Subject: Re: C++ debugging progress In-Reply-To: <20011128124118.A23447@nevyn.them.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-11/txt/msg00209.txt.bz2 On Wed, 28 Nov 2001, Daniel Jacobowitz wrote: > On Wed, Nov 28, 2001 at 09:31:07AM +0000, Jason Merrill wrote: > > >>>>> "Daniel" == Daniel Jacobowitz writes: > > > > > I'll not be posting the patches for another day or two. The way I do it now > > > is grossly inefficient; I look through RTTI at every lookup instead of once > > > per type. It also depends on presence of RTTI. There's not much I can do > > > about that - or rather, I could, but AFAICT it would require walking the > > > inheritance graph in the proper order and I don't have the machinery to do > > > that easily. I'm not heartbroken that we need RTTI for debugging though. > > > > So you're using the inheritance information in the RTTI rather than the debug > > info? That seems unfortunate. I'm not sure why you would need to worry > > about ordering; the debug info should tell you exactly where things are. > > If it doesn't, it should probably be fixed. > > In that case, the debug info absolutely needs to be fixed. > > (I'm looking at stabs here. I haven't tried to see what Dwarf2 emits > yet. I don't have my head wrapped around Dwarf2. Yeah, I know, I > should be using it.) > > Consider this: > > struct Base { int xxx; }; > struct Left : public virtual Base { int yyy; }; > struct Right : public virtual Base { int zzz; }; > struct Bottom : public Left, public Right { int bbb; }; > > int main() { struct Bottom bzz; return 1; } > > The question, of course, is: Where's bzz.xxx? > > Dwarf2 first: > <1><115>: Abbrev Number: 15 (DW_TAG_structure_type) > DW_AT_sibling : <1c2> > DW_AT_name : Bottom > DW_AT_byte_size : 24 > DW_AT_decl_file : 1 > DW_AT_decl_line : 4 > DW_AT_containing_type: <22e> > <2><128>: Abbrev Number: 16 (DW_TAG_inheritance) > DW_AT_type : <22e> > DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0; ) > DW_AT_accessibility: 1 (public) > <2><131>: Abbrev Number: 16 (DW_TAG_inheritance) > DW_AT_type : <2df> > DW_AT_data_member_location: 2 byte block: 23 8 (DW_OP_plus_uconst: 8; ) > DW_AT_accessibility: 1 (public) > <2><13a>: Abbrev Number: 3 (DW_TAG_member) > DW_AT_name : bbb > DW_AT_decl_file : 1 > DW_AT_decl_line : 4 > DW_AT_type : > DW_AT_data_member_location: 2 byte block: 23 10 (DW_OP_plus_uconst: 16; ) > > Do you see it? I don't, and I'm pretty sure it's not there. Umm, look at type 2df and 22e. I'm going to bet money xxx is there. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: Daniel Jacobowitz Cc: Jason Merrill , , Subject: Re: C++ debugging progress Date: Wed, 28 Nov 2001 10:36:00 -0000 Message-ID: References: <20011128124118.A23447@nevyn.them.org> X-SW-Source: 2001-11/msg00316.html Message-ID: <20011128103600.ZALXZPQhZnxVLA6q2QrPZczYgvjZ7bTl_4t0bnl3y5I@z> On Wed, 28 Nov 2001, Daniel Jacobowitz wrote: > On Wed, Nov 28, 2001 at 09:31:07AM +0000, Jason Merrill wrote: > > >>>>> "Daniel" == Daniel Jacobowitz writes: > > > > > I'll not be posting the patches for another day or two. The way I do it now > > > is grossly inefficient; I look through RTTI at every lookup instead of once > > > per type. It also depends on presence of RTTI. There's not much I can do > > > about that - or rather, I could, but AFAICT it would require walking the > > > inheritance graph in the proper order and I don't have the machinery to do > > > that easily. I'm not heartbroken that we need RTTI for debugging though. > > > > So you're using the inheritance information in the RTTI rather than the debug > > info? That seems unfortunate. I'm not sure why you would need to worry > > about ordering; the debug info should tell you exactly where things are. > > If it doesn't, it should probably be fixed. > > In that case, the debug info absolutely needs to be fixed. > > (I'm looking at stabs here. I haven't tried to see what Dwarf2 emits > yet. I don't have my head wrapped around Dwarf2. Yeah, I know, I > should be using it.) > > Consider this: > > struct Base { int xxx; }; > struct Left : public virtual Base { int yyy; }; > struct Right : public virtual Base { int zzz; }; > struct Bottom : public Left, public Right { int bbb; }; > > int main() { struct Bottom bzz; return 1; } > > The question, of course, is: Where's bzz.xxx? > > Dwarf2 first: > <1><115>: Abbrev Number: 15 (DW_TAG_structure_type) > DW_AT_sibling : <1c2> > DW_AT_name : Bottom > DW_AT_byte_size : 24 > DW_AT_decl_file : 1 > DW_AT_decl_line : 4 > DW_AT_containing_type: <22e> > <2><128>: Abbrev Number: 16 (DW_TAG_inheritance) > DW_AT_type : <22e> > DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0; ) > DW_AT_accessibility: 1 (public) > <2><131>: Abbrev Number: 16 (DW_TAG_inheritance) > DW_AT_type : <2df> > DW_AT_data_member_location: 2 byte block: 23 8 (DW_OP_plus_uconst: 8; ) > DW_AT_accessibility: 1 (public) > <2><13a>: Abbrev Number: 3 (DW_TAG_member) > DW_AT_name : bbb > DW_AT_decl_file : 1 > DW_AT_decl_line : 4 > DW_AT_type : > DW_AT_data_member_location: 2 byte block: 23 10 (DW_OP_plus_uconst: 16; ) > > Do you see it? I don't, and I'm pretty sure it's not there. Umm, look at type 2df and 22e. I'm going to bet money xxx is there.