[Bug c++/11500] gdb does not support smart pointers

swagiaal at redhat dot com sourceware-bugzilla@sourceware.org
Wed Apr 14 20:31:00 GMT 2010


------- Additional Comments From swagiaal at redhat dot com  2010-04-14 20:31 -------
Here is a better example (Without the template)

#include "stdio.h"

class MyType{
  public:
  void foo(){
    printf("I am foo\n");
  }
};

class SmartPointer{
  MyType* p;
 public:
  SmartPointer(MyType *pointer){
    p = pointer;
  }

  MyType* operator->(){
    return p;
  }

};


int main(){
  MyType mt;

  SmartPointer sp(&mt);
  sp->foo();

  return 0;
}

(gdb) p sp->foo()
Couldn't find method SmartPointer::foo



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=11500

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Gdb-prs mailing list