diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 23e0e2208ea..f98d2393883 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2753,7 +2753,7 @@ void CdbEngine::setupScripting(const DebuggerResponse &response) return; } - QString dumperPath = Core::ICore::resourcePath("debugger").toUserOutput(); + QString dumperPath = runParameters().dumperPath.toUserOutput(); dumperPath.replace('\\', "\\\\"); runCommand({"sys.path.insert(1, '" + dumperPath + "')", ScriptCommand}); runCommand({"from cdbbridge import Dumper", ScriptCommand}); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 87d52ad74b1..f2dd9f09a00 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1056,6 +1056,8 @@ void DebuggerEngine::setRunTool(DebuggerRunTool *runTool) d->m_device = runControl->device(); if (!d->m_device) d->m_device = d->m_runParameters.inferior.device; + if (d->m_device) + d->m_runParameters.dumperPath = d->m_device->debugDumperPath(); d->m_terminalRunner = runTool->terminalRunner(); validateRunParameters(d->m_runParameters); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 2099bc2f959..6c66d269c8d 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -203,6 +203,8 @@ public: int testCase = 0; QStringList validationErrors; + + Utils::FilePath dumperPath; }; class UpdateParameters diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 8b92c7d31dc..22daff02a21 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -946,6 +946,8 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm m_engine = createPdbEngine(); } } + + m_runParameters.dumperPath = Core::ICore::resourcePath("debugger/"); } void DebuggerRunTool::startRunControl() diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b5494c9f024..63f654e7a86 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3985,7 +3985,6 @@ void GdbEngine::setupEngine() // We need to guarantee a roundtrip before the adapter proceeds. // Make sure this stays the last command in startGdb(). // Don't use ConsoleCommand, otherwise Mac won't markup the output. - const QString dumperSourcePath = ICore::resourcePath("debugger/").toString(); //if (terminal()->isUsable()) // runCommand({"set inferior-tty " + QString::fromUtf8(terminal()->slaveDevice())}); @@ -3993,7 +3992,7 @@ void GdbEngine::setupEngine() const QString uninstalledData = rp.debugger.command.executable().pathAppended("data-directory/python").path(); - runCommand({"python sys.path.insert(1, '" + dumperSourcePath + "')"}); + runCommand({"python sys.path.insert(1, '" + rp.dumperPath.path() + "')"}); runCommand({"python sys.path.append('" + uninstalledData + "')"}); runCommand({"python from gdbbridge import *"}); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 26816ce5469..744387baa3a 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -237,9 +237,9 @@ void LldbEngine::setupEngine() showStatusMessage(tr("Setting up inferior...")); - const QByteArray dumperSourcePath = ICore::resourcePath("debugger/").toString().toLocal8Bit(); + const DebuggerRunParameters &rp = runParameters(); - executeCommand("script sys.path.insert(1, '" + dumperSourcePath + "')"); + executeCommand("script sys.path.insert(1, '" + rp.dumperPath.path().toLocal8Bit() + "')"); // This triggers reportState("enginesetupok") or "enginesetupfailed": executeCommand("script from lldbbridge import *"); @@ -268,8 +268,6 @@ void LldbEngine::setupEngine() }; runCommand(cmd1); - const DebuggerRunParameters &rp = runParameters(); - const SourcePathMap sourcePathMap = mergePlatformQtPath(rp, debuggerSettings()->sourcePathMap.value()); for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 6efa7fac557..1af3b5d436f 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -839,6 +839,9 @@ void DockerDevicePrivate::startContainer() mount = q->mapToDevicePath(FilePath::fromUserInput(mount)); dockerCreate.addArgs({"-v", mount + ':' + mount}); } + FilePath dumperPath = FilePath::fromString("/tmp/qtcreator/debugger"); + dockerCreate.addArgs({"-v", q->debugDumperPath().toUserOutput() + ':' + dumperPath.path()}); + q->setDebugDumperPath(dumperPath); dockerCreate.addArgs({"--entrypoint", "/bin/sh", m_data.imageId}); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index f1bedcc4416..746890a6cae 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -33,6 +33,7 @@ #include "../kitinformation.h" #include "../runconfiguration.h" +#include #include #include #include @@ -153,6 +154,7 @@ public: QSsh::SshConnectionParameters sshParameters; PortList freePorts; FilePath debugServerPath; + FilePath debugDumperPath = Core::ICore::resourcePath("debugger/"); FilePath qmlRunCommand; bool emptyCommandAllowed = false; @@ -763,6 +765,16 @@ void IDevice::setDebugServerPath(const FilePath &path) d->debugServerPath = path; } +FilePath IDevice::debugDumperPath() const +{ + return d->debugDumperPath; +} + +void IDevice::setDebugDumperPath(const Utils::FilePath &path) +{ + d->debugDumperPath = path; +} + FilePath IDevice::qmlRunCommand() const { return d->qmlRunCommand; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 56bdbb5bd28..978c08a25a6 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -217,6 +217,9 @@ public: Utils::FilePath debugServerPath() const; void setDebugServerPath(const Utils::FilePath &path); + Utils::FilePath debugDumperPath() const; + void setDebugDumperPath(const Utils::FilePath &path); + Utils::FilePath qmlRunCommand() const; void setQmlRunCommand(const Utils::FilePath &path);