forked from qt-creator/qt-creator
debugger: make watchers visible after project load again
This commit is contained in:
@@ -467,6 +467,37 @@ void AttachRemoteParameters::clear()
|
|||||||
attachTarget.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
|
// 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)
|
void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
|
||||||
{
|
{
|
||||||
static DummyEngine dummyEngine;
|
|
||||||
|
|
||||||
if (!engine)
|
if (!engine)
|
||||||
engine = &dummyEngine;
|
engine = dummyEngine();
|
||||||
|
|
||||||
if (m_currentEngine == engine)
|
if (m_currentEngine == engine)
|
||||||
return;
|
return;
|
||||||
@@ -2914,7 +2925,7 @@ void DebuggerPluginPrivate::activateDebugMode()
|
|||||||
void DebuggerPluginPrivate::sessionLoaded()
|
void DebuggerPluginPrivate::sessionLoaded()
|
||||||
{
|
{
|
||||||
m_breakHandler->loadSessionData();
|
m_breakHandler->loadSessionData();
|
||||||
WatchHandler::loadSessionData();
|
dummyEngine()->watchHandler()->loadSessionData();
|
||||||
synchronizeWatchers();
|
synchronizeWatchers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2931,7 +2942,7 @@ void DebuggerPluginPrivate::aboutToUnloadSession()
|
|||||||
|
|
||||||
void DebuggerPluginPrivate::aboutToSaveSession()
|
void DebuggerPluginPrivate::aboutToSaveSession()
|
||||||
{
|
{
|
||||||
WatchHandler::saveSessionData();
|
dummyEngine()->watchHandler()->loadSessionData();
|
||||||
m_breakHandler->saveSessionData();
|
m_breakHandler->saveSessionData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1492,10 +1492,10 @@ void WatchHandler::updateWatchers()
|
|||||||
|
|
||||||
void WatchHandler::loadWatchers()
|
void WatchHandler::loadWatchers()
|
||||||
{
|
{
|
||||||
|
m_watcherNames.clear();
|
||||||
QVariant value = debuggerCore()->sessionValue("Watchers");
|
QVariant value = debuggerCore()->sessionValue("Watchers");
|
||||||
foreach (const QString &exp, value.toStringList())
|
foreach (const QString &exp, value.toStringList())
|
||||||
m_watcherNames[exp.toLatin1()] = watcherCounter++;
|
watchExpression(exp);
|
||||||
|
|
||||||
//qDebug() << "LOAD WATCHERS: " << m_watchers;
|
//qDebug() << "LOAD WATCHERS: " << m_watchers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,8 +155,8 @@ public:
|
|||||||
const WatchData *findItem(const QByteArray &iname) const;
|
const WatchData *findItem(const QByteArray &iname) const;
|
||||||
QModelIndex itemIndex(const QByteArray &iname) const;
|
QModelIndex itemIndex(const QByteArray &iname) const;
|
||||||
|
|
||||||
static void loadSessionData();
|
void loadSessionData();
|
||||||
static void saveSessionData();
|
void saveSessionData();
|
||||||
void removeTooltip();
|
void removeTooltip();
|
||||||
|
|
||||||
bool isExpandedIName(const QByteArray &iname) const
|
bool isExpandedIName(const QByteArray &iname) const
|
||||||
@@ -182,8 +182,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class WatchModel;
|
friend class WatchModel;
|
||||||
|
|
||||||
static void loadWatchers();
|
void loadWatchers();
|
||||||
static void saveWatchers();
|
void saveWatchers();
|
||||||
static void loadTypeFormats();
|
static void loadTypeFormats();
|
||||||
static void saveTypeFormats();
|
static void saveTypeFormats();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user