We had a customer who had issues with autoexp.dat. He added few data visualizers in autoexp.dat file but somehow none of them took effect in the debugger windows like Autos, Locals, etc. We initially thought the issue is with the way he gave format specifier in autoexp.dat file. After several corrections/trials nothing seemed to take effect.
(Just to give a brief description of autoexp.dat: Its a text file which tells visual studio debugger how to display a user defined type in debugger windows like Autos, Locals etc.)
In the end this turned out to be an issue with an option given in Tools->Options->Debugging->General. Please see highlighted item in the list. This option turns off all object structure view customizations if its turned on.
So in order to demonstrate the problem, I tested out CString display in the autos debugger window. This is how the display of autos window look when “Show raw structure of objects in variables window” is ‘Off’. Note how the value of the CString variable ‘Test’ is displayed in the same line as the variable…
This is how the display of autos window look when “Show raw structure of objects in variables window” is ‘On’. Please note display of CString variable ‘Test’, now the value is not displayed int the same line but visual studio displays the type in expanded form according to the member variables in CString type…
The above demo was a simple one becuase CString is not that complex a type (has few members). For complex types if “Show raw structure of objects in variables window” is on you might end up expanding several nodes in order to see the real value, for e.g. map, vector etc. Have a look at how vector looks like when this option is ‘off’ and ‘on’…
vector has a much better display in the autos window when this option is off.
Well then you may ask why do we need the “Show raw structure of objects in variables window” option? It has its own uses, the raw structure display is useful when you need to see how the object looks in memory, i.e. what addresses the internal vars were allocated at etc.
Yeah this option is kinda living in oblivion with very few aware of this option.