From 36ec37b29d22a5128d1ab088a73d6b5237ac56f5 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 19 May 2017 11:54:13 +0200 Subject: Debugger: Streamline ramping down There were only two used target states, and in case of mixed debugging all parts of the machinery better agree on the direction. So one bool in the (shared) runTool is sufficient. Change-Id: Iffbf1651b82dde707cfc37d8da9d3da573b34b76 Reviewed-by: Christian Stenger --- src/plugins/debugger/qml/qmlcppengine.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/plugins/debugger/qml/qmlcppengine.cpp') diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index 11d04e219b..a678a71ea3 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -68,7 +68,7 @@ QmlCppEngine::QmlCppEngine(DebuggerEngine *cppEngine, bool useTerminal) m_qmlEngine->setMasterEngine(this); m_cppEngine = cppEngine; m_cppEngine->setMasterEngine(this); - setActiveEngine(m_cppEngine); + m_activeEngine = m_cppEngine; } QmlCppEngine::~QmlCppEngine() @@ -271,11 +271,6 @@ void QmlCppEngine::assignValueInDebugger(WatchItem *item, void QmlCppEngine::notifyInferiorIll() { - //This will eventually shutdown the engine - //Set final state to avoid quitDebugger() being called - //after this call - setTargetState(DebuggerFinished); - //Call notifyInferiorIll of cpp engine //as qml engine will follow state transitions //of cpp engine @@ -378,7 +373,7 @@ void QmlCppEngine::executeDebuggerCommand(const QString &command, DebuggerLangua void QmlCppEngine::setupEngine() { EDEBUG("\nMASTER SETUP ENGINE"); - setActiveEngine(m_cppEngine); + m_activeEngine = m_cppEngine; m_qmlEngine->setupSlaveEngine(); m_cppEngine->setupSlaveEngine(); @@ -474,6 +469,7 @@ void QmlCppEngine::slaveEngineStateChanged DebuggerEngine *otherEngine = (slaveEngine == m_cppEngine) ? m_qmlEngine : m_cppEngine; + QTC_ASSERT(otherEngine, return); QTC_CHECK(otherEngine != slaveEngine); if (debug) { @@ -584,9 +580,11 @@ void QmlCppEngine::slaveEngineStateChanged if (state() == InferiorRunOk) { setState(InferiorStopRequested); } else if (state() == InferiorStopOk) { - notifyInferiorRunRequested(); - notifyInferiorRunOk(); - setState(InferiorStopRequested); + if (!isDying()) { + notifyInferiorRunRequested(); + notifyInferiorRunOk(); + setState(InferiorStopRequested); + } } else if (state() == InferiorRunRequested) { notifyInferiorRunOk(); setState(InferiorStopRequested); @@ -606,7 +604,7 @@ void QmlCppEngine::slaveEngineStateChanged || state() == InferiorStopOk, qDebug() << state()); // Just to make sure, we're shutting down anyway ... - setActiveEngine(m_cppEngine); + m_activeEngine = m_cppEngine; if (state() == InferiorStopRequested) setState(InferiorStopOk); -- cgit v1.2.1