MCPcopy Create free account
hub / github.com/KDE/kdevelop / handleEvent

Method handleEvent

kdevplatform/debugger/interfaces/ivariablecontroller.cpp:77–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void IVariableController::handleEvent(IDebugSession::event_t event)
78{
79 Q_D(IVariableController);
80
81 if (!variableCollection()) return;
82
83 if (event != IDebugSession::thread_or_frame_changed) {
84 return;
85 }
86
87 const auto thread = session()->frameStackModel()->currentThread();
88 const auto frame = session()->frameStackModel()->currentFrame();
89 if (thread < 0 || frame < 0) {
90 // Update only when both the current thread and the current frame become valid.
91 // Redundant updating breaks highlighting changed variables, slows down
92 // debugging by issuing unneeded MI commands, and may cause other bugs.
93 qCDebug(DEBUGGER).nospace() << "not handling a change to invalid thread (" << thread << ") or frame (" << frame
94 << ')';
95 return;
96 }
97
98 qCDebug(DEBUGGER) << d->autoUpdate;
99 if (!(d->autoUpdate & UpdateLocals)) {
100 const auto locals = variableCollection()->allLocals();
101 for (Locals* l : locals) {
102 if (!l->isExpanded() && !l->childCount()) {
103 l->setHasMore(true);
104 }
105 }
106 }
107
108 if (thread == d->activeThread && frame == d->activeFrame) {
109 return;
110 }
111
112 qCDebug(DEBUGGER) << "handling a change: thread" << d->activeThread << "=>" << thread << ';' << "frame"
113 << d->activeFrame << "=>" << frame;
114 d->activeThread = thread;
115 d->activeFrame = frame;
116
117 variableCollection()->root()->resetChanged();
118 if (d->autoUpdate != UpdateNone) {
119 update();
120 }
121}
122
123void IVariableController::setAutoUpdate(QFlags<UpdateType> autoUpdate)
124{

Callers 1

raiseEventMethod · 0.45

Calls 10

variableCollectionFunction · 0.85
currentThreadMethod · 0.80
currentFrameMethod · 0.80
allLocalsMethod · 0.80
isExpandedMethod · 0.80
setHasMoreMethod · 0.80
resetChangedMethod · 0.80
rootMethod · 0.80
frameStackModelMethod · 0.45
childCountMethod · 0.45

Tested by

no test coverage detected