From 2c4023b5dc8f1d92474e973a483af52939d17cb7 Mon Sep 17 00:00:00 2001 From: dt <qtc-committer@nokia.com> Date: Thu, 5 Feb 2009 17:19:27 +0100 Subject: [PATCH] Fixes: Hopefully parse more gcc/ld errors. Details: If we know don't parse some errors, then i'd like to know. --- src/plugins/qt4projectmanager/gccparser.cpp | 47 ++++++--------------- src/plugins/qt4projectmanager/gccparser.h | 1 - 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/plugins/qt4projectmanager/gccparser.cpp b/src/plugins/qt4projectmanager/gccparser.cpp index 1d43e77f574..b71a3362f55 100644 --- a/src/plugins/qt4projectmanager/gccparser.cpp +++ b/src/plugins/qt4projectmanager/gccparser.cpp @@ -46,14 +46,12 @@ GccParser::GccParser() m_regExpIncluded.setPattern("^.*from\\s([^:]+):(\\d+)(,|:)$"); m_regExpIncluded.setMinimal(true); - m_regExpLinker.setPattern("^(\\S+)\\(\\S+\\):\\s(.+)$"); + m_regExpLinker.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$"); m_regExpLinker.setMinimal(true); //make[4]: Entering directory `/home/kkoehne/dev/ide-explorer/src/plugins/qtscripteditor' m_makeDir.setPattern("^make.*: (\\w+) directory .(.+).$"); m_makeDir.setMinimal(true); - - m_linkIndent = false; } QString GccParser::name() const @@ -76,7 +74,15 @@ void GccParser::stdOutput(const QString & line) void GccParser::stdError(const QString & line) { QString lne = line.trimmed(); - if (m_regExp.indexIn(lne) > -1) { + if (m_regExpLinker.indexIn(lne) > -1) { + QString description = m_regExpLinker.cap(2); + emit addToTaskWindow( + m_regExpLinker.cap(1), //filename + ProjectExplorer::BuildParserInterface::Error, + -1, //linenumber + description); + //qDebug()<<"m_regExpLinker"<<m_regExpLinker.cap(2); + } else if (m_regExp.indexIn(lne) > -1) { ProjectExplorer::BuildParserInterface::PatternType type; if (m_regExp.cap(5) == "warning") type = ProjectExplorer::BuildParserInterface::Warning; @@ -86,17 +92,14 @@ void GccParser::stdError(const QString & line) type = ProjectExplorer::BuildParserInterface::Unknown; QString description = m_regExp.cap(6); - if (m_linkIndent) - description.prepend(QLatin1String("-> ")); - //qDebug()<<m_regExp.cap(1)<<m_regExp.cap(2)<<m_regExp.cap(3)<<m_regExp.cap(4); + //qDebug()<<"m_regExp"<<m_regExp.cap(1)<<m_regExp.cap(2)<<m_regExp.cap(5); emit addToTaskWindow( m_regExp.cap(1), //filename type, m_regExp.cap(2).toInt(), //line number description); - } else if (m_regExpIncluded.indexIn(lne) > -1) { emit addToTaskWindow( m_regExpIncluded.cap(1), //filename @@ -104,29 +107,7 @@ void GccParser::stdError(const QString & line) m_regExpIncluded.cap(2).toInt(), //linenumber lne //description ); - } else if (m_regExpLinker.indexIn(lne) > -1) { - ProjectExplorer::BuildParserInterface::PatternType type = ProjectExplorer::BuildParserInterface::Error; - QString description = m_regExpLinker.cap(2); - if (lne.endsWith(QLatin1Char(':'))) { - m_linkIndent = true; - } else if (m_linkIndent) { - description.prepend(QLatin1String("-> ")); - type = ProjectExplorer::BuildParserInterface::Unknown; - } - emit addToTaskWindow( - m_regExpLinker.cap(1), //filename - type, - -1, //linenumber - description); + //qDebug()<<"m_regExpInclude"<<m_regExpIncluded.cap(1)<<m_regExpIncluded.cap(2); } else if (lne.startsWith(QLatin1String("collect2:"))) { - emit addToTaskWindow( - "", - ProjectExplorer::BuildParserInterface::Error, - -1, - lne //description - ); - m_linkIndent = false; - } else { - m_linkIndent = false; - } -} + emit addToTaskWindow("", ProjectExplorer::BuildParserInterface::Error, -1, lne); + }} diff --git a/src/plugins/qt4projectmanager/gccparser.h b/src/plugins/qt4projectmanager/gccparser.h index 24b21cde6f3..80796f4be2a 100644 --- a/src/plugins/qt4projectmanager/gccparser.h +++ b/src/plugins/qt4projectmanager/gccparser.h @@ -54,7 +54,6 @@ private: QRegExp m_regExpIncluded; QRegExp m_regExpLinker; QRegExp m_makeDir; - bool m_linkIndent; }; } // namespace ProjectExplorer -- GitLab