This is the central hub of event dispatch. All events first arrive here and then get dispatched based on the content
| 1117 | |
| 1118 | // This is the central hub of event dispatch. All events first arrive here and then get dispatched based on the content |
| 1119 | void DebuggerController::EventHandler(const DebuggerEvent& event) |
| 1120 | { |
| 1121 | switch (event.type) |
| 1122 | { |
| 1123 | case ResumeEventType: |
| 1124 | case StepIntoEventType: |
| 1125 | { |
| 1126 | // Todo: this is just a temporary workaround. Otherwise, the connection status would not be set properly |
| 1127 | m_state->SetConnectionStatus(DebugAdapterConnectedStatus); |
| 1128 | m_state->SetExecutionStatus(DebugAdapterRunningStatus); |
| 1129 | m_state->MarkDirty(); |
| 1130 | break; |
| 1131 | } |
| 1132 | case TargetExitedEventType: |
| 1133 | m_exitCode = event.data.exitData.exitCode; |
| 1134 | case QuitDebuggingEventType: |
| 1135 | case DetachedEventType: |
| 1136 | case LaunchFailureEventType: |
| 1137 | { |
| 1138 | m_inputFileLoaded = false; |
| 1139 | m_initialBreakpointSeen = false; |
| 1140 | // The m_liveView can be nullptr if the launch attempt fails because of the safe mode |
| 1141 | if (m_liveView) |
| 1142 | m_liveView->GetFile()->UnregisterViewOfType("Debugger", m_liveView); |
| 1143 | SetLiveView(nullptr); |
| 1144 | m_currentIP = 0; |
| 1145 | m_lastIP = 0; |
| 1146 | m_state->SetConnectionStatus(DebugAdapterNotConnectedStatus); |
| 1147 | m_state->SetExecutionStatus(DebugAdapterInvalidStatus); |
| 1148 | break; |
| 1149 | } |
| 1150 | case TargetStoppedEventType: |
| 1151 | { |
| 1152 | m_state->UpdateCaches(); |
| 1153 | m_state->SetConnectionStatus(DebugAdapterConnectedStatus); |
| 1154 | m_state->SetExecutionStatus(DebugAdapterPausedStatus); |
| 1155 | m_lastIP = m_currentIP; |
| 1156 | m_currentIP = m_state->IP(); |
| 1157 | |
| 1158 | DetectLoadedModule(); |
| 1159 | UpdateStackVariables(); |
| 1160 | AddRegisterValuesToExpressionParser(); |
| 1161 | break; |
| 1162 | } |
| 1163 | case ActiveThreadChangedEvent: |
| 1164 | { |
| 1165 | m_state->UpdateCaches(); |
| 1166 | m_lastIP = m_currentIP; |
| 1167 | m_currentIP = m_state->IP(); |
| 1168 | AddRegisterValuesToExpressionParser(); |
| 1169 | break; |
| 1170 | } |
| 1171 | case RegisterChangedEvent: |
| 1172 | { |
| 1173 | m_lastIP = m_currentIP; |
| 1174 | m_currentIP = m_state->IP(); |
| 1175 | AddRegisterValuesToExpressionParser(); |
| 1176 | break; |
nothing calls this directly
no test coverage detected