Debugger: Let the DebuggerRunTool optionally handle the PortsGatherer

Less code in the target implementations.

Change-Id: I759f082eba5eab7f4e8252c0d7b5ec64059ba860
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-10-19 14:23:43 +02:00
parent c99b8c2fd1
commit f521b2428d
3 changed files with 41 additions and 23 deletions

View File

@@ -1988,15 +1988,12 @@ public:
{
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
setDisplayName("AttachToRunningProcess");
setUsePortsGatherer(true, false);
portsGatherer()->setDevice(device);
portsGatherer = new GdbServerPortsGatherer(runControl);
portsGatherer->setUseGdbServer(true);
portsGatherer->setUseQmlServer(false);
portsGatherer->setDevice(device);
auto gdbServer = new GdbServerRunner(runControl, portsGatherer);
auto gdbServer = new GdbServerRunner(runControl, portsGatherer());
gdbServer->setUseMulti(false);
gdbServer->addStartDependency(portsGatherer);
gdbServer->addStartDependency(portsGatherer());
gdbServer->setDevice(device);
gdbServer->setAttachPid(ProcessHandle(pid));
@@ -2009,14 +2006,6 @@ public:
setUseContinueInsteadOfRun(true);
setContinueAfterAttach(false);
}
void start() final
{
setRemoteChannel(portsGatherer->gdbServerChannel());
DebuggerRunTool::start();
}
GdbServerPortsGatherer *portsGatherer;
};
void DebuggerPluginPrivate::attachToRunningApplication()