Code Gem

Code Gem

Knowledge was arriving in dribs and drabs

Code Gem RSS Feed
 
 
 
 

An Easy Way to Visualize Customize Data Structure in Visual Studio

Start from Visual Studio 2005, STL containers can be shown in the Watch windows, and we can expand the tree-like control to navigator through the whole data structure to exam every element of the container. This brings a great benefit of debugging code, and it is one of the major reason why I prefer STL containers.

While working with legacy code there are a lot of customized data structures which doesn’t implemented well enough for the debugger to figure out its data structure automatically. Thus it cannot be shown in the Watch window other than a plain pointer address, even with symbol set up correctly. This really becomes an debug obstacle.

Once a while I believe that in order to get over the problem we have to implement an extension, like it is described in the following articles:

Well there turned to be another way easier approach. Under <VisualStudio Install Location>\Common7\Packages\Debugger there is a file named autoexp.dat. Open it with any text editor we could see a bunch of interesting stuff. It looks like that all those find STL/ATL Watch stuff is defined in this file!

The header of the file described how to add your own definition for the customize data structure. There is a great article also covered a good amount of details. See the following link:

Now armed with the new trick, my debugging life becomes easier!

Share/Save/Bookmark

Leave a Reply

September 2010
M T W T F S S
« Feb «-»  
 12345
6789101112
13141516171819
20212223242526
27282930  

Blogroll