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]
?
This will limit the length of the string in the debugger:
<Type Name="MyData">
<DisplayString>{data,[length]su}</DisplayString>
</Type>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With