auto visualizer does not always work.
take the example of code:
#include <stdlib.h>
#include <iostream>
struct MyType
{
int _value_;
};
void test1(MyType mt) {
std::cout << mt._value_ << std::endl;
}
void test2(const MyType mt) {
std::cout << mt._value_ << std::endl;
}
void test3(const MyType &mt) {
std::cout << mt._value_ << std::endl;
}
void test4(const MyType *mt) {
std::cout << mt->_value_ << std::endl;
}
int main()
{
MyType mt{10};
test1(mt);
test2(mt);
test3(mt);
test4(&mt);
system("pause");
return 0;
}
and create a natvis file:
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="MyType">
<DisplayString>[{_value_}]</DisplayString>
<Expand>
<Item Name="Value">_value_</Item>
</Expand>
</Type>
</AutoVisualizer>
if you create a project that Win32 Visual C++
if the project is to create MinGW/Cygwin VisualGDB