Debugger: Avoid crash when debugging with remote cdb engine

When trying to attach to an already running cdb session remotely we
currently fail.
When debugger is aborted on QC side and the remote cdb afterwards we
crashed when selecting a no more existing perspective.

Change-Id: I9d3c20f034b25ef85449b0b4e658aab2c3988db8
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2022-06-27 14:52:22 +02:00
parent b5066d71b8
commit ebf57d37b9

View File

@@ -1372,7 +1372,8 @@ void DebuggerEngine::notifyInferiorSpontaneousStop()
{
showMessage("NOTE: INFERIOR SPONTANEOUS STOP");
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
d->m_perspective->select();
if (QTC_GUARD(d->m_perspective))
d->m_perspective->select();
showMessage(tr("Stopped."), StatusBar);
setState(InferiorStopOk);
if (debuggerSettings()->raiseOnInterrupt.value())