MCPcopy Create free account
hub / github.com/KDE/kdevelop / currentSessionChanged

Method currentSessionChanged

plugins/gdb/gdboutputwidget.cpp:119–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void 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/***************************************************************************/

Callers

nothing calls this directly

Calls 2

debuggerStateMethod · 0.80
clearFunction · 0.50

Tested by

no test coverage detected