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: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Kai Koehne
2012-01-23 14:57:51 +01:00
parent 3629b30e8d
commit 079fc49e91
6 changed files with 22 additions and 11 deletions

View File

@@ -69,6 +69,7 @@ public:
qmlServerPort(ProjectExplorer::Constants::QML_DEFAULT_DEBUG_SERVER_PORT), qmlServerPort(ProjectExplorer::Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
useServerStartScript(false), useServerStartScript(false),
connParams(Utils::SshConnectionParameters::NoProxy), connParams(Utils::SshConnectionParameters::NoProxy),
requestRemoteSetup(false),
startMode(NoStartMode), startMode(NoStartMode),
executableUid(0), executableUid(0),
communicationChannel(CommunicationChannelTcpIp), communicationChannel(CommunicationChannelTcpIp),
@@ -115,6 +116,7 @@ public:
QString remoteMountPoint; QString remoteMountPoint;
QString localMountDir; QString localMountDir;
Utils::SshConnectionParameters connParams; Utils::SshConnectionParameters connParams;
bool requestRemoteSetup;
QString debuggerCommand; QString debuggerCommand;
ProjectExplorer::Abi toolChainAbi; ProjectExplorer::Abi toolChainAbi;

View File

@@ -95,7 +95,10 @@ void RemoteGdbServerAdapter::startAdapter()
m_uploadProc.waitForStarted(); m_uploadProc.waitForStarted();
} }
} }
if (startParameters().requestRemoteSetup)
m_engine->requestRemoteSetup(); m_engine->requestRemoteSetup();
else
handleSetupDone();
} }
void RemoteGdbServerAdapter::uploadProcError(QProcess::ProcessError error) void RemoteGdbServerAdapter::uploadProcError(QProcess::ProcessError error)

View File

@@ -54,7 +54,16 @@ void RemotePlainGdbAdapter::startAdapter()
{ {
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(QLatin1String("TRYING TO START ADAPTER")); showMessage(QLatin1String("TRYING TO START ADAPTER"));
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(); m_engine->requestRemoteSetup();
else
handleRemoteSetupDone(startParameters().connParams.port, startParameters().qmlServerPort);
} }
void RemotePlainGdbAdapter::setupInferior() void RemotePlainGdbAdapter::setupInferior()
@@ -106,10 +115,6 @@ void RemotePlainGdbAdapter::handleRemoteSetupDone(int gdbServerPort, int qmlPort
if (qmlPort != -1) if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort; 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, m_gdbProc.realStart(m_engine->startParameters().debuggerCommand,
QStringList() << QLatin1String("-i") << QLatin1String("mi"), QStringList() << QLatin1String("-i") << QLatin1String("mi"),
m_engine->startParameters().executable); m_engine->startParameters().executable);

View File

@@ -450,8 +450,7 @@ void QmlEngine::shutdownEngine()
void QmlEngine::setupEngine() void QmlEngine::setupEngine()
{ {
if (startParameters().startMode == AttachToQmlPort if (startParameters().requestRemoteSetup) {
|| startParameters().startMode == AttachToRemoteServer) {
// we need to get the port first // we need to get the port first
emit requestRemoteSetup(); emit requestRemoteSetup();
} else { } else {

View File

@@ -84,10 +84,12 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
sp.remoteChannel = activeDeployConf->serialPortName(); sp.remoteChannel = activeDeployConf->serialPortName();
sp.processArgs = rc->commandLineArguments(); sp.processArgs = rc->commandLineArguments();
if (rc->useQmlDebugger() && !rc->useCppDebugger()) if (rc->useQmlDebugger() && !rc->useCppDebugger()) {
sp.requestRemoteSetup = true;
sp.startMode = Debugger::AttachToRemoteServer; sp.startMode = Debugger::AttachToRemoteServer;
else } else {
sp.startMode = Debugger::StartInternal; sp.startMode = Debugger::StartInternal;
}
sp.toolChainAbi = rc->abi(); sp.toolChainAbi = rc->abi();
sp.executable = debugFileName; sp.executable = debugFileName;

View File

@@ -109,7 +109,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
params.executable = runConfig->localExecutableFilePath(); params.executable = runConfig->localExecutableFilePath();
params.debuggerCommand = runConfig->gdbCmd(); params.debuggerCommand = runConfig->gdbCmd();
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1"); params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
params.useServerStartScript = true; params.requestRemoteSetup = true;
// TODO: This functionality should be inside the debugger. // TODO: This functionality should be inside the debugger.
const ProjectExplorer::Abi &abi = runConfig->target() const ProjectExplorer::Abi &abi = runConfig->target()