maemo: access the debugger engine instead of the runcontrol

This commit is contained in:
hjk
2011-01-06 19:33:59 +01:00
parent 747451dcc5
commit b0a9d61d43
2 changed files with 19 additions and 18 deletions

View File

@@ -107,24 +107,25 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
params.startMode = AttachToRemote; params.startMode = AttachToRemote;
} }
DebuggerRunControl * const debuggerRunControl DebuggerRunControl * const runControl =
= DebuggerPlugin::createDebugger(params, runConfig); DebuggerPlugin::createDebugger(params, runConfig);
new MaemoDebugSupport(runConfig, debuggerRunControl); MaemoDebugSupport *debugSupport =
return debuggerRunControl; new MaemoDebugSupport(runConfig, runControl->engine());
connect(runControl, SIGNAL(finished()),
debugSupport, SLOT(handleDebuggingFinished()));
return runControl;
} }
MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig, MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
DebuggerRunControl *runControl) DebuggerEngine *engine)
: QObject(runControl), m_runControl(runControl), m_runConfig(runConfig), : QObject(engine), m_engine(engine), m_runConfig(runConfig),
m_runner(new MaemoSshRunner(this, runConfig, true)), m_runner(new MaemoSshRunner(this, runConfig, true)),
m_debuggingType(runConfig->debuggingType()), m_debuggingType(runConfig->debuggingType()),
m_dumperLib(runConfig->dumperLib()), m_dumperLib(runConfig->dumperLib()),
m_state(Inactive), m_gdbServerPort(-1), m_qmlPort(-1) m_state(Inactive), m_gdbServerPort(-1), m_qmlPort(-1)
{ {
connect(m_runControl->engine(), SIGNAL(requestRemoteSetup()), this, connect(m_engine, SIGNAL(requestRemoteSetup()), this,
SLOT(handleAdapterSetupRequested())); SLOT(handleAdapterSetupRequested()));
connect(m_runControl, SIGNAL(finished()), this,
SLOT(handleDebuggingFinished()));
} }
MaemoDebugSupport::~MaemoDebugSupport() MaemoDebugSupport::~MaemoDebugSupport()
@@ -134,8 +135,8 @@ MaemoDebugSupport::~MaemoDebugSupport()
void MaemoDebugSupport::showMessage(const QString &msg, int channel) void MaemoDebugSupport::showMessage(const QString &msg, int channel)
{ {
if (m_runControl) if (m_engine)
m_runControl->engine()->showMessage(msg, channel); m_engine->showMessage(msg, channel);
} }
void MaemoDebugSupport::handleAdapterSetupRequested() void MaemoDebugSupport::handleAdapterSetupRequested()
@@ -302,7 +303,7 @@ void MaemoDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
{ {
ASSERT_STATE(QList<State>() << Inactive << StartingRemoteProcess << Debugging); ASSERT_STATE(QList<State>() << Inactive << StartingRemoteProcess << Debugging);
if (!m_runControl) if (!m_engine)
return; return;
showMessage(QString::fromUtf8(output), AppOutput); showMessage(QString::fromUtf8(output), AppOutput);
@@ -324,13 +325,13 @@ void MaemoDebugSupport::handleProgressReport(const QString &progressOutput)
void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error) void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
{ {
setState(Inactive); setState(Inactive);
m_runControl->engine()->handleRemoteSetupFailed(tr("Initial setup failed: %1").arg(error)); m_engine->handleRemoteSetupFailed(tr("Initial setup failed: %1").arg(error));
} }
void MaemoDebugSupport::handleAdapterSetupDone() void MaemoDebugSupport::handleAdapterSetupDone()
{ {
setState(Debugging); setState(Debugging);
m_runControl->engine()->handleRemoteSetupDone(m_gdbServerPort, m_qmlPort); m_engine->handleRemoteSetupDone(m_gdbServerPort, m_qmlPort);
} }
void MaemoDebugSupport::setState(State newState) void MaemoDebugSupport::setState(State newState)
@@ -365,7 +366,7 @@ QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig &devConf)
bool MaemoDebugSupport::useGdb() const bool MaemoDebugSupport::useGdb() const
{ {
return m_runControl->engine()->startParameters().startMode == StartRemoteGdb return m_engine->startParameters().startMode == StartRemoteGdb
&& m_debuggingType != MaemoRunConfiguration::DebugQmlOnly; && m_debuggingType != MaemoRunConfiguration::DebugQmlOnly;
} }

View File

@@ -47,7 +47,7 @@
namespace Core { class SftpChannel; } namespace Core { class SftpChannel; }
namespace Debugger { namespace Debugger {
class DebuggerRunControl; class DebuggerEngine;
} }
namespace ProjectExplorer { class RunControl; } namespace ProjectExplorer { class RunControl; }
@@ -65,7 +65,7 @@ public:
static ProjectExplorer::RunControl *createDebugRunControl(MaemoRunConfiguration *runConfig); static ProjectExplorer::RunControl *createDebugRunControl(MaemoRunConfiguration *runConfig);
MaemoDebugSupport(MaemoRunConfiguration *runConfig, MaemoDebugSupport(MaemoRunConfiguration *runConfig,
Debugger::DebuggerRunControl *runControl); Debugger::DebuggerEngine *engine);
~MaemoDebugSupport(); ~MaemoDebugSupport();
static QString uploadDir(const MaemoDeviceConfig &devConf); static QString uploadDir(const MaemoDeviceConfig &devConf);
@@ -99,7 +99,7 @@ private:
bool setPort(int &port); bool setPort(int &port);
void showMessage(const QString &msg, int channel); void showMessage(const QString &msg, int channel);
const QPointer<Debugger::DebuggerRunControl> m_runControl; const QPointer<Debugger::DebuggerEngine> m_engine;
const QPointer<MaemoRunConfiguration> m_runConfig; const QPointer<MaemoRunConfiguration> m_runConfig;
MaemoSshRunner * const m_runner; MaemoSshRunner * const m_runner;
const MaemoRunConfiguration::DebuggingType m_debuggingType; const MaemoRunConfiguration::DebuggingType m_debuggingType;