I've got a custom data structure holding a char* buffer with two lengths associated: maximum and actual length:
struct MyData {
char* data;
int length;
int capacity;
};
In the Visual Studio (2015) debugger visualizer I only want to display the first length elements of the data buffer and not the (usually uninitialized) remaining elements.
I've the following rule in my custom .natvis file for displaying my custom data structure:
<Type Name="MyData">
<DisplayString>content="{data,su}" length={length}</DisplayString>
</Type>
Is it possible to only display data as a "su"-encoded string from data[0] to data[length-1]?