forked from qt-creator/qt-creator
LdParser: Do not interpret .data as a source filename
Change-Id: Ide088490db3c48f5036cc2969d4841e08d9a15cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
f262593596
commit
531cba5812
@@ -839,6 +839,27 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
|
|||||||
)
|
)
|
||||||
<< QString();
|
<< QString();
|
||||||
|
|
||||||
|
QTest::newRow("ld: .data section")
|
||||||
|
<< QString::fromLatin1("foo.o:(.data+0x0): multiple definition of `foo'\n"
|
||||||
|
"bar.o:(.data+0x0): first defined here\n"
|
||||||
|
"collect2: error: ld returned 1 exit status")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< (QList<ProjectExplorer::Task>()
|
||||||
|
<< Task(Task::Error,
|
||||||
|
QLatin1String("multiple definition of `foo'"),
|
||||||
|
Utils::FileName::fromUserInput(QLatin1String("foo.o")), -1,
|
||||||
|
categoryCompile)
|
||||||
|
<< Task(Task::Unknown,
|
||||||
|
QLatin1String("first defined here"),
|
||||||
|
Utils::FileName::fromUserInput(QLatin1String("bar.o")), -1,
|
||||||
|
categoryCompile)
|
||||||
|
<< Task(Task::Error,
|
||||||
|
QLatin1String("collect2: error: ld returned 1 exit status"),
|
||||||
|
Utils::FileName(), -1,
|
||||||
|
categoryCompile)
|
||||||
|
)
|
||||||
|
<< QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::testGccOutputParsers()
|
void ProjectExplorerPlugin::testGccOutputParsers()
|
||||||
|
|||||||
@@ -97,9 +97,12 @@ void LdParser::stdError(const QString &line)
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
lineno = -1;
|
lineno = -1;
|
||||||
Utils::FileName filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(1));
|
Utils::FileName filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(1));
|
||||||
if (!m_regExpLinker.cap(4).isEmpty()
|
const QString sourceFileName = m_regExpLinker.cap(4);
|
||||||
&& !m_regExpLinker.cap(4).startsWith(QLatin1String("(.text")))
|
if (!sourceFileName.isEmpty()
|
||||||
filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(4));
|
&& !sourceFileName.startsWith(QLatin1String("(.text"))
|
||||||
|
&& !sourceFileName.startsWith(QLatin1String("(.data"))) {
|
||||||
|
filename = Utils::FileName::fromUserInput(sourceFileName);
|
||||||
|
}
|
||||||
QString description = m_regExpLinker.cap(8).trimmed();
|
QString description = m_regExpLinker.cap(8).trimmed();
|
||||||
Task task(Task::Error, description, filename, lineno,
|
Task task(Task::Error, description, filename, lineno,
|
||||||
Core::Id(Constants::TASK_CATEGORY_COMPILE));
|
Core::Id(Constants::TASK_CATEGORY_COMPILE));
|
||||||
|
|||||||
Reference in New Issue
Block a user