[Lldb-commits] [PATCH] D157168: [lldb] [mach-o corefiles] If we have LC_NOTE metadata and can't find a binary, don't fall back to an exhaustive scan
Jason Molenda via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 4 17:41:14 PDT 2023
jasonmolenda created this revision.
jasonmolenda added reviewers: bulbazord, JDevlieghere.
jasonmolenda added a project: LLDB.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.
We have some corefiles which are intended to debug a standalone binary, and have an LC_NOTE mach-o load command with the UUID and/or address of that binary. If the search for that binary fails for any reason, we don't load the intended binary. ProcessMachCore then falls back to doing an exhaustive scan of the corefile memory pages looking for a darwin kernel or a userland dyld binary. And the case where this comes up most often, there is a darwin kernel. lldb starts doing a darwin kernel debug session and that's not at all what the user is intending to do.
This patch changes ProcessMachCore::LoadBinariesViaMetadata to return if any metadata record was found, even if we didn't find the binary, and ProcessMachCore::LoadBinariesAndSetDYLD will only start an exhaustive search if we had no metadata.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D157168
Files:
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157168.547424.patch
Type: text/x-patch
Size: 5395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230805/08d3616f/attachment.bin>
More information about the lldb-commits
mailing list