forked from qt-creator/qt-creator
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!
This commit is contained in:
@@ -654,6 +654,10 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
|
|||||||
QTest::newRow("dynamic QtCore: arm linux 32bit")
|
QTest::newRow("dynamic QtCore: arm linux 32bit")
|
||||||
<< QString::fromLatin1("%1/abi/dynamic/arm-linux.so").arg(prefix)
|
<< QString::fromLatin1("%1/abi/dynamic/arm-linux.so").arg(prefix)
|
||||||
<< (QStringList() << QString::fromLatin1("arm-linux-generic-elf-32bit"));
|
<< (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()
|
void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary()
|
||||||
|
|||||||
@@ -182,7 +182,8 @@ static QList<ProjectExplorer::Abi> guessGccAbi(const QString &m)
|
|||||||
|
|
||||||
foreach (const QString &p, parts) {
|
foreach (const QString &p, parts) {
|
||||||
if (p == QLatin1String("unknown") || p == QLatin1String("pc") || p == QLatin1String("none")
|
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;
|
continue;
|
||||||
} else if (p == QLatin1String("i386") || p == QLatin1String("i486") || p == QLatin1String("i586")
|
} else if (p == QLatin1String("i386") || p == QLatin1String("i486") || p == QLatin1String("i586")
|
||||||
|| p == QLatin1String("i686") || p == QLatin1String("x86")) {
|
|| p == QLatin1String("i686") || p == QLatin1String("x86")) {
|
||||||
@@ -191,6 +192,9 @@ static QList<ProjectExplorer::Abi> guessGccAbi(const QString &m)
|
|||||||
} else if (p == QLatin1String("arm")) {
|
} else if (p == QLatin1String("arm")) {
|
||||||
arch = ProjectExplorer::Abi::ArmArchitecture;
|
arch = ProjectExplorer::Abi::ArmArchitecture;
|
||||||
width = 32;
|
width = 32;
|
||||||
|
} else if (p == QLatin1String("mipsel")) {
|
||||||
|
arch = ProjectExplorer::Abi::MipsArcitecture;
|
||||||
|
width = 32;
|
||||||
} else if (p == QLatin1String("x86_64")) {
|
} else if (p == QLatin1String("x86_64")) {
|
||||||
arch = ProjectExplorer::Abi::X86Architecture;
|
arch = ProjectExplorer::Abi::X86Architecture;
|
||||||
width = 64;
|
width = 64;
|
||||||
@@ -838,6 +842,9 @@ void ProjectExplorerPlugin::testGccAbiGuessing_data()
|
|||||||
<< QString::fromLatin1("x86_64-linux-gnu")
|
<< QString::fromLatin1("x86_64-linux-gnu")
|
||||||
<< (QStringList() << QLatin1String("x86-linux-generic-elf-64bit")
|
<< (QStringList() << QLatin1String("x86-linux-generic-elf-64bit")
|
||||||
<< QLatin1String("x86-linux-generic-elf-32bit"));
|
<< 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")
|
QTest::newRow("Mingw 1")
|
||||||
<< QString::fromLatin1("i686-w64-mingw32")
|
<< QString::fromLatin1("i686-w64-mingw32")
|
||||||
<< (QStringList() << QLatin1String("x86-windows-msys-pe-64bit")
|
<< (QStringList() << QLatin1String("x86-windows-msys-pe-64bit")
|
||||||
|
|||||||
Reference in New Issue
Block a user