[all-commits] [llvm/llvm-project] 77a38f: jGetLoadedDynamicLibrariesInfos can inspect machos...

Jason Molenda via All-commits all-commits at lists.llvm.org
Fri Jul 8 15:14:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77a38f6839980bfac61babb40d83772c51427011
      https://github.com/llvm/llvm-project/commit/77a38f6839980bfac61babb40d83772c51427011
  Author: Jason Molenda <jason at molenda.com>
  Date:   2022-07-08 (Fri, 08 Jul 2022)

  Changed paths:
    A lldb/test/API/macosx/unregistered-macho/Makefile
    A lldb/test/API/macosx/unregistered-macho/TestUnregisteredMacho.py
    A lldb/test/API/macosx/unregistered-macho/main.c
    M lldb/tools/debugserver/source/MacOSX/MachProcess.h
    M lldb/tools/debugserver/source/MacOSX/MachProcess.mm

  Log Message:
  -----------
  jGetLoadedDynamicLibrariesInfos can inspect machos not yet loaded

jGetLoadedDynamicLibrariesInfos normally checks with dyld to find
the list of binaries loaded in the inferior, and getting the filepath,
before trying to parse the Mach-O binary in inferior memory.
This allows for debugserver to parse a Mach-O binary present in memory,
but not yet registered with dyld.  This patch also adds some simple
sanity checks that we're reading a Mach-O header before we begin
stepping through load commands, because we won't have the sanity check
of consulting dyld for the list of loaded binaries before parsing.
Also adds a testcase.

Differential Revision: https://reviews.llvm.org/D128956
rdar://95737734




More information about the All-commits mailing list