Commit b8186493 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Toolchain processes: Make source of warnings easier to locate.

Reviewed-by: Friedemann Kleint
parent 9cc4a778
...@@ -190,17 +190,18 @@ static QByteArray gccPredefinedMacros(const QString &gcc, const QStringList &env ...@@ -190,17 +190,18 @@ static QByteArray gccPredefinedMacros(const QString &gcc, const QStringList &env
cpp.setEnvironment(env); cpp.setEnvironment(env);
cpp.start(gcc, arguments); cpp.start(gcc, arguments);
if (!cpp.waitForStarted()) { if (!cpp.waitForStarted()) {
qWarning("Cannot start '%s': %s", qPrintable(gcc), qPrintable(cpp.errorString())); qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(gcc),
qPrintable(cpp.errorString()));
return QByteArray(); return QByteArray();
} }
cpp.closeWriteChannel(); cpp.closeWriteChannel();
if (!cpp.waitForFinished()) { if (!cpp.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(cpp); Utils::SynchronousProcess::stopProcess(cpp);
qWarning("Timeout running '%s'.", qPrintable(gcc)); qWarning("%s: Timeout running '%s'.", Q_FUNC_INFO, qPrintable(gcc));
return QByteArray(); return QByteArray();
} }
if (cpp.exitStatus() != QProcess::NormalExit) { if (cpp.exitStatus() != QProcess::NormalExit) {
qWarning("'%s' crashed.", qPrintable(gcc)); qWarning("%s: '%s' crashed.", Q_FUNC_INFO, qPrintable(gcc));
return QByteArray(); return QByteArray();
} }
QByteArray predefinedMacros = cpp.readAllStandardOutput(); QByteArray predefinedMacros = cpp.readAllStandardOutput();
...@@ -245,17 +246,18 @@ static QList<HeaderPath> gccSystemHeaderPaths(const QString &gcc, ProjectExplore ...@@ -245,17 +246,18 @@ static QList<HeaderPath> gccSystemHeaderPaths(const QString &gcc, ProjectExplore
cpp.setReadChannelMode(QProcess::MergedChannels); cpp.setReadChannelMode(QProcess::MergedChannels);
cpp.start(gcc, arguments); cpp.start(gcc, arguments);
if (!cpp.waitForStarted()) { if (!cpp.waitForStarted()) {
qWarning("Cannot start '%s': %s", qPrintable(gcc), qPrintable(cpp.errorString())); qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(gcc),
qPrintable(cpp.errorString()));
return systemHeaderPaths; return systemHeaderPaths;
} }
cpp.closeWriteChannel(); cpp.closeWriteChannel();
if (!cpp.waitForFinished()) { if (!cpp.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(cpp); Utils::SynchronousProcess::stopProcess(cpp);
qWarning("Timeout running '%s'.", qPrintable(gcc)); qWarning("%s: Timeout running '%s'.", Q_FUNC_INFO, qPrintable(gcc));
return systemHeaderPaths; return systemHeaderPaths;
} }
if (cpp.exitStatus() != QProcess::NormalExit) { if (cpp.exitStatus() != QProcess::NormalExit) {
qWarning("'%s' crashed.", qPrintable(gcc)); qWarning("%s: '%s' crashed.", Q_FUNC_INFO, qPrintable(gcc));
return systemHeaderPaths; return systemHeaderPaths;
} }
QByteArray line; QByteArray line;
...@@ -656,17 +658,18 @@ static QByteArray msvcPredefinedMacros(const QStringList &env) ...@@ -656,17 +658,18 @@ static QByteArray msvcPredefinedMacros(const QStringList &env)
arguments << QLatin1String("/EP") << QDir::toNativeSeparators(tmpFilePath); arguments << QLatin1String("/EP") << QDir::toNativeSeparators(tmpFilePath);
cpp.start(QLatin1String("cl.exe"), arguments); cpp.start(QLatin1String("cl.exe"), arguments);
if (!cpp.waitForStarted()) { if (!cpp.waitForStarted()) {
qWarning("Cannot start '%s': %s", qPrintable(binary), qPrintable(cpp.errorString())); qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(binary),
qPrintable(cpp.errorString()));
return predefinedMacros; return predefinedMacros;
} }
cpp.closeWriteChannel(); cpp.closeWriteChannel();
if (!cpp.waitForFinished()) { if (!cpp.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(cpp); Utils::SynchronousProcess::stopProcess(cpp);
qWarning("Timeout running '%s'.", qPrintable(binary)); qWarning("%s: Timeout running '%s'.", Q_FUNC_INFO, qPrintable(binary));
return predefinedMacros; return predefinedMacros;
} }
if (cpp.exitStatus() != QProcess::NormalExit) { if (cpp.exitStatus() != QProcess::NormalExit) {
qWarning("'%s' crashed.", qPrintable(binary)); qWarning("%s: '%s' crashed.", Q_FUNC_INFO, qPrintable(binary));
return predefinedMacros; return predefinedMacros;
} }
...@@ -784,11 +787,12 @@ MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSettingI(const ...@@ -784,11 +787,12 @@ MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSettingI(const
const QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC")); const QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC"));
run.start(cmdPath, QStringList()<< QLatin1String("/c")<<QDir::toNativeSeparators(filename)); run.start(cmdPath, QStringList()<< QLatin1String("/c")<<QDir::toNativeSeparators(filename));
if (!run.waitForStarted()) { if (!run.waitForStarted()) {
qWarning("Unable to run '%s': %s", qPrintable(varsBat), qPrintable(run.errorString())); qWarning("%s: Unable to run '%s': %s", Q_FUNC_INFO, qPrintable(varsBat),
qPrintable(run.errorString()));
return StringStringPairList(); return StringStringPairList();
} }
if (!run.waitForFinished()) { if (!run.waitForFinished()) {
qWarning("Timeout running '%s'", qPrintable(varsBat)); qWarning("%s: Timeout running '%s'", Q_FUNC_INFO, qPrintable(varsBat));
Utils::SynchronousProcess::stopProcess(run); Utils::SynchronousProcess::stopProcess(run);
return StringStringPairList(); return StringStringPairList();
} }
...@@ -819,7 +823,7 @@ void MSVCToolChain::addToEnvironment(ProjectExplorer::Environment &env) ...@@ -819,7 +823,7 @@ void MSVCToolChain::addToEnvironment(ProjectExplorer::Environment &env)
if (debug) if (debug)
qDebug() << "MSVCToolChain::addToEnvironment" << m_installation.name; qDebug() << "MSVCToolChain::addToEnvironment" << m_installation.name;
if (m_installation.name.isEmpty() || m_installation.varsBat.isEmpty()) { if (m_installation.name.isEmpty() || m_installation.varsBat.isEmpty()) {
qWarning("Attempt to set up invalid MSVC Toolchain."); qWarning("%s: Attempt to set up invalid MSVC Toolchain.", Q_FUNC_INFO);
return; return;
} }
// We cache the full environment (incoming + modifications by setup script). // We cache the full environment (incoming + modifications by setup script).
......
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