From 04ad5619b6102898033202e9c75ef51c279ce4b8 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Tue, 20 Jul 2010 15:12:29 +0200
Subject: [PATCH] debugger: somewhat more graceful shutdown in known situations

---
 src/plugins/debugger/debuggerengine.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index e55aff1d07e..bed156e59c8 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -1409,7 +1409,15 @@ void DebuggerEngine::setActive(bool on)
 void DebuggerEngine::quitDebugger()
 {
     showMessage("QUIT DEBUGGER REQUESTED");
-    shutdownInferior();
+    d->m_targetState = DebuggerFinished;
+    if (state() == InferiorStopOk) {
+        d->doShutdownInferior();
+    } else if (state() == InferiorRunOk) {
+        d->doInterruptInferior();
+    } else {
+        // FIXME: We should disable the actions connected to that
+        notifyInferiorIll();
+    }
 }
 
 void DebuggerEngine::requestInterruptInferior()
-- 
GitLab