forked from qt-creator/qt-creator
Docker: mount python dumpers to device
Change-Id: Ic0d67b4a18247439f5797a0dcf74df945ef6f61e Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -2753,7 +2753,7 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString dumperPath = Core::ICore::resourcePath("debugger").toUserOutput();
|
QString dumperPath = runParameters().dumperPath.toUserOutput();
|
||||||
dumperPath.replace('\\', "\\\\");
|
dumperPath.replace('\\', "\\\\");
|
||||||
runCommand({"sys.path.insert(1, '" + dumperPath + "')", ScriptCommand});
|
runCommand({"sys.path.insert(1, '" + dumperPath + "')", ScriptCommand});
|
||||||
runCommand({"from cdbbridge import Dumper", ScriptCommand});
|
runCommand({"from cdbbridge import Dumper", ScriptCommand});
|
||||||
|
@@ -1056,6 +1056,8 @@ void DebuggerEngine::setRunTool(DebuggerRunTool *runTool)
|
|||||||
d->m_device = runControl->device();
|
d->m_device = runControl->device();
|
||||||
if (!d->m_device)
|
if (!d->m_device)
|
||||||
d->m_device = d->m_runParameters.inferior.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();
|
d->m_terminalRunner = runTool->terminalRunner();
|
||||||
|
|
||||||
validateRunParameters(d->m_runParameters);
|
validateRunParameters(d->m_runParameters);
|
||||||
|
@@ -203,6 +203,8 @@ public:
|
|||||||
int testCase = 0;
|
int testCase = 0;
|
||||||
|
|
||||||
QStringList validationErrors;
|
QStringList validationErrors;
|
||||||
|
|
||||||
|
Utils::FilePath dumperPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UpdateParameters
|
class UpdateParameters
|
||||||
|
@@ -946,6 +946,8 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
|
|||||||
m_engine = createPdbEngine();
|
m_engine = createPdbEngine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_runParameters.dumperPath = Core::ICore::resourcePath("debugger/");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerRunTool::startRunControl()
|
void DebuggerRunTool::startRunControl()
|
||||||
|
@@ -3985,7 +3985,6 @@ void GdbEngine::setupEngine()
|
|||||||
// We need to guarantee a roundtrip before the adapter proceeds.
|
// We need to guarantee a roundtrip before the adapter proceeds.
|
||||||
// Make sure this stays the last command in startGdb().
|
// Make sure this stays the last command in startGdb().
|
||||||
// Don't use ConsoleCommand, otherwise Mac won't markup the output.
|
// Don't use ConsoleCommand, otherwise Mac won't markup the output.
|
||||||
const QString dumperSourcePath = ICore::resourcePath("debugger/").toString();
|
|
||||||
|
|
||||||
//if (terminal()->isUsable())
|
//if (terminal()->isUsable())
|
||||||
// runCommand({"set inferior-tty " + QString::fromUtf8(terminal()->slaveDevice())});
|
// runCommand({"set inferior-tty " + QString::fromUtf8(terminal()->slaveDevice())});
|
||||||
@@ -3993,7 +3992,7 @@ void GdbEngine::setupEngine()
|
|||||||
const QString uninstalledData =
|
const QString uninstalledData =
|
||||||
rp.debugger.command.executable().pathAppended("data-directory/python").path();
|
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 sys.path.append('" + uninstalledData + "')"});
|
||||||
runCommand({"python from gdbbridge import *"});
|
runCommand({"python from gdbbridge import *"});
|
||||||
|
|
||||||
|
@@ -237,9 +237,9 @@ void LldbEngine::setupEngine()
|
|||||||
|
|
||||||
showStatusMessage(tr("Setting up inferior..."));
|
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":
|
// This triggers reportState("enginesetupok") or "enginesetupfailed":
|
||||||
executeCommand("script from lldbbridge import *");
|
executeCommand("script from lldbbridge import *");
|
||||||
|
|
||||||
@@ -268,8 +268,6 @@ void LldbEngine::setupEngine()
|
|||||||
};
|
};
|
||||||
runCommand(cmd1);
|
runCommand(cmd1);
|
||||||
|
|
||||||
const DebuggerRunParameters &rp = runParameters();
|
|
||||||
|
|
||||||
const SourcePathMap sourcePathMap =
|
const SourcePathMap sourcePathMap =
|
||||||
mergePlatformQtPath(rp, debuggerSettings()->sourcePathMap.value());
|
mergePlatformQtPath(rp, debuggerSettings()->sourcePathMap.value());
|
||||||
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd();
|
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd();
|
||||||
|
@@ -839,6 +839,9 @@ void DockerDevicePrivate::startContainer()
|
|||||||
mount = q->mapToDevicePath(FilePath::fromUserInput(mount));
|
mount = q->mapToDevicePath(FilePath::fromUserInput(mount));
|
||||||
dockerCreate.addArgs({"-v", mount + ':' + 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});
|
dockerCreate.addArgs({"--entrypoint", "/bin/sh", m_data.imageId});
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#include "../kitinformation.h"
|
#include "../kitinformation.h"
|
||||||
#include "../runconfiguration.h"
|
#include "../runconfiguration.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <utils/displayname.h>
|
#include <utils/displayname.h>
|
||||||
#include <utils/icon.h>
|
#include <utils/icon.h>
|
||||||
@@ -153,6 +154,7 @@ public:
|
|||||||
QSsh::SshConnectionParameters sshParameters;
|
QSsh::SshConnectionParameters sshParameters;
|
||||||
PortList freePorts;
|
PortList freePorts;
|
||||||
FilePath debugServerPath;
|
FilePath debugServerPath;
|
||||||
|
FilePath debugDumperPath = Core::ICore::resourcePath("debugger/");
|
||||||
FilePath qmlRunCommand;
|
FilePath qmlRunCommand;
|
||||||
bool emptyCommandAllowed = false;
|
bool emptyCommandAllowed = false;
|
||||||
|
|
||||||
@@ -763,6 +765,16 @@ void IDevice::setDebugServerPath(const FilePath &path)
|
|||||||
d->debugServerPath = 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
|
FilePath IDevice::qmlRunCommand() const
|
||||||
{
|
{
|
||||||
return d->qmlRunCommand;
|
return d->qmlRunCommand;
|
||||||
|
@@ -217,6 +217,9 @@ public:
|
|||||||
Utils::FilePath debugServerPath() const;
|
Utils::FilePath debugServerPath() const;
|
||||||
void setDebugServerPath(const Utils::FilePath &path);
|
void setDebugServerPath(const Utils::FilePath &path);
|
||||||
|
|
||||||
|
Utils::FilePath debugDumperPath() const;
|
||||||
|
void setDebugDumperPath(const Utils::FilePath &path);
|
||||||
|
|
||||||
Utils::FilePath qmlRunCommand() const;
|
Utils::FilePath qmlRunCommand() const;
|
||||||
void setQmlRunCommand(const Utils::FilePath &path);
|
void setQmlRunCommand(const Utils::FilePath &path);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user