Debugger: Rework 'Attach to unstarted application' startup

Change-Id: I42c7ce8e413c850e05b02f5d6fe1b83376436c65
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-02-25 16:30:23 +01:00
parent 027328059b
commit bf87fc9640
8 changed files with 72 additions and 74 deletions

View File

@@ -89,12 +89,17 @@ void GdbAttachEngine::handleAttach(const DebuggerResponse &response)
case ResultRunning:
showMessage(_("INFERIOR ATTACHED"));
if (state() == EngineRunRequested) {
// FIXME: Really? Looks like we are always stopped already.
// Happens e.g. for "Attach to unstarted application"
// We will get a '*stopped' later that we'll interpret as 'spontaneous'
// So acknowledge the current state and put a delayed 'continue' in the pipe.
showMessage(msgAttachedToStoppedInferior(), StatusBar);
showMessage(tr("Attached to running application"), StatusBar);
notifyEngineRunAndInferiorRunOk();
interruptInferior();
} else {
// InferiorStopOk, e.g. for "Attach to running application".
// The *stopped came in between sending the 'attach' and
// receiving its '^done'.
if (startParameters().continueAfterAttach)
continueInferiorInternal();
}
break;
case ResultError: