This is an archive of the discontinued LLVM Phabricator instance.

Add a final fallback technique to the old Darwin dynamic loader plugin to find the dyld_all_image_infos structure
ClosedPublic

Authored by jasonmolenda on Dec 14 2022, 4:04 PM.

Details

Summary

When lldb is running on a userland corefile (the only case where DynamicLoaderMacOSX is still used today), lldb finds dyld in the corefile by exhaustive search, then reads the symbol table in the corefile to find the "dyld_all_image_infos" symbol. Using this object in the corefile, we can find the filepaths & load addresses of all other binaries.

This patch adds an additional fallback if we can't find the symbol name "dyld_all_image_infos" - by looking for the named section in dyld that is used specifically to identify this object. It is only used after the two function names we try have failed, at the point where we have no other possible ways to find the dyld_all_image_infos object in the corefile.

Diff Detail

Event Timeline

jasonmolenda created this revision.Dec 14 2022, 4:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 4:04 PM
jasonmolenda requested review of this revision.Dec 14 2022, 4:04 PM
This revision is now accepted and ready to land.Jan 5 2023, 11:10 AM