forked from qt-creator/qt-creator
BareMetal: Handle warnings from BL51 linker
It handles an additional linker warnings, in a form like: *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?GPIO_TASK?GPIO Change-Id: I58420ea19d4b562c0307be11808be435e02a3f27 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -164,9 +164,9 @@ bool KeilParser::parseMcs51WarningOrErrorDetailsMessage2(const QString &lne)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeilParser::parseMcs51FatalErrorMessage1(const QString &lne)
|
bool KeilParser::parseMcs51WarningOrFatalErrorMessage(const QString &lne)
|
||||||
{
|
{
|
||||||
const QRegularExpression re("^\\*{3} (FATAL ERROR) (.+)$");
|
const QRegularExpression re("^\\*{3} (WARNING|FATAL ERROR) (.+)$");
|
||||||
const QRegularExpressionMatch match = re.match(lne);
|
const QRegularExpressionMatch match = re.match(lne);
|
||||||
if (match.hasMatch()) {
|
if (match.hasMatch()) {
|
||||||
enum CaptureIndex { MessageTypeIndex = 1, MessageDescriptionIndex };
|
enum CaptureIndex { MessageTypeIndex = 1, MessageDescriptionIndex };
|
||||||
@@ -228,7 +228,7 @@ void KeilParser::stdOutput(const QString &line)
|
|||||||
const bool parsed = parseMcs51WarningOrErrorDetailsMessage1(lne)
|
const bool parsed = parseMcs51WarningOrErrorDetailsMessage1(lne)
|
||||||
|| parseMcs51WarningOrErrorDetailsMessage2(lne);
|
|| parseMcs51WarningOrErrorDetailsMessage2(lne);
|
||||||
if (!parsed) {
|
if (!parsed) {
|
||||||
if (parseMcs51FatalErrorMessage1(lne))
|
if (parseMcs51WarningOrFatalErrorMessage(lne))
|
||||||
return;
|
return;
|
||||||
if (parseMcs51FatalErrorMessage2(lne))
|
if (parseMcs51FatalErrorMessage2(lne))
|
||||||
return;
|
return;
|
||||||
@@ -499,6 +499,21 @@ void BareMetalPlugin::testKeilOutputParsers_data()
|
|||||||
<< QString();
|
<< QString();
|
||||||
|
|
||||||
// Linker messages.
|
// Linker messages.
|
||||||
|
QTest::newRow("MCS51: Linker warning")
|
||||||
|
<< QString::fromLatin1("*** WARNING L16: Some warning\n"
|
||||||
|
" Some detail 1")
|
||||||
|
<< OutputParserTester::STDOUT
|
||||||
|
<< QString::fromLatin1("*** WARNING L16: Some warning\n"
|
||||||
|
" Some detail 1\n")
|
||||||
|
<< QString()
|
||||||
|
<< (Tasks() << Task(Task::Warning,
|
||||||
|
QLatin1String("L16: Some warning\n"
|
||||||
|
" Some detail 1"),
|
||||||
|
Utils::FilePath(),
|
||||||
|
-1,
|
||||||
|
categoryCompile))
|
||||||
|
<< QString();
|
||||||
|
|
||||||
QTest::newRow("MCS51: Linker simple fatal error")
|
QTest::newRow("MCS51: Linker simple fatal error")
|
||||||
<< QString::fromLatin1("*** FATAL ERROR L456: Some error")
|
<< QString::fromLatin1("*** FATAL ERROR L456: Some error")
|
||||||
<< OutputParserTester::STDOUT
|
<< OutputParserTester::STDOUT
|
||||||
|
@@ -52,7 +52,7 @@ private:
|
|||||||
// MCS51 compiler specific parsers.
|
// MCS51 compiler specific parsers.
|
||||||
bool parseMcs51WarningOrErrorDetailsMessage1(const QString &lne);
|
bool parseMcs51WarningOrErrorDetailsMessage1(const QString &lne);
|
||||||
bool parseMcs51WarningOrErrorDetailsMessage2(const QString &lne);
|
bool parseMcs51WarningOrErrorDetailsMessage2(const QString &lne);
|
||||||
bool parseMcs51FatalErrorMessage1(const QString &lne);
|
bool parseMcs51WarningOrFatalErrorMessage(const QString &lne);
|
||||||
bool parseMcs51FatalErrorMessage2(const QString &lne);
|
bool parseMcs51FatalErrorMessage2(const QString &lne);
|
||||||
|
|
||||||
void stdError(const QString &line) final;
|
void stdError(const QString &line) final;
|
||||||
|
Reference in New Issue
Block a user