forked from qt-creator/qt-creator
ProjectExplorer: Allow partial remote ABI detection
The "Mac static library" case from 2011 (c9f7d779a6
) is still
local-only.
Change-Id: I5b437722bc1946458f54f3bdaf3e087f9264842a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1157,20 +1157,19 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path)
|
|||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
QFile f(path.toString());
|
QByteArray data = path.fileContents(1024);
|
||||||
if (!f.exists())
|
|
||||||
return tmp;
|
|
||||||
|
|
||||||
if (!f.open(QFile::ReadOnly))
|
|
||||||
return tmp;
|
|
||||||
|
|
||||||
QByteArray data = f.read(1024);
|
|
||||||
if (data.size() >= 67
|
if (data.size() >= 67
|
||||||
&& getUint8(data, 0) == '!' && getUint8(data, 1) == '<' && getUint8(data, 2) == 'a'
|
&& getUint8(data, 0) == '!' && getUint8(data, 1) == '<' && getUint8(data, 2) == 'a'
|
||||||
&& getUint8(data, 3) == 'r' && getUint8(data, 4) == 'c' && getUint8(data, 5) == 'h'
|
&& getUint8(data, 3) == 'r' && getUint8(data, 4) == 'c' && getUint8(data, 5) == 'h'
|
||||||
&& getUint8(data, 6) == '>' && getUint8(data, 7) == 0x0a) {
|
&& getUint8(data, 6) == '>' && getUint8(data, 7) == 0x0a) {
|
||||||
// We got an ar file: possibly a static lib for ELF, PE or Mach-O
|
// We got an ar file: possibly a static lib for ELF, PE or Mach-O
|
||||||
|
|
||||||
|
// FIXME: Implement remote
|
||||||
|
QTC_ASSERT(!path.needsDevice(), return tmp);
|
||||||
|
QFile f(path.toString());
|
||||||
|
if (!f.open(QFile::ReadOnly))
|
||||||
|
return tmp;
|
||||||
|
|
||||||
data = data.mid(8); // Cut of ar file magic
|
data = data.mid(8); // Cut of ar file magic
|
||||||
quint64 offset = 8;
|
quint64 offset = 8;
|
||||||
|
|
||||||
@@ -1203,7 +1202,6 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path)
|
|||||||
} else {
|
} else {
|
||||||
tmp = abiOf(data);
|
tmp = abiOf(data);
|
||||||
}
|
}
|
||||||
f.close();
|
|
||||||
|
|
||||||
// Remove duplicates:
|
// Remove duplicates:
|
||||||
Abis result;
|
Abis result;
|
||||||
|
Reference in New Issue
Block a user