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

Method currentSessionChanged

plugins/debuggercommon/widgets/disassemblewidget.cpp:299–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void DisassembleWidget::currentSessionChanged(KDevelop::IDebugSession* iSession,
300 KDevelop::IDebugSession* iPreviousSession)
301{
302 if (auto* const previousSession = qobject_cast<MIDebugSession*>(iPreviousSession)) {
303 disconnect(previousSession, nullptr, this, nullptr);
304
305 // The disassembly flavor in the next debug session may differ from that in the previous one.
306 m_disassemblyFlavorActionsUpToDate = false;
307
308 // Clear out all addresses of the previous debug session because
309 // they are unlikely to be valid or useful in the next session.
310 m_upToDate = true;
311 m_regionDisassemblyFlavorUpToDate = true;
312 m_currentAddress.reset();
313 m_regionFirst.reset();
314 m_regionLast.reset();
315 m_disassembleWindow->clear();
316 m_dlg->clearHistory();
317 }
318
319 auto* const session = qobject_cast<MIDebugSession*>(iSession);
320
321 enableControls( session != nullptr ); // disable if session closed
322
323 m_registersManager->setSession(session);
324
325 if (session) {
326 connect(session, &MIDebugSession::showStepInSource,
327 this, &DisassembleWidget::slotShowStepInSource);
328 connect(session,&MIDebugSession::showStepInDisassemble,this, &DisassembleWidget::update);
329 }
330}
331
332
333/***************************************************************************/

Callers

nothing calls this directly

Calls 4

clearHistoryMethod · 0.80
setSessionMethod · 0.80
resetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected