forked from qt-creator/qt-creator
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: Robert Loehning <robert.loehning@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -480,21 +480,27 @@ void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int q
|
|||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
|
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
|
||||||
|
|
||||||
if (m_isMulti) {
|
DebuggerStartParameters ¶ms = isMasterEngine()
|
||||||
// Has been done in notifyEngineRemoteServerRunning
|
? startParameters() : masterEngine()->startParameters();
|
||||||
} else {
|
if (gdbServerPort != -1) {
|
||||||
if (qmlPort != -1)
|
QString &rc = params.remoteChannel;
|
||||||
startParameters().qmlServerPort = qmlPort;
|
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
|
||||||
if (gdbServerPort != -1) {
|
if (sepIndex != -1) {
|
||||||
QString &rc = startParameters().remoteChannel;
|
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
|
||||||
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
|
QString::number(gdbServerPort));
|
||||||
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)
|
void GdbRemoteServerEngine::notifyEngineRemoteSetupFailed(const QString &reason)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
|
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
@@ -60,7 +61,6 @@ public:
|
|||||||
: engine(engine),
|
: engine(engine),
|
||||||
qmlDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger()),
|
qmlDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger()),
|
||||||
cppDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useCppDebugger()),
|
cppDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useCppDebugger()),
|
||||||
target(DeviceKitInformation::device(runConfig->target()->kit())->sshParameters().host.toLatin1()),
|
|
||||||
gdbServerPort(-1), qmlPort(-1)
|
gdbServerPort(-1), qmlPort(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,6 @@ public:
|
|||||||
bool qmlDebugging;
|
bool qmlDebugging;
|
||||||
bool cppDebugging;
|
bool cppDebugging;
|
||||||
QByteArray gdbserverOutput;
|
QByteArray gdbserverOutput;
|
||||||
QByteArray target;
|
|
||||||
int gdbServerPort;
|
int gdbServerPort;
|
||||||
int qmlPort;
|
int qmlPort;
|
||||||
};
|
};
|
||||||
@@ -99,8 +98,12 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractR
|
|||||||
params.qmlServerPort = 0; // port is selected later on
|
params.qmlServerPort = 0; // port is selected later on
|
||||||
}
|
}
|
||||||
if (aspect->useCppDebugger()) {
|
if (aspect->useCppDebugger()) {
|
||||||
|
params.multiProcess = true;
|
||||||
params.languages |= CppLanguage;
|
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.startMode = AttachToRemoteServer;
|
||||||
params.executable = runConfig->localExecutableFilePath();
|
params.executable = runConfig->localExecutableFilePath();
|
||||||
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
|
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
|
||||||
@@ -265,8 +268,6 @@ void LinuxDeviceDebugSupport::handleAdapterSetupFailed(const QString &error)
|
|||||||
void LinuxDeviceDebugSupport::handleAdapterSetupDone()
|
void LinuxDeviceDebugSupport::handleAdapterSetupDone()
|
||||||
{
|
{
|
||||||
AbstractRemoteLinuxRunSupport::handleAdapterSetupDone();
|
AbstractRemoteLinuxRunSupport::handleAdapterSetupDone();
|
||||||
QByteArray remote = d->target + ':' + QByteArray::number(d->gdbServerPort);
|
|
||||||
d->engine->notifyEngineRemoteServerRunning(remote, -1);
|
|
||||||
d->engine->notifyEngineRemoteSetupDone(d->gdbServerPort, d->qmlPort);
|
d->engine->notifyEngineRemoteSetupDone(d->gdbServerPort, d->qmlPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user