Commit 079fc49e authored by Kai Koehne's avatar Kai Koehne
Browse files

RemoteGdb: Fix setup for attaching via dialog

Fix regression introduced in 9e8f935a

 while at the same time decoupling
the 'useServerStartScript' setting from whether the engine uses
requestRemoteSetup, or not.

Task-number: QTCREATORBUG-6841
Change-Id: I0850ec60e0f45ac66ba6736bcb9f75fdf73c1d23
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 3629b30e
......@@ -69,6 +69,7 @@ public:
qmlServerPort(ProjectExplorer::Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
useServerStartScript(false),
connParams(Utils::SshConnectionParameters::NoProxy),
requestRemoteSetup(false),
startMode(NoStartMode),
executableUid(0),
communicationChannel(CommunicationChannelTcpIp),
......@@ -115,6 +116,7 @@ public:
QString remoteMountPoint;
QString localMountDir;
Utils::SshConnectionParameters connParams;
bool requestRemoteSetup;
QString debuggerCommand;
ProjectExplorer::Abi toolChainAbi;
......
......@@ -95,7 +95,10 @@ void RemoteGdbServerAdapter::startAdapter()
m_uploadProc.waitForStarted();
}
}
m_engine->requestRemoteSetup();
if (startParameters().requestRemoteSetup)
m_engine->requestRemoteSetup();
else
handleSetupDone();
}
void RemoteGdbServerAdapter::uploadProcError(QProcess::ProcessError error)
......
......@@ -54,7 +54,16 @@ void RemotePlainGdbAdapter::startAdapter()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(QLatin1String("TRYING TO START ADAPTER"));
m_engine->requestRemoteSetup();
if (!startParameters().workingDirectory.isEmpty())
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
if (startParameters().environment.size())
m_gdbProc.setEnvironment(startParameters().environment.toStringList());
if (startParameters().requestRemoteSetup)
m_engine->requestRemoteSetup();
else
handleRemoteSetupDone(startParameters().connParams.port, startParameters().qmlServerPort);
}
void RemotePlainGdbAdapter::setupInferior()
......@@ -106,10 +115,6 @@ void RemotePlainGdbAdapter::handleRemoteSetupDone(int gdbServerPort, int qmlPort
if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort;
if (!startParameters().workingDirectory.isEmpty())
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
if (startParameters().environment.size())
m_gdbProc.setEnvironment(startParameters().environment.toStringList());
m_gdbProc.realStart(m_engine->startParameters().debuggerCommand,
QStringList() << QLatin1String("-i") << QLatin1String("mi"),
m_engine->startParameters().executable);
......
......@@ -450,8 +450,7 @@ void QmlEngine::shutdownEngine()
void QmlEngine::setupEngine()
{
if (startParameters().startMode == AttachToQmlPort
|| startParameters().startMode == AttachToRemoteServer) {
if (startParameters().requestRemoteSetup) {
// we need to get the port first
emit requestRemoteSetup();
} else {
......
......@@ -84,10 +84,12 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
sp.remoteChannel = activeDeployConf->serialPortName();
sp.processArgs = rc->commandLineArguments();
if (rc->useQmlDebugger() && !rc->useCppDebugger())
if (rc->useQmlDebugger() && !rc->useCppDebugger()) {
sp.requestRemoteSetup = true;
sp.startMode = Debugger::AttachToRemoteServer;
else
} else {
sp.startMode = Debugger::StartInternal;
}
sp.toolChainAbi = rc->abi();
sp.executable = debugFileName;
......
......@@ -109,7 +109,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
params.executable = runConfig->localExecutableFilePath();
params.debuggerCommand = runConfig->gdbCmd();
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
params.useServerStartScript = true;
params.requestRemoteSetup = true;
// TODO: This functionality should be inside the debugger.
const ProjectExplorer::Abi &abi = runConfig->target()
......
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