Debugger: reset thread after failed function call

Change-Id: If390d681ec33aa7c03b7e6cc62c45f2950186998
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2017-12-19 09:33:34 +01:00
parent 90c7170dae
commit f06d97c67f

View File

@@ -505,9 +505,13 @@ bool ExtensionContext::call(const std::string &functionCall,
const bool crashed = output->find(L"This exception may be expected and handled.") != std::string::npos; const bool crashed = output->find(L"This exception may be expected and handled.") != std::string::npos;
if (crashed && !callFlags) { if (crashed && !callFlags) {
m_stopReason.clear(); m_stopReason.clear();
hr = m_control->Execute(DEBUG_OUTCTL_ALL_CLIENTS, goCommandForCall(CallWithExceptionsNotHandled), DEBUG_EXECUTE_ECHO);
m_control->WaitForEvent(0, INFINITE);
*errorMessage = "A crash occurred while calling: " + functionCall; *errorMessage = "A crash occurred while calling: " + functionCall;
hr = m_control->Execute(DEBUG_OUTCTL_ALL_CLIENTS, goCommandForCall(CallWithExceptionsNotHandled), DEBUG_EXECUTE_ECHO);
startRecordingOutput();
m_control->WaitForEvent(0, INFINITE);
// if we encounter a second chance exception while calling reset the call stack
if (stopRecordingOutput().find(L"!!! second chance !!!") != std::string::npos)
m_control->Execute(DEBUG_OUTCTL_IGNORE, ".call /C", DEBUG_EXECUTE_ECHO);
return false; return false;
} }
return true; return true;