Visual Studio in debug mode restarts automatically after an exception is thrown (C++)

1.4k views Asked by At

I'm working on a big C++ project which I haven't created, but the following short code fully represents a problem which I'm faced with:

#include <string>
#include <iostream>
int main(int argc, char **argv){
    using namespace std;
    try{
        string str;
        str = "r";
        double d = stod(str);
        cout << "'stod' worked! d = " << d << endl;
    }
    catch (invalid_argument){
        cout << "I'm in 'catch'\n";
    }
    cout << "I'm after 'try-catch'\n";
    cin.get();
    cin.get();
    return 0;
}

If I launch the code without debugger, everything works fine and as expected it gets into the catch-scope and then main() proceeds.

If I use the debugger, Visual Studio under 32-bit configuration restarts immediately or under 64-bit configuration I get a message: "The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted."

I'm using VS2013 Ultimate on Windows 8.1 Professional.

Due to this post: msvsmon.exe crashed when debugging I have already installed Update 4. I have no breakpoints. In DEBUG->EXCEPTIONS the reset was done.

I also do not understand, what msvsmon.exe is. The Google-search combines it with remote debugger which confuses me a little bit, because I'm using the local debugger, at least I press each time the 'Local Windows Debugger' button.

Could anybody help me out?

0

There are 0 answers