forked from qt-creator/qt-creator
RunControl: Simplify some usages of runnable()
Change-Id: I77fbb140469053f0e6cdcccfb7c78857fbb8b7e7 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -127,8 +127,8 @@ bool GdbServerProvider::isValid() const
|
|||||||
bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(runTool, return false);
|
QTC_ASSERT(runTool, return false);
|
||||||
const ProcessRunData runnable = runTool->runControl()->runnable();
|
const CommandLine cmd = runTool->runControl()->commandLine();
|
||||||
const FilePath bin = FilePath::fromString(runnable.command.executable().path());
|
const FilePath bin = FilePath::fromString(cmd.executable().path());
|
||||||
if (bin.isEmpty()) {
|
if (bin.isEmpty()) {
|
||||||
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
||||||
return false;
|
return false;
|
||||||
@@ -141,7 +141,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa
|
|||||||
|
|
||||||
ProcessRunData inferior;
|
ProcessRunData inferior;
|
||||||
inferior.command.setExecutable(bin);
|
inferior.command.setExecutable(bin);
|
||||||
inferior.command.setArguments(runnable.command.arguments());
|
inferior.command.setArguments(cmd.arguments());
|
||||||
DebuggerRunParameters &rp = runTool->runParameters();
|
DebuggerRunParameters &rp = runTool->runParameters();
|
||||||
rp.setInferior(inferior);
|
rp.setInferior(inferior);
|
||||||
rp.setSymbolFile(bin);
|
rp.setSymbolFile(bin);
|
||||||
|
@@ -162,7 +162,7 @@ QString UvscServerProvider::channelString() const
|
|||||||
bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(runTool, return false);
|
QTC_ASSERT(runTool, return false);
|
||||||
const FilePath bin = runTool->runControl()->runnable().command.executable();
|
const FilePath bin = runTool->runControl()->commandLine().executable();
|
||||||
if (bin.isEmpty()) {
|
if (bin.isEmpty()) {
|
||||||
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
errorMessage = Tr::tr("Cannot debug: Local executable is not set.");
|
||||||
return false;
|
return false;
|
||||||
|
@@ -632,7 +632,7 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup()
|
|||||||
if (m_runParameters.serverAttachPid().isValid())
|
if (m_runParameters.serverAttachPid().isValid())
|
||||||
cmd.addArgs({"--attach", QString::number(m_runParameters.serverAttachPid().pid())});
|
cmd.addArgs({"--attach", QString::number(m_runParameters.serverAttachPid().pid())});
|
||||||
else
|
else
|
||||||
cmd.addCommandLineAsArgs(runControl()->runnable().command);
|
cmd.addCommandLineAsArgs(runControl()->commandLine());
|
||||||
} else {
|
} else {
|
||||||
// Something resembling gdbserver
|
// Something resembling gdbserver
|
||||||
if (m_runParameters.serverUseMulti())
|
if (m_runParameters.serverUseMulti())
|
||||||
|
@@ -1633,8 +1633,7 @@ void ProcessRunner::start()
|
|||||||
appendMessage(msg, NormalMessageFormat);
|
appendMessage(msg, NormalMessageFormat);
|
||||||
if (runControl()->isPrintEnvironmentEnabled()) {
|
if (runControl()->isPrintEnvironmentEnabled()) {
|
||||||
appendMessage(Tr::tr("Environment:"), NormalMessageFormat);
|
appendMessage(Tr::tr("Environment:"), NormalMessageFormat);
|
||||||
runControl()->runnable().environment
|
d->m_environment.forEachEntry([this](const QString &key, const QString &value, bool enabled) {
|
||||||
.forEachEntry([this](const QString &key, const QString &value, bool enabled) {
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
appendMessage(key + '=' + value, StdOutFormat);
|
appendMessage(key + '=' + value, StdOutFormat);
|
||||||
});
|
});
|
||||||
|
@@ -193,7 +193,7 @@ public:
|
|||||||
worker->setId("ApplicationManagerPlugin.Run.TargetRunner");
|
worker->setId("ApplicationManagerPlugin.Run.TargetRunner");
|
||||||
QObject::connect(worker, &RunWorker::stopped, worker, [worker, runControl] {
|
QObject::connect(worker, &RunWorker::stopped, worker, [worker, runControl] {
|
||||||
worker->appendMessage(
|
worker->appendMessage(
|
||||||
Tr::tr("%1 exited.").arg(runControl->runnable().command.toUserOutput()),
|
Tr::tr("%1 exited.").arg(runControl->commandLine().toUserOutput()),
|
||||||
OutputFormat::NormalMessageFormat);
|
OutputFormat::NormalMessageFormat);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user