Pages

Saturday, February 27, 2010

Personalize view in VS debug, watch windows

Base article:

Writing custom visualizers for Visual Studio 2005

Example for a structure:

In source code:

struct test_struct{
int val; /* 0xf - FALSE; 0xa - TRUE other - INCOHERENT*/
}

In autoexp.dat, [Visualizer] section:

[Visualizer]

; My Visualizer for my test struct
test_struct {
preview (
#(
#if ($c.val == 0xA) (
#("TRUE")
) #else (
#if ($c.val == 0xF) (
#("FALSE")
) #else (
#("INCOHERENT")
)
)
)
)
}