Commit dcd78d04 authored by Nikolai Kosjar's avatar Nikolai Kosjar

ClangStaticAnalyzer: Simplify debugging

* If the logging rules are active, add "-v" to the clang command line.
  This provides the internal command line and the effective include
  paths.
* Dump output also for the success case.

Change-Id: I16a01d010c68575a983a4fb82f8bd8632c2fc20c
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 317a8971
......@@ -55,7 +55,12 @@ static QStringList constructCommandLineArguments(const QString &filePath,
const QString &logFile,
const QStringList &options)
{
QStringList arguments = QStringList()
QStringList arguments;
if (LOG().isDebugEnabled())
arguments << QLatin1String("-v");
arguments
<< QLatin1String("--analyze")
<< QLatin1String("-o")
<< logFile
......@@ -132,8 +137,11 @@ void ClangStaticAnalyzerRunner::onProcessStarted()
void ClangStaticAnalyzerRunner::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
if (exitStatus == QProcess::NormalExit) {
if (exitCode == 0)
if (exitCode == 0) {
qCDebug(LOG).noquote() << "Output:\n" << Utils::SynchronousProcess::normalizeNewlines(
QString::fromLocal8Bit(m_processOutput));
emit finishedWithSuccess(actualLogFile());
}
else
emit finishedWithFailure(finishedWithBadExitCode(exitCode), processCommandlineAndOutput());
} else { // == QProcess::CrashExit
......
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