[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 18 02:08:14 PST 2024
================
@@ -127,19 +162,31 @@ bool ObjectFileXCOFF::MagicBytesMatch(DataBufferSP &data_sp,
lldb::addr_t data_length) {
lldb_private::DataExtractor data;
data.SetData(data_sp, data_offset, data_length);
+ // Need to set this as XCOFF is only compatible with Big Endian
data.SetByteOrder(eByteOrderBig);
lldb::offset_t offset = 0;
uint16_t magic = data.GetU16(&offset);
return XCOFFHeaderSizeFromMagic(magic) != 0;
}
-bool ObjectFileXCOFF::ParseHeader() { return false; }
+bool ObjectFileXCOFF::ParseHeader() {
+ ModuleSP module_sp(GetModule());
+ // Only 64-bit is supported for now
+ return module_sp && m_binary->fileHeader64()->Magic == XCOFF::XCOFF64;
----------------
labath wrote:
```suggestion
return m_binary->fileHeader64()->Magic == XCOFF::XCOFF64;
```
https://github.com/llvm/llvm-project/pull/116338
More information about the lldb-commits
mailing list