forked from qt-creator/qt-creator
RunControl: Drop IDevice * from doStart()
Use device set inside passed runnable instead. Grep for all usages of RunControl::start(). If passed device wasn't nullptr, set this device inside passed runnable. Otherwise ensure that passed runnable contains device set to nullptr. Change-Id: I06fd42a16246fa9fedd81eeb47481a217f887cb0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -348,7 +348,9 @@ GdbServerProviderRunner::GdbServerProviderRunner(ProjectExplorer::RunControl *ru
|
|||||||
{
|
{
|
||||||
setId("BareMetalGdbServer");
|
setId("BareMetalGdbServer");
|
||||||
// Baremetal's GDB servers are launched on the host, not on the target.
|
// Baremetal's GDB servers are launched on the host, not on the target.
|
||||||
setStarter([this, runnable] { doStart(runnable, {}); });
|
Runnable devicelessRunnable = runnable;
|
||||||
|
devicelessRunnable.device.reset();
|
||||||
|
setStarter([this, devicelessRunnable] { doStart(devicelessRunnable); });
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -147,7 +147,8 @@ public:
|
|||||||
// FIXME: Spaces!
|
// FIXME: Spaces!
|
||||||
r.command.setArguments(r.command.executable().toString() + ' ' + r.command.arguments());
|
r.command.setArguments(r.command.executable().toString() + ' ' + r.command.arguments());
|
||||||
r.command.setExecutable(FilePath::fromString(Constants::AppcontrollerFilepath));
|
r.command.setExecutable(FilePath::fromString(Constants::AppcontrollerFilepath));
|
||||||
doStart(r, runControl->device());
|
r.device = runControl->device();
|
||||||
|
doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1085,8 +1085,8 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
debugServer.command.setArguments(ProcessArgs::joinArgs(args, OsTypeLinux));
|
debugServer.command.setArguments(ProcessArgs::joinArgs(args, OsTypeLinux));
|
||||||
|
debugServer.device = runControl->device();
|
||||||
doStart(debugServer, runControl->device());
|
doStart(debugServer);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -99,7 +99,7 @@ public:
|
|||||||
CommandLine::Raw};
|
CommandLine::Raw};
|
||||||
r.workingDirectory = target->activeBuildConfiguration()->buildDirectory();
|
r.workingDirectory = target->activeBuildConfiguration()->buildDirectory();
|
||||||
r.environment = target->activeBuildConfiguration()->environment();
|
r.environment = target->activeBuildConfiguration()->environment();
|
||||||
SimpleTargetRunner::doStart(r, {});
|
SimpleTargetRunner::doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1188,13 +1188,16 @@ SimpleTargetRunner::SimpleTargetRunner(RunControl *runControl)
|
|||||||
|
|
||||||
void SimpleTargetRunner::start()
|
void SimpleTargetRunner::start()
|
||||||
{
|
{
|
||||||
if (m_starter)
|
if (m_starter) {
|
||||||
m_starter();
|
m_starter();
|
||||||
else
|
} else {
|
||||||
doStart(runControl()->runnable(), runControl()->device());
|
Runnable runnable = runControl()->runnable();
|
||||||
|
runnable.device = runControl()->device();
|
||||||
|
doStart(runControl()->runnable());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstPtr &device)
|
void SimpleTargetRunner::doStart(const Runnable &runnable)
|
||||||
{
|
{
|
||||||
m_stopForced = false;
|
m_stopForced = false;
|
||||||
m_stopReported = false;
|
m_stopReported = false;
|
||||||
@@ -1231,7 +1234,8 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
|
|||||||
|
|
||||||
connect(&m_launcher, &ApplicationLauncher::appendMessage, this, &RunWorker::appendMessage);
|
connect(&m_launcher, &ApplicationLauncher::appendMessage, this, &RunWorker::appendMessage);
|
||||||
|
|
||||||
const bool isDesktop = device.isNull() || device.dynamicCast<const DesktopDevice>();
|
const bool isDesktop = runnable.device.isNull()
|
||||||
|
|| runnable.device.dynamicCast<const DesktopDevice>();
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
connect(&m_launcher, &ApplicationLauncher::processStarted, this, [this] {
|
connect(&m_launcher, &ApplicationLauncher::processStarted, this, [this] {
|
||||||
// Console processes only know their pid after being started
|
// Console processes only know their pid after being started
|
||||||
@@ -1248,9 +1252,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
|
|||||||
} else {
|
} else {
|
||||||
connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted);
|
connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted);
|
||||||
}
|
}
|
||||||
Runnable runnableWithDevice = runnable;
|
m_launcher.setRunnable(runnable);
|
||||||
runnableWithDevice.device = device;
|
|
||||||
m_launcher.setRunnable(runnableWithDevice);
|
|
||||||
m_launcher.start();
|
m_launcher.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -294,7 +294,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setStarter(const std::function<void()> &starter);
|
void setStarter(const std::function<void()> &starter);
|
||||||
void doStart(const Runnable &runnable, const IDevice::ConstPtr &device);
|
void doStart(const Runnable &runnable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void start() final;
|
void start() final;
|
||||||
|
@@ -149,7 +149,8 @@ LocalQmlPreviewSupport::LocalQmlPreviewSupport(ProjectExplorer::RunControl *runC
|
|||||||
|
|
||||||
runnable.command.addArg(QmlDebug::qmlDebugLocalArguments(QmlDebug::QmlPreviewServices,
|
runnable.command.addArg(QmlDebug::qmlDebugLocalArguments(QmlDebug::QmlPreviewServices,
|
||||||
serverUrl.path()));
|
serverUrl.path()));
|
||||||
doStart(runnable, {});
|
runnable.device.reset();
|
||||||
|
doStart(runnable);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -255,8 +255,8 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
|
|||||||
arguments += ' ' + debuggee.command.arguments();
|
arguments += ' ' + debuggee.command.arguments();
|
||||||
|
|
||||||
debuggee.command.setArguments(arguments);
|
debuggee.command.setArguments(arguments);
|
||||||
|
debuggee.device.reset();
|
||||||
doStart(debuggee, {});
|
doStart(debuggee);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,8 +62,8 @@ QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
|
|||||||
|
|
||||||
Runnable r = runControl->runnable();
|
Runnable r = runControl->runnable();
|
||||||
r.command.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, serverUrl));
|
r.command.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, serverUrl));
|
||||||
|
r.device = runControl->device();
|
||||||
doStart(r, runControl->device());
|
doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -116,8 +116,8 @@ public:
|
|||||||
portsGatherer->qmlServer()));
|
portsGatherer->qmlServer()));
|
||||||
}
|
}
|
||||||
r.command.setArguments(ProcessArgs::joinArgs(arguments));
|
r.command.setArguments(ProcessArgs::joinArgs(arguments));
|
||||||
|
r.device = runControl->device();
|
||||||
doStart(r, runControl->device());
|
doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -202,7 +202,8 @@ public:
|
|||||||
|
|
||||||
Runnable r;
|
Runnable r;
|
||||||
r.command = {QNX_DEBUG_EXECUTABLE, {QString::number(pdebugPort)}};
|
r.command = {QNX_DEBUG_EXECUTABLE, {QString::number(pdebugPort)}};
|
||||||
doStart(r, runControl->device());
|
r.device = runControl->device();
|
||||||
|
doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -59,8 +59,8 @@ RemoteLinuxQmlToolingSupport::RemoteLinuxQmlToolingSupport(RunControl *runContro
|
|||||||
|
|
||||||
Runnable r = runControl->runnable();
|
Runnable r = runControl->runnable();
|
||||||
r.command.addArg(QmlDebug::qmlDebugTcpArguments(services, serverUrl));
|
r.command.addArg(QmlDebug::qmlDebugTcpArguments(services, serverUrl));
|
||||||
|
r.device = runControl->device();
|
||||||
doStart(r, runControl->device());
|
doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ public:
|
|||||||
r.command = emrunCommand(runControl->runConfiguration(),
|
r.command = emrunCommand(runControl->runConfiguration(),
|
||||||
browserId,
|
browserId,
|
||||||
QString::number(portsGatherer->findEndPoint().port()));
|
QString::number(portsGatherer->findEndPoint().port()));
|
||||||
SimpleTargetRunner::doStart(r, {});
|
SimpleTargetRunner::doStart(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user