BareMetal: Handle missed SDCC assembler errors

... in a form like:

 autovec_sdcc.a51:7: Error: <o> .org in REL area or directive / mnemonic error
 autovec_sdcc.a51:8: Error: <o> .org in REL area or directive / mnemonic error
 autovec_sdcc.a51:8: Error: <q> missing or improper operators, terminators, or delimiters

Fixes: QTCREATORBUG-23084
Change-Id: I346b1970a90bc515a647477d089e66e742567733
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Denis Shienkov
2019-10-13 18:05:52 +03:00
parent 6d089f33f7
commit 9035a8b17e

View File

@@ -110,7 +110,7 @@ void SdccParser::stdError(const QString &line)
return; return;
} }
re.setPattern("^(.+\\.\\S+):(\\d+): (syntax error): (.+)$"); re.setPattern("^(.+\\.\\S+):(\\d+): (Error|syntax error): (.+)$");
match = re.match(lne); match = re.match(lne);
if (match.hasMatch()) { if (match.hasMatch()) {
enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, enum CaptureIndex { FilePathIndex = 1, LineNumberIndex,
@@ -208,6 +208,18 @@ void BareMetalPlugin::testSdccOutputParsers_data()
// Compiler messages. // Compiler messages.
QTest::newRow("Assembler error")
<< QString::fromLatin1("c:\\foo\\main.c:63: Error: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: Error: Some error\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("Some error"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
63,
categoryCompile))
<< QString();
QTest::newRow("Compiler single line warning") QTest::newRow("Compiler single line warning")
<< QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning") << QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning")
<< OutputParserTester::STDERR << OutputParserTester::STDERR