From 22c5d99fcbcb324fbf987e88c57216831b87cbf0 Mon Sep 17 00:00:00 2001
From: hjk <hjk121@nokiamail.com>
Date: Tue, 28 May 2013 12:12:42 +0200
Subject: [PATCH] Debugger: Disable some commands on Mac

Version of gdb < 7.4 means we are on Mac, so we can
disable commands that have known results there.

Change-Id: I8fc97ed61c47af2c3d9e5cc2bf83e97661204d4f
Reviewed-by: hjk <hjk121@nokiamail.com>
---
 src/plugins/debugger/gdb/gdbengine.cpp | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 024f5e8cf0c..cac10fe73b8 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1816,15 +1816,25 @@ void GdbEngine::handleShowVersion(const GdbResponse &response)
         if (m_gdbVersion > 70100)
             m_disassembleUsesComma = true;
 
-        if (usesExecInterrupt())
-            postCommand("set target-async on", ConsoleCommand);
-        else
-            postCommand("set target-async off", ConsoleCommand);
+        if (m_gdbVersion > 70100) {
+            if (usesExecInterrupt())
+                postCommand("set target-async on", ConsoleCommand);
+            else
+                postCommand("set target-async off", ConsoleCommand);
+        }
 
         if (startParameters().multiProcess)
             postCommand("set detach-on-fork off", ConsoleCommand);
 
-        postCommand("set build-id-verbose 2", ConsoleCommand);
+        //postCommand("set build-id-verbose 2", ConsoleCommand);
+
+        if (m_gdbVersion > 701000) {
+            // Quick check whether we have python.
+            showMessage(_("NOTE: CHECK FOR PYTHON SUPPRESSED, VERSION TOO LOW"));
+            postCommand("python print 43", ConsoleCommand, CB(handleHasPython));
+        } else {
+            pythonDumpersFailed();
+        }
     }
 }
 
@@ -4906,12 +4916,10 @@ void GdbEngine::startGdb(const QStringList &args)
         postCommand("set detach-on-fork off");
     }
 
-    // Quick check whether we have python.
-    postCommand("python print 43", ConsoleCommand, CB(handleHasPython));
-
     // Dummy command to guarantee a roundtrip before the adapter proceed.
     // Make sure this stays the last command in startGdb().
-    postCommand("pwd", ConsoleCommand, CB(reportEngineSetupOk));
+    // Don't use ConsoleCommand, otherwise Mac won't markup the output.
+    postCommand("pwd", CB(reportEngineSetupOk));
 }
 
 void GdbEngine::reportEngineSetupOk(const GdbResponse &response)
-- 
GitLab