[Lldb-commits] [PATCH] D106348: Write the # of addressable bits into Mach-O corefiles, read it back out again

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 20 00:58:22 PDT 2021


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

On systems where we have an address mask, add support to process save-core to note the number of bits used for addressing in the corefile in an LC_NOTE, and look for that value in a corefile and set the mask in the Process.

In a live debug session on Apple Silicon using arm64e, debugserver reports the number of bits used for addressing.  Corefiles of those same processes don't currently record this information any place, making them hard to use.  This is a simple patch to add the LC_NOTE and read it back in again, nothing fancy.

I added a couple of comments on the masks to note that the mask uses 1 bits to indicate bits not used in addressing, open to disagreements about this but it always seemed backwards to me (I know we're following what the Linux kernel provides) and I will confuse myself if I'm not careful.  Basically, leaving notes so Future Jason doesn't have to puzzle over the right answer quite so long, because I'm sure I'll forget this again.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106348

Files:
  lldb/include/lldb/Symbol/ObjectFile.h
  lldb/include/lldb/Target/Process.h
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106348.360041.patch
Type: text/x-patch
Size: 8465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210720/3400cd57/attachment-0001.bin>


More information about the lldb-commits mailing list