[all-commits] [llvm/llvm-project] fe3103: Increase search for kernel image from 32MB to 128MB

Jason Molenda via All-commits all-commits at lists.llvm.org
Mon Dec 5 15:12:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fe3103fa485f67b15efffd11d592a3341eb7bd57
      https://github.com/llvm/llvm-project/commit/fe3103fa485f67b15efffd11d592a3341eb7bd57
  Author: Jason Molenda <jason at molenda.com>
  Date:   2022-12-05 (Mon, 05 Dec 2022)

  Changed paths:
    M lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

  Log Message:
  -----------
  Increase search for kernel image from 32MB to 128MB

DynamicLoaderDarwinKernel::SearchForKernelNearPC() searches for a
Darwin kernel mach-o header starting at $pc and working backwards,
stopping on the first memory read error encountered.  The kernel,
and the kexts linked in to the kernel, have grown over the years
and the original 32MB scan limit is giving a high chance of failing
to find the kernel if we're in a random kext.

In non-kernel environments, firmware and bare board typically, we
will hit a memory read error on an unmapped page quickly so this
doesn't add a lot of random memory read requests in those environments.

We only check at one megabyte boundaries, so worst case this is 128
reads at the start of a gdb-remote connection.  The check for a
memory read error & stopping was a more recent addition (a few years
ago), so I kept the scan region a bit small.




More information about the All-commits mailing list