diff --git a/debugger/interfaces/ivariablecontroller.h b/debugger/interfaces/ivariablecontroller.h --- a/debugger/interfaces/ivariablecontroller.h +++ b/debugger/interfaces/ivariablecontroller.h @@ -87,12 +87,7 @@ void stateChanged(KDevelop::IDebugSession::DebuggerState); private: - void updateIfFrameOrThreadChanged(); - QFlags m_autoUpdate; - int m_activeThread; - int m_activeFrame; - }; } // namespace KDevelop diff --git a/debugger/interfaces/ivariablecontroller.cpp b/debugger/interfaces/ivariablecontroller.cpp --- a/debugger/interfaces/ivariablecontroller.cpp +++ b/debugger/interfaces/ivariablecontroller.cpp @@ -32,7 +32,7 @@ IVariableController::IVariableController(IDebugSession* parent) - : QObject(parent), m_activeThread(-1), m_activeFrame(-1) + : QObject(parent) { connect(parent, &IDebugSession::stateChanged, this, &IVariableController::stateChanged); @@ -55,10 +55,9 @@ return; } - if (state == IDebugSession::ActiveState) { - //variables are now outdated, update them - m_activeThread = -1; - m_activeFrame = -1; + if (state == IDebugSession::PausedState) { + // Debugger is now paused, update variables + update(); } else if (state == IDebugSession::EndedState || state == IDebugSession::NotStartedState) { // Remove all locals. foreach (Locals *l, variableCollection()->allLocals()) { @@ -75,17 +74,6 @@ } } -void IVariableController::updateIfFrameOrThreadChanged() -{ - IFrameStackModel *sm = session()->frameStackModel(); - if (sm->currentThread() != m_activeThread || sm->currentFrame() != m_activeFrame) { - m_activeThread = sm->currentThread(); - m_activeFrame = sm->currentFrame(); - variableCollection()->root()->resetChanged(); - update(); - } -} - void IVariableController::handleEvent(IDebugSession::event_t event) { if (!variableCollection()) return; @@ -101,7 +89,8 @@ } } if (m_autoUpdate != UpdateNone) { - updateIfFrameOrThreadChanged(); + variableCollection()->root()->resetChanged(); + update(); } break;