From f06d97c67fc4628d7706bbf360c562a568145bdc Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 19 Dec 2017 09:33:34 +0100 Subject: [PATCH] Debugger: reset thread after failed function call Change-Id: If390d681ec33aa7c03b7e6cc62c45f2950186998 Reviewed-by: Christian Stenger --- src/libs/qtcreatorcdbext/extensioncontext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/qtcreatorcdbext/extensioncontext.cpp b/src/libs/qtcreatorcdbext/extensioncontext.cpp index 0d8864ee972..c6ae69fac7e 100644 --- a/src/libs/qtcreatorcdbext/extensioncontext.cpp +++ b/src/libs/qtcreatorcdbext/extensioncontext.cpp @@ -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; if (crashed && !callFlags) { 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; + 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 true;