Commit 87cd4495 authored by hjk's avatar hjk

Debugger: Pass interrupt request more directly to engines

De-virtualize requestInterruptInferior() and let always
the master engine react to the request. interruptInferior()
diverts to the active slave in case of the combined engine.

Change-Id: I5d62cf9379c8a452132827897a9ac51e4027f595
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent dfe23b21
......@@ -233,7 +233,6 @@ public:
void doRunEngine();
void doShutdownEngine();
void doShutdownInferior();
void doInterruptInferior();
void reloadDisassembly()
{
......@@ -856,16 +855,6 @@ void DebuggerEngine::notifyInferiorStopFailed()
d->doShutdownEngine();
}
void DebuggerEnginePrivate::doInterruptInferior()
{
//QTC_ASSERT(isMasterEngine(), return);
QTC_ASSERT(state() == InferiorRunOk, qDebug() << m_engine << state());
m_engine->setState(InferiorStopRequested);
m_engine->showMessage("CALL: INTERRUPT INFERIOR");
m_engine->showStatusMessage(tr("Attempting to interrupt."));
m_engine->interruptInferior();
}
void DebuggerEnginePrivate::doShutdownInferior()
{
m_engine->setState(InferiorShutdownRequested);
......@@ -1237,7 +1226,9 @@ void DebuggerEngine::quitDebugger()
d->doShutdownInferior();
break;
case InferiorRunOk:
d->doInterruptInferior();
setState(InferiorStopRequested);
showStatusMessage(tr("Attempting to interrupt."));
interruptInferior();
break;
case EngineSetupRequested:
notifyEngineSetupFailed();
......@@ -1283,7 +1274,12 @@ void DebuggerEngine::abortDebugger()
void DebuggerEngine::requestInterruptInferior()
{
d->doInterruptInferior();
QTC_CHECK(isMasterEngine());
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
setState(InferiorStopRequested);
showMessage("CALL: INTERRUPT INFERIOR");
showStatusMessage(tr("Attempting to interrupt."));
interruptInferior();
}
void DebuggerEngine::progressPing()
......
......@@ -442,7 +442,7 @@ protected:
virtual void continueInferior();
virtual void interruptInferior();
virtual void requestInterruptInferior();
void requestInterruptInferior();
virtual void executeRunToLine(const Internal::ContextData &data);
virtual void executeRunToFunction(const QString &functionName);
......
......@@ -3036,7 +3036,7 @@ DebuggerEngine *currentEngine()
{
DebuggerEngine *engine = nullptr;
if (dd->m_currentRunTool)
engine = dd->m_currentRunTool->activeEngine();
engine = dd->m_currentRunTool->engine();
return engine ? engine : dd->dummyEngine();
}
......
......@@ -337,13 +337,7 @@ void QmlCppEngine::continueInferior()
void QmlCppEngine::interruptInferior()
{
EDEBUG("\nMASTER INTERRUPT INFERIOR");
m_cppEngine->requestInterruptInferior();
}
void QmlCppEngine::requestInterruptInferior()
{
EDEBUG("\nMASTER REQUEST INTERRUPT INFERIOR");
DebuggerEngine::requestInterruptInferior();
m_activeEngine->interruptInferior();
}
void QmlCppEngine::executeRunToLine(const ContextData &data)
......
......@@ -98,7 +98,6 @@ protected:
void executeReturn() override;
void continueInferior() override;
void interruptInferior() override;
void requestInterruptInferior() override;
void executeRunToLine(const ContextData &data) override;
void executeRunToFunction(const QString &functionName) override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment