[all-commits] [llvm/llvm-project] c31921: Change the dyld notification function that lldb pu...

Jason Molenda via All-commits all-commits at lists.llvm.org
Thu Jul 6 18:00:25 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3192196aea279eea0a87247a02f224ebe067c44
  Author: Jason Molenda <jason at molenda.com>
  Date:   2023-07-06 (Thu, 06 Jul 2023)

  Changed paths:
    M lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp

  Log Message:
  Change the dyld notification function that lldb puts a breakpoint in

On Darwin systems, the dynamic linker dyld has an empty function
it calls when binaries are added/removed from the process.  lldb puts
a breakpoint on this dyld function to catch the notifications.  The
function arguments are used by lldb to tell what is happening.

The linker has a natural representation when the addresses of
binaries being added/removed are in the pointer size of the process.
There is then a second function where the addresses of the binaries
are in a uint64_t array, which the debugger has been using before -
dyld allocates memory for the array, copies the values in to it,
and calls it for lldb's benefit.

This changes to using the native notifier function, with pointer-sized

This is the second time landing this change; this time correct the
size of the image_count argument, and add a fallback if the
notification function "lldb_image_notifier" can't be found.

Differential Revision: https://reviews.llvm.org/D139453

More information about the All-commits mailing list