Question

When debugging an unmanaged (native) C++ program, I get the error "An unspecified error has occurred" any time I try to evaluate an expression in the Watch, or in a tracepoint, or execute anything in the Immediate window. The tooltip evaluator doesn't work either. The only window that shows variables is "Locals"; the "Autos" window is empty. Here's how it looks like in the Watch:

enter image description here

This problem occurs on two different computers (so a config issue is unlikely), but only on one specific solution. This project was recently migrated from Visual C++ 2008, where everything was fine. Obviously I made sure the debug info is there, and optimizations are off. Rebuild all didn't helpGoogle knows nothing.

What can I do about it?

----------- EDIT 2: -----------
I managed to isolate the problem. It appears that the debugger cannot inspect variables in methods of classes in a namespace named "NI". To reproduce the problem, compile this code and place a breakpoint where indicated. The Watch window won't work.

namespace NI
{
    class Test
    {
    public:
        static void helloworld();
    };

    void Test::helloworld()
    {
        int i = 0;     // <------- insert breakpoint here
    }
}


int _tmain(int argc, _TCHAR* argv[])
{
    NI::Test::helloworld();
    return 0;
}

I submitted a bug report to Microsoft.

Was it helpful?

Solution

Microsoft confirmed this is a bug in Visual C++ 2012. The rare case when I'm not the one to blame...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top