This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is Single step into C++ virtual thunk still broken?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]