aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2017-11-13 11:11:43 +0100
committerDavid Schulz <david.schulz@qt.io>2017-11-13 11:25:42 +0000
commitd2784c68053ecbaacfced84161cd7750cbbd9f0f (patch)
tree8c9cc1a61ebc125f658ba85755554b544036329a /src
parent078ced511d230bad06a3af6476225d576b4bb4aa (diff)
Debugger: Set inferior device when attaching to running application
The device is needed to properly interrupt the inferior with cdb. Change-Id: I96f3a7393770be9821d8edd7123c458399d4494a Task-nnumber: QTCREATORBUG-19253 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp5
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp1
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp5
-rw-r--r--src/plugins/debugger/debuggerruncontrol.h1
4 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 38d5a759f3..4949694ecc 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -881,7 +881,10 @@ void CdbEngine::doInterruptInferior(SpecialStopMode sm)
QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return;);
if (DebuggerRunTool *rt = runTool()) {
- if (IDevice::ConstPtr device = rt->device())
+ IDevice::ConstPtr device = rt->device();
+ if (!device)
+ device = runParameters().inferior.device;
+ if (device)
m_signalOperation = device->signalOperation();
}
m_specialStopMode = sm;
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 5b56c128a3..1aeb3f6813 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2088,6 +2088,7 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
debugger->setAttachPid(ProcessHandle(process.pid));
debugger->setRunControlName(tr("Process %1").arg(process.pid));
debugger->setInferiorExecutable(process.exe);
+ debugger->setInferiorDevice(device);
debugger->setStartMode(AttachExternal);
debugger->setCloseMode(DetachAtClose);
debugger->setContinueAfterAttach(contAfterAttach);
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 93f3473c09..2e65cc320e 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -436,6 +436,11 @@ void DebuggerRunTool::setInferiorEnvironment(const Utils::Environment &env)
m_runParameters.inferior.environment = env;
}
+void DebuggerRunTool::setInferiorDevice(IDevice::ConstPtr device)
+{
+ m_runParameters.inferior.device = device;
+}
+
void DebuggerRunTool::setRunControlName(const QString &name)
{
m_runParameters.displayName = name;
diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h
index 422756fb48..1795b9bf68 100644
--- a/src/plugins/debugger/debuggerruncontrol.h
+++ b/src/plugins/debugger/debuggerruncontrol.h
@@ -84,6 +84,7 @@ public:
void setInferior(const ProjectExplorer::Runnable &runnable);
void setInferiorExecutable(const QString &executable);
void setInferiorEnvironment(const Utils::Environment &env); // Used by GammaRay plugin
+ void setInferiorDevice(ProjectExplorer::IDevice::ConstPtr device); // Used by cdbengine
void setRunControlName(const QString &name);
void setStartMessage(const QString &msg);
void appendInferiorCommandLineArgument(const QString &arg);