[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
Mon Dec 16 22:27:16 PST 2024


================
@@ -81,9 +79,44 @@ ObjectFile *ObjectFileXCOFF::CreateInstance(const lldb::ModuleSP &module_sp,
   if (!objfile_up)
     return nullptr;
 
+  // Cache xcoff binary.
+  if (!objfile_up->CreateBinary())
+    return nullptr;
+
+  if (!objfile_up->ParseHeader())
+    return nullptr;
+
   return objfile_up.release();
 }
 
+bool ObjectFileXCOFF::CreateBinary() {
+  if (m_binary)
+    return true;
+
+  Log *log = GetLog(LLDBLog::Object);
+
+  auto binary = llvm::object::XCOFFObjectFile::createObjectFile(
----------------
DhruvSrivastavaX wrote:

Yes, that will be good. In that case, I can open a PR under llvm code to split the createXCOFFObjectfile to `32|64`. 
If it goes through I can introduce the change for objectfilexcoff too, if we are able to introduce. 
For this one, I can change try changing to `llvm::object::ObjectFile::createObjectFile`

https://github.com/llvm/llvm-project/pull/116338


More information about the lldb-commits mailing list