Debugger: Remove DebuggerRunControl

Use plain RunControl + DebuggerRunTool combo instead.

Change-Id: Ib71b5eab50da667b9d71dcc6689d2643ad8ecdee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-04-27 09:53:07 +02:00
parent 6e2756244d
commit 6e990f96c6
27 changed files with 136 additions and 229 deletions

View File

@@ -155,18 +155,18 @@ RunControl *IosDebugSupport::createDebugRunControl(RunConfiguration *runConfig,
params.startMode = AttachToRemoteServer;
}
RunControl *runControl = createDebuggerRunControl(params, runConfig, errorMessage);
if (runControl)
new IosDebugSupport(runControl, cppDebug, qmlDebug);
Q_UNUSED(errorMessage); // FIXME
auto runControl = new RunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new IosDebugSupport(runControl, params, cppDebug, qmlDebug);
return runControl;
}
IosDebugSupport::IosDebugSupport(RunControl *runControl, bool cppDebug, bool qmlDebug)
: ToolRunner(runControl),
IosDebugSupport::IosDebugSupport(RunControl *runControl, const DebuggerStartParameters &sp, bool cppDebug, bool qmlDebug)
: Debugger::DebuggerRunTool(runControl, sp),
m_runner(new IosRunner(this, runControl, cppDebug,
qmlDebug ? QmlDebug::QmlDebuggerServices : QmlDebug::NoQmlDebugServices))
{
connect(this->runControl()->toolRunner(), &DebuggerRunTool::requestRemoteSetup,
connect(this, &Debugger::DebuggerRunTool::requestRemoteSetup,
m_runner, &IosRunner::start);
connect(runControl, &RunControl::finished,
m_runner, &IosRunner::stop);
@@ -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()->toolRunner()->notifyEngineRemoteSetupFinished(result);
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()->toolRunner()->notifyEngineRemoteSetupFinished(result);
notifyEngineRemoteSetupFinished(result);
}
void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
@@ -213,22 +213,17 @@ void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
appendMessage(tr("Run ended with error."), Utils::DebugFormat);
else
appendMessage(tr("Run ended."), Utils::DebugFormat);
runControl()->toolRunner()->abortDebugger();
abortDebugger();
}
void IosDebugSupport::handleRemoteOutput(const QString &output)
{
runControl()->toolRunner()->showMessage(output, AppOutput);
showMessage(output, AppOutput);
}
void IosDebugSupport::handleRemoteErrorOutput(const QString &output)
{
runControl()->toolRunner()->showMessage(output, AppError);
}
DebuggerRunControl *IosDebugSupport::runControl()
{
return qobject_cast<DebuggerRunControl *>(ToolRunner::runControl()) ;
showMessage(output, AppError);
}
} // namespace Internal

View File

@@ -27,10 +27,7 @@
#include "iosrunconfiguration.h"
#include <projectexplorer/runconfiguration.h>
namespace Debugger { class DebuggerRunControl; }
namespace ProjectExplorer { class RunControl; }
#include <debugger/debuggerruncontrol.h>
namespace Ios {
namespace Internal {
@@ -38,7 +35,7 @@ namespace Internal {
class IosRunConfiguration;
class IosRunner;
class IosDebugSupport : public ProjectExplorer::ToolRunner
class IosDebugSupport : public Debugger::DebuggerRunTool
{
Q_OBJECT
@@ -46,7 +43,9 @@ public:
static ProjectExplorer::RunControl *createDebugRunControl(ProjectExplorer::RunConfiguration *runConfig,
QString *errorMessage);
IosDebugSupport(ProjectExplorer::RunControl *runControl, bool cppDebug, bool qmlDebug);
IosDebugSupport(ProjectExplorer::RunControl *runControl,
const Debugger::DebuggerStartParameters &sp,
bool cppDebug, bool qmlDebug);
private:
void handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort);
@@ -56,8 +55,6 @@ private:
void handleRemoteOutput(const QString &output);
void handleRemoteErrorOutput(const QString &output);
Debugger::DebuggerRunControl *runControl();
IosRunner * const m_runner;
const QString m_dumperLib;
};