PsuedoVariables and Format Specifiers

The VS debugger has a history of tiny but useful features hidden in the expression evaluator. These features are like the yellow shirted ensign in star trek.  They are useful, but unknown and expendable. Developer's learn about them by attending a Power Debugging talk, or buying one of John Robbins very good books.

 

I started blogging about some of these features recently. When I mentioned that to John Cunningham, he told me he had already blogged about these.  I did a search and found something even more surprising.  There's real documentation!

 

Pseudovariables: (This is what I was going to blog about. Goodbye series of good blog topics.)

https://msdn2.microsoft.com/en-us/library/ms164891(en-US,VS.80).aspx

 

You should also see these blog posts for pseudovariables in action:

Whidbey Debugger pseudo-register - $user

Devenv stealth feature, Poor Man's Profiler

Cool Whidbey debugger feature: Merge Environment

One last debugger tip

 

Format specifiers in C++:

https://msdn2.microsoft.com/en-us/library/75w45ekt(en-US,VS.80).aspx

 

Format specifiers in C#:

https://msdn2.microsoft.com/en-us/library/ms164891

 

Format specifiers are useful for telling the debugger how you want to display the value of an expression.  In the watch window the 'Size Specifier for pointers and Arrays' is very useful.  When you start using Tracepoints you'll quickly find ,x and ,d are invaluable.  There are more extensive mechanisms for customizing how expressions are displayed in VS, but that is a topic for another day.

Comments