From 51625f88b2015bca31991975eb304f56822c0eb3 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Mon, 6 Sep 2010 15:29:26 +0200
Subject: [PATCH] debugger: don't start the watch dog timer on -gdb-exit

---
 src/plugins/debugger/gdb/gdbengine.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index b9863631e52..19890fc0acc 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -805,7 +805,12 @@ void GdbEngine::flushCommand(const GdbCommand &cmd0)
     // Start Watchdog.
     if (m_commandTimer->interval() <= 20000)
         m_commandTimer->setInterval(commandTimeoutTime());
-    m_commandTimer->start();
+    // The process can die for external reason between the "-gdb-exit" was
+    // sent and a response could be retrieved. We don't want the watchdog
+    // to bark in that case since the only possible outcome is a dead
+    // process anyway.
+    if (cmd.command != "-gdb-exit")
+        m_commandTimer->start();
 
     //if (cmd.flags & LosesChild)
     //    setState(InferiorShutdownRequested);
-- 
GitLab