Changeset View
Changeset View
Standalone View
Standalone View
debugger/interfaces/ivariablecontroller.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 62 | } else if (state == IDebugSession::EndedState || state == IDebugSession::NotStartedState) { | |||
---|---|---|---|---|---|
74 | } | 74 | } | ||
75 | } | 75 | } | ||
76 | } | 76 | } | ||
77 | 77 | | |||
78 | void IVariableController::updateIfFrameOrThreadChanged() | 78 | void IVariableController::updateIfFrameOrThreadChanged() | ||
79 | { | 79 | { | ||
80 | IFrameStackModel *sm = session()->frameStackModel(); | 80 | IFrameStackModel *sm = session()->frameStackModel(); | ||
81 | if (sm->currentThread() != m_activeThread || sm->currentFrame() != m_activeFrame) { | 81 | if (sm->currentThread() != m_activeThread || sm->currentFrame() != m_activeFrame) { | ||
82 | m_activeThread = sm->currentThread(); | | |||
83 | m_activeFrame = sm->currentFrame(); | | |||
84 | variableCollection()->root()->resetChanged(); | 82 | variableCollection()->root()->resetChanged(); | ||
85 | update(); | 83 | update(); | ||
86 | } | 84 | } | ||
87 | } | 85 | } | ||
88 | 86 | | |||
89 | void IVariableController::handleEvent(IDebugSession::event_t event) | 87 | void IVariableController::handleEvent(IDebugSession::event_t event) | ||
90 | { | 88 | { | ||
91 | if (!variableCollection()) return; | 89 | if (!variableCollection()) return; | ||
92 | 90 | | |||
93 | switch (event) { | 91 | switch (event) { | ||
94 | case IDebugSession::thread_or_frame_changed: | 92 | case IDebugSession::thread_or_frame_changed: | ||
95 | qCDebug(DEBUGGER) << m_autoUpdate; | 93 | qCDebug(DEBUGGER) << m_autoUpdate; | ||
96 | if (!(m_autoUpdate & UpdateLocals)) { | 94 | if (!(m_autoUpdate & UpdateLocals)) { | ||
97 | foreach (Locals *l, variableCollection()->allLocals()) { | 95 | foreach (Locals *l, variableCollection()->allLocals()) { | ||
98 | if (!l->isExpanded() && !l->childCount()) { | 96 | if (!l->isExpanded() && !l->childCount()) { | ||
99 | l->setHasMore(true); | 97 | l->setHasMore(true); | ||
100 | } | 98 | } | ||
101 | } | 99 | } | ||
102 | } | 100 | } | ||
103 | if (m_autoUpdate != UpdateNone) { | 101 | if (m_autoUpdate != UpdateNone) { | ||
104 | updateIfFrameOrThreadChanged(); | 102 | updateIfFrameOrThreadChanged(); | ||
105 | } | 103 | } | ||
104 | | ||||
105 | // update our cache of active thread/frame regardless of m_autoUpdate | ||||
106 | // to keep them synced when user currently hides the variable list | ||||
107 | m_activeThread = session()->frameStackModel()->currentThread(); | ||||
108 | m_activeFrame = session()->frameStackModel()->currentFrame(); | ||||
106 | break; | 109 | break; | ||
107 | 110 | | |||
108 | default: | 111 | default: | ||
109 | break; | 112 | break; | ||
110 | } | 113 | } | ||
111 | } | 114 | } | ||
112 | 115 | | |||
113 | void IVariableController::setAutoUpdate(QFlags<UpdateType> autoUpdate) | 116 | void IVariableController::setAutoUpdate(QFlags<UpdateType> autoUpdate) | ||
Show All 16 Lines |