================ @@ -983,6 +1001,66 @@ llvm::Error ProcessElfCore::ParseThreadContextsFromNoteSegment( } } +bool ProcessElfCore::IsElf(lldb::addr_t address) { + uint8_t buf[4]; + Status error; + size_t byte_read = ReadMemory(address, buf, 4, error); + if (byte_read != 4) + return false; ---------------- labath wrote:
I think you can just delete this and put the magic bytes check at on line ~1024, after you read the full header. Reading 4 bytes is not going to be appreciably faster than reading 64 (sizeof(Elf64_Ehdr)), and this will make the code look more like the one on lines 60--70 (which essentially does the same thing). https://github.com/llvm/llvm-project/pull/92492 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits