diff options
author | hjk <[email protected]> | 2018-05-09 14:37:02 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2018-05-11 07:56:33 +0000 |
commit | 3cfc715d7d33b724ad896c540af4a914d922e9bc (patch) | |
tree | e837018161278300c1928130ffecaaaca05897bc /src/plugins/debugger/debuggerplugin.cpp | |
parent | 2c5e8e8d64862966d90586a0c7120225d7831567 (diff) |
Debugger: Try harder to find a usable device
In remote setups without proper run configuration (e.g. attach
using the menu) there was no device available. In some situation
there's access to a kit, though, containing the right device.
Use it.
Task-number: QTCREATORBUG-20331
Change-Id: I54523f71fc10c9959901f36f3d62872d139279e5
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b58a226b095..851bebac8c0 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1188,7 +1188,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, if (!kit) kit = guessKitFromAbis(Abi::abisOfBinary(FileName::fromString(executable))); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, kit); debugger->setInferiorExecutable(executable); if (pid) { @@ -1960,7 +1961,8 @@ void DebuggerPluginPrivate::attachCore() setConfigValue("LastExternalStartScript", dlg.overrideStartScript()); setConfigValue("LastForceLocalCoreFile", dlg.forcesLocalCoreFile()); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(dlg.kit()); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, dlg.kit()); debugger->setInferiorExecutable(dlg.localExecutableFile()); debugger->setCoreFileName(dlg.localCoreFile()); @@ -1987,7 +1989,8 @@ void DebuggerPluginPrivate::startRemoteCdbSession() return; setConfigValue(connectionKey, dlg.connection()); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, kit); debugger->setStartMode(AttachToRemoteServer); debugger->setCloseMode(KillAtClose); @@ -2045,7 +2048,7 @@ void DebuggerPluginPrivate::attachToRunningApplication() if (device->type() == PE::DESKTOP_DEVICE_TYPE) { attachToRunningProcess(kit, process, false); } else { - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new RemoteAttachRunner(runControl, kit, process.pid); debugger->startRunControl(); } |