Fairly obvious that we'll add whatever command you give me to a queue Not quite so obvious though is that if we are going to run again. then any information requests become redundant and must be removed. We also try and run whatever command happens to be at the head of the queue.
| 837 | // We also try and run whatever command happens to be at the head of |
| 838 | // the queue. |
| 839 | void MIDebugSession::queueCmd(std::unique_ptr<MICommand> cmd) |
| 840 | { |
| 841 | if (debuggerStateIsOn(s_dbgNotStarted)) { |
| 842 | const QString messageText = |
| 843 | i18n("<b>Gdb command sent when debugger is not running</b><br>" |
| 844 | "The command was:<br> %1", cmd->initialString()); |
| 845 | auto* message = new Sublime::Message(messageText, Sublime::Message::Information); |
| 846 | ICore::self()->uiController()->postMessage(message); |
| 847 | return; |
| 848 | } |
| 849 | |
| 850 | if (m_stateReloadInProgress) |
| 851 | cmd->setStateReloading(true); |
| 852 | |
| 853 | qCDebug(DEBUGGERCOMMON) << "QUEUE: " << cmd->initialString() |
| 854 | << (m_stateReloadInProgress ? "(state reloading)" : "") |
| 855 | << m_commandQueue->count() << "pending"; |
| 856 | |
| 857 | if (cmd->needsContext()) { |
| 858 | if (cmd->thread() == -1) |
| 859 | qCDebug(DEBUGGERCOMMON) << "\t--thread will be added on execution"; |
| 860 | |
| 861 | if (cmd->frame() == -1) |
| 862 | qCDebug(DEBUGGERCOMMON) << "\t--frame will be added on execution"; |
| 863 | } |
| 864 | |
| 865 | m_commandQueue->enqueue(std::move(cmd)); |
| 866 | |
| 867 | setDebuggerStateOn(s_dbgBusy); |
| 868 | raiseEvent(debugger_busy); |
| 869 | |
| 870 | executeCmd(); |
| 871 | } |
| 872 | |
| 873 | void MIDebugSession::executeCmd() |
| 874 | { |
nothing calls this directly
no test coverage detected