debugger: fix message when trying to shut down with a finished debugger

This commit is contained in:
hjk
2010-07-20 15:16:17 +02:00
parent 04ad5619b6
commit 15629b037f

View File

@@ -2744,21 +2744,35 @@ bool DebuggerListener::coreAboutToClose()
DebuggerPlugin *plugin = DebuggerPlugin::instance(); DebuggerPlugin *plugin = DebuggerPlugin::instance();
if (!plugin) if (!plugin)
return true; return true;
// FIXME: Iterate over all running debuggers.
// Ask to terminate the session. // Ask to terminate the session.
bool cleanTermination = false; bool cleanTermination = false;
switch (plugin->state()) { switch (plugin->state()) {
case DebuggerNotReady: case DebuggerNotReady:
return true; case DebuggerFinished:
case EngineSetupOk: // Most importantly, terminating a running
case EngineSetupFailed: // debuggee can cause problems.
case InferiorUnrunnable: case InferiorUnrunnable:
return true;
case EngineSetupRequested:
case EngineSetupOk:
case EngineSetupFailed:
case InferiorSetupRequested:
case InferiorSetupFailed: case InferiorSetupFailed:
case EngineRunRequested:
case InferiorRunRequested:
case InferiorRunOk:
case InferiorStopRequested:
case InferiorStopOk: case InferiorStopOk:
case InferiorShutdownRequested:
case EngineShutdownRequested:
case InferiorShutdownOk: case InferiorShutdownOk:
cleanTermination = true; case InferiorShutdownFailed:
break; case InferiorStopFailed:
default: case EngineRunFailed:
break; case InferiorRunFailed:
case EngineShutdownOk:
case EngineShutdownFailed:
return false;
} }
const QString question = cleanTermination ? const QString question = cleanTermination ?