[all-commits] [llvm/llvm-project] 8d36a8: [lldb] Flush the global thread pool in Debugger::T...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Mon Aug 15 17:57:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8d36a82d0a3d118329b9f24b33e58d0a28360891
      https://github.com/llvm/llvm-project/commit/8d36a82d0a3d118329b9f24b33e58d0a28360891
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-08-15 (Mon, 15 Aug 2022)

  Changed paths:
    M lldb/source/Core/Debugger.cpp

  Log Message:
  -----------
  [lldb] Flush the global thread pool in Debugger::Terminate

Use the Initialize/Terminate pattern for the global thread pool to make
sure it gets flushed during teardown.

Differential revision: https://reviews.llvm.org/D131407


  Commit: 11f45f36dcf54b0fe8e54ce5e410e24f3b9b5a1e
      https://github.com/llvm/llvm-project/commit/11f45f36dcf54b0fe8e54ce5e410e24f3b9b5a1e
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-08-15 (Mon, 15 Aug 2022)

  Changed paths:
    M lldb/include/lldb/Core/Debugger.h
    M lldb/include/lldb/Core/DebuggerEvents.h
    M lldb/include/lldb/Core/ModuleList.h
    M lldb/include/lldb/Symbol/LocateSymbolFile.h
    M lldb/include/lldb/Target/Target.h
    M lldb/source/Core/CoreProperties.td
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Core/DebuggerEvents.cpp
    M lldb/source/Core/Module.cpp
    M lldb/source/Core/ModuleList.cpp
    M lldb/source/Symbol/LocateSymbolFile.cpp
    M lldb/source/Symbol/LocateSymbolFileMacOSX.cpp

  Log Message:
  -----------
  [lldb] Fetching symbols in the background with dsymForUUID

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, it takes a while to launch the
process. This is expected and therefore many people 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 in the background for every module that shows up in the
backtrace but doesn't have symbols for. From the user's perspective
there is no slowdown, because the process launches immediately, with
whatever symbols are available. Meanwhile, more symbol information is
added over time as the background fetching completes.

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

rdar://76241471

Differential revision: https://reviews.llvm.org/D131328


Compare: https://github.com/llvm/llvm-project/compare/df2213f34547...11f45f36dcf5


More information about the All-commits mailing list