From 4622aba79e4a7fde9eb8d842674555f8cd61d975 Mon Sep 17 00:00:00 2001
From: hjk <hjk121@nokiamail.com>
Date: Thu, 31 Jan 2013 16:04:04 +0100
Subject: [PATCH] Debugger: Fix triggering display of threadnames

This is a recent regression introduced by the delayed python dumper
initialization.

Task-number: QTCREATORBUG-8615
Change-Id: I3b5dbe5b04c68cf873e3a2597edc60fe2888b3c9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
---
 src/plugins/debugger/gdb/gdbengine.cpp | 12 +++++++++---
 src/plugins/debugger/gdb/gdbengine.h   |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 43b4f4bc942..7fd39494778 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1841,6 +1841,14 @@ void GdbEngine::handleListFeatures(const GdbResponse &response)
 }
 
 void GdbEngine::handleHasPython(const GdbResponse &response)
+{
+    if (response.resultClass == GdbResultDone)
+        m_hasPython = true;
+    else
+        pythonDumpersFailed();
+}
+
+void GdbEngine::handlePythonSetup(const GdbResponse &response)
 {
     if (response.resultClass == GdbResultDone) {
         m_hasPython = true;
@@ -1863,8 +1871,6 @@ void GdbEngine::handleHasPython(const GdbResponse &response)
         }
         const GdbMi hasInferiorThreadList = data.findChild("hasInferiorThreadList");
         m_hasInferiorThreadList = (hasInferiorThreadList.data().toInt() != 0);
-    } else {
-        pythonDumpersFailed();
     }
 }
 
@@ -4924,7 +4930,7 @@ void GdbEngine::tryLoadPythonDumpers()
 
     loadInitScript();
 
-    postCommand("bbsetup", ConsoleCommand);
+    postCommand("bbsetup", ConsoleCommand, CB(handlePythonSetup));
 }
 
 void GdbEngine::reloadDebuggingHelpers()
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index c9f932f89ca..a036df65691 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -391,6 +391,7 @@ protected:
     void handleShowVersion(const GdbResponse &response);
     void handleListFeatures(const GdbResponse &response);
     void handleHasPython(const GdbResponse &response);
+    void handlePythonSetup(const GdbResponse &response);
 
     int m_gdbVersion; // 6.8.0 is 60800
     int m_gdbBuildVersion; // MAC only?
-- 
GitLab