I'm trying to define a .natvis <DisplayString> for a uint32_t
type, to show as an array of four characters, which in the Watch window, during debugging, would be expressed a bit like this: (char*)&fourcc,4
.
Unfortunately, natvis doesn't seem to like the & very much - it gets ignored, e.g. {(char*)&fourcc,4}
, {(char*)&{fourcc},4
, {((char*)&)fourcc,4}
doesn't work. The documentation does not make it obvious how to perform casts, if it is supported at all.
What am I missing?
Casts are supported, and the syntax is {(char*)&fourcc,4}
, i.e. use the xml entity for '&'.
For best results the na
modifier may be used along the array size (i.e. 4
above) to suppress the showing of the memory address.