[Lldb-commits] [PATCH] D131328: [lldb] Support fetching symbols with dsymForUUID in the background

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Aug 6 09:39:01 PDT 2022


JDevlieghere created this revision.
JDevlieghere added reviewers: jasonmolenda, jingham, mib, clayborg.
Herald added a project: All.
JDevlieghere requested review of this revision.

On macOS, LLDB uses the DebugSymbols.framework to locate symbol rich dSYM bundles. [1] The framework uses a variety of methods, one of them calling into a binary or shell script to locate (and download) dSYMs. Internally at Apple, that tool is called `dsymForUUID` and for simplicity I'm just going to refer to it that way here too, even though it can be be an arbitrary executable.

The most common use case for dsymForUUID is to fetch symbols from the network. This can take a long time, and because the calls to the DebugSymbols.framework  are blocking, lldb does not launch the process immediately. This is the expected behavior and many people therefore often don't use this functionality, but instead use `add-dsym` when they want symbols for a given frame, backtrace or module. This is a little faster because you're only fetching symbols for the module you care about, but it's still a slow, blocking operation.

This patch introduces a hybrid approach between the two. When `symbols.enable-background-lookup` is enabled, lldb will do the equivalent of `add-dsym` for every module it doesn't have symbols for in the background. From the user's perspective there is no slowdown, because the process launches immediately, with whatever symbols are available and more symbol information is added over time as the background fetching completes.

[1] https://lldb.llvm.org/use/symbols.html


https://reviews.llvm.org/D131328

Files:
  lldb/include/lldb/Core/Debugger.h
  lldb/include/lldb/Core/ModuleList.h
  lldb/include/lldb/Symbol/LocateSymbolFile.h
  lldb/include/lldb/Target/TargetList.h
  lldb/source/Core/CoreProperties.td
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Symbol/LocateSymbolFile.cpp
  lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
  lldb/source/Target/TargetList.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131328.450546.patch
Type: text/x-patch
Size: 11983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220806/1d604f21/attachment.bin>


More information about the lldb-commits mailing list