| 46 | } |
| 47 | |
| 48 | void 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 | |
| 77 | void IVariableController::handleEvent(IDebugSession::event_t event) |
| 78 | { |
nothing calls this directly
no test coverage detected