How to setup a breakpoint on constructor

Michael Elizabeth Chastain mec.gnu@mindspring.com
Sat Jul 17 10:09:00 GMT 2004


jimb> If I remember right, the use of separate complete and base
jimb> constructors is an ABI requirement; the compiler doesn't have the
jimb> option of just generating whatever code it likes.

The ABI does require separate names.

If I recall correctly, Apple implemented this by having separate names
for base ctor and complete ctor (as required by the ABI) and then having
them call a unified constructor.

Gcc optimization can reduce calls from {base,complete}-ctor to
unified-ctor, from call instructions to jump instructions.

Then the debugger just puts ctor breakpoints on the
unified-ctor.

  http://gcc.gnu.org/ml/gcc-patches/2002-08/msg00354.html

Apple folks, have I got that right?

Michael C



More information about the Gdb mailing list