================
@@ -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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to