| 117 | } |
| 118 | |
| 119 | void GDBOutputWidget::currentSessionChanged(KDevelop::IDebugSession* iSession, |
| 120 | KDevelop::IDebugSession* iPreviousSession) |
| 121 | { |
| 122 | if (auto* const previousSession = qobject_cast<DebugSession*>(iPreviousSession)) { |
| 123 | disconnect(this, nullptr, previousSession, nullptr); |
| 124 | disconnect(previousSession, nullptr, this, nullptr); |
| 125 | clear(); |
| 126 | } |
| 127 | |
| 128 | auto* const session = qobject_cast<DebugSession*>(iSession); |
| 129 | if (!session) { |
| 130 | handleDebuggerNotRunning(); |
| 131 | return; |
| 132 | } |
| 133 | |
| 134 | connect(this, &GDBOutputWidget::userGDBCmd, session, &DebugSession::addUserCommand); |
| 135 | connect(this, &GDBOutputWidget::breakInto, session, &DebugSession::interruptDebugger); |
| 136 | |
| 137 | connect(session, &DebugSession::debuggerInternalCommandOutput, this, &GDBOutputWidget::slotInternalCommandStdout); |
| 138 | connect(session, &DebugSession::debuggerUserCommandOutput, this, &GDBOutputWidget::slotUserCommandStdout); |
| 139 | connect(session, &DebugSession::debuggerInternalOutput, this, &GDBOutputWidget::receivedStderrOrLog); |
| 140 | |
| 141 | connect(session, &DebugSession::debuggerStateChanged, this, [this](DBGStateFlags oldState, DBGStateFlags newState) { |
| 142 | Q_UNUSED(oldState); |
| 143 | debuggerStateChanged(newState); |
| 144 | }); |
| 145 | |
| 146 | debuggerStateChanged(session->debuggerState()); |
| 147 | } |
| 148 | |
| 149 | |
| 150 | /***************************************************************************/ |
nothing calls this directly
no test coverage detected