[all-commits] [llvm/llvm-project] 8113a8: [lldb/ObjectFileMachO] Fetch shared cache images f...

fredriss via All-commits all-commits at lists.llvm.org
Thu Jul 16 10:40:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8113a8bb793453832301e2684dc2b8cebec331b0
      https://github.com/llvm/llvm-project/commit/8113a8bb793453832301e2684dc2b8cebec331b0
  Author: Fred Riss <friss at apple.com>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M lldb/include/lldb/Host/HostInfoBase.h
    M lldb/include/lldb/Host/macosx/HostInfoMacOSX.h
    M lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
    M lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    M lldb/unittests/ObjectFile/CMakeLists.txt
    A lldb/unittests/ObjectFile/MachO/CMakeLists.txt
    A lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp

  Log Message:
  -----------
  [lldb/ObjectFileMachO] Fetch shared cache images from our own shared cache

Summary:
On macOS 11, the libraries that have been integrated in the system
shared cache are not present on the filesystem anymore. LLDB was
using those files to get access to the symbols of those libraries.
LLDB can get the images from the target process memory though.

This has 2 consequences:
 - LLDB cannot load the images before the process starts, reporting
   an error if someone tries to break on a system symbol.
 - Loading the symbols by downloading the data from the inferior
   is super slow. It takes tens of seconds at the start of the
   debug session to populate the Module list.

To fix this, we can use the library images LLDB has in its own
mapping of the shared cache. Shared cache images are somewhat
special as their LINKEDIT segment is moved to the end of the cache
and thus the images are not contiguous in memory. All of this can
hidden in ObjectFileMachO.

This patch fixes a number of test failures on macOS 11 due to the
first problem described above and adds some specific unittesting
for the new SharedCache Host utilities.

Reviewers: jasonmolenda, labath

Subscribers: llvm-commits, lldb-commits

Tags: #lldb, #llvm

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




More information about the All-commits mailing list