summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb/gdbengine.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-04-03 11:39:23 +0200
committerhjk <hjk@qt.io>2023-04-03 10:15:31 +0000
commit5715b8baecce2723605826254166608c0544d028 (patch)
tree50f0698574b62b99692e9c9a819776ad831efa7a /src/plugins/debugger/gdb/gdbengine.cpp
parentea73bb9146af5ecc21978ec0bec6bec6c4b1423d (diff)
downloadqt-creator-5715b8baecce2723605826254166608c0544d028.tar.gz
Debugger: Execute the non-installed gdb data-dir magic
... only when there's a hope for it to help. Change-Id: I0b7215af371515a1eec8420fdf59e60037584941 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/gdb/gdbengine.cpp')
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 8a98c0e433..23ebc1df94 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -3969,11 +3969,14 @@ void GdbEngine::handleGdbStarted()
//if (terminal()->isUsable())
// runCommand({"set inferior-tty " + QString::fromUtf8(terminal()->slaveDevice())});
- const QString uninstalledData = rp.debugger.command.executable().parentDir()
- .pathAppended("data-directory/python").path();
-
runCommand({"python sys.path.insert(1, '" + rp.dumperPath.path() + "')"});
- runCommand({"python sys.path.append('" + uninstalledData + "')"});
+
+ // This is useful (only) in custom gdb builds that did not run 'make install'
+ const FilePath uninstalledData = rp.debugger.command.executable().parentDir()
+ / "data-directory/python";
+ if (uninstalledData.exists())
+ runCommand({"python sys.path.append('" + uninstalledData.path() + "')"});
+
runCommand({"python from gdbbridge import *"});
const QString path = debuggerSettings()->extraDumperFile.value();