This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: representing C++ constructors in GDB's symbol tables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]