[Orc] Drop arch check in the DebugObjectManagerPlugin for ELF
authorStefan Gränitz <stefan.graenitz@gmail.com>
Fri, 31 Mar 2023 10:48:16 +0000 (12:48 +0200)
committerStefan Gränitz <stefan.graenitz@gmail.com>
Fri, 31 Mar 2023 10:59:09 +0000 (12:59 +0200)
Tested this with the new AArch32 backend on armv7l and it works without issues in GDB. The size of the load-address field is only 32-bit here, but we implicitly account for it by writing a ELFT::uint which is:
https://github.com/llvm/llvm-project/blob/release/16.x/llvm/include/llvm/Object/ELFTypes.h#L57

So, instead of adding a newly supported machine type, let's just drop this restriction althogether.

llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp

index bd2faeb..ab2f7a1 100644 (file)
@@ -60,8 +60,6 @@ public:
 
 private:
   typename ELFT::Shdr *Header;
-
-  bool isTextOrDataSection() const;
 };
 
 template <typename ELFT>
@@ -268,11 +266,6 @@ ELFDebugObject::CreateArchType(MemoryBufferRef Buffer,
   if (!ObjRef)
     return ObjRef.takeError();
 
-  // TODO: Add support for other architectures.
-  uint16_t TargetMachineArch = ObjRef->getHeader().e_machine;
-  if (TargetMachineArch != ELF::EM_X86_64)
-    return nullptr;
-
   Expected<ArrayRef<SectionHeader>> Sections = ObjRef->sections();
   if (!Sections)
     return Sections.takeError();