llvm-project/lldb/source/Symbol
Jeffrey Tan 7b81192d46 Introduce new symbol on-demand for debug info
This diff introduces a new symbol on-demand which skips
loading a module's debug info unless explicitly asked on
demand. This provides significant performance improvement
for application with dynamic linking mode which has large
number of modules.
The feature can be turned on with:
"settings set symbols.load-on-demand true"

The feature works by creating a new SymbolFileOnDemand class for
each module which wraps the actual SymbolFIle subclass as member
variable. By default, most virtual methods on SymbolFileOnDemand are
skipped so that it looks like there is no debug info for that module.
But once the module's debug info is explicitly requested to
be enabled (in the conditions mentioned below) SymbolFileOnDemand
will allow all methods to pass through and forward to the actual SymbolFile
which would hydrate module's debug info on-demand.

In an internal benchmark, we are seeing more than 95% improvement
for a 3000 modules application.

Currently we are providing several ways to on demand hydrate
a module's debug info:
* Source line breakpoint: matching in supported files
* Stack trace: resolving symbol context for an address
* Symbolic breakpoint: symbol table match guided promotion
* Global variable: symbol table match guided promotion

In all above situations the module's debug info will be on-demand
parsed and indexed.

Some follow-ups for this feature:
* Add a command that allows users to load debug info explicitly while using a
  new or existing command when this feature is enabled
* Add settings for "never load any of these executables in Symbols On Demand"
  that takes a list of globs
* Add settings for "always load the the debug info for executables in Symbols
  On Demand" that takes a list of globs
* Add a new column in "image list" that shows up by default when Symbols On
  Demand is enable to show the status for each shlib like "not enabled for
  this", "debug info off" and "debug info on" (with a single character to
  short string, not the ones I just typed)

Differential Revision: https://reviews.llvm.org/D121631
2022-04-26 10:42:06 -07:00
..
ArmUnwindInfo.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Block.cpp [lldb] Rename Logging.h to LLDBLog.h and clean up includes 2022-02-03 14:47:01 +01:00
CMakeLists.txt Introduce new symbol on-demand for debug info 2022-04-26 10:42:06 -07:00
CompactUnwindInfo.cpp [lldb] Rename Logging.h to LLDBLog.h and clean up includes 2022-02-03 14:47:01 +01:00
CompileUnit.cpp Introduce new symbol on-demand for debug info 2022-04-26 10:42:06 -07:00
CompilerDecl.cpp
CompilerDeclContext.cpp
CompilerType.cpp [lldb][NFC] Give CompilerType's IsArrayType/IsVectorType/IsBlockPointerType out-parameters default values 2021-02-23 11:15:31 +01:00
DWARFCallFrameInfo.cpp [LLDB] Remove cases of using namespace llvm:: from header file 2022-03-03 10:39:06 -08:00
DebugMacros.cpp
DeclVendor.cpp [lldb][NFC] Remove outdated FIXME 2021-09-20 11:44:20 -07:00
FuncUnwinders.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Function.cpp [lldb] Rename Logging.h to LLDBLog.h and clean up includes 2022-02-03 14:47:01 +01:00
LineEntry.cpp Change PathMappingList::FindFile to return an optional result (NFC) 2021-06-29 15:10:46 -07:00
LineTable.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
LocateSymbolFile.cpp [lldb] Show the DBGError if dsymForUUID can't find a dSYM 2022-04-14 16:54:00 -07:00
LocateSymbolFileMacOSX.cpp [lldb] Show the DBGError if dsymForUUID can't find a dSYM 2022-04-14 16:54:00 -07:00
LocateSymbolFileMacOSX.cpp.rej [lldb] Show the DBGError if dsymForUUID can't find a dSYM 2022-04-14 16:54:00 -07:00
ObjectFile.cpp [lldb] Change CreateMemoryInstance to take a WritableDataBuffer 2022-04-05 13:46:41 -07:00
PostfixExpression.cpp [LLDB] Remove cases of using namespace llvm:: from header file 2022-03-03 10:39:06 -08:00
Symbol.cpp [LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB 2022-03-14 13:32:03 -07:00
SymbolContext.cpp [lldb] Prevent crash when adding a stop hook with --shlib 2022-04-14 11:00:21 -07:00
SymbolFile.cpp Introduce new symbol on-demand for debug info 2022-04-26 10:42:06 -07:00
SymbolFileOnDemand.cpp Introduce new symbol on-demand for debug info 2022-04-26 10:42:06 -07:00
SymbolVendor.cpp [lldb] Return StringRef from PluginInterface::GetPluginName 2021-10-18 10:14:42 +02:00
Symtab.cpp [lldb] Rename DemangleWithRichManglingInfo to GetRichManglingInfo (NFC) 2022-02-04 10:40:33 -08:00
Type.cpp [LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB 2022-03-14 13:32:03 -07:00
TypeList.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
TypeMap.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
TypeSystem.cpp Use true/false instead of 1/0 (NFC) 2022-01-09 12:21:06 -08:00
UnwindPlan.cpp Cleanup LLVMDWARFDebugInfo 2022-02-15 09:16:03 +01:00
UnwindTable.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Variable.cpp [LLDB][NativePDB] Add support for S_DEFRANGE_REGISTER and S_DEFRANGE_SUBFIELD_REGISTER 2022-03-10 12:40:31 -08:00
VariableList.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00