From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21983 invoked by alias); 9 Jul 2002 16:27:50 -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 21972 invoked from network); 9 Jul 2002 16:27:48 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 9 Jul 2002 16:27:48 -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 17Rxq4-0002JH-00; Tue, 09 Jul 2002 11:27:44 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17Rxq2-0001Mr-00; Tue, 09 Jul 2002 12:27:42 -0400 Date: Tue, 09 Jul 2002 09:27: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: <20020709162742.GA5100@nevyn.them.org> Mail-Followup-To: Daedalus , gdb@sources.redhat.com References: <1026229835.2426.30.camel@pan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1026229835.2426.30.camel@pan> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-07/txt/msg00094.txt.bz2 On Tue, Jul 09, 2002 at 04:50:31PM +0100, Daedalus wrote: > Well, after a bit of investigation, I have come up with this simple C++ > code which gdb gets a bit wrong. > > Having class Base as a *virtual* base class of class Derived seems to > cause the problem. Take out virtual and everything works fine. > > Anyway, to see what I mean, stick a breakpoint in the code where > indicated, then single step into the virtual function. gdb ends up on > the last line of the virtual function, rather than the first. If you > move the function to another file, it can just end up somewhere random. > Take out the virtual as indicated and everything works fine > > Let me know what you think. > > Andrew > > PS Are you a gdb maintainer? Whatever, thanks for the help. 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. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer