[Lldb-commits] [PATCH] D83023: [lldb/ObjectFileMachO] Fetch shared cache images from our own shared cache

Frederic Riss via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 1 22:16:40 PDT 2020


friss created this revision.
friss added reviewers: jasonmolenda, labath.
Herald added projects: LLDB, LLVM.
Herald added a subscriber: llvm-commits.

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. To do this patch extends ModuleSpec
to be able to store a DataBuffer for the Module that the MacOS
platform will provide by querying a new HostInfo utility which
describes the contents of the shared cache.

This patch fixes a number of test failures on macOS 11 due to the
first problem described above.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83023

Files:
  lldb/include/lldb/Core/Module.h
  lldb/include/lldb/Core/ModuleSpec.h
  lldb/include/lldb/Host/macosx/HostInfoMacOSX.h
  lldb/include/lldb/Symbol/ObjectFile.h
  lldb/include/lldb/Utility/DataBuffer.h
  lldb/source/Core/Module.cpp
  lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  lldb/source/Symbol/ObjectFile.cpp
  lldb/unittests/Host/HostInfoTest.cpp
  llvm/include/llvm/BinaryFormat/MachO.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83023.275004.patch
Type: text/x-patch
Size: 31029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200702/413a49c3/attachment-0001.bin>


More information about the lldb-commits mailing list