Commit e5f76153 authored by hjk's avatar hjk

Debugger: Fix use of server start script

... when using Debug->Start->Attach to Running Debug Server

Task-number: QTCREATORBUG-14747
Task-number: QTCREATORBUG-7459
Change-Id: I98c3d4f2d565d972369f2716ff2b72b4d3d04b2b
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 67363314
......@@ -1364,7 +1364,6 @@ void DebuggerPluginPrivate::attachToRemoteServer()
rp.startMode = AttachToRemoteServer;
if (StartApplicationDialog::run(ICore::dialogParent(), &rp, &kit)) {
rp.closeMode = KillAtClose;
rp.serverStartScript.clear();
createAndScheduleRun(rp, kit);
}
}
......
......@@ -78,24 +78,27 @@ void GdbRemoteServerEngine::setupEngine()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(_("TRYING TO START ADAPTER"));
if (!runParameters().serverStartScript.isEmpty()) {
QString serverStartScript = runParameters().serverStartScript;
if (!serverStartScript.isEmpty()) {
// Provide script information about the environment
QString arglist;
QtcProcess::addArg(&arglist, runParameters().serverStartScript);
QtcProcess::addArg(&arglist, serverStartScript);
QtcProcess::addArg(&arglist, runParameters().executable);
QtcProcess::addArg(&arglist, runParameters().remoteChannel);
m_uploadProc.start(_("/bin/sh ") + arglist);
m_uploadProc.start(arglist);
m_uploadProc.waitForStarted();
}
if (!runParameters().workingDirectory.isEmpty())
m_gdbProc.setWorkingDirectory(runParameters().workingDirectory);
if (runParameters().remoteSetupNeeded)
if (runParameters().remoteSetupNeeded) {
notifyEngineRequestRemoteSetup();
else
} else {
m_startAttempted = true;
startGdb();
}
}
void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error)
......@@ -151,7 +154,8 @@ void GdbRemoteServerEngine::readUploadStandardError()
void GdbRemoteServerEngine::uploadProcFinished()
{
if (m_uploadProc.exitStatus() == QProcess::NormalExit && m_uploadProc.exitCode() == 0) {
startGdb();
if (!m_startAttempted)
startGdb();
} else {
RemoteSetupResult result;
result.success = false;
......
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