Welcome to Omgili,
Omgili ( Oh My God I Love It ;) is a search engine for discussions. With Omgili you can find answers and solutions, debates, discussions, personal experiences, opinions and more... To learn more about Omgili click here.
This is a complete preview of the discussion as it was indexed by Omgili crawlers. Use this preview if the original discussion is unavailable.
Click here to view the original discussion.
 |
|
 |
|
Debugging C++ STL containers in Windbg
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.
|
|
 |
|
 |
 |
|
 |
|
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.
|
|
 |
|
 |
 |
|
 |
|
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
|
|
 |
|
 |
 |
|
 |
|
Use dt -r i.e dt yourapp!class 7ffdf000 -r5
|
|
 |
|
 |
 |
|
 |
|
You might also want to give this debugger extension a try.
It is a library called SDbgExt, developed by Skywing .
|
|
 |
|
 |
|
|
|