FIXME: connect to debugger's slot.
| 1296 | |
| 1297 | // FIXME: connect to debugger's slot. |
| 1298 | void MIDebugSession::defaultErrorHandler(const MI::ResultRecord& result) |
| 1299 | { |
| 1300 | const auto errorMessage = result.errorMessage(); |
| 1301 | |
| 1302 | if (errorMessage.contains(QLatin1String("No such process"))) { |
| 1303 | setDebuggerState(s_appNotStarted|s_programExited); |
| 1304 | raiseEvent(program_exited); |
| 1305 | return; |
| 1306 | } |
| 1307 | |
| 1308 | const QString messageText = i18n("<b>Debugger error:</b><br />") + errorMessage; |
| 1309 | auto* message = new Sublime::Message(messageText, Sublime::Message::Error); |
| 1310 | ICore::self()->uiController()->postMessage(message); |
| 1311 | |
| 1312 | // Error most likely means that some change made in GUI |
| 1313 | // was not communicated to the gdb, so GUI is now not |
| 1314 | // in sync with gdb. Resync it. |
| 1315 | // |
| 1316 | // Another approach is to make each widget reload it content |
| 1317 | // on errors from commands that it sent, but that's too complex. |
| 1318 | // Errors are supposed to happen rarely, so full reload on error |
| 1319 | // is not a big deal. Well, maybe except for memory view, but |
| 1320 | // it's no auto-reloaded anyway. |
| 1321 | // |
| 1322 | // Also, don't reload state on errors appeared during state |
| 1323 | // reloading! |
| 1324 | if (!m_debugger->currentCommand()->stateReloading()) |
| 1325 | raiseEvent(program_state_changed); |
| 1326 | } |
| 1327 | |
| 1328 | void MIDebugSession::setSourceInitFile(bool enable) |
| 1329 | { |
nothing calls this directly
no test coverage detected