This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: How to setup a breakpoint on constructor
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: drow at false dot org, eliz at gnu dot org
- Cc: gdb at sources dot redhat dot com, mec dot gnu at mindspring dot com, rolandz at poczta dot fm
- Date: Fri, 16 Jul 2004 15:31:17 -0400 (EDT)
- Subject: Re: How to setup a breakpoint on constructor
To take the points in reverse order,
> (B) It exposes the difference between complete and base constructors,
> which is an implementation detail of the C++ ABI that most users don't
> understand.
That is reality. The reality is that g++ emits two functions in the
object code. In my opinion, if we try to gloss over that, then we'll
just create more confusion for commands such as 'disassemble' and
'tbreak'.
> (A) It was an ugly interface change to work around an internal
> limitation, and they needed to retrain users to it.
I agree with this part, to an extent. However, the gdb group
has no control over the fact that there are two object code
functions.
I like the way it worked in gcc 2.95.3. With gcc 2.95.3,
gcc emits one function with a hidden parameter. c++ programmers
and gdb are both familiar with hidden parameters ('this').
If I recall correctly, Apple modified gcc 3.X to do something
similar.
Michael C