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: Jim Blandy <jimb at redhat dot com>
- To: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- Cc: drow at false dot org, eliz at gnu dot org, gdb at sources dot redhat dot com, rolandz at poczta dot fm
- Date: 16 Jul 2004 16:49:31 -0500
- Subject: Re: How to setup a breakpoint on constructor
- References: <20040716193117.EFE514B104@berman.michael-chastain.com>
mec.gnu@mindspring.com (Michael Elizabeth Chastain) writes:
> 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.
If I remember right, the use of separate complete and base
constructors is an ABI requirement; the compiler doesn't have the
option of just generating whatever code it likes.