forked from qt-creator/qt-creator
always clear pending command queue before posting shutdown commands
this ensures that, among other things, we won't get into this scenario: - process is running - interrupt is requested by user - termination is requested by user - before interrupt takes effect, the process terminates => shutdown is called => exit is also queued, as there is already a queued kill => nothing happens, as there will never be a stop response Reviewed-by: hjk
This commit is contained in:
@@ -1406,7 +1406,6 @@ void GdbEngine::handleExecContinue(const GdbResponse &response)
|
|||||||
} else {
|
} else {
|
||||||
if (state() == InferiorRunningRequested_Kill) {
|
if (state() == InferiorRunningRequested_Kill) {
|
||||||
setState(InferiorStopped);
|
setState(InferiorStopped);
|
||||||
m_commandsToRunOnTemporaryBreak.clear();
|
|
||||||
shutdown();
|
shutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1423,7 +1422,6 @@ void GdbEngine::handleExecContinue(const GdbResponse &response)
|
|||||||
} else {
|
} else {
|
||||||
showMessageBox(QMessageBox::Critical, tr("Execution Error"),
|
showMessageBox(QMessageBox::Critical, tr("Execution Error"),
|
||||||
tr("Cannot continue debugged process:\n") + QString::fromLocal8Bit(msg));
|
tr("Cannot continue debugged process:\n") + QString::fromLocal8Bit(msg));
|
||||||
m_commandsToRunOnTemporaryBreak.clear();
|
|
||||||
shutdown();
|
shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1468,6 +1466,7 @@ void GdbEngine::shutdown()
|
|||||||
// fall-through
|
// fall-through
|
||||||
case AdapterStartFailed: // Adapter "did something", but it did not help
|
case AdapterStartFailed: // Adapter "did something", but it did not help
|
||||||
if (m_gdbProc.state() == QProcess::Running) {
|
if (m_gdbProc.state() == QProcess::Running) {
|
||||||
|
m_commandsToRunOnTemporaryBreak.clear();
|
||||||
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
|
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
|
||||||
} else {
|
} else {
|
||||||
setState(DebuggerNotReady);
|
setState(DebuggerNotReady);
|
||||||
@@ -1486,6 +1485,7 @@ void GdbEngine::shutdown()
|
|||||||
case InferiorShutDown:
|
case InferiorShutDown:
|
||||||
case InferiorShutdownFailed: // Whatever
|
case InferiorShutdownFailed: // Whatever
|
||||||
case InferiorUnrunnable:
|
case InferiorUnrunnable:
|
||||||
|
m_commandsToRunOnTemporaryBreak.clear();
|
||||||
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
|
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
|
||||||
setState(EngineShuttingDown); // Do it after posting the command!
|
setState(EngineShuttingDown); // Do it after posting the command!
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user