Commit 199dfbb4 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

fix gdb shutdown logic on gdb crash

Reviewed-by: hjk
parent aa898a53
...@@ -205,14 +205,17 @@ void GdbEngine::initializeVariables() ...@@ -205,14 +205,17 @@ void GdbEngine::initializeVariables()
void GdbEngine::gdbProcError(QProcess::ProcessError error) void GdbEngine::gdbProcError(QProcess::ProcessError error)
{ {
QString msg; QString msg;
bool kill = true;
switch (error) { switch (error) {
case QProcess::FailedToStart: case QProcess::FailedToStart:
kill = false;
msg = tr("The Gdb process failed to start. Either the " msg = tr("The Gdb process failed to start. Either the "
"invoked program '%1' is missing, or you may have insufficient " "invoked program '%1' is missing, or you may have insufficient "
"permissions to invoke the program.") "permissions to invoke the program.")
.arg(theDebuggerStringSetting(GdbLocation)); .arg(theDebuggerStringSetting(GdbLocation));
break; break;
case QProcess::Crashed: case QProcess::Crashed:
kill = false;
msg = tr("The Gdb process crashed some time after starting " msg = tr("The Gdb process crashed some time after starting "
"successfully."); "successfully.");
break; break;
...@@ -238,7 +241,8 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error) ...@@ -238,7 +241,8 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error)
q->showStatusMessage(msg); q->showStatusMessage(msg);
QMessageBox::critical(q->mainWindow(), tr("Error"), msg); QMessageBox::critical(q->mainWindow(), tr("Error"), msg);
// act as if it was closed by the core // act as if it was closed by the core
q->exitDebugger(); if (kill)
q->exitDebugger();
} }
void GdbEngine::uploadProcError(QProcess::ProcessError error) void GdbEngine::uploadProcError(QProcess::ProcessError error)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment