This is the mail archive of the gdb@sourceware.org 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: C++ debugging pain


On Tue, Aug 26, 2008 at 9:22 AM, Stefano Sabatini
<stefano.sabatini-lala@poste.it> wrote:

> * "class X does not have any method named Y": this happens with
>  virtual methods defined in a parent class rather than in the class
>  of the instance debugged

Try "set print object on".
(I am working on a fix which would make that unnecessary).

> * "Cannot resolve method (null)X to any overloaded instance":
>  this happen when I try to invoke a method on some object

This usually happens when you have a pointer to Foo, and do:

  print p.virtfn()

Instead, try:

  print p->virtfn()

(I am also working on that fix).

>  I've been already advised by Daniel Jacobowitz (thanks Daniel) that
>  it could depend on the method invoked being inlined.

If you compiled without '-O*', no inlining should have happened.
If you do compile with '-g -O2', you are inflicting pain on yourself.

Cheers,
-- 
Paul Pluzhnikov


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