forked from qt-creator/qt-creator
BareMetal: Allow IDebugServerProvider to create own runner
It is more correct way, because only the server providers know about own runners. Change-Id: I645f4696a5d9738d9cd578d642389124a0b0de60 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -72,7 +72,8 @@ BareMetalDebugSupport::BareMetalDebugSupport(RunControl *runControl)
|
||||
return;
|
||||
}
|
||||
|
||||
p->addTargetRunner(this, runControl);
|
||||
if (RunWorker *runner = p->targetRunner(runControl))
|
||||
addStartDependency(runner);
|
||||
}
|
||||
|
||||
void BareMetalDebugSupport::start()
|
||||
|
@@ -209,18 +209,16 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool,
|
||||
return true;
|
||||
}
|
||||
|
||||
void GdbServerProvider::addTargetRunner(Debugger::DebuggerRunTool *runTool,
|
||||
ProjectExplorer::RunControl *runControl) const
|
||||
RunWorker *GdbServerProvider::targetRunner(RunControl *runControl) const
|
||||
{
|
||||
if (m_startupMode != GdbServerProvider::StartupOnNetwork)
|
||||
return;
|
||||
return nullptr;
|
||||
|
||||
Runnable r;
|
||||
r.setCommandLine(command());
|
||||
// Command arguments are in host OS style as the bare metal's GDB servers are launched
|
||||
// on the host, not on that target.
|
||||
const auto runner = new GdbServerProviderRunner(runControl, r);
|
||||
runTool->addStartDependency(runner);
|
||||
return new GdbServerProviderRunner(runControl, r);
|
||||
}
|
||||
|
||||
void GdbServerProvider::updateDevice(ProjectExplorer::IDevice *dev) const
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
bool aboutToRun(Debugger::DebuggerRunTool *runTool,
|
||||
QString &errorMessage) const final;
|
||||
void addTargetRunner(Debugger::DebuggerRunTool *runTool,
|
||||
ProjectExplorer::RunWorker *targetRunner(
|
||||
ProjectExplorer::RunControl *runControl) const final;
|
||||
void updateDevice(ProjectExplorer::IDevice *dev) const final;
|
||||
|
||||
|
@@ -45,12 +45,12 @@ class DebuggerRunTool;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class DeviceProcess;
|
||||
class IDevice;
|
||||
class RunControl;
|
||||
class DeviceProcess;
|
||||
class RunWorker;
|
||||
}
|
||||
|
||||
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
virtual bool aboutToRun(Debugger::DebuggerRunTool *runTool,
|
||||
QString &errorMessage) const = 0;
|
||||
virtual void addTargetRunner(Debugger::DebuggerRunTool *runTool,
|
||||
virtual ProjectExplorer::RunWorker *targetRunner(
|
||||
ProjectExplorer::RunControl *runControl) const = 0;
|
||||
virtual void updateDevice(ProjectExplorer::IDevice *dev) const = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user