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

Method stateChanged

kdevplatform/debugger/interfaces/ivariablecontroller.cpp:48–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void IVariableController::stateChanged(IDebugSession::DebuggerState state)
49{
50 Q_D(IVariableController);
51
52 if (!ICore::self() || ICore::self()->shuttingDown()) {
53 return;
54 }
55
56 if (state == IDebugSession::ActiveState) {
57 //variables are now outdated, update them
58 d->activeThread = -1;
59 d->activeFrame = -1;
60 } else if (state == IDebugSession::EndedState || state == IDebugSession::NotStartedState) {
61 // Remove all locals.
62 const auto locals = variableCollection()->allLocals();
63 for (Locals* l : locals) {
64 l->deleteChildren();
65 l->setHasMore(false);
66 }
67
68 for (int i=0; i < variableCollection()->watches()->childCount(); ++i) {
69 auto *var = qobject_cast<Variable*>(variableCollection()->watches()->child(i));
70 if (var) {
71 var->setInScope(false);
72 }
73 }
74 }
75}
76
77void IVariableController::handleEvent(IDebugSession::event_t event)
78{

Callers

nothing calls this directly

Calls 8

variableCollectionFunction · 0.85
shuttingDownMethod · 0.80
allLocalsMethod · 0.80
deleteChildrenMethod · 0.80
setHasMoreMethod · 0.80
setInScopeMethod · 0.80
childCountMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected