diff options
Diffstat (limited to 'src/plugins/baremetal/iarewparser.cpp')
-rw-r--r-- | src/plugins/baremetal/iarewparser.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/plugins/baremetal/iarewparser.cpp b/src/plugins/baremetal/iarewparser.cpp index 93e97ac056..039e32aa8d 100644 --- a/src/plugins/baremetal/iarewparser.cpp +++ b/src/plugins/baremetal/iarewparser.cpp @@ -179,6 +179,22 @@ bool IarParser::parseErrorInCommandLineMessage(const QString &lne) return true; } +bool IarParser::parseErrorMessage1(const QString &lne) +{ + const QRegularExpression re("^(Error)\\[(.+)\\]:\\s(.+)$"); + const QRegularExpressionMatch match = re.match(lne); + if (!match.hasMatch()) + return false; + enum CaptureIndex { MessageTypeIndex = 1, MessageCodeIndex, DescriptionIndex }; + const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); + const QString descr = QString("[%1]: %2").arg(match.captured(MessageCodeIndex), + match.captured(DescriptionIndex)); + // This task has not a file path and line number (as it is a linker message) + const Task task(type, descr, {}, -1, Constants::TASK_CATEGORY_COMPILE); + newTask(task); + return true; +} + void IarParser::stdError(const QString &line) { IOutputParser::stdError(line); @@ -225,7 +241,10 @@ void IarParser::stdOutput(const QString &line) const QString lne = rightTrimmed(line); - if (!parseErrorInCommandLineMessage(lne)) + // The call sequence has the meaning! + const bool leastOneParsed = parseErrorInCommandLineMessage(lne) + || parseErrorMessage1(lne); + if (!leastOneParsed) return; doFlush(); @@ -297,6 +316,18 @@ void BareMetalPlugin::testIarOutputParsers_data() categoryCompile)) << QString(); + QTest::newRow("Linker error") + << QString::fromLatin1("Error[e46]: Some error") + << OutputParserTester::STDOUT + << QString::fromLatin1("Error[e46]: Some error\n") + << QString() + << (Tasks() << Task(Task::Error, + QLatin1String("[e46]: Some error"), + Utils::FilePath(), + -1, + categoryCompile)) + << QString(); + // For std error. QTest::newRow("No details warning") << QString::fromLatin1("\"c:\\foo\\main.c\",63 Warning[Pe223]:\n" |