From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15058 invoked by alias); 9 Jul 2002 18:51:39 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 15045 invoked from network); 9 Jul 2002 18:51:38 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 9 Jul 2002 18:51:38 -0000 Received: from dsl254-114-096.nyc1.dsl.speakeasy.net ([216.254.114.96] helo=nevyn.them.org) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17S05I-0002X0-00; Tue, 09 Jul 2002 13:51:36 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17S05H-0005nh-00; Tue, 09 Jul 2002 14:51:35 -0400 Date: Tue, 09 Jul 2002 11:51:00 -0000 From: Daniel Jacobowitz To: Daedalus Cc: gdb@sources.redhat.com Subject: Re: Is Single step into C++ virtual thunk still broken? Message-ID: <20020709185135.GA22053@nevyn.them.org> Mail-Followup-To: Daedalus , gdb@sources.redhat.com References: <1026229835.2426.30.camel@pan> <20020709162742.GA5100@nevyn.them.org> <1026240215.1532.14.camel@mojo> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1026240215.1532.14.camel@mojo> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-07/txt/msg00097.txt.bz2 On Tue, Jul 09, 2002 at 07:43:34PM +0100, Daedalus wrote: > On Tue, 2002-07-09 at 17:27, Daniel Jacobowitz wrote: > > > > Right now, with your test case, I step into the virtual function's > > thunk - end up at a random line - step again, and end up at the > > beginning of the virtual function. Which is annoying but not so bad. > > The line I end up at is the first line of the Derived class, which > > isn't an entirely unreasonable place for the thunk to be but is still > > probably wrong. That is a minor GCC bug. > > > > On the other hand, GDB should skip the thunk and step you right into > > the function being called. I'll try to think of a way to do this. > > > > If, as you suggest, a second step (s command) would take me into the > virtual function, I could live with the (minor) problem, but here the > first step command takes me to the closing } of the virtual function > (although if this is random as you suggest, it might not be significant) > and the second step (s) command takes me to the next statement after the > virtual function call, jumping it completely. Very inconvenient. > > In order for me to try and replicate your behaviour, could you give me > some details? > > I am running the very latest GNU gdb 2002-07-09-cvs, gcc 3.1 and I > compiled the example with > gcc -g3 -lstdc++ thunk.cpp > > Red Hat Linux 7.3 With 3.0: drow@nevyn:~/debugging/thunks% gcc-3.0 -g3 -lstdc++ -o vthunk vthunk.cc drow@nevyn:~/debugging/thunks% gdb ./vthunk GNU gdb 2002-04-01-cvs Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"... (gdb) b 53 Breakpoint 1 at 0x8048719: file vthunk.cc, line 53. (gdb) r Starting program: /home/drow/debugging/thunks/vthunk Breakpoint 1, main (argc=1, argv=0xbffff664) at vthunk.cc:53 53 p->VirtualFn(); (gdb) s virtual thunk to Derived::VirtualFn() (this=0xbffff5e0) at vthunk.cc:23 23 { (gdb) Derived::VirtualFn() (this=0x4001413c) at vthunk.cc:39 39 int a=1; (gdb) With 3.1, same thing. Curiously, with 2.95 we step right over it... I don't have time to investigate why at the moment. (By the way, you really should use g++ to compile C++ code.) -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer