Monday, August 22, 2011

Visual Studio watch window

The watch window can do a lot more than simply displaying variables. The official documentation: "Variable Windows" in the MSDN. The article X64 Debugging With Pseudo Variables And Format Specifiers gives a few examples.

The watch window can also call functions. My favorites to display byte buffers in the watch window are: BitConverter.ToString(buffer) Encoding.ASCII.GetString(buffer, 0, buffer.Length)

And here are some tips mostly regarding the watch window GUI, but including also some other features: 10 Tips you should know about “Watch Window” While debugging in Visual Studio

If the format specifiers aren't sufficient, here are two articles that explain how to program Visual Studio to display your data structures the way you want using autoexp.dat:

See also Sara Ford's blog for more Visual Studio tips. Unfortunately she has left Microsoft.

No comments:

Post a Comment