Commit e8305e3e authored by Christian Kandeler's avatar Christian Kandeler Committed by hjk

RemoteLinux: Fix mixed debugging.

The QML part was broken due to recent changes relating to gdbserver
"multi" mode.

Task-number: QTCREATORBUG-12928
Change-Id: Ia806f0cbfedd6961138f7cd89a0387bd851ff83e
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 2a649123
......@@ -480,21 +480,27 @@ void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int q
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
if (m_isMulti) {
// Has been done in notifyEngineRemoteServerRunning
} else {
if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort;
if (gdbServerPort != -1) {
QString &rc = startParameters().remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(gdbServerPort));
}
DebuggerStartParameters &params = isMasterEngine()
? startParameters() : masterEngine()->startParameters();
if (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(gdbServerPort));
}
startGdb();
}
if (qmlPort != -1) {
params.qmlServerPort = qmlPort;
params.processArgs.replace(_("%qml_port%"), QString::number(qmlPort));
}
// TODO: Aren't these redundant?
m_isMulti = params.multiProcess;
m_targetPid = -1;
m_serverChannel = params.remoteChannel.toLatin1();
startGdb();
}
void GdbRemoteServerEngine::notifyEngineRemoteSetupFailed(const QString &reason)
......
......@@ -42,6 +42,7 @@
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <QPointer>
......@@ -60,7 +61,6 @@ public:
: engine(engine),
qmlDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger()),
cppDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useCppDebugger()),
target(DeviceKitInformation::device(runConfig->target()->kit())->sshParameters().host.toLatin1()),
gdbServerPort(-1), qmlPort(-1)
{
}
......@@ -69,7 +69,6 @@ public:
bool qmlDebugging;
bool cppDebugging;
QByteArray gdbserverOutput;
QByteArray target;
int gdbServerPort;
int qmlPort;
};
......@@ -99,8 +98,12 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractR
params.qmlServerPort = 0; // port is selected later on
}
if (aspect->useCppDebugger()) {
params.multiProcess = true;
params.languages |= CppLanguage;
params.processArgs = runConfig->arguments().join(QLatin1String(" "));
QStringList args = runConfig->arguments();
if (aspect->useQmlDebugger())
args.prepend(QString::fromLatin1("-qmljsdebugger=port:%qml_port%,block"));
params.processArgs = Utils::QtcProcess::joinArgs(args, Utils::OsTypeLinux);
params.startMode = AttachToRemoteServer;
params.executable = runConfig->localExecutableFilePath();
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
......@@ -265,8 +268,6 @@ void LinuxDeviceDebugSupport::handleAdapterSetupFailed(const QString &error)
void LinuxDeviceDebugSupport::handleAdapterSetupDone()
{
AbstractRemoteLinuxRunSupport::handleAdapterSetupDone();
QByteArray remote = d->target + ':' + QByteArray::number(d->gdbServerPort);
d->engine->notifyEngineRemoteServerRunning(remote, -1);
d->engine->notifyEngineRemoteSetupDone(d->gdbServerPort, d->qmlPort);
}
......
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