Commit f8700f19 authored by Kai Koehne's avatar Kai Koehne

Debugger: Expose which languages (QML, C++, Any) an engine supports

Change-Id: Ia690b5cda84738c303ae7b6bd579e43313728525
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent b8ed8f49
......@@ -436,7 +436,7 @@ static inline Utils::SavedAction *theAssemblerAction()
CdbEngine::CdbEngine(const DebuggerStartParameters &sp,
DebuggerEngine *masterEngine, const OptionsPtr &options) :
DebuggerEngine(sp, masterEngine),
DebuggerEngine(sp, CppLanguage, masterEngine),
m_creatorExtPrefix("<qtcreatorcdbext>|"),
m_tokenPrefix("<token>"),
m_options(options),
......
......@@ -139,11 +139,13 @@ class DebuggerEnginePrivate : public QObject
public:
DebuggerEnginePrivate(DebuggerEngine *engine,
DebuggerEngine *masterEngine,
DebuggerLanguages languages,
const DebuggerStartParameters &sp)
: m_engine(engine),
m_masterEngine(masterEngine),
m_runControl(0),
m_startParameters(sp),
m_languages(languages),
m_state(DebuggerNotReady),
m_lastGoodState(DebuggerNotReady),
m_targetState(DebuggerNotReady),
......@@ -256,6 +258,7 @@ public:
DebuggerRunControl *m_runControl; // Not owned.
DebuggerStartParameters m_startParameters;
DebuggerLanguages m_languages;
// The current state.
DebuggerState m_state;
......@@ -292,8 +295,9 @@ public:
//////////////////////////////////////////////////////////////////////
DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters,
DebuggerLanguages languages,
DebuggerEngine *parentEngine)
: d(new DebuggerEnginePrivate(this, parentEngine, startParameters))
: d(new DebuggerEnginePrivate(this, parentEngine, languages, startParameters))
{
d->m_inferiorPid = 0;
}
......@@ -1133,6 +1137,11 @@ DebuggerEngine *DebuggerEngine::masterEngine() const
return d->m_masterEngine;
}
DebuggerLanguages DebuggerEngine::languages() const
{
return d->m_languages;
}
bool DebuggerEngine::debuggerActionsEnabled() const
{
return debuggerActionsEnabled(d->m_state);
......
......@@ -144,6 +144,7 @@ class DEBUGGER_EXPORT DebuggerEngine : public QObject
public:
explicit DebuggerEngine(const DebuggerStartParameters &sp,
DebuggerLanguages languages,
DebuggerEngine *parentEngine = 0);
virtual ~DebuggerEngine();
......@@ -272,6 +273,8 @@ public:
bool isMasterEngine() const;
DebuggerEngine *masterEngine() const;
DebuggerLanguages languages() const;
virtual bool setupQmlStep(bool /*on*/) { return false; }
virtual void readyToExecuteQmlStep() {}
......
......@@ -475,7 +475,7 @@ class DummyEngine : public DebuggerEngine
Q_OBJECT
public:
DummyEngine() : DebuggerEngine(DebuggerStartParameters()) {}
DummyEngine() : DebuggerEngine(DebuggerStartParameters(), AnyLanguage) {}
~DummyEngine() {}
void setupEngine() {}
......
......@@ -189,7 +189,7 @@ static QByteArray parsePlainConsoleStream(const GdbResponse &response)
GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters,
DebuggerEngine *masterEngine)
: DebuggerEngine(startParameters, masterEngine)
: DebuggerEngine(startParameters, CppLanguage, masterEngine)
{
setObjectName(_("GdbEngine"));
......
......@@ -66,7 +66,7 @@ namespace Debugger {
namespace Internal {
IPCEngineHost::IPCEngineHost (const DebuggerStartParameters &startParameters)
: DebuggerEngine(startParameters)
: DebuggerEngine(startParameters, CppLanguage)
, m_localGuest(0)
, m_nextMessagePayloadSize(0)
, m_cookie(1)
......
......@@ -90,7 +90,7 @@ namespace Internal {
///////////////////////////////////////////////////////////////////////
PdbEngine::PdbEngine(const DebuggerStartParameters &startParameters)
: DebuggerEngine(startParameters)
: DebuggerEngine(startParameters, AnyLanguage)
{
setObjectName(QLatin1String("PdbEngine"));
}
......
......@@ -139,7 +139,7 @@ void QmlCppEnginePrivate::qmlStackChanged()
QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp,
DebuggerEngineType slaveEngineType,
QString *errorMessage)
: DebuggerEngine(sp), d(new QmlCppEnginePrivate(this, sp))
: DebuggerEngine(sp, DebuggerLanguages(CppLanguage) | QmlLanguage), d(new QmlCppEnginePrivate(this, sp))
{
setObjectName(QLatin1String("QmlCppEngine"));
d->m_cppEngine = DebuggerRunControlFactory::createEngine(slaveEngineType, sp, this, errorMessage);
......
......@@ -115,7 +115,7 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *q)
QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
DebuggerEngine *masterEngine)
: DebuggerEngine(startParameters, masterEngine),
: DebuggerEngine(startParameters, QmlLanguage, masterEngine),
d(new QmlEnginePrivate(this))
{
setObjectName(QLatin1String("QmlEngine"));
......
......@@ -205,7 +205,7 @@ void ScriptAgent::scriptUnload(qint64 scriptId)
///////////////////////////////////////////////////////////////////////
ScriptEngine::ScriptEngine(const DebuggerStartParameters &startParameters)
: DebuggerEngine(startParameters)
: DebuggerEngine(startParameters, AnyLanguage)
{
setObjectName(QLatin1String("ScriptEngine"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment