ClangStaticAnalyzer: Print shell quoted command line

...by using QtcProcess::quoteArg().

Change-Id: Ic7c160d0332456e94e0d5fa1ca51320b8c1dd394
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2016-07-05 10:42:13 +02:00
parent 57c2c595ca
commit 64c7f28c6a

View File

@@ -27,6 +27,7 @@
#include "clangstaticanalyzerconstants.h" #include "clangstaticanalyzerconstants.h"
#include <utils/qtcprocess.h>
#include <utils/synchronousprocess.h> #include <utils/synchronousprocess.h>
#include <QDebug> #include <QDebug>
@@ -111,7 +112,7 @@ bool ClangStaticAnalyzerRunner::run(const QString &filePath, const QStringList &
QTC_ASSERT(!m_logFile.isEmpty(), return false); QTC_ASSERT(!m_logFile.isEmpty(), return false);
const QStringList arguments = constructCommandLineArguments(filePath, m_logFile, const QStringList arguments = constructCommandLineArguments(filePath, m_logFile,
compilerOptions); compilerOptions);
m_commandLine = (QStringList(m_clangExecutable) + arguments).join(QLatin1String("\" \"")); m_commandLine = Utils::QtcProcess::joinArgs(QStringList(m_clangExecutable) + arguments);
qCDebug(LOG) << "Starting" << m_commandLine; qCDebug(LOG) << "Starting" << m_commandLine;
m_process.start(m_clangExecutable, arguments); m_process.start(m_clangExecutable, arguments);
@@ -171,7 +172,7 @@ QString ClangStaticAnalyzerRunner::createLogFile(const QString &filePath) const
QString ClangStaticAnalyzerRunner::processCommandlineAndOutput() const QString ClangStaticAnalyzerRunner::processCommandlineAndOutput() const
{ {
return tr("Command line: \"%1\"\n" return tr("Command line: %1\n"
"Process Error: %2\n" "Process Error: %2\n"
"Output:\n%3") "Output:\n%3")
.arg(m_commandLine, .arg(m_commandLine,