From 06abe6b813841837cfee2491aee43114138c4a3c Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Tue, 6 Oct 2009 11:06:34 +0200
Subject: [PATCH] debugger: fix frame switching when using core files

---
 src/plugins/debugger/gdb/coregdbadapter.cpp | 3 +++
 src/plugins/debugger/gdb/gdbengine.cpp      | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp
index 0c2356ec581..5fa80055c5e 100644
--- a/src/plugins/debugger/gdb/coregdbadapter.cpp
+++ b/src/plugins/debugger/gdb/coregdbadapter.cpp
@@ -149,6 +149,9 @@ void CoreGdbAdapter::handleTargetCore1(const GdbResponse &response)
             emit inferiorStartFailed(tr("No binary found."));
         } else {
             m_executable = console.data().mid(pos1 + 1, pos2 - pos1 - 1);
+            // Strip off command line arguments. FIXME: make robust.
+            if (m_executable.contains(' '))
+                m_executable = m_executable.section(' ', 0, 0);
             QTC_ASSERT(!m_executable.isEmpty(), /**/);
             // Finish extra round.
             m_engine->postCommand(_("detach"), CB(handleDetach1));
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 8e3cf81e36f..dfd9e954104 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -2368,7 +2368,7 @@ void GdbEngine::handleStackListFrames(const GdbResponse &response)
 void GdbEngine::activateFrame(int frameIndex)
 {
     m_manager->resetLocation();
-    if (state() != InferiorStopped)
+    if (state() != InferiorStopped && state() != InferiorUnrunnable)
         return;
 
     StackHandler *stackHandler = manager()->stackHandler();
-- 
GitLab