From e903c4d9cd562c80b345c2ce9a60b274bdfd2327 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Thu, 29 Oct 2009 15:31:43 +0100
Subject: [PATCH] reset program location when we detect "spontaneous running"

i.e., don't allow user to confuse himself :)
---
 src/plugins/debugger/gdb/gdbengine.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 4c11211a73c..84ef6c33ffc 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -539,6 +539,11 @@ void GdbEngine::handleResponse(const QByteArray &buff)
             if (resultClass == "done") {
                 response.resultClass = GdbResultDone;
             } else if (resultClass == "running") {
+                if (state() == InferiorStopped) { // Result of manual command.
+                    m_manager->resetLocation();
+                    setTokenBarrier();
+                    setState(InferiorRunningRequested);
+                }
                 setState(InferiorRunning);
                 showStatusMessage(tr("Running..."));
                 response.resultClass = GdbResultRunning;
-- 
GitLab