From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/c++] Fix printing classes with virtual base classes Date: Tue, 27 Nov 2001 07:15:00 -0000 Message-id: References: <20011126201945.A27754@nevyn.them.org> <20011127003659.A3965@nevyn.them.org> X-SW-Source: 2001-11/msg00494.html Daniel Jacobowitz writes: > On Mon, Nov 26, 2001 at 11:39:34PM -0500, Jim Blandy wrote: > > > > I'm with you on VALUE_OFFSET and VALUE_EMBEDDED_OFFSET. I'm pretty > > sure VALUE_OFFSET can be eliminated from GDB entirely, with some minor > > changes to the representation of subvalues of registers and > > convenience variables. > > I am exceedingly tempted to do this. Yeah, wouldn't it be nice if VALUE_ADDRESS returned, oh, say, the value's address? For register and convenience variable subvalues, use the value's address field instead of the offset field. I'm pretty sure VALUE_OFFSET goes away entirely then. > Gnu v2 code handles this by casting the Baz to a Foo, at which point > magic happens, and somehow the vptr is visible. This suggests that my > fix is not the best way of doing it, and I should be using > TYPE_VPTR_BASETYPE somehow instead. I may need to think some more. Yeah, I think that's what I was getting at; I wanted to see TYPE_VPTR_BASETYPE in there somewhere. > > I wonder if that dereferencing code could be simplified with a > > judicious use of `lookup_pointer_type (vtable_type)' and > > `value_deref'... > > I suppose it would read simpler if I took a value_addr () and cast a > bit. But magic happens in value casting that I don't want to happen. :( From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24787 invoked by alias); 27 Nov 2001 15:15:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24762 invoked from network); 27 Nov 2001 15:15:41 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by hostedprojects.ges.redhat.com with SMTP; 27 Nov 2001 15:15:41 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 085B05E9D8; Tue, 27 Nov 2001 10:16:56 -0500 (EST) To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/c++] Fix printing classes with virtual base classes References: <20011126201945.A27754@nevyn.them.org> <20011127003659.A3965@nevyn.them.org> From: Jim Blandy Date: Wed, 14 Nov 2001 13:02:00 -0000 In-Reply-To: Daniel Jacobowitz's message of Tue, 27 Nov 2001 00:36:59 -0500 Message-ID: X-Mailer: Gnus v5.3/Emacs 19.34 X-SW-Source: 2001-11/txt/msg00279.txt.bz2 Message-ID: <20011114130200.j7IHl6LYWpjQ0OU17m_H00t7g1QTok3EpDEGTtnoH0E@z> Daniel Jacobowitz writes: > On Mon, Nov 26, 2001 at 11:39:34PM -0500, Jim Blandy wrote: > > > > I'm with you on VALUE_OFFSET and VALUE_EMBEDDED_OFFSET. I'm pretty > > sure VALUE_OFFSET can be eliminated from GDB entirely, with some minor > > changes to the representation of subvalues of registers and > > convenience variables. > > I am exceedingly tempted to do this. Yeah, wouldn't it be nice if VALUE_ADDRESS returned, oh, say, the value's address? For register and convenience variable subvalues, use the value's address field instead of the offset field. I'm pretty sure VALUE_OFFSET goes away entirely then. > Gnu v2 code handles this by casting the Baz to a Foo, at which point > magic happens, and somehow the vptr is visible. This suggests that my > fix is not the best way of doing it, and I should be using > TYPE_VPTR_BASETYPE somehow instead. I may need to think some more. Yeah, I think that's what I was getting at; I wanted to see TYPE_VPTR_BASETYPE in there somewhere. > > I wonder if that dereferencing code could be simplified with a > > judicious use of `lookup_pointer_type (vtable_type)' and > > `value_deref'... > > I suppose it would read simpler if I took a value_addr () and cast a > bit. But magic happens in value casting that I don't want to happen. :(