[Lldb-commits] [PATCH] D99571: Update ProcessMachCore::DoLoadCore to handle binary hints with and without addresses

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 30 03:10:31 PDT 2021


jasonmolenda created this revision.
jasonmolenda added a project: LLDB.
Herald added a subscriber: JDevlieghere.
jasonmolenda requested review of this revision.

ProcessMachCore::DoLoadCore was implemented to handle the two LC_NOTEs "kern ver str" and "main bin spec" with only certain combinations of UUID and address and type present.  Other groups are starting to adopt these corefile hints and there are combinations that lldb wouldn't handle correctly.

This patch cleans up the handling of these hints in DoLoadCore a lot -- I've been wanting to clean this up for over a year now -- and adds tests for all of the combinations.

I did make one change to DynamicLoaderStatic to only set load addresses of Sections to their file addresses (slide==0) if an address hasn't already been set.  This gives me the ability to set the load address in ProcessMachCore and have it not get re-set back to the original file address later by the dynamic loader plugin.

The rest of this patch is is code that's my little playground of ProcessMachCore, so I don't know if others will have any comments, but I wanted to open it to the floor if anyone has suggestions or questions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99571

Files:
  lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
  lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py
  lldb/test/API/macosx/lc-note/firmware-corefile/create-empty-corefile.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99571.334090.patch
Type: text/x-patch
Size: 21370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210330/2241dd40/attachment-0001.bin>


More information about the lldb-commits mailing list