From 45666dc93254ef2b003812dd2953f0e0ac91d9bc Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 22 Oct 2018 14:48:11 +0200 Subject: [PATCH] Debugger: Do not interrupt twice Fixes unwanted interrupt after setting a breakpoint to a running inferior. Change-Id: I8d24fd4beff53fa74f92d2134866d418745fa747 Reviewed-by: Christian Stenger --- src/plugins/debugger/cdb/cdbengine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index ee2f15e3610..96206aa7217 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -832,6 +832,7 @@ void CdbEngine::handleDoInterruptInferior(const QString &errorMessage) void CdbEngine::doInterruptInferior(const InterruptCallback &callback) { + const bool requestInterrupt = m_stopMode == NoStopRequested; if (callback) { m_interrupCallbacks.push_back(callback); if (!m_initialSessionIdleHandled) @@ -842,6 +843,8 @@ void CdbEngine::doInterruptInferior(const InterruptCallback &callback) m_stopMode = Interrupt; } + if (!requestInterrupt) + return; // we already requested a stop no need to interrupt twice showMessage(QString("Interrupting process %1...").arg(inferiorPid()), LogMisc); QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return); QTC_ASSERT(device(), notifyInferiorRunFailed(); return);