[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)
Dhruv Srivastava via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 13 07:24:52 PST 2024
================
@@ -130,19 +164,41 @@ 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() {
+
+ bool retVal = false;
+ ModuleSP module_sp(GetModule());
+ if (module_sp) {
+ // Only 64-bit is supported for now
+ if (m_binary->fileHeader64()->Magic == XCOFF::XCOFF64)
+ retVal = true;
----------------
DhruvSrivastavaX wrote:
Sure Thanks!
https://github.com/llvm/llvm-project/pull/116338
More information about the lldb-commits
mailing list