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>
This commit is contained in:
hjk
2023-04-03 11:39:23 +02:00
parent ea73bb9146
commit 5715b8baec

View File

@@ -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();