diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index c0b5f16a8902f23abcc06f95832bff82272aa8a9..1fd69445efe24716785fbac263cced1585822785 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -239,6 +239,7 @@ public slots: void scheduleResetLocation() { m_stackHandler.scheduleResetLocation(); + m_watchHandler.scheduleResetLocation(); m_threadsHandler.scheduleResetLocation(); m_disassemblerAgent.scheduleResetLocation(); m_locationTimer.setSingleShot(true); @@ -250,6 +251,7 @@ public slots: m_locationTimer.stop(); m_locationMark.reset(); m_stackHandler.resetLocation(); + m_watchHandler.resetLocation(); m_threadsHandler.resetLocation(); m_disassemblerAgent.resetLocation(); } diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 53ebfe23b2539b1ab05314a7d149b7c895b8cc29..37eb25d16af9cacf922d788a68641dbc799a295e 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -155,7 +155,7 @@ Qt::ItemFlags StackHandler::flags(const QModelIndex &index) const const bool isValid = frame.isUsable() || debuggerCore()->boolSetting(OperateByInstruction); return isValid && m_contentsValid - ? QAbstractTableModel::flags(index) : Qt::ItemFlags(0); + ? QAbstractTableModel::flags(index) : Qt::ItemFlags(); } StackFrame StackHandler::currentFrame() const diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 07b8609204172281ada5d515df876fabd620920a..9fea42c7980a57c29c398103cb934b8caf6de0af 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -790,7 +790,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const static const QVariant red(QColor(200, 0, 0)); static const QVariant gray(QColor(140, 140, 140)); switch (idx.column()) { - case 1: return !data.valueEnabled ? gray + case 1: return (!data.valueEnabled || !m_handler->m_contentsValid) ? gray : data.changed ? red : QVariant(); } break; @@ -907,6 +907,9 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const { + if (!m_handler->m_contentsValid) + return Qt::ItemFlags(); + if (!idx.isValid()) return Qt::ItemFlags(); @@ -1253,6 +1256,9 @@ WatchHandler::WatchHandler(DebuggerEngine *engine) m_watchers = new WatchModel(this, WatchersWatch); m_tooltips = new WatchModel(this, TooltipsWatch); + m_contentsValid = false; + m_resetLocationScheduled = false; + connect(debuggerCore()->action(SortStructMembers), SIGNAL(valueChanged(QVariant)), SLOT(reinsertAllData())); connect(debuggerCore()->action(ShowStdNamespace), SIGNAL(valueChanged(QVariant)), @@ -1275,6 +1281,10 @@ void WatchHandler::endCycle() m_locals->endCycle(); m_watchers->endCycle(); m_tooltips->endCycle(); + + m_contentsValid = true; + m_resetLocationScheduled = false; + updateWatchersWindow(); } @@ -1858,5 +1868,22 @@ void WatchHandler::editTypeFormats(bool includeLocals, const QByteArray &iname) setTypeFormats(dlg.typeFormats()); } +void WatchHandler::scheduleResetLocation() +{ + m_contentsValid = false; + m_resetLocationScheduled = true; +} + +void WatchHandler::resetLocation() +{ + if (m_resetLocationScheduled) { + m_resetLocationScheduled = false; + m_return->reset(); + m_locals->reset(); + m_watchers->reset(); + m_tooltips->reset(); + } +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 7edbf39cde82c0f7e4afd80964bac92ea4e0e38f..2069f95474ac0d91029a7e009af5b63fd9b15331 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -202,6 +202,9 @@ public: QString editorContents(); void editTypeFormats(bool includeLocals, const QByteArray &iname); + void scheduleResetLocation(); + void resetLocation(); + private: friend class WatchModel; @@ -234,6 +237,9 @@ private: DebuggerEngine *m_engine; int m_watcherCounter; + + bool m_contentsValid; + bool m_resetLocationScheduled; }; } // namespace Internal