Commit ba811dfb authored by hjk's avatar hjk

debugger: make watchers visible after project load again

parent 790648b9
......@@ -467,6 +467,37 @@ void AttachRemoteParameters::clear()
attachTarget.clear();
}
///////////////////////////////////////////////////////////////////////
//
// DummyEngine
//
///////////////////////////////////////////////////////////////////////
class DummyEngine : public DebuggerEngine
{
Q_OBJECT
public:
DummyEngine() : DebuggerEngine(DebuggerStartParameters()) {}
virtual ~DummyEngine() {}
virtual void setupEngine() {}
virtual void setupInferior() {}
virtual void runEngine() {}
virtual void shutdownEngine() {}
virtual void shutdownInferior() {}
virtual void executeDebuggerCommand(const QString &) {}
virtual unsigned debuggerCapabilities() const { return 0; }
};
static DebuggerEngine *dummyEngine()
{
static DummyEngine dummy;
return &dummy;
}
///////////////////////////////////////////////////////////////////////
//
// DebugMode
......@@ -2463,30 +2494,10 @@ void DebuggerPluginPrivate::startDebugger(RunControl *rc)
}
class DummyEngine : public DebuggerEngine
{
Q_OBJECT
public:
DummyEngine() : DebuggerEngine(DebuggerStartParameters()) {}
virtual ~DummyEngine() {}
virtual void setupEngine() {}
virtual void setupInferior() {}
virtual void runEngine() {}
virtual void shutdownEngine() {}
virtual void shutdownInferior() {}
virtual void executeDebuggerCommand(const QString &) {}
virtual unsigned debuggerCapabilities() const { return 0; }
};
void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
{
static DummyEngine dummyEngine;
if (!engine)
engine = &dummyEngine;
engine = dummyEngine();
if (m_currentEngine == engine)
return;
......@@ -2914,7 +2925,7 @@ void DebuggerPluginPrivate::activateDebugMode()
void DebuggerPluginPrivate::sessionLoaded()
{
m_breakHandler->loadSessionData();
WatchHandler::loadSessionData();
dummyEngine()->watchHandler()->loadSessionData();
synchronizeWatchers();
}
......@@ -2931,7 +2942,7 @@ void DebuggerPluginPrivate::aboutToUnloadSession()
void DebuggerPluginPrivate::aboutToSaveSession()
{
WatchHandler::saveSessionData();
dummyEngine()->watchHandler()->loadSessionData();
m_breakHandler->saveSessionData();
}
......
......@@ -1492,10 +1492,10 @@ void WatchHandler::updateWatchers()
void WatchHandler::loadWatchers()
{
m_watcherNames.clear();
QVariant value = debuggerCore()->sessionValue("Watchers");
foreach (const QString &exp, value.toStringList())
m_watcherNames[exp.toLatin1()] = watcherCounter++;
watchExpression(exp);
//qDebug() << "LOAD WATCHERS: " << m_watchers;
}
......
......@@ -155,8 +155,8 @@ public:
const WatchData *findItem(const QByteArray &iname) const;
QModelIndex itemIndex(const QByteArray &iname) const;
static void loadSessionData();
static void saveSessionData();
void loadSessionData();
void saveSessionData();
void removeTooltip();
bool isExpandedIName(const QByteArray &iname) const
......@@ -182,8 +182,8 @@ public:
private:
friend class WatchModel;
static void loadWatchers();
static void saveWatchers();
void loadWatchers();
void saveWatchers();
static void loadTypeFormats();
static void saveTypeFormats();
......
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