Commit 531cba58 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

LdParser: Do not interpret .data as a source filename



Change-Id: Ide088490db3c48f5036cc2969d4841e08d9a15cd
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent f2625935
......@@ -839,6 +839,27 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
)
<< 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()
......
......@@ -97,9 +97,12 @@ void LdParser::stdError(const QString &line)
if (!ok)
lineno = -1;
Utils::FileName filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(1));
if (!m_regExpLinker.cap(4).isEmpty()
&& !m_regExpLinker.cap(4).startsWith(QLatin1String("(.text")))
filename = Utils::FileName::fromUserInput(m_regExpLinker.cap(4));
const QString sourceFileName = m_regExpLinker.cap(4);
if (!sourceFileName.isEmpty()
&& !sourceFileName.startsWith(QLatin1String("(.text"))
&& !sourceFileName.startsWith(QLatin1String("(.data"))) {
filename = Utils::FileName::fromUserInput(sourceFileName);
}
QString description = m_regExpLinker.cap(8).trimmed();
Task task(Task::Error, description, filename, lineno,
Core::Id(Constants::TASK_CATEGORY_COMPILE));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment