diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 60692a75a11..8474f6665c1 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -805,32 +805,9 @@ void CdbEngine::interruptInferior() if (debug) qDebug() << "CdbEngine::interruptInferior()" << stateName(state()); - if (!canInterruptInferior()) { - // Restore running state if inferior can't be stoped. - showMessage(tr("Interrupting is not possible in remote sessions."), LogError); - STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorStopOk") - notifyInferiorStopOk(); - STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunRequested") - notifyInferiorRunRequested(); - STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunOk") - notifyInferiorRunOk(); - return; - } doInterruptInferior(); } -void CdbEngine::handleDoInterruptInferior(const QString &errorMessage) -{ - if (errorMessage.isEmpty()) { - showMessage("Interrupted " + QString::number(inferiorPid())); - } else { - showMessage(errorMessage, LogError); - notifyInferiorStopFailed(); - } - m_signalOperation->disconnect(this); - m_signalOperation.clear(); -} - void CdbEngine::doInterruptInferior(const InterruptCallback &callback) { const bool requestInterrupt = m_stopMode == NoStopRequested; @@ -847,15 +824,7 @@ void CdbEngine::doInterruptInferior(const InterruptCallback &callback) 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); - m_signalOperation = device()->signalOperation(); - QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed(); return;); - connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished, - this, &CdbEngine::handleDoInterruptInferior); - - m_signalOperation->setDebuggerCommand(runParameters().debugger.command.executable()); - m_signalOperation->interruptProcess(inferiorPid()); + m_process.interrupt(); } void CdbEngine::executeRunToLine(const ContextData &data) diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 1209d0ad3a7..8dd3739dea0 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -113,8 +113,6 @@ private: void createFullBacktrace(); - void handleDoInterruptInferior(const QString &errorMessage); - typedef QPair SourcePathMapping; struct NormalizedSourceFileName // Struct for caching mapped/normalized source files. { @@ -207,7 +205,6 @@ private: //! Debugger accessible (expecting commands) bool m_accessible = false; StopMode m_stopMode = NoStopRequested; - ProjectExplorer::DeviceProcessSignalOperation::Ptr m_signalOperation; int m_nextCommandToken = 0; QHash m_commandForToken; QString m_currentBuiltinResponse;