diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index b8580587cdc..559382ce73d 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -280,9 +280,6 @@ public: public: DebuggerState state() const { return m_state; } bool isMasterEngine() const { return m_engine->isMasterEngine(); } - DebuggerRunTool *runTool() const - { return m_masterEngine ? m_masterEngine->runTool() : m_runTool.data(); } - RunControl *runControl() const; DebuggerEngine *m_engine = nullptr; // Not owned. DebuggerEngine *m_masterEngine = nullptr; // Not owned @@ -498,7 +495,7 @@ void DebuggerEngine::start() const DebuggerRunParameters &rp = runParameters(); d->m_inferiorPid = rp.attachPID.isValid() ? rp.attachPID : ProcessHandle(); if (d->m_inferiorPid.isValid()) - runControl()->setApplicationProcessHandle(d->m_inferiorPid); + d->m_runTool->runControl()->setApplicationProcessHandle(d->m_inferiorPid); action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability)); @@ -935,8 +932,8 @@ void DebuggerEnginePrivate::doShutdownEngine() { m_engine->setState(EngineShutdownRequested); QTC_ASSERT(isMasterEngine(), qDebug() << m_engine; return); - QTC_ASSERT(runTool(), return); - runTool()->startDying(); + QTC_ASSERT(m_runTool, return); + m_runTool->startDying(); m_engine->showMessage("CALL: SHUTDOWN ENGINE"); m_engine->shutdownEngine(); } @@ -957,12 +954,6 @@ void DebuggerEngine::notifyEngineShutdownFailed() d->doFinishDebugger(); } -RunControl *DebuggerEnginePrivate::runControl() const -{ - DebuggerRunTool *tool = runTool(); - return tool ? tool->runControl() : nullptr; -} - void DebuggerEngine::notifyEngineIll() { //#ifdef WITH_BENCHMARK @@ -1221,7 +1212,7 @@ void DebuggerEngine::notifyInferiorPid(const ProcessHandle &pid) return; d->m_inferiorPid = pid; if (pid.isValid()) { - runControl()->setApplicationProcessHandle(pid); + d->m_runTool->runControl()->setApplicationProcessHandle(pid); showMessage(tr("Taking notice of pid %1").arg(pid.pid())); DebuggerStartMode sm = runParameters().startMode; if (sm == StartInternal || sm == StartExternal || sm == AttachExternal) @@ -1297,8 +1288,8 @@ void DebuggerEngine::abortDebugger() // We already tried. Try harder. showMessage("ABORTING DEBUGGER. SECOND TIME."); abortDebuggerProcess(); - if (runControl()) - runControl()->initiateFinish(); + if (d->m_runTool && d->m_runTool->runControl()) + d->m_runTool->runControl()->initiateFinish(); } } @@ -1313,11 +1304,6 @@ void DebuggerEngine::progressPing() d->m_progress.setProgressValue(progress); } -RunControl *DebuggerEngine::runControl() const -{ - return d->runControl(); -} - DebuggerRunTool *DebuggerEngine::runTool() const { return d->m_runTool.data(); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index aa6d3e5e606..a4ff6f47d0a 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -458,7 +458,6 @@ protected: void setMasterEngine(DebuggerEngine *masterEngine); - ProjectExplorer::RunControl *runControl() const; TerminalRunner *terminal() const; static QString msgStopped(const QString &reason = QString()); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8e15bde5eec..926a730cd43 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3221,8 +3221,9 @@ void GdbEngine::handleMakeSnapshot(const DebuggerResponse &response, const QStri const StackFrame &frame = frames.at(0); function = frame.function + ":" + QString::number(frame.line); } - QTC_ASSERT(runControl()->runConfiguration(), return); - auto rc = new RunControl(runControl()->runConfiguration(), ProjectExplorer::Constants::DEBUG_RUN_MODE); + auto runConfig = runTool()->runControl()->runConfiguration(); + QTC_ASSERT(runConfig, return); + auto rc = new RunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(rc); debugger->setStartMode(AttachCore); debugger->setRunControlName(function + ": " + QDateTime::currentDateTime().toString()); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index b3a719a15e8..b5e8fde5b96 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -334,7 +334,7 @@ void QmlEngine::handleLauncherStarted() { // FIXME: The QmlEngine never calls notifyInferiorPid() triggering the // raising, so do it here manually for now. - runControl()->applicationProcessHandle().activate(); + runTool()->runControl()->applicationProcessHandle().activate(); tryToConnect(); }