forked from qt-creator/qt-creator
Make sure we always quote the qmldebug command line arguments
Change-Id: I5ce68c238e0ab05d19715659a9cc2161e51e1a7e Task-number: QTCREATORBUG-20260 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -477,16 +477,16 @@ void DebuggerRunTool::setCoreFileName(const QString &coreFile, bool isSnapshot)
|
||||
|
||||
void DebuggerRunTool::appendInferiorCommandLineArgument(const QString &arg)
|
||||
{
|
||||
if (!m_runParameters.inferior.commandLineArguments.isEmpty())
|
||||
m_runParameters.inferior.commandLineArguments.append(' ');
|
||||
m_runParameters.inferior.commandLineArguments.append(arg);
|
||||
QtcProcess::addArg(&m_runParameters.inferior.commandLineArguments, arg,
|
||||
device() ? device()->osType() : HostOsInfo::hostOs());
|
||||
}
|
||||
|
||||
void DebuggerRunTool::prependInferiorCommandLineArgument(const QString &arg)
|
||||
{
|
||||
if (!m_runParameters.inferior.commandLineArguments.isEmpty())
|
||||
m_runParameters.inferior.commandLineArguments.prepend(' ');
|
||||
m_runParameters.inferior.commandLineArguments.prepend(arg);
|
||||
m_runParameters.inferior.commandLineArguments.prepend(
|
||||
QtcProcess::quoteArg(arg, device() ? device()->osType() : HostOsInfo::hostOs()));
|
||||
}
|
||||
|
||||
void DebuggerRunTool::addQmlServerInferiorCommandLineArgumentIfNeeded()
|
||||
|
@@ -46,6 +46,7 @@
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcfallthrough.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/url.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
@@ -254,8 +255,8 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(QmlProfilerTool *profilerTool,
|
||||
else
|
||||
QTC_CHECK(false);
|
||||
|
||||
QString arguments = QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices,
|
||||
code, true);
|
||||
QString arguments = Utils::QtcProcess::quoteArg(
|
||||
QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices, code, true));
|
||||
|
||||
if (!debuggee.commandLineArguments.isEmpty())
|
||||
arguments += ' ' + debuggee.commandLineArguments;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <qmlprofiler/qmlprofilertool.h>
|
||||
|
||||
#include <utils/url.h>
|
||||
#include <utils/temporaryfile.h>
|
||||
|
||||
#include <QtTest>
|
||||
#include <QTcpServer>
|
||||
@@ -148,6 +149,31 @@ void LocalQmlProfilerRunnerTest::testRunner()
|
||||
runControl->initiateFinish();
|
||||
QTRY_VERIFY(runControl.isNull());
|
||||
QVERIFY(profiler.isNull());
|
||||
|
||||
debuggee.commandLineArguments = QString("-test QmlProfiler,");
|
||||
serverUrl.setScheme(Utils::urlSocketScheme());
|
||||
{
|
||||
Utils::TemporaryFile file("file with spaces");
|
||||
if (file.open())
|
||||
serverUrl.setPath(file.fileName());
|
||||
}
|
||||
|
||||
runControl = new ProjectExplorer::RunControl(nullptr,
|
||||
ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
runControl->setRunnable(debuggee);
|
||||
profiler = new LocalQmlProfilerSupport(&tool, runControl, serverUrl);
|
||||
connectRunner();
|
||||
runControl->initiateStart();
|
||||
|
||||
QTRY_VERIFY_WITH_TIMEOUT(running, 30000);
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!running, 30000);
|
||||
QCOMPARE(startCount, 4);
|
||||
QCOMPARE(stopCount, 4);
|
||||
QCOMPARE(runCount, 3);
|
||||
|
||||
runControl->initiateFinish();
|
||||
QTRY_VERIFY(runControl.isNull());
|
||||
QVERIFY(profiler.isNull());
|
||||
}
|
||||
|
||||
void LocalQmlProfilerRunnerTest::testFindFreePort()
|
||||
|
@@ -75,11 +75,10 @@ void QnxQmlProfilerSupport::start()
|
||||
serverUrl.setScheme("tcp");
|
||||
m_profiler->recordData("QmlServerUrl", serverUrl);
|
||||
|
||||
QString args = QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, qmlPort);
|
||||
auto r = runnable().as<StandardRunnable>();
|
||||
if (!r.commandLineArguments.isEmpty())
|
||||
r.commandLineArguments.append(' ');
|
||||
r.commandLineArguments += args;
|
||||
QtcProcess::addArg(&r.commandLineArguments,
|
||||
QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, qmlPort),
|
||||
device()->osType());
|
||||
|
||||
setRunnable(r);
|
||||
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <projectexplorer/runnables.h>
|
||||
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/url.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -66,11 +67,9 @@ void RemoteLinuxQmlToolingSupport::start()
|
||||
serverUrl.setPort(qmlPort.number());
|
||||
m_runworker->recordData("QmlServerUrl", serverUrl);
|
||||
|
||||
QString args = QmlDebug::qmlDebugTcpArguments(m_services, qmlPort);
|
||||
auto r = runnable().as<StandardRunnable>();
|
||||
if (!r.commandLineArguments.isEmpty())
|
||||
r.commandLineArguments.append(' ');
|
||||
r.commandLineArguments += args;
|
||||
QtcProcess::addArg(&r.commandLineArguments, QmlDebug::qmlDebugTcpArguments(m_services, qmlPort),
|
||||
device()->osType());
|
||||
|
||||
setRunnable(r);
|
||||
|
||||
|
Reference in New Issue
Block a user