Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Tuesday, 28 May 2013

A Moment Of Luck In The Sea Of Misfortune

The latest update to Microsoft Visual Studio 2012 gives the ability to build C++11 programs for versions of Windows from XP upwards. For that build configuration, the static analysis tools are disabled, as are some other areas of less used functionality (HLSL compilation, remote debugging, direct x debugging). Note the new v110_xp mode is the only supported one for targeting XP.

This new update requires updates to tools around MSVC e.g. CMake 2.8.11 is required to use the new mode. 

Updating MSVC also brings new advice about what compiler options are sensible, and what options are newly harmful. /Za is bad in MSVC 2010+, and is discussed in the boost warning guidelines.

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.