Commit 7bae23b3 authored by Tobias Hunger's avatar Tobias Hunger

Abi: Mips support

* Detect Mips in binaries
* Parse mips gcc string properly
* Add unit tests for both

Thanks go to fralik from devnet for providing the test data!
parent 1352ae3d
......@@ -654,6 +654,10 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
QTest::newRow("dynamic QtCore: arm linux 32bit")
<< QString::fromLatin1("%1/abi/dynamic/arm-linux.so").arg(prefix)
<< (QStringList() << QString::fromLatin1("arm-linux-generic-elf-32bit"));
QTest::newRow("dynamic QtCore: mips linux 32bit")
<< QString::fromLatin1("%1/abi/dynamic/mips-linux.so").arg(prefix)
<< (QStringList() << QString::fromLatin1("mips-linux-generic-elf-32bit"));
}
void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary()
......
......@@ -182,7 +182,8 @@ static QList<ProjectExplorer::Abi> guessGccAbi(const QString &m)
foreach (const QString &p, parts) {
if (p == QLatin1String("unknown") || p == QLatin1String("pc") || p == QLatin1String("none")
|| p == QLatin1String("gnu") || p == QLatin1String("86_64")) {
|| p == QLatin1String("gnu") || p == QLatin1String("uclibc")
|| p == QLatin1String("86_64")) {
continue;
} else if (p == QLatin1String("i386") || p == QLatin1String("i486") || p == QLatin1String("i586")
|| p == QLatin1String("i686") || p == QLatin1String("x86")) {
......@@ -191,6 +192,9 @@ static QList<ProjectExplorer::Abi> guessGccAbi(const QString &m)
} else if (p == QLatin1String("arm")) {
arch = ProjectExplorer::Abi::ArmArchitecture;
width = 32;
} else if (p == QLatin1String("mipsel")) {
arch = ProjectExplorer::Abi::MipsArcitecture;
width = 32;
} else if (p == QLatin1String("x86_64")) {
arch = ProjectExplorer::Abi::X86Architecture;
width = 64;
......@@ -838,6 +842,9 @@ void ProjectExplorerPlugin::testGccAbiGuessing_data()
<< QString::fromLatin1("x86_64-linux-gnu")
<< (QStringList() << QLatin1String("x86-linux-generic-elf-64bit")
<< QLatin1String("x86-linux-generic-elf-32bit"));
QTest::newRow("Linux 4")
<< QString::fromLatin1("mipsel-linux-uclibc")
<< (QStringList() << QLatin1String("mips-linux-generic-elf-32bit"));
QTest::newRow("Mingw 1")
<< QString::fromLatin1("i686-w64-mingw32")
<< (QStringList() << QLatin1String("x86-windows-msys-pe-64bit")
......
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