Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Dahman on January 05, 2007, 11:54:45 am

Title: Watching smart pointers
Post by: Dahman on January 05, 2007, 11:54:45 am
Hello,
How to debug and watch a smart pointer like boost::intrusive_ptr and boost::shared_ptr?
I tried this in gdb_types.script:

....
function Evaluate_SharedPtr(type, ptr, start, count)
{
    local result = _T("output ") + _T("(*") + ptr + _T(".get())");

    return result;
}
....

and work fine, but not if the smart pointer is an object of a class that contain another smart pointer (I see just the memory adress of the second pointer)
Thanks for any help.

Regards

Title: Re: Watching smart pointers
Post by: tiwag on January 05, 2007, 12:11:29 pm
you can add a custom watch

eg.

*(classpointer->memberpointer)
Title: Re: Watching smart pointers
Post by: Dahman on January 05, 2007, 01:39:09 pm
Tiwag, thank you for the fast replay, I will try it.
Dahman