Re: How to setup a breakpoint on constructor

Daniel Jacobowitz
2004-07-15T13:55:15Z

On Thu, Jul 15, 2004 at 07:31:03AM -0400, Michael Chastain wrote:
> Hi Roland,
>
> Would you like to try a makeshift and experimental patch?
>
> ftp://ftp.shout.net/pub/users/mec/ctor-dtor-base.patch
>
> (Patch attached to this message too).
>
> You have to apply this to the libiberty/ subdirectory of a
> recent gdb, such as gdb 6.1.1, and then rebuild gdb.
>
> There's a lot of doco in the patch but it rambles.
> The basic idea is that I patched the demangler so that
> it demangles the different ctor's with different names:
>
> A::A()
> A::A$base()
> A::A$allocate()
>
> I don't know if it's a good idea for gdb to work this way,
> but I think it's worth getting some user feedback.
>
> Testing: I haven't run the test suite with this.
> I did test a small program (testsuite/gdb.cp/derivation.cc)
> and it works the way I think it should.

FYI, I implemented this once. The users who tried it didn't like it at
all.

--
Daniel Jacobowitz