GccToolchain: Print command line arguments and error message

In case of compiler toolchain defines autodetection print relevant
information needed to find out why it failed.

Change-Id: I03ff5d01c39c06bd4c3a24ad51688a7a701a3c33
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Cristian Adam
2019-09-26 18:27:46 +02:00
parent 016ad4a978
commit b4022f90d5

View File

@@ -32,6 +32,7 @@
#include "toolchainmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <utils/algorithm.h>
#include <utils/environment.h>
@@ -88,10 +89,13 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons
cpp.setEnvironment(environment);
cpp.setTimeoutS(10);
SynchronousProcessResponse response = cpp.runBlocking(CommandLine(gcc, arguments));
CommandLine cmdLine(gcc, arguments);
SynchronousProcessResponse response = cpp.runBlocking(cmdLine);
if (response.result != SynchronousProcessResponse::Finished ||
response.exitCode != 0) {
qWarning() << response.exitMessage(gcc.toString(), 10);
Core::MessageManager::write("Compiler feature detection failure!");
Core::MessageManager::write(response.exitMessage(cmdLine.toUserOutput(), 10));
Core::MessageManager::write(QString::fromUtf8(response.allRawOutput()));
return QByteArray();
}