Debugger: Merge EngineSetup and InferiorSetup start phases

It was needed in the past to trigger e.g. gdbserver setup in
remote cases which is nowadays handled by separate RunWorkers.

Change-Id: I30bce071dab0779cce2e7abef7b31550d8539461
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2017-11-15 17:12:03 +01:00
parent 2427f1267f
commit 8f1a161c64
16 changed files with 90 additions and 219 deletions

View File

@@ -541,17 +541,17 @@ void CdbEngine::setupEngine()
showMessage(QString("%1 running as %2").
arg(QDir::toNativeSeparators(executable)).arg(pid), LogMisc);
m_hasDebuggee = true;
m_initialSessionIdleHandled = false;
if (isRemote) { // We do not get an 'idle' in a remote session, but are accessible
m_accessible = true;
runCommand({".load " + extensionFileName, NoFlags});
notifyEngineSetupOk();
handleInitialSessionIdle();
}
}
void CdbEngine::setupInferior()
void CdbEngine::handleInitialSessionIdle()
{
if (debug)
qDebug("setupInferior");
m_initialSessionIdleHandled = true;
const DebuggerRunParameters &rp = runParameters();
if (!rp.commandsAfterConnect.isEmpty())
runCommand({rp.commandsAfterConnect, NoFlags});
@@ -582,13 +582,13 @@ void CdbEngine::setupInferior()
if (response.resultClass == ResultDone)
notifyInferiorPid(response.data.toProcessHandle());
if (response.resultClass == ResultDone || runParameters().startMode == AttachCore) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorSetupOk")
notifyInferiorSetupOk();
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupOk")
notifyEngineSetupOk();
} else {
showMessage(QString("Failed to determine inferior pid: %1").
arg(response.data["msg"].data()), LogError);
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorSetupFailed")
notifyInferiorSetupFailed();
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed")
notifyEngineSetupFailed();
}
}});
}
@@ -2136,9 +2136,8 @@ void CdbEngine::handleSessionIdle(const QString &message)
break;
}
if (state() == EngineSetupRequested) { // Temporary stop at beginning
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupOk")
notifyEngineSetupOk();
if (!m_initialSessionIdleHandled) { // Temporary stop at beginning
handleInitialSessionIdle();
// Store stop reason to be handled in runEngine().
if (runParameters().startMode == AttachCore) {
m_coreStopReason.reset(new GdbMi);