From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1631 invoked by alias); 27 Nov 2001 21:26:03 -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 1549 invoked from network); 27 Nov 2001 21:25:54 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by hostedprojects.ges.redhat.com with SMTP; 27 Nov 2001 21:25:54 -0000 Received: from drow by nevyn.them.org with local (Exim 3.32 #1 (Debian)) id 168pk4-0004lo-00; Tue, 27 Nov 2001 16:26:12 -0500 Date: Wed, 14 Nov 2001 22:41:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/c++] Fix printing classes with virtual base classes Message-ID: <20011127162612.A18178@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: <20011126201945.A27754@nevyn.them.org> <20011127020634.A10010@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/msg00295.txt.bz2 They are both independent fixes. The fixes to gnu-v3-abi.c by themselves fix several tests in virtfunc.exp when using G++ 3.0 (from XFAIL to XPASS, ugh...). Then if you look at the test logs, you should find two failure modes for the ones that still fail. Some are marked "virtual baseclass botch", and I am trying right now to fix those; but I believe that one will just be wrong. That's because my use of value_field in gnuv3_virtual_fn_field triggers the bug; the value has not been read in yet, so only its address is copied, and the embedded offset for the parent type is lost. We then get the wrong vtable and call the wrong function. I can't construct an independent testcase, but I think it should be possible. Most things run afoul of the other "botch" bug. On Tue, Nov 27, 2001 at 04:17:51PM -0500, Jim Blandy wrote: > > These are two independent fixes, right? I understand GDB may need > them both before it works correctly; I'm asking if each of them is a > correct change in its own right. If so, could you show me a test case > that each change fixes? > > Daniel Jacobowitz writes: > > 2001-11-26 Daniel Jacobowitz > > > > * values.c (value_primitive_field): Add embedded_offset to the > > address of structure members. > > * gnu-v3-abi.c (gnuv3_rtti_type): Cast to base type before > > attempting to access vtable pointer. Set using_enc_p if we cast. > > (gnuv3_virtual_fn_field): Call value_cast with structure rather than > > structure pointer. Cast to base type before attempting to access > > vtable pointer. > -- 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: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/c++] Fix printing classes with virtual base classes Date: Tue, 27 Nov 2001 13:26:00 -0000 Message-ID: <20011127162612.A18178@nevyn.them.org> References: <20011126201945.A27754@nevyn.them.org> <20011127020634.A10010@nevyn.them.org> X-SW-Source: 2001-11/msg00510.html Message-ID: <20011127132600.7eFEZMPj9UCaLRcTkXZPpb-DtxyB7fMlRdwDC7sFXbQ@z> They are both independent fixes. The fixes to gnu-v3-abi.c by themselves fix several tests in virtfunc.exp when using G++ 3.0 (from XFAIL to XPASS, ugh...). Then if you look at the test logs, you should find two failure modes for the ones that still fail. Some are marked "virtual baseclass botch", and I am trying right now to fix those; but I believe that one will just be wrong. That's because my use of value_field in gnuv3_virtual_fn_field triggers the bug; the value has not been read in yet, so only its address is copied, and the embedded offset for the parent type is lost. We then get the wrong vtable and call the wrong function. I can't construct an independent testcase, but I think it should be possible. Most things run afoul of the other "botch" bug. On Tue, Nov 27, 2001 at 04:17:51PM -0500, Jim Blandy wrote: > > These are two independent fixes, right? I understand GDB may need > them both before it works correctly; I'm asking if each of them is a > correct change in its own right. If so, could you show me a test case > that each change fixes? > > Daniel Jacobowitz writes: > > 2001-11-26 Daniel Jacobowitz > > > > * values.c (value_primitive_field): Add embedded_offset to the > > address of structure members. > > * gnu-v3-abi.c (gnuv3_rtti_type): Cast to base type before > > attempting to access vtable pointer. Set using_enc_p if we cast. > > (gnuv3_virtual_fn_field): Call value_cast with structure rather than > > structure pointer. Cast to base type before attempting to access > > vtable pointer. > -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer