tags:

views:

1160

answers:

4

Windbg fans claim that it is quite powerful and I tend to agree. But when it comes to debugging STL containers, I am always stuck. If the variable is on the stack, the !stl extension sometimes figures it out, but when a container with a complex type (e.g. std::vector<TemplateField, std::allocator<TemplateField> >) is on the heap or part of some other structure, I just don't know how to view its contents.

Appreciate any tips, pointers.

+2  A: 

I often find debugger support for STL data types inadequate. For this reason I'm increasingly using logging frameworks and logging statements. I used to think that these are for people who can't use a debugger, but I now realize that they offer real value. They allow you to embed portable debugging knowledge in your code and maintain it together with the code. In contrast, work you do in the debugger is typically ephemeral.

Diomidis Spinellis
A: 

I usually end up sticking a toString() method in a lot of my classes. This shows all the info that I deem important, any containers can then call this to display the class information in the console

Harald Scheirich
A: 

Use dt -r i.e dt yourapp!class 7ffdf000 -r5

Tal
+1  A: 

You might also want to give this debugger extension a try. It is a library called SDbgExt, developed by Skywing.

This extension seems to work only with VC7.0...
David Alfonso