From 5715b8baecce2723605826254166608c0544d028 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 3 Apr 2023 11:39:23 +0200 Subject: 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 --- src/plugins/debugger/gdb/gdbengine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/plugins/debugger/gdb/gdbengine.cpp') 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(); -- cgit v1.2.1