[all-commits] [llvm/llvm-project] 809652: Update TODO noting that DriverKit should be added too

Jason Molenda via All-commits all-commits at lists.llvm.org
Wed Oct 6 20:12:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 809652c93ba6b0fe6b01f935cc3da88d26a6714d
      https://github.com/llvm/llvm-project/commit/809652c93ba6b0fe6b01f935cc3da88d26a6714d
  Author: Jason Molenda <jason at molenda.com>
  Date:   2021-10-06 (Wed, 06 Oct 2021)

  Changed paths:
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

  Log Message:
  -----------
  Update TODO noting that DriverKit should be added too

When BridgeOS and DriverKit are added to llvm Triple.


  Commit: 62d9163830d0b8b09e1e6d6a43c99c1371091c65
      https://github.com/llvm/llvm-project/commit/62d9163830d0b8b09e1e6d6a43c99c1371091c65
  Author: Jason Molenda <jason at molenda.com>
  Date:   2021-10-06 (Wed, 06 Oct 2021)

  Changed paths:
    M lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp

  Log Message:
  -----------
  Don't register mem segments that aren't present in a corefile

A Mach-O corefile has an array of memory segments, representing
the memory of the process at the point of the capture.  Each segment
has a virtual address + size, and a file offset + size.  The file
size may be less than the virtual address size, indicating that
the memory was unavailable. When ProcessMachCore::DoLoadCore scans
this array of memory segments, it builds up a table to translate
virtual addresses to file offsets, for memory read requests.
This lookup table combines contiguous memory segments into a single
entry, to reduce the number of entries (some corefile writers will
emit a separate segement for each virtual meory page).

This contiguous check wasn't taking into account a segment that
isn't present in the corefile, e.g. filesize==0, and every contiguous
memory segment after that point would result in lldb reading the
wrong offset of the file because it didn't account for this.

I'd like to have an error message when someone tries to read memory from
one of these segments, instead of returning all zeroes, so this patch
intentionally leaves these out of the vmaddr -> fileoff table (and
avoids combining them with segments that actually do exist in the
corefile).

I'm a little unsure of writing a test for this one; I'd have to do
a yaml2obj of a corefile with the problem, or add an internal mode
to the Mach-O process save-core where it could write a filesize==0
segment while it was writing one.

rdar://83382487


Compare: https://github.com/llvm/llvm-project/compare/1e39d32c5a11...62d9163830d0


More information about the All-commits mailing list