[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92078)

Fangrui Song via lldb-commits lldb-commits at lists.llvm.org
Tue May 14 15:02:57 PDT 2024


================
@@ -983,6 +999,40 @@ llvm::Error ProcessElfCore::ParseThreadContextsFromNoteSegment(
   }
 }
 
+bool ProcessElfCore::IsElf(const NT_FILE_Entry entry) {
+  size_t size = strlen(llvm::ELF::ElfMagic);
+  uint8_t buf[size];
----------------
MaskRay wrote:

We can allocate a buffer of 4 and read it.
Can ELFHeader::MagicBytesMatch be used here?

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


More information about the lldb-commits mailing list