================ @@ -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; + return elf::ELFHeader::MagicBytesMatch(buf); +} + +std::optional<UUID> ProcessElfCore::FindNoteInCoreMemory(lldb::addr_t address, + uint32_t type) { ---------------- labath wrote:
I don't think this `type` argument is useful, as this function already a UUID, and so it can't be used to parse any other kind of a note. I'd recommend inlining NT_GNU_BUILD_ID into the function (and renaming it to something like FindBuidIdInCoreMemory). 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