RemoteLinux: switch to extended-remote connection

Change-Id: If282a037e5b26f81859aaad8b407d644aa8b5c1c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Tim Sander
2014-06-05 15:10:43 +02:00
committed by hjk
parent 594b184bb1
commit 162d0e3d09
2 changed files with 13 additions and 3 deletions

View File

@@ -295,7 +295,6 @@ void GdbRemoteServerEngine::handleTargetExtendedRemote(const GdbResponse &respon
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
if (response.resultClass == GdbResultDone) {
// gdb server will stop the remote application itself.
showMessage(_("ATTACHED TO GDB SERVER STARTED"));
showMessage(msgAttachedToStoppedInferior(), StatusBar);
QString postAttachCommands = debuggerCore()->stringSetting(GdbPostAttachCommands);
@@ -303,7 +302,13 @@ void GdbRemoteServerEngine::handleTargetExtendedRemote(const GdbResponse &respon
foreach (const QString &cmd, postAttachCommands.split(QLatin1Char('\n')))
postCommand(cmd.toLatin1());
}
postCommand("attach " + QByteArray::number(m_targetPid), CB(handleTargetExtendedAttach));
if (m_targetPid > 0) { // attach to pid if valid
// gdb server will stop the remote application itself.
postCommand("attach " + QByteArray::number(m_targetPid), CB(handleTargetExtendedAttach));
} else {
postCommand("-gdb-set remote exec-file " + startParameters().remoteExecutable.toLatin1(),
CB(handleTargetExtendedAttach));
}
} else {
QString msg = msgConnectRemoteServerFailed(
QString::fromLocal8Bit(response.data["msg"].data()));