Debugger: Stop in case of gdb crash in InferiorStop.

Reviewed-by: hjk
Task-number: QTCREATORBUG-3099
This commit is contained in:
Friedemann Kleint
2010-11-16 12:38:50 +01:00
parent 62285b48d9
commit 78a560a6df

View File

@@ -4300,6 +4300,9 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error)
void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type) void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type)
{ {
if (m_commandTimer && m_commandTimer->isActive())
m_commandTimer->stop();
//qDebug() << "GDB PROCESS FINISHED"; //qDebug() << "GDB PROCESS FINISHED";
showMessage(_("GDB PROCESS FINISHED, status %1, code %2").arg(type).arg(code)); showMessage(_("GDB PROCESS FINISHED, status %1, code %2").arg(type).arg(code));
/* /*
@@ -4314,20 +4317,25 @@ void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type)
} }
initializeVariables(); initializeVariables();
*/ */
if (state() == EngineShutdownRequested) { switch (state()) {
case EngineShutdownRequested:
notifyEngineShutdownOk(); notifyEngineShutdownOk();
} else if (state() == InferiorRunOk) { break;
case InferiorRunOk:
// This could either be a real gdb crash or a quickly exited inferior // This could either be a real gdb crash or a quickly exited inferior
// in the terminal adapter. In this case the stub proc will die soon, // in the terminal adapter. In this case the stub proc will die soon,
// too, so there's no need to act here. // too, so there's no need to act here.
showMessage(_("The gdb process exited somewhat unexpectedly.")); showMessage(_("The gdb process exited somewhat unexpectedly."));
notifyEngineSpontaneousShutdown(); notifyEngineSpontaneousShutdown();
} else { break;
QString msg = tr("The gdb process exited unexpectedly (%1).") default: {
.arg((type == QProcess::CrashExit) notifyEngineIll(); // Initiate shutdown sequence
? tr("crashed") : tr("code %1").arg(code)); const QString msg = type == QProcess::CrashExit ?
tr("The gdb process crashed.") :
tr("The gdb process exited unexpectedly (code %1)").arg(code);
showMessageBox(QMessageBox::Critical, tr("Unexpected Gdb Exit"), msg); showMessageBox(QMessageBox::Critical, tr("Unexpected Gdb Exit"), msg);
notifyEngineSpontaneousShutdown(); }
break;
} }
} }