forked from qt-creator/qt-creator
BareMetal: Inline UvscServerProviderRunner
Task-number: QTCREATORBUG-29168 Change-Id: Ic8c7d4e2e72510bea2000b17b83e829ee367bb26 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -204,13 +204,11 @@ bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMess
|
||||
|
||||
ProjectExplorer::RunWorker *UvscServerProvider::targetRunner(RunControl *runControl) const
|
||||
{
|
||||
// Get uVision executable path.
|
||||
const ProcessRunData uv = DebuggerKitAspect::runnable(runControl->kit());
|
||||
const CommandLine server{uv.command.executable(),
|
||||
{"-j0", QStringLiteral("-s%1").arg(m_channel.port())}};
|
||||
ProcessRunData r;
|
||||
r.command = server;
|
||||
return new UvscServerProviderRunner(runControl, r);
|
||||
auto worker = new SimpleTargetRunner(runControl);
|
||||
worker->setId("BareMetalUvscServer");
|
||||
worker->setCommandLine({DebuggerKitAspect::runnable(runControl->kit()).command.executable(),
|
||||
{"-j0", QStringLiteral("-s%1").arg(m_channel.port())}});
|
||||
return worker;
|
||||
}
|
||||
|
||||
void UvscServerProvider::fromMap(const Store &data)
|
||||
@@ -339,38 +337,4 @@ void UvscServerProviderConfigWidget::setFromProvider()
|
||||
m_driverSelector->setSelection(p->driverSelection());
|
||||
}
|
||||
|
||||
// UvscServerProviderRunner
|
||||
|
||||
UvscServerProviderRunner::UvscServerProviderRunner(ProjectExplorer::RunControl *runControl,
|
||||
const ProcessRunData &runnable)
|
||||
: RunWorker(runControl)
|
||||
{
|
||||
setId("BareMetalUvscServer");
|
||||
|
||||
m_process.setCommand(runnable.command);
|
||||
|
||||
connect(&m_process, &Process::started, this, [this] {
|
||||
ProcessHandle pid(m_process.processId());
|
||||
this->runControl()->setApplicationProcessHandle(pid);
|
||||
reportStarted();
|
||||
});
|
||||
connect(&m_process, &Process::done, this, [this] {
|
||||
appendMessage(m_process.exitMessage(), NormalMessageFormat);
|
||||
reportStopped();
|
||||
});
|
||||
}
|
||||
|
||||
void UvscServerProviderRunner::start()
|
||||
{
|
||||
const QString msg = Tr::tr("Starting %1...").arg(m_process.commandLine().displayName());
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
|
||||
m_process.start();
|
||||
}
|
||||
|
||||
void UvscServerProviderRunner::stop()
|
||||
{
|
||||
m_process.terminate();
|
||||
}
|
||||
|
||||
} // BareMetal::Internal
|
||||
|
@@ -115,20 +115,5 @@ protected:
|
||||
Uv::DriverSelector *m_driverSelector = nullptr;
|
||||
};
|
||||
|
||||
// UvscServerProviderRunner
|
||||
|
||||
class UvscServerProviderRunner final : public ProjectExplorer::RunWorker
|
||||
{
|
||||
public:
|
||||
explicit UvscServerProviderRunner(ProjectExplorer::RunControl *runControl,
|
||||
const Utils::ProcessRunData &runnable);
|
||||
|
||||
private:
|
||||
void start() final;
|
||||
void stop() final;
|
||||
|
||||
Utils::Process m_process;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace BareMetal
|
||||
|
Reference in New Issue
Block a user