News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Watching smart pointers

Started by Dahman, January 05, 2007, 11:54:45 AM

Previous topic - Next topic

Dahman

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


tiwag

you can add a custom watch

eg.

*(classpointer->memberpointer)

Dahman

Tiwag, thank you for the fast replay, I will try it.
Dahman