Friday, 6 February 2009

The Thin Line Between Love and Hatred

Visual Studio 2005 has a nice debugger; I spend quite a lot of time there. It is certainly an improvement over gdb. Some of its nicer features are the visualisations of the programs data structures - STL containers, arrays of characters as strings. The visualisation of data structures can be customised, and this is good; Sadly, it is not a documented feature. The autoexp.dat file contains the relevant specifications.

It can be used to provide custom views of data structures specific to programs and libraries. One example is the Chromium browser from google. (and links 1,2,3,4,5). It can also be used to auto expand watched data.

The parser and evaluator for these leave much to be desired. Syntax errors are silently ignored (the preview, or child view, the visualiser for a given type is unchanged) leaving the display unchanged. If not ignored, they are reported in a single modal dialog. If an error is not syntactic, the debugger will crash. Possibly immediately, possibly subsequently in the middle of a debugging session on inspecting certain values.

Beyond the implementation quality issues, the lack of documentation is the main problem. The syntax, while not good, would be improved by a smattering of documentation on the MSDN.

Its a shame, because it is obviously a (potentially) useful feature. It certainly was useful for substituting names for numeric codes in data views (when it didn't crash...)

The Visual Studio command line options are documented on MSDN - some obscure but useful ones. Possibly the most useful is /debugexe - to invoke the debugger on a program from the command line.

No comments: