This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: representing C++ constructors in GDB's symbol tables
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: jimb at redhat dot com, david dot carlton at sun dot com
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 17 Sep 2004 22:29:31 -0400
- Subject: Re: representing C++ constructors in GDB's symbol tables
- References: <vt2pt4ko6p7.fsf@zenia.home><yf2ekl0a0ra.fsf@kealia.sfbay.sun.com>
David Carlton <david.carlton@sun.com> wrote:
> You can use "X(...)" to create a temporary object of type X.
Sure. And of course:
X my_x = X();
Also remember destructors. A C++ program can explicitly call
a destructor. Sigh.
> Having said that, a constructor really is a different beast from an
> ordinary function call. And I don't think that having GDB support
>
> (gdb) print Printer().print()
>
> should be high on your list of priorities.
Yeah. I would be comfortable if gdb said "forget about it,
I don't call a ctor directly" (and the same for dtor).
Then in 2006 someone else can come along and fix that limitation,
watching out for the big trap that the ABI for constructors and
destructors can be *different* than for normal functions,
with hidden magic parameters.
Michael