aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-04-21 17:20:57 +0200
committerhjk <hjk@qt.io>2017-04-24 14:48:35 +0000
commit07884645af8fb449d6b1343d33b734925588768a (patch)
tree59d84632e36a60492ec719da9980c61602286f37 /src/plugins
parente720e72a258122d2db15ec3b1b75699fe133184b (diff)
Debugger et al: Move code from DebuggerRunControl to DebuggerRunTool
It's tool specific, so put it into the tool (only) related code. The additional level of indirection will go again, plus the original one will be removed once the *DebugSupport classes can directly use DebuggerRunTool as base. Change-Id: Ieaa386a0f7d724b09cedaaba8fb7d1e6dc4ad55b Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/android/androiddebugsupport.cpp8
-rw-r--r--src/plugins/baremetal/baremetaldebugsupport.cpp12
-rw-r--r--src/plugins/debugger/debuggerengine.cpp52
-rw-r--r--src/plugins/debugger/debuggerengine.h3
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp85
-rw-r--r--src/plugins/debugger/debuggerruncontrol.h32
-rw-r--r--src/plugins/ios/iosdebugsupport.cpp10
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h23
-rw-r--r--src/plugins/qnx/qnxattachdebugsupport.cpp6
-rw-r--r--src/plugins/qnx/qnxdebugsupport.cpp23
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp14
-rw-r--r--src/plugins/winrt/winrtrunnerhelper.cpp2
-rw-r--r--src/plugins/winrt/winrtrunnerhelper.h8
13 files changed, 142 insertions, 136 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp
index aaffde81d48..b31a1269f87 100644
--- a/src/plugins/android/androiddebugsupport.cpp
+++ b/src/plugins/android/androiddebugsupport.cpp
@@ -159,7 +159,7 @@ AndroidDebugSupport::AndroidDebugSupport(RunControl *runControl)
connect(m_runner, &AndroidRunner::remoteServerRunning,
[this](const QByteArray &serverChannel, int pid) {
- this->runControl()->notifyEngineRemoteServerRunning(serverChannel, pid);
+ this->runControl()->toolRunner()->notifyEngineRemoteServerRunning(serverChannel, pid);
});
connect(m_runner, &AndroidRunner::remoteProcessStarted,
@@ -173,12 +173,12 @@ AndroidDebugSupport::AndroidDebugSupport(RunControl *runControl)
connect(m_runner, &AndroidRunner::remoteErrorOutput,
[this](const QString &output) {
- this->runControl()->showMessage(output, AppError);
+ this->runControl()->toolRunner()->showMessage(output, AppError);
});
connect(m_runner, &AndroidRunner::remoteOutput,
[this](const QString &output) {
- this->runControl()->showMessage(output, AppOutput);
+ this->runControl()->toolRunner()->showMessage(output, AppOutput);
});
QTC_ASSERT(runControl, return);
@@ -200,7 +200,7 @@ void AndroidDebugSupport::handleRemoteProcessStarted(Utils::Port gdbServerPort,
result.success = true;
result.gdbServerPort = gdbServerPort;
result.qmlServerPort = qmlPort;
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
DebuggerRunControl *AndroidDebugSupport::runControl()
diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp
index 4a8a3ee2269..7bc83fcf85d 100644
--- a/src/plugins/baremetal/baremetaldebugsupport.cpp
+++ b/src/plugins/baremetal/baremetaldebugsupport.cpp
@@ -96,12 +96,12 @@ void BareMetalDebugSupport::appRunnerFinished(bool success)
if (m_state == Running) {
if (!success)
- runControl()->notifyInferiorIll();
+ runControl()->toolRunner()->notifyInferiorIll();
} else if (m_state == StartingRunner) {
Debugger::RemoteSetupResult result;
result.success = false;
result.reason = tr("Debugging failed.");
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
reset();
@@ -116,7 +116,7 @@ void BareMetalDebugSupport::appRunnerError(const QString &error)
{
if (m_state == Running) {
showMessage(error, Debugger::AppError);
- runControl()->notifyInferiorIll();
+ runControl()->toolRunner()->notifyInferiorIll();
} else if (m_state != Inactive) {
adapterSetupFailed(error);
}
@@ -127,7 +127,7 @@ void BareMetalDebugSupport::adapterSetupDone()
m_state = Running;
Debugger::RemoteSetupResult result;
result.success = true;
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void BareMetalDebugSupport::adapterSetupFailed(const QString &error)
@@ -137,7 +137,7 @@ void BareMetalDebugSupport::adapterSetupFailed(const QString &error)
Debugger::RemoteSetupResult result;
result.success = false;
result.reason = tr("Initial setup failed: %1").arg(error);
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void BareMetalDebugSupport::startExecution()
@@ -191,7 +191,7 @@ void BareMetalDebugSupport::reset()
void BareMetalDebugSupport::showMessage(const QString &msg, int channel)
{
if (m_state != Inactive)
- runControl()->showMessage(msg, channel);
+ runControl()->toolRunner()->showMessage(msg, channel);
}
Debugger::DebuggerRunControl *BareMetalDebugSupport::runControl()
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 0c4be6d5180..d6adad2b226 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -341,13 +341,14 @@ public:
DebuggerState state() const { return m_state; }
RemoteSetupState remoteSetupState() const { return m_remoteSetupState; }
bool isMasterEngine() const { return m_engine->isMasterEngine(); }
- DebuggerRunControl *runControl() const
- { return m_masterEngine ? m_masterEngine->runControl() : m_runControl; }
+ DebuggerRunTool *runTool() const
+ { return m_masterEngine ? m_masterEngine->runTool() : m_runTool.data(); }
+ DebuggerRunControl *runControl() const { return runTool()->runControl(); }
void setRemoteSetupState(RemoteSetupState state);
DebuggerEngine *m_engine = nullptr; // Not owned.
DebuggerEngine *m_masterEngine = nullptr; // Not owned
- DebuggerRunControl *m_runControl = nullptr; // Not owned.
+ QPointer<DebuggerRunTool> m_runTool; // Not owned.
DebuggerRunParameters m_runParameters;
@@ -554,10 +555,15 @@ void DebuggerEngine::setRegisterValue(const QString &name, const QString &value)
Q_UNUSED(value);
}
-void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
+void DebuggerEngine::setRunTool(DebuggerRunTool *runTool)
{
- QTC_ASSERT(runControl, notifyEngineSetupFailed(); return);
- QTC_ASSERT(!d->m_runControl, notifyEngineSetupFailed(); return);
+ QTC_ASSERT(!d->m_runTool, notifyEngineSetupFailed(); return);
+ d->m_runTool = runTool;
+}
+
+void DebuggerEngine::startDebugger()
+{
+ QTC_ASSERT(d->m_runTool, notifyEngineSetupFailed(); return);
d->m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(),
@@ -566,12 +572,10 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
d->m_progress.reportStarted();
- d->m_runControl = runControl;
-
d->m_inferiorPid = d->m_runParameters.attachPID.isValid()
? d->m_runParameters.attachPID : ProcessHandle();
if (d->m_inferiorPid.isValid())
- d->m_runControl->setApplicationProcessHandle(d->m_inferiorPid);
+ runControl()->setApplicationProcessHandle(d->m_inferiorPid);
if (isNativeMixedActive())
d->m_runParameters.inferior.environment.set("QV4_FORCE_INTERPRETER", "1");
@@ -586,14 +590,14 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_terminal.setup();
if (d->m_terminal.isUsable()) {
- connect(&d->m_terminal, &Terminal::stdOutReady, [this, runControl](const QString &msg) {
- runControl->appendMessage(msg, Utils::StdOutFormatSameLine);
+ connect(&d->m_terminal, &Terminal::stdOutReady, [this](const QString &msg) {
+ d->m_runTool->appendMessage(msg, Utils::StdOutFormatSameLine);
});
- connect(&d->m_terminal, &Terminal::stdErrReady, [this, runControl](const QString &msg) {
- runControl->appendMessage(msg, Utils::StdErrFormatSameLine);
+ connect(&d->m_terminal, &Terminal::stdErrReady, [this](const QString &msg) {
+ d->m_runTool->appendMessage(msg, Utils::StdErrFormatSameLine);
});
- connect(&d->m_terminal, &Terminal::error, [this, runControl](const QString &msg) {
- runControl->appendMessage(msg, Utils::ErrorMessageFormat);
+ connect(&d->m_terminal, &Terminal::error, [this](const QString &msg) {
+ d->m_runTool->appendMessage(msg, Utils::ErrorMessageFormat);
});
}
@@ -642,7 +646,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
void DebuggerEngine::handleStartFailed()
{
showMessage("HANDLE RUNCONTROL START FAILED");
- d->m_runControl = 0;
+ d->m_runTool.clear();
d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled();
d->m_progress.reportFinished();
@@ -652,7 +656,7 @@ void DebuggerEngine::handleStartFailed()
void DebuggerEngine::handleFinished()
{
showMessage("HANDLE RUNCONTROL FINISHED");
- d->m_runControl = 0;
+ d->m_runTool.clear();
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
modulesHandler()->removeAll();
@@ -784,8 +788,8 @@ void DebuggerEngine::notifyEngineSetupFailed()
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
setState(EngineSetupFailed);
- if (isMasterEngine() && runControl())
- runControl()->startFailed();
+ if (isMasterEngine() && runTool())
+ runTool()->startFailed();
setState(DebuggerFinished);
}
@@ -1122,8 +1126,8 @@ void DebuggerEnginePrivate::doFinishDebugger()
{
m_engine->showMessage("NOTE: FINISH DEBUGGER");
QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state());
- if (isMasterEngine() && m_runControl)
- m_runControl->debuggingFinished();
+ if (isMasterEngine() && m_runTool)
+ m_runTool->debuggingFinished();
}
void DebuggerEnginePrivate::setRemoteSetupState(RemoteSetupState state)
@@ -1521,9 +1525,9 @@ DebuggerRunControl *DebuggerEngine::runControl() const
DebuggerRunTool *DebuggerEngine::runTool() const
{
- if (DebuggerRunControl *rc = d->runControl())
- return qobject_cast<DebuggerRunTool *>(rc->toolRunner());
- return nullptr;
+// if (DebuggerRunControl *rc = d->runControl())
+// return qobject_cast<DebuggerRunTool *>(rc->toolRunner());
+ return d->m_runTool;
}
Terminal *DebuggerEngine::terminal() const
diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h
index 73c9d99cf96..18fb4501d7d 100644
--- a/src/plugins/debugger/debuggerengine.h
+++ b/src/plugins/debugger/debuggerengine.h
@@ -200,7 +200,9 @@ public:
const DebuggerRunParameters &runParameters() const;
DebuggerRunParameters &runParameters();
+ void setRunTool(DebuggerRunTool *runTool);
DebuggerRunTool *runTool() const;
+ void startDebugger();
enum {
// Remove need to qualify each use.
@@ -224,7 +226,6 @@ public:
void updateWatchData(const QString &iname); // FIXME: Merge with above.
virtual void selectWatchData(const QString &iname);
- virtual void startDebugger(DebuggerRunControl *runControl);
virtual void prepareForRestart() {}
virtual void watchPoint(const QPoint &pnt);
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index b92e49c06bc..d511dc9e85c 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -81,8 +81,6 @@ DebuggerEngine *createQmlEngine(const DebuggerRunParameters &rp);
DebuggerEngine *createQmlCppEngine(const DebuggerRunParameters &rp, QStringList *error);
DebuggerEngine *createLldbEngine(const DebuggerRunParameters &rp);
-static DebuggerEngine *engine(const DebuggerRunControl *runControl);
-
} // namespace Internal
@@ -135,12 +133,17 @@ DebuggerRunControl::~DebuggerRunControl()
void DebuggerRunControl::start()
{
+ toolRunner()->startIt();
+}
+
+void DebuggerRunTool::startIt()
+{
Debugger::Internal::saveModeToRestore();
Debugger::selectPerspective(Debugger::Constants::CppPerspectiveId);
TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO);
TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_RUNTIME);
- DebuggerEngine *engine = Internal::engine(this);
+ DebuggerEngine *engine = m_engine;
QTC_ASSERT(engine, return);
const DebuggerRunParameters &rp = engine->runParameters();
// User canceled input dialog asking for executable when working on library project.
@@ -148,8 +151,8 @@ void DebuggerRunControl::start()
&& rp.inferior.executable.isEmpty()
&& rp.interpreter.isEmpty()) {
appendMessage(tr("No executable specified.") + QLatin1Char('\n'), ErrorMessageFormat);
- reportApplicationStart();
- reportApplicationStop();
+ runControl()->reportApplicationStart();
+ runControl()->reportApplicationStop();
return;
}
@@ -182,75 +185,74 @@ void DebuggerRunControl::start()
// We might get a synchronous startFailed() notification on Windows,
// when launching the process fails. Emit a proper finished() sequence.
- reportApplicationStart();
+ runControl()->reportApplicationStart();
- engine->startDebugger(this);
+ engine->startDebugger();
- if (isRunning())
+ if (runControl()->isRunning())
appendMessage(tr("Debugging starts") + QLatin1Char('\n'), NormalMessageFormat);
}
-void DebuggerRunControl::startFailed()
+void DebuggerRunTool::startFailed()
{
appendMessage(tr("Debugging has failed") + QLatin1Char('\n'), NormalMessageFormat);
- engine(this)->handleStartFailed();
+ m_engine->handleStartFailed();
}
-void DebuggerRunControl::notifyEngineRemoteServerRunning(const QByteArray &msg, int pid)
+void DebuggerRunTool::notifyEngineRemoteServerRunning(const QByteArray &msg, int pid)
{
- engine(this)->notifyEngineRemoteServerRunning(QString::fromUtf8(msg), pid);
+ m_engine->notifyEngineRemoteServerRunning(QString::fromUtf8(msg), pid);
}
-void DebuggerRunControl::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
+void DebuggerRunTool::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{
- engine(this)->notifyEngineRemoteSetupFinished(result);
+ m_engine->notifyEngineRemoteSetupFinished(result);
}
void DebuggerRunControl::stop()
{
- QTC_ASSERT(engine(this), return);
- engine(this)->quitDebugger();
+ m_debuggerTool->stopIt();
+}
+
+void DebuggerRunTool::stopIt()
+{
+ m_engine->quitDebugger();
}
-void DebuggerRunControl::debuggingFinished()
+DebuggerRunTool *DebuggerRunControl::toolRunner() const
{
- reportApplicationStop();
+// return qobject_cast<DebuggerRunTool *>(RunControl::toolRunner());
+ return m_debuggerTool;
}
-void DebuggerRunControl::showMessage(const QString &msg, int channel)
+void DebuggerRunTool::debuggingFinished()
{
- QTC_ASSERT(engine(this), return);
- QTC_ASSERT(engine(this)->runTool(), return);
- engine(this)->runTool()->showMessage(msg, channel);
+ runControl()->reportApplicationStop();
}
-DebuggerStartParameters &DebuggerRunControl::startParameters()
+DebuggerStartParameters &DebuggerRunTool::startParameters()
{
- return engine(this)->runParameters();
+ return m_engine->runParameters();
}
-void DebuggerRunControl::notifyInferiorIll()
+void DebuggerRunTool::notifyInferiorIll()
{
- QTC_ASSERT(engine(this), return);
- engine(this)->notifyInferiorIll();
+ m_engine->notifyInferiorIll();
}
-void DebuggerRunControl::notifyInferiorExited()
+void DebuggerRunTool::notifyInferiorExited()
{
- QTC_ASSERT(engine(this), return);
- engine(this)->notifyInferiorExited();
+ m_engine->notifyInferiorExited();
}
-void DebuggerRunControl::quitDebugger()
+void DebuggerRunTool::quitDebugger()
{
- QTC_ASSERT(engine(this), return);
- engine(this)->quitDebugger();
+ m_engine->quitDebugger();
}
-void DebuggerRunControl::abortDebugger()
+void DebuggerRunTool::abortDebugger()
{
- QTC_ASSERT(engine(this), return);
- engine(this)->abortDebugger();
+ m_engine->abortDebugger();
}
///////////////////////////////////////////////////////////////////////
@@ -517,6 +519,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, const DebuggerStartPara
DebuggerRunTool::DebuggerRunTool(RunControl *runControl, const DebuggerRunParameters &rp, QString *errorMessage)
: ToolRunner(runControl)
{
+ this->runControl()->m_debuggerTool = this; // FIXME: Remove.
DebuggerRunParameters m_rp = rp;
runControl->setDisplayName(m_rp.displayName);
@@ -533,7 +536,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, const DebuggerRunParame
}
}
- qobject_cast<DebuggerRunControl *>(runControl)->m_engine = m_engine;
+ m_engine->setRunTool(this);
connect(runControl, &RunControl::finished,
this, &DebuggerRunTool::handleFinished);
@@ -592,14 +595,6 @@ void DebuggerRunTool::showMessage(const QString &msg, int channel, int timeout)
namespace Internal {
-DebuggerEngine *engine(const DebuggerRunControl *runControl)
-{
- QTC_ASSERT(runControl, return nullptr);
- //return qobject_cast<DebuggerRunTool *>(runControl->toolRunner())->engine();
- return runControl->m_engine;
-}
-
-
/// DebuggerRunControlFactory
class DebuggerRunControlFactory : public IRunControlFactory
diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h
index ba3e0a42cee..6b15c0624e8 100644
--- a/src/plugins/debugger/debuggerruncontrol.h
+++ b/src/plugins/debugger/debuggerruncontrol.h
@@ -58,10 +58,24 @@ public:
Internal::DebuggerEngine *engine() const { return m_engine; }
DebuggerRunControl *runControl() const;
- void showMessage(const QString &msg, int channel, int timeout = -1);
+ void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1);
+
+ void startIt();
+ void stopIt();
void handleFinished();
+ void startFailed();
+ void notifyEngineRemoteServerRunning(const QByteArray &msg, int pid);
+ void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
+ void notifyInferiorIll();
+ Q_SLOT void notifyInferiorExited();
+ void quitDebugger();
+ void abortDebugger();
+ void debuggingFinished();
+
+ DebuggerStartParameters &startParameters(); // Used in Boot2Qt.
+
private:
Internal::DebuggerEngine *m_engine = nullptr; // Master engine
QStringList m_errors;
@@ -75,22 +89,10 @@ public:
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig, Core::Id runMode);
~DebuggerRunControl() override;
- // ProjectExplorer::RunControl
void start() override;
void stop() override; // Called from SnapshotWindow.
- void startFailed();
- void notifyEngineRemoteServerRunning(const QByteArray &msg, int pid);
- void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
- void notifyInferiorIll();
- Q_SLOT void notifyInferiorExited();
- void quitDebugger();
- void abortDebugger();
- void debuggingFinished();
-
- void showMessage(const QString &msg, int channel = LogDebug);
-
- DebuggerStartParameters &startParameters(); // Used in Boot2Qt.
+ DebuggerRunTool *toolRunner() const;
signals:
void requestRemoteSetup();
@@ -98,7 +100,7 @@ signals:
void stateChanged(Debugger::DebuggerState state);
public:
- Internal::DebuggerEngine *m_engine = nullptr; // FIXME: Remove.
+ DebuggerRunTool *m_debuggerTool = nullptr;
};
} // namespace Debugger
diff --git a/src/plugins/ios/iosdebugsupport.cpp b/src/plugins/ios/iosdebugsupport.cpp
index 5e41e2459d7..03ff6467b0d 100644
--- a/src/plugins/ios/iosdebugsupport.cpp
+++ b/src/plugins/ios/iosdebugsupport.cpp
@@ -193,7 +193,7 @@ void IosDebugSupport::handleServerPorts(Utils::Port gdbServerPort, Utils::Port q
|| (m_runner && !m_runner->cppDebug() && qmlPort.isValid());
if (!result.success)
result.reason = tr("Could not get debug server file descriptor.");
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void IosDebugSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort)
@@ -204,7 +204,7 @@ void IosDebugSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort)
result.success = pid > 0;
if (!result.success)
result.reason = tr("Got an invalid process id.");
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
@@ -213,17 +213,17 @@ void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
appendMessage(tr("Run ended with error."), Utils::DebugFormat);
else
appendMessage(tr("Run ended."), Utils::DebugFormat);
- runControl()->abortDebugger();
+ runControl()->toolRunner()->abortDebugger();
}
void IosDebugSupport::handleRemoteOutput(const QString &output)
{
- runControl()->showMessage(output, AppOutput);
+ runControl()->toolRunner()->showMessage(output, AppOutput);
}
void IosDebugSupport::handleRemoteErrorOutput(const QString &output)
{
- runControl()->showMessage(output, AppError);
+ runControl()->toolRunner()->showMessage(output, AppError);
}
DebuggerRunControl *IosDebugSupport::runControl()
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index a466f4d42f6..3bff6b64042 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -415,6 +415,17 @@ public:
virtual void notifyRemoteSetupFailed(const QString &) {} // Same.
virtual void notifyRemoteFinished() {} // Same.
+ void reportApplicationStart(); // Call this when the application starts to run
+ void reportApplicationStop(); // Call this when the application has stopped for any reason
+
+ bool showPromptToStopDialog(const QString &title, const QString &text,
+ const QString &stopButtonText = QString(),
+ const QString &cancelButtonText = QString(),
+ bool *prompt = nullptr) const;
+
+ virtual void start();
+ virtual void stop();
+
signals:
void appendMessageRequested(ProjectExplorer::RunControl *runControl,
const QString &msg, Utils::OutputFormat format);
@@ -424,18 +435,6 @@ signals:
void finished(); // Use reportApplicationStop!
void applicationProcessHandleChanged(QPrivateSignal); // Use setApplicationProcessHandle
-protected:
- virtual void start();
- virtual void stop();
-
- void reportApplicationStart(); // Call this when the application starts to run
- void reportApplicationStop(); // Call this when the application has stopped for any reason
-
- bool showPromptToStopDialog(const QString &title, const QString &text,
- const QString &stopButtonText = QString(),
- const QString &cancelButtonText = QString(),
- bool *prompt = nullptr) const;
-
private:
friend class Internal::RunControlPrivate;
friend class TargetRunner;
diff --git a/src/plugins/qnx/qnxattachdebugsupport.cpp b/src/plugins/qnx/qnxattachdebugsupport.cpp
index 1e69983c631..d4f304aca4e 100644
--- a/src/plugins/qnx/qnxattachdebugsupport.cpp
+++ b/src/plugins/qnx/qnxattachdebugsupport.cpp
@@ -159,19 +159,19 @@ void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState s
void QnxAttachDebugSupport::handleError(const QString &message)
{
if (m_runControl)
- m_runControl->showMessage(message, Debugger::AppError);
+ m_runControl->toolRunner()->showMessage(message, Debugger::AppError);
}
void QnxAttachDebugSupport::handleProgressReport(const QString &message)
{
if (m_runControl)
- m_runControl->showMessage(message + QLatin1Char('\n'), Debugger::AppStuff);
+ m_runControl->toolRunner()->showMessage(message + QLatin1Char('\n'), Debugger::AppStuff);
}
void QnxAttachDebugSupport::handleRemoteOutput(const QByteArray &output)
{
if (m_runControl)
- m_runControl->showMessage(QString::fromUtf8(output), Debugger::AppOutput);
+ m_runControl->toolRunner()->showMessage(QString::fromUtf8(output), Debugger::AppOutput);
}
void QnxAttachDebugSupport::stopPDebug()
diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp
index 4243adfb5d4..0978a072d9c 100644
--- a/src/plugins/qnx/qnxdebugsupport.cpp
+++ b/src/plugins/qnx/qnxdebugsupport.cpp
@@ -82,7 +82,7 @@ void QnxDebugSupport::handleAdapterSetupRequested()
{
QTC_ASSERT(state() == Inactive, return);
- runControl()->showMessage(tr("Preparing remote side...") + QLatin1Char('\n'), Debugger::AppStuff);
+ runControl()->toolRunner()->showMessage(tr("Preparing remote side...") + '\n', Debugger::AppStuff);
QnxAbstractRunSupport::handleAdapterSetupRequested();
}
@@ -124,7 +124,7 @@ void QnxDebugSupport::handleRemoteProcessStarted()
result.success = true;
result.gdbServerPort = m_pdebugPort;
result.qmlServerPort = m_qmlPort;
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void QnxDebugSupport::handleRemoteProcessFinished(bool success)
@@ -134,13 +134,13 @@ void QnxDebugSupport::handleRemoteProcessFinished(bool success)
if (state() == Running) {
if (!success)
- runControl()->notifyInferiorIll();
+ runControl()->toolRunner()->notifyInferiorIll();
} else {
Debugger::RemoteSetupResult result;
result.success = false;
result.reason = tr("The %1 process closed unexpectedly.").arg(processExecutable());
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
}
@@ -166,38 +166,39 @@ void QnxDebugSupport::killInferiorProcess()
void QnxDebugSupport::handleProgressReport(const QString &progressOutput)
{
- runControl()->showMessage(progressOutput + QLatin1Char('\n'), Debugger::AppStuff);
+ runControl()->toolRunner()->showMessage(progressOutput + QLatin1Char('\n'), Debugger::AppStuff);
}
void QnxDebugSupport::handleRemoteOutput(const QByteArray &output)
{
QTC_ASSERT(state() == Inactive || state() == Running, return);
- runControl()->showMessage(QString::fromUtf8(output), Debugger::AppOutput);
+ runControl()->toolRunner()->showMessage(QString::fromUtf8(output), Debugger::AppOutput);
}
void QnxDebugSupport::handleError(const QString &error)
{
if (state() == Running) {
- runControl()->showMessage(error, Debugger::AppError);
- runControl()->notifyInferiorIll();
+ runControl()->toolRunner()->showMessage(error, Debugger::AppError);
+ runControl()->toolRunner()->notifyInferiorIll();
} else if (state() != Inactive) {
setFinished();
Debugger::RemoteSetupResult result;
result.success = false;
result.reason = tr("Initial setup failed: %1").arg(error);
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
}
void QnxDebugSupport::printMissingWarning()
{
- runControl()->showMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available."), Debugger::AppError);
+ runControl()->toolRunner()->showMessage(tr("Warning: \"slog2info\" is not found "
+ "on the device, debug output not available."), Debugger::AppError);
}
void QnxDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat)
{
Q_UNUSED(outputFormat);
- runControl()->showMessage(msg, Debugger::AppOutput);
+ runControl()->toolRunner()->showMessage(msg, Debugger::AppOutput);
}
Debugger::DebuggerRunControl *QnxDebugSupport::runControl()
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 5e2443a23e1..b5b8924cc22 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -101,7 +101,7 @@ bool LinuxDeviceDebugSupport::isQmlDebugging() const
void LinuxDeviceDebugSupport::showMessage(const QString &msg, int channel)
{
if (state() != Inactive)
- runControl()->showMessage(msg, channel);
+ runControl()->toolRunner()->showMessage(msg, channel);
}
DebuggerRunControl *LinuxDeviceDebugSupport::runControl() const
@@ -185,7 +185,7 @@ void LinuxDeviceDebugSupport::handleAppRunnerError(const QString &error)
{
if (state() == Running) {
showMessage(error, AppError);
- runControl()->notifyInferiorIll();
+ runControl()->toolRunner()->notifyInferiorIll();
} else if (state() != Inactive) {
handleAdapterSetupFailed(error);
}
@@ -199,15 +199,15 @@ void LinuxDeviceDebugSupport::handleAppRunnerFinished(bool success)
if (state() == Running) {
// The QML engine does not realize on its own that the application has finished.
if (d->qmlDebugging && !d->cppDebugging)
- runControl()->quitDebugger();
+ runControl()->toolRunner()->quitDebugger();
else if (!success)
- runControl()->notifyInferiorIll();
+ runControl()->toolRunner()->notifyInferiorIll();
} else if (state() == StartingRunner) {
RemoteSetupResult result;
result.success = false;
result.reason = tr("Debugging failed.");
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
reset();
}
@@ -251,7 +251,7 @@ void LinuxDeviceDebugSupport::handleAdapterSetupFailed(const QString &error)
RemoteSetupResult result;
result.success = false;
result.reason = tr("Initial setup failed: %1").arg(error);
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void LinuxDeviceDebugSupport::handleAdapterSetupDone()
@@ -262,7 +262,7 @@ void LinuxDeviceDebugSupport::handleAdapterSetupDone()
result.success = true;
result.gdbServerPort = d->gdbServerPort;
result.qmlServerPort = d->qmlPort;
- runControl()->notifyEngineRemoteSetupFinished(result);
+ runControl()->toolRunner()->notifyEngineRemoteSetupFinished(result);
}
void LinuxDeviceDebugSupport::handleRemoteProcessStarted()
diff --git a/src/plugins/winrt/winrtrunnerhelper.cpp b/src/plugins/winrt/winrtrunnerhelper.cpp
index 05256fe93c8..7f3d3c70b3b 100644
--- a/src/plugins/winrt/winrtrunnerhelper.cpp
+++ b/src/plugins/winrt/winrtrunnerhelper.cpp
@@ -148,7 +148,7 @@ bool WinRtRunnerHelper::waitForStarted(int msecs)
void WinRtRunnerHelper::setDebugRunControl(Debugger::DebuggerRunControl *runControl)
{
- m_debugMessenger = runControl;
+ m_debugMessenger = runControl->toolRunner();
m_messenger = runControl;
}
diff --git a/src/plugins/winrt/winrtrunnerhelper.h b/src/plugins/winrt/winrtrunnerhelper.h
index 743b5dc8c0e..19563669c5c 100644
--- a/src/plugins/winrt/winrtrunnerhelper.h
+++ b/src/plugins/winrt/winrtrunnerhelper.h
@@ -36,7 +36,11 @@
namespace Utils { class QtcProcess; }
namespace ProjectExplorer { class RunControl; }
-namespace Debugger { class DebuggerRunControl; }
+
+namespace Debugger {
+class DebuggerRunControl;
+class DebuggerRunTool;
+}
namespace WinRt {
namespace Internal {
@@ -76,7 +80,7 @@ private:
void appendMessage(const QString &message, Utils::OutputFormat format);
ProjectExplorer::RunControl *m_messenger;
- Debugger::DebuggerRunControl *m_debugMessenger;
+ Debugger::DebuggerRunTool *m_debugMessenger;
WinRtRunConfiguration *m_runConfiguration;
WinRtDevice::ConstPtr m_device;
Utils::Environment m_environment;