diff options
author | hjk <qthjk@ovi.com> | 2012-08-15 14:33:39 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-08-16 11:56:10 +0200 |
commit | 8184d8e703c22dc525b39493ff3e32752bc930aa (patch) | |
tree | a343e6711f366839f9803891ef5dbf54a9e99004 | |
parent | 081fb1f0626a1278d9be2bc0fbf3e62f1d332804 (diff) |
debugger: simplify DebuggerEngine construction
The master engine pointer can be given later.
Change-Id: I4d72679dcbd5fe7291067a5e78c984d26cc187aa
Reviewed-by: hjk <qthjk@ovi.com>
27 files changed, 76 insertions, 130 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 9a9251aa8d..c461f576dd 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -327,8 +327,7 @@ static inline bool validMode(DebuggerStartMode sm) } // Accessed by RunControlFactory -DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine, QString *errorMessage) +DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *errorMessage) { #ifdef Q_OS_WIN CdbOptionsPage *op = CdbOptionsPage::instance(); @@ -336,9 +335,8 @@ DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, *errorMessage = QLatin1String("Internal error: Invalid start parameters passed for thre CDB engine."); return 0; } - return new CdbEngine(sp, masterEngine, op->options()); + return new CdbEngine(sp, op->options()); #else - Q_UNUSED(masterEngine) Q_UNUSED(sp) #endif *errorMessage = QString::fromLatin1("Unsupported debug mode"); @@ -426,9 +424,8 @@ static inline Utils::SavedAction *theAssemblerAction() return debuggerCore()->action(OperateByInstruction); } -CdbEngine::CdbEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine, const OptionsPtr &options) : - DebuggerEngine(sp, masterEngine), +CdbEngine::CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &options) : + DebuggerEngine(sp), m_creatorExtPrefix("<qtcreatorcdbext>|"), m_tokenPrefix("<token>"), m_options(options), diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 10af052146..f4e0e04f1a 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -79,11 +79,9 @@ public: typedef void (CdbEngine::*BuiltinCommandHandler)(const CdbBuiltinCommandPtr &); typedef void (CdbEngine::*ExtensionCommandHandler)(const CdbExtensionCommandPtr &); - explicit CdbEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine, - const OptionsPtr &options); + CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &options); + ~CdbEngine(); - virtual ~CdbEngine(); // Factory function that returns 0 if the debug engine library cannot be found. virtual bool setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 4c4021ecd3..4d2f088ae2 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -153,11 +153,9 @@ class DebuggerEnginePrivate : public QObject Q_OBJECT public: - DebuggerEnginePrivate(DebuggerEngine *engine, - DebuggerEngine *masterEngine, - const DebuggerStartParameters &sp) + DebuggerEnginePrivate(DebuggerEngine *engine, const DebuggerStartParameters &sp) : m_engine(engine), - m_masterEngine(masterEngine), + m_masterEngine(0), m_runControl(0), m_startParameters(sp), m_state(DebuggerNotReady), @@ -330,9 +328,8 @@ public: // ////////////////////////////////////////////////////////////////////// -DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *parentEngine) - : d(new DebuggerEnginePrivate(this, parentEngine, startParameters)) +DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters) + : d(new DebuggerEnginePrivate(this, startParameters)) {} DebuggerEngine::~DebuggerEngine() @@ -1264,6 +1261,11 @@ bool DebuggerEngine::isMasterEngine() const return d->m_masterEngine == 0; } +void DebuggerEngine::setMasterEngine(DebuggerEngine *masterEngine) +{ + d->m_masterEngine = masterEngine; +} + DebuggerEngine *DebuggerEngine::masterEngine() const { return d->m_masterEngine; diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index b87c7b5f6e..580a3e4db7 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -139,8 +139,7 @@ class DEBUGGER_EXPORT DebuggerEngine : public QObject Q_OBJECT public: - explicit DebuggerEngine(const DebuggerStartParameters &sp, - DebuggerEngine *parentEngine = 0); + explicit DebuggerEngine(const DebuggerStartParameters &sp); virtual ~DebuggerEngine(); const DebuggerStartParameters &startParameters() const; @@ -360,6 +359,7 @@ protected: virtual void frameDown(); void setTargetState(DebuggerState state); + void setMasterEngine(DebuggerEngine *masterEngine); DebuggerRunControl *runControl() const; diff --git a/src/plugins/debugger/debuggerruncontrolfactory.h b/src/plugins/debugger/debuggerruncontrolfactory.h index b53bd94df4..9f0b2c230a 100644 --- a/src/plugins/debugger/debuggerruncontrolfactory.h +++ b/src/plugins/debugger/debuggerruncontrolfactory.h @@ -57,7 +57,6 @@ public: static DebuggerEngine *createEngine(DebuggerEngineType et, const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine, QString *errorMessage); static DebuggerRunControl *createAndScheduleRun( diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 317d1ce0e8..bc78d87c84 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -42,7 +42,6 @@ #include "debuggerprofileinformation.h" #include "lldb/lldbenginehost.h" #include "debuggertooltipmanager.h" -#include "qml/qmlengine.h" #ifdef Q_OS_WIN # include "peutils.h" @@ -85,19 +84,14 @@ namespace Internal { bool isCdbEngineEnabled(); // Check the configuration page //bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check); -DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine, QString *error); +DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *error); //bool checkGdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check); -DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine); - +DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp); DebuggerEngine *createScriptEngine(const DebuggerStartParameters &sp); DebuggerEngine *createPdbEngine(const DebuggerStartParameters &sp); -QmlEngine *createQmlEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine); -DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp, - QString *errorMessage); +DebuggerEngine *createQmlEngine(const DebuggerStartParameters &sp); +DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp, QString *error); DebuggerEngine *createLldbEngine(const DebuggerStartParameters &sp); extern QString msgNoBinaryForToolChain(const Abi &abi); @@ -326,7 +320,7 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration, // Create the engine. Could arguably be moved to the factory, but // we still have a derived S60DebugControl. Should rarely fail, though. QString errorMessage; - d->m_engine = DebuggerRunControlFactory::createEngine(sp.masterEngineType, sp, 0, &errorMessage); + d->m_engine = DebuggerRunControlFactory::createEngine(sp.masterEngineType, sp, &errorMessage); if (d->m_engine) { DebuggerToolTipManager::instance()->registerEngine(d->m_engine); @@ -757,23 +751,20 @@ RunConfigWidget *DebuggerRunControlFactory::createConfigurationWidget return new DebuggerRunConfigWidget(runConfiguration); } -DebuggerEngine *DebuggerRunControlFactory::createEngine - (DebuggerEngineType et, - const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine, - QString *errorMessage) +DebuggerEngine *DebuggerRunControlFactory::createEngine(DebuggerEngineType et, + const DebuggerStartParameters &sp, QString *errorMessage) { switch (et) { case GdbEngineType: - return createGdbEngine(sp, masterEngine); + return createGdbEngine(sp); case ScriptEngineType: return createScriptEngine(sp); case CdbEngineType: - return createCdbEngine(sp, masterEngine, errorMessage); + return createCdbEngine(sp, errorMessage); case PdbEngineType: return createPdbEngine(sp); case QmlEngineType: - return createQmlEngine(sp, masterEngine); + return createQmlEngine(sp); case LldbEngineType: return createLldbEngine(sp); case QmlCppEngineType: diff --git a/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp b/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp index 6a1d209c02..2b76292dfb 100644 --- a/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp +++ b/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp @@ -49,9 +49,8 @@ namespace Internal { static_cast<GdbEngine::GdbCommandCallback>(&GdbAbstractPlainEngine::callback), \ STRINGIFY(callback) -GdbAbstractPlainEngine::GdbAbstractPlainEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbEngine(startParameters, masterEngine) +GdbAbstractPlainEngine::GdbAbstractPlainEngine(const DebuggerStartParameters &startParameters) + : GdbEngine(startParameters) {} void GdbAbstractPlainEngine::setupInferior() diff --git a/src/plugins/debugger/gdb/abstractplaingdbadapter.h b/src/plugins/debugger/gdb/abstractplaingdbadapter.h index 7986b647fb..fa3bb49115 100644 --- a/src/plugins/debugger/gdb/abstractplaingdbadapter.h +++ b/src/plugins/debugger/gdb/abstractplaingdbadapter.h @@ -42,8 +42,7 @@ class GdbAbstractPlainEngine : public GdbEngine Q_OBJECT public: - GdbAbstractPlainEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbAbstractPlainEngine(const DebuggerStartParameters &startParameters); void setupInferior(); void runEngine(); diff --git a/src/plugins/debugger/gdb/attachgdbadapter.cpp b/src/plugins/debugger/gdb/attachgdbadapter.cpp index 438d931359..e32cc39963 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.cpp +++ b/src/plugins/debugger/gdb/attachgdbadapter.cpp @@ -52,9 +52,8 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -GdbAttachEngine::GdbAttachEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbEngine(startParameters, masterEngine) +GdbAttachEngine::GdbAttachEngine(const DebuggerStartParameters &startParameters) + : GdbEngine(startParameters) { } diff --git a/src/plugins/debugger/gdb/attachgdbadapter.h b/src/plugins/debugger/gdb/attachgdbadapter.h index 590fa7a374..d77f934b40 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.h +++ b/src/plugins/debugger/gdb/attachgdbadapter.h @@ -48,8 +48,7 @@ class GdbAttachEngine : public GdbEngine Q_OBJECT public: - GdbAttachEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbAttachEngine(const DebuggerStartParameters &startParameters); private: DumperHandling dumperHandling() const { return DumperLoadedByGdb; } diff --git a/src/plugins/debugger/gdb/codagdbadapter.cpp b/src/plugins/debugger/gdb/codagdbadapter.cpp index 6cd37a19a0..47d479a24a 100644 --- a/src/plugins/debugger/gdb/codagdbadapter.cpp +++ b/src/plugins/debugger/gdb/codagdbadapter.cpp @@ -116,9 +116,8 @@ static inline QString startMsg(const Coda::Session &session) * - Stop all threads once one stops? * - Breakpoints do not trigger in threads other than the main thread. */ -GdbCodaEngine:: GdbCodaEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbEngine(startParameters, masterEngine), +GdbCodaEngine:: GdbCodaEngine(const DebuggerStartParameters &startParameters) + : GdbEngine(startParameters), m_running(false), m_stopReason(0), m_gdbAckMode(true), diff --git a/src/plugins/debugger/gdb/codagdbadapter.h b/src/plugins/debugger/gdb/codagdbadapter.h index 4e264382ab..d4e6d2df0a 100644 --- a/src/plugins/debugger/gdb/codagdbadapter.h +++ b/src/plugins/debugger/gdb/codagdbadapter.h @@ -80,8 +80,7 @@ public: typedef Coda::Callback<const Coda::CodaCommandResult &> CodaCallback; typedef Coda::Callback<const GdbResponse &> GdbCallback; - GdbCodaEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbCodaEngine(const DebuggerStartParameters &startParameters); ~GdbCodaEngine(); void setGdbServerName(const QString &name); diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index 44c70289d7..f6ca7af366 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -63,9 +63,8 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -GdbCoreEngine::GdbCoreEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbEngine(startParameters, masterEngine) +GdbCoreEngine::GdbCoreEngine(const DebuggerStartParameters &startParameters) + : GdbEngine(startParameters) {} GdbCoreEngine::~GdbCoreEngine() diff --git a/src/plugins/debugger/gdb/coregdbadapter.h b/src/plugins/debugger/gdb/coregdbadapter.h index 75104e44f3..1027fffbbf 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.h +++ b/src/plugins/debugger/gdb/coregdbadapter.h @@ -48,8 +48,7 @@ class GdbCoreEngine : public GdbEngine Q_OBJECT public: - GdbCoreEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbCoreEngine(const DebuggerStartParameters &startParameters); ~GdbCoreEngine(); private: diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index af672d8252..c9c1f3944d 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -237,9 +237,8 @@ private: // /////////////////////////////////////////////////////////////////////// -GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : DebuggerEngine(startParameters, masterEngine) +GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) + : DebuggerEngine(startParameters) { setObjectName(_("GdbEngine")); @@ -5399,27 +5398,24 @@ void GdbEngine::interruptLocalInferior(qint64 pid) // Factory // -DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine) +DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp) { - if (sp.toolChainAbi.os() == Abi::SymbianOS) { - // FIXME: 1 of 3 testing hacks. - return new GdbCodaEngine(sp, masterEngine); - } + if (sp.toolChainAbi.os() == Abi::SymbianOS) + return new GdbCodaEngine(sp); switch (sp.startMode) { case AttachCore: - return new GdbCoreEngine(sp, masterEngine); + return new GdbCoreEngine(sp); case AttachToRemoteServer: - return new GdbRemoteServerEngine(sp, masterEngine); + return new GdbRemoteServerEngine(sp); case StartRemoteGdb: - return new GdbRemotePlainEngine(sp, masterEngine); + return new GdbRemotePlainEngine(sp); case AttachExternal: - return new GdbAttachEngine(sp, masterEngine); + return new GdbAttachEngine(sp); default: if (sp.useTerminal) - return new GdbTermEngine(sp, masterEngine); - return new GdbLocalPlainEngine(sp, masterEngine); + return new GdbTermEngine(sp); + return new GdbLocalPlainEngine(sp); } } diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 71d364b7aa..cd2e513653 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -195,8 +195,7 @@ class GdbEngine : public Debugger::DebuggerEngine Q_OBJECT public: - GdbEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbEngine(const DebuggerStartParameters &startParameters); ~GdbEngine(); private: ////////// General Interface ////////// diff --git a/src/plugins/debugger/gdb/localplaingdbadapter.cpp b/src/plugins/debugger/gdb/localplaingdbadapter.cpp index 0684bf0788..59a02f5967 100644 --- a/src/plugins/debugger/gdb/localplaingdbadapter.cpp +++ b/src/plugins/debugger/gdb/localplaingdbadapter.cpp @@ -51,9 +51,8 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -GdbLocalPlainEngine::GdbLocalPlainEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbAbstractPlainEngine(startParameters, masterEngine) +GdbLocalPlainEngine::GdbLocalPlainEngine(const DebuggerStartParameters &startParameters) + : GdbAbstractPlainEngine(startParameters) { // Output connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)), diff --git a/src/plugins/debugger/gdb/localplaingdbadapter.h b/src/plugins/debugger/gdb/localplaingdbadapter.h index 534651f743..684360fe87 100644 --- a/src/plugins/debugger/gdb/localplaingdbadapter.h +++ b/src/plugins/debugger/gdb/localplaingdbadapter.h @@ -49,8 +49,7 @@ class GdbLocalPlainEngine : public GdbAbstractPlainEngine Q_OBJECT public: - GdbLocalPlainEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbLocalPlainEngine(const DebuggerStartParameters &startParameters); private: void setupEngine(); diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index c4d8505eea..bae3168c84 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -57,9 +57,8 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -GdbRemoteServerEngine::GdbRemoteServerEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbEngine(startParameters, masterEngine) +GdbRemoteServerEngine::GdbRemoteServerEngine(const DebuggerStartParameters &startParameters) + : GdbEngine(startParameters) { connect(&m_uploadProc, SIGNAL(error(QProcess::ProcessError)), SLOT(uploadProcError(QProcess::ProcessError))); diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.h b/src/plugins/debugger/gdb/remotegdbserveradapter.h index 303c6172be..e23c630b41 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.h +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.h @@ -48,8 +48,7 @@ class GdbRemoteServerEngine : public GdbEngine Q_OBJECT public: - GdbRemoteServerEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbRemoteServerEngine(const DebuggerStartParameters &startParameters); private: DumperHandling dumperHandling() const; diff --git a/src/plugins/debugger/gdb/remoteplaingdbadapter.cpp b/src/plugins/debugger/gdb/remoteplaingdbadapter.cpp index 17f91a0b11..f4556f5bd6 100644 --- a/src/plugins/debugger/gdb/remoteplaingdbadapter.cpp +++ b/src/plugins/debugger/gdb/remoteplaingdbadapter.cpp @@ -39,9 +39,8 @@ namespace Debugger { namespace Internal { -GdbRemotePlainEngine::GdbRemotePlainEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbAbstractPlainEngine(startParameters, masterEngine), +GdbRemotePlainEngine::GdbRemotePlainEngine(const DebuggerStartParameters &startParameters) + : GdbAbstractPlainEngine(startParameters), m_gdbProc(startParameters.connParams, this) { connect(&m_gdbProc, SIGNAL(started()), this, SLOT(handleGdbStarted())); diff --git a/src/plugins/debugger/gdb/remoteplaingdbadapter.h b/src/plugins/debugger/gdb/remoteplaingdbadapter.h index 79870bbdf8..92ab079b4e 100644 --- a/src/plugins/debugger/gdb/remoteplaingdbadapter.h +++ b/src/plugins/debugger/gdb/remoteplaingdbadapter.h @@ -43,8 +43,7 @@ class GdbRemotePlainEngine : public GdbAbstractPlainEngine public: friend class RemoteGdbProcess; - GdbRemotePlainEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit GdbRemotePlainEngine(const DebuggerStartParameters &startParameters); private slots: void handleGdbStarted(); diff --git a/src/plugins/debugger/gdb/termgdbadapter.cpp b/src/plugins/debugger/gdb/termgdbadapter.cpp index 5ca2ec9aaa..f41ec43074 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.cpp +++ b/src/plugins/debugger/gdb/termgdbadapter.cpp @@ -56,9 +56,8 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -GdbTermEngine::GdbTermEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : GdbEngine(startParameters, masterEngine) +GdbTermEngine::GdbTermEngine(const DebuggerStartParameters &startParameters) + : GdbEngine(startParameters) { #ifdef Q_OS_WIN // Windows up to xp needs a workaround for attaching to freshly started processes. see proc_stub_win diff --git a/src/plugins/debugger/gdb/termgdbadapter.h b/src/plugins/debugger/gdb/termgdbadapter.h index d727a0d2fd..a0a3cd1ccb 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.h +++ b/src/plugins/debugger/gdb/termgdbadapter.h @@ -50,9 +50,7 @@ class GdbTermEngine : public GdbEngine Q_OBJECT public: - GdbTermEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); - + explicit GdbTermEngine(const DebuggerStartParameters &startParameters); ~GdbTermEngine(); private: diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index 5bbe39719c..fd38502e1f 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -54,9 +54,6 @@ enum { debug = 0 }; const int ConnectionWaitTimeMs = 5000; -QmlEngine *createQmlEngine(const DebuggerStartParameters &, - DebuggerEngine *masterEngine); - DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp, QString *errorMessage) { @@ -74,32 +71,17 @@ DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp, // //////////////////////////////////////////////////////////////////////// -class QmlCppEnginePrivate : public QObject +class QmlCppEnginePrivate { - Q_OBJECT - public: - QmlCppEnginePrivate(QmlCppEngine *parent, - const DebuggerStartParameters &sp); - ~QmlCppEnginePrivate() {} + QmlCppEnginePrivate() {} -private: - friend class QmlCppEngine; - QmlCppEngine *q; QmlEngine *m_qmlEngine; DebuggerEngine *m_cppEngine; DebuggerEngine *m_activeEngine; }; -QmlCppEnginePrivate::QmlCppEnginePrivate(QmlCppEngine *parent, - const DebuggerStartParameters &sp) - : q(parent), m_qmlEngine(createQmlEngine(sp, q)), - m_cppEngine(0), m_activeEngine(0) -{ - setObjectName(QLatin1String("QmlCppEnginePrivate")); -} - //////////////////////////////////////////////////////////////////////// // // QmlCppEngine @@ -107,10 +89,14 @@ QmlCppEnginePrivate::QmlCppEnginePrivate(QmlCppEngine *parent, //////////////////////////////////////////////////////////////////////// QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp, QString *errorMessage) - : DebuggerEngine(sp), d(new QmlCppEnginePrivate(this, sp)) + : DebuggerEngine(sp) { setObjectName(QLatin1String("QmlCppEngine")); - d->m_cppEngine = DebuggerRunControlFactory::createEngine(sp.firstSlaveEngineType, sp, this, errorMessage); + d = new QmlCppEnginePrivate; + d->m_qmlEngine = new QmlEngine(sp); + d->m_qmlEngine->setMasterEngine(this); + d->m_cppEngine = DebuggerRunControlFactory::createEngine(sp.firstSlaveEngineType, sp, errorMessage); + d->m_cppEngine->setMasterEngine(this); if (!d->m_cppEngine) { *errorMessage = tr("The slave debugging engine required for combined QML/C++-Debugging could not be created: %1").arg(*errorMessage); return; @@ -831,5 +817,3 @@ void QmlCppEngine::setActiveEngine(DebuggerEngine *engine) } // namespace Internal } // namespace Debugger - -#include "qmlcppengine.moc" diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index e4530f464d..0e8c5f3c5b 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -266,9 +266,8 @@ public: // /////////////////////////////////////////////////////////////////////// -QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine) - : DebuggerEngine(startParameters, masterEngine) +QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters) + : DebuggerEngine(startParameters) , m_adapter(this) , m_inspectorAdapter(&m_adapter, this) , m_retryOnConnectFail(false) @@ -1343,10 +1342,9 @@ bool QmlEngine::adjustBreakpointLineAndColumn( return success; } -QmlEngine *createQmlEngine(const DebuggerStartParameters &sp, - DebuggerEngine *masterEngine) +DebuggerEngine *createQmlEngine(const DebuggerStartParameters &sp) { - return new QmlEngine(sp, masterEngine); + return new QmlEngine(sp); } } // namespace Internal diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h index eadd05bdd0..f613a4c1da 100644 --- a/src/plugins/debugger/qml/qmlengine.h +++ b/src/plugins/debugger/qml/qmlengine.h @@ -60,8 +60,7 @@ class QmlEngine : public DebuggerEngine Q_OBJECT public: - QmlEngine(const DebuggerStartParameters &startParameters, - DebuggerEngine *masterEngine); + explicit QmlEngine(const DebuggerStartParameters &startParameters); ~QmlEngine(); void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort); |