2

I am currently creating a debug visualizer for my class in Visual Studio 2010 and Visual Studio 2012 with autoexp.dat and natvis. Everything work fine with natvis, but I have 1 problem with autoexp.dat.

When I create a static array of my class, the debugger display my array as 1 instance of my class and not like an array of my class. This only occur if I write the children section.

My autoexp.dat :

TestA{
    preview( #("a=", $e.m_a, " b=",$e.m_b) )

    children(#(#(a : $e.m_a),#(b : $e.m_b)))
}

And my quick program to show the problem :

class TestA
{
public:
    TestA():m_a(0),m_b(0){}
    TestA(int a, int b):m_a(a),m_b(b){}
private :
    int m_a;
    int m_b;
};

int main()
{
    TestA test[10];

    for (int i = 0; i < 10; ++i)
    {
        test[i] = TestA(i,i);
    }

    return 0;
}

Here is what I see in the debugger with the children section and without(sorry I can't post image).

With : https://i.stack.imgur.com/LIhEv.jpg Without : https://i.stack.imgur.com/QpsNu.jpg

I would like to see all my array like without the children section but with a/b and not m_a/m_b.

Thank you in advance

Ichiban
  • 23
  • 3

0 Answers0