Commit 2217eef3 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlDebug: Allow different styles of command line arguments



We have tcp, local, and native by now. We have to expose that in a
clean way.

Change-Id: I0ce7be693aa7f47ebea7abe435a224a176b6c94b
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent e1dd3cf7
......@@ -60,18 +60,31 @@ static inline QString qmlDebugServices(QmlDebugServicesPreset preset)
}
static inline QString qmlDebugCommandLineArguments(QmlDebugServicesPreset services,
quint16 port = 0)
const QString &connectionMode, bool block)
{
if (services == NoQmlDebugServices)
return QString();
if (services == QmlNativeDebuggerServices)
return QString::fromLatin1("-qmljsdebugger=native,services:%1")
.arg(qmlDebugServices(services));
return QString::fromLatin1("-qmljsdebugger=%1%2,services:%3").arg(connectionMode)
.arg(QLatin1String(block ? ",block" : "")).arg(qmlDebugServices(services));
}
static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services, quint16 port = 0,
bool block = true)
{
return qmlDebugCommandLineArguments(services, port ? QString::fromLatin1("port:%1").arg(port) :
QStringLiteral("port:%qml_port%"), block);
}
return QString::fromLatin1("-qmljsdebugger=port:%1,block,services:%2")
.arg(port ? QString::number(port) : QStringLiteral("%qml_port%"))
.arg(qmlDebugServices(services));
static inline QString qmlDebugNativeArguments(QmlDebugServicesPreset services, bool block = true)
{
return qmlDebugCommandLineArguments(services, QLatin1String("native"), block);
}
static inline QString qmlDebugLocalArguments(QmlDebugServicesPreset services, const QString &socket,
bool block = true)
{
return qmlDebugCommandLineArguments(services, QLatin1String("file:") + socket, block);
}
} // namespace QmlDebug
......
......@@ -532,7 +532,9 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
service = QmlDebug::QmlDebuggerServices;
}
if (m_rp.startMode != AttachExternal)
QtcProcess::addArg(&m_rp.processArgs, QmlDebug::qmlDebugCommandLineArguments(service, m_rp.qmlServerPort));
QtcProcess::addArg(&m_rp.processArgs, wantCppDebugger && m_rp.nativeMixedEnabled ?
QmlDebug::qmlDebugNativeArguments(service, false) :
QmlDebug::qmlDebugTcpArguments(service, m_rp.qmlServerPort));
}
}
......
......@@ -82,7 +82,7 @@ QStringList IosRunner::extraArgs()
{
QStringList res = m_arguments;
if (m_qmlPort != 0)
res << QmlDebug::qmlDebugCommandLineArguments(m_qmlDebugServices, m_qmlPort);
res << QmlDebug::qmlDebugTcpArguments(m_qmlDebugServices, m_qmlPort);
return res;
}
......
......@@ -121,8 +121,8 @@ LocalQmlProfilerRunner::~LocalQmlProfilerRunner()
void LocalQmlProfilerRunner::start()
{
QString arguments = QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices,
m_configuration.port);
QString arguments = QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices,
m_configuration.port);
if (!m_configuration.executableArguments.isEmpty())
arguments += QLatin1Char(' ') + m_configuration.executableArguments;
......
......@@ -99,7 +99,7 @@ void QnxAnalyzeSupport::startExecution()
const QStringList args = QStringList()
<< Utils::QtcProcess::splitArgs(m_runControl->startParameters().debuggeeArgs)
<< QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices, m_qmlPort);
<< QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, m_qmlPort);
appRunner()->setEnvironment(environment());
appRunner()->setWorkingDirectory(workingDirectory());
......
......@@ -106,7 +106,7 @@ void QnxDebugSupport::startExecution()
if (m_useQmlDebugger)
m_runControl->startParameters().processArgs +=
QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlDebuggerServices, m_qmlPort);
QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, m_qmlPort);
QStringList arguments;
if (m_useCppDebugger)
......
......@@ -157,7 +157,7 @@ void RemoteLinuxAnalyzeSupport::startExecution()
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError);
const QStringList args = arguments()
<< QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices, d->qmlPort);
<< QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, d->qmlPort);
runner->setWorkingDirectory(workingDirectory());
runner->setEnvironment(environment());
......
......@@ -102,7 +102,7 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractR
aspect->setUseMultiProcess(true);
QStringList args = runConfig->arguments();
if (aspect->useQmlDebugger())
args.prepend(QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlDebuggerServices));
args.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
params.processArgs = Utils::QtcProcess::joinArgs(args, Utils::OsTypeLinux);
params.executable = runConfig->localExecutableFilePath();
......@@ -166,8 +166,7 @@ void LinuxDeviceDebugSupport::startExecution()
QString command;
if (d->qmlDebugging)
args.prepend(QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlDebuggerServices,
d->qmlPort));
args.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, d->qmlPort));
if (d->qmlDebugging && !d->cppDebugging) {
command = remoteFilePath();
......
......@@ -114,7 +114,7 @@ RunControl *WinRtDebugSupport::createDebugRunControl(WinRtRunConfiguration *runC
if (!getFreePort(qmlDebugPort, errorMessage))
return 0;
runConfig->setArguments(runConfig->arguments() + QLatin1Char(' ')
+ QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlDebuggerServices, qmlDebugPort));
+ QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, qmlDebugPort));
params.qmlServerAddress = QHostAddress::LocalHost;
params.qmlServerPort = qmlDebugPort;
}
......
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