Search code examples
debuggingeclipse-cdt

Controlling Eclipse CDT debugger output?


When using CDT I would like to have std::string show up in the 'variable' debug window with the string it contains. For instance if it is currently holding the word "history" I would like to see history in the debugger window labeled "variables".

I think that there is a general way to have it drill down into objects but I can't put my finger on it. Does anyone out there know how to do this?

This would also be useful for me to use when outputting just a single field from a complex object.

Thanks, Bill


Solution

  • Note that you don't want a general way of drilling down into objects; you want to pretty-print STL containers.

    I think CDT delegates this to the debugger backend; i.e. it is up to your debugger (gdb, perhaps?) to inform CDT about the value of a variable and how it can be expanded.

    Edit: I don't think that the GDB backend shipped with CDT has any support for "intelligent" display of STL containers. If you're really interested in this, I'd suggest that you contact the CDT development team at [email protected].

    Update/Edit: Please see other responses below for instructions on how to enable pretty printers in CDT.