From 4e176cb15cc09868392076082d4d3f6f11790463 Mon Sep 17 00:00:00 2001
From: hjk <hjk121@nokiamail.com>
Date: Wed, 2 Apr 2014 15:08:50 +0200
Subject: [PATCH] Debugger: Abort gdb session if no python support is found

The message will be untranslated due to the string freeze,
but better than nothing.

Task-number: QTCREATORBUG-11505

Change-Id: I6f5e65615e4c20f42ce6800b8107f923c2ae2c4f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
---
 src/plugins/debugger/gdb/gdbengine.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 89b52fde81d..e514199616e 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1763,6 +1763,13 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response)
         showMessage(_("ENGINE SUCCESSFULLY STARTED"));
         notifyEngineSetupOk();
     } else {
+        QByteArray msg = response.data["msg"].data();
+        if (msg.contains("Python scripting is not supported in this copy of GDB.")) {
+            QString out1 = _("The selected build of GDB does not support Python scripting.");
+            QString out2 = _("It cannot be used in Qt Creator.");
+            showStatusMessage(out1 + QLatin1Char(' ') + out2);
+            showMessageBox(QMessageBox::Critical, tr("Execution Error"), out1 + _("<br>") + out2);
+        }
         notifyEngineSetupFailed();
     }
 }
-- 
GitLab