Commit 3bafbe71 authored by hjk's avatar hjk

Debugger: Fix Android startup

Change-Id: I495412434ccffdb33528bbbe030c7a4bfa7e387c
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 2fffafe2
......@@ -846,6 +846,21 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
if (d->remoteSetupState() != RemoteSetupCancelled)
d->setRemoteSetupState(RemoteSetupSucceeded);
if (result.gdbServerPort != InvalidPid) {
QString &rc = d->m_startParameters.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.gdbServerPort));
}
}
if (result.qmlServerPort != InvalidPort) {
d->m_startParameters.qmlServerPort = result.qmlServerPort;
d->m_startParameters.processArgs.replace(_("%qml_port%"), QString::number(result.qmlServerPort));
}
} else {
showMessage(_("NOTE: REMOTE SETUP FAILED: ") + result.reason);
}
......
......@@ -476,6 +476,7 @@ void GdbRemoteServerEngine::notifyEngineRemoteServerRunning
m_isMulti = true;
m_targetPid = inferiorPid;
m_serverChannel = serverChannel;
m_startAttempted = true;
startGdb();
}
......@@ -489,27 +490,13 @@ void GdbRemoteServerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupRes
return;
}
DebuggerStartParameters &params = isMasterEngine()
? startParameters() : masterEngine()->startParameters();
if (result.gdbServerPort != -1) {
QString &rc = params.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.gdbServerPort));
}
}
if (result.qmlServerPort != -1) {
params.qmlServerPort = result.qmlServerPort;
params.processArgs.replace(_("%qml_port%"), QString::number(result.qmlServerPort));
}
// TODO: Aren't these redundant?
m_isMulti = params.multiProcess;
m_isMulti = startParameters().multiProcess;
m_targetPid = -1;
m_serverChannel = params.remoteChannel.toLatin1();
m_serverChannel = startParameters().remoteChannel.toLatin1();
startGdb();
if (!m_startAttempted)
startGdb();
}
} // namespace Internal
......
......@@ -91,6 +91,7 @@ private:
QProcess m_uploadProc;
bool m_isMulti;
bool m_startAttempted;
int m_targetPid;
QByteArray m_serverChannel;
};
......
......@@ -1342,7 +1342,9 @@ void LldbEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
if (!result.success) {
if (result.success) {
startLldb();
} else {
showMessage(_("ADAPTER START FAILED"));
if (!result.reason.isEmpty()) {
const QString title = tr("Adapter start failed");
......@@ -1351,21 +1353,6 @@ void LldbEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result
notifyEngineSetupFailed();
return;
}
if (result.qmlServerPort != InvalidPort)
startParameters().qmlServerPort = result.qmlServerPort;
if (result.inferiorPid != InvalidPid) {
if (startParameters().startMode == AttachExternal) {
startParameters().attachPID = result.inferiorPid;
} else {
QString &rc = startParameters().remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1)
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.inferiorPid));
}
}
startLldb();
}
///////////////////////////////////////////////////////////////////////
......
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