[all-commits] [llvm/llvm-project] befa77: [lldb] Filter DIEs based on qualified name where p...

Alex via All-commits all-commits at lists.llvm.org
Thu Aug 4 11:19:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: befa77e59a7760d8c4fdd177b234e4a59500f61c
      https://github.com/llvm/llvm-project/commit/befa77e59a7760d8c4fdd177b234e4a59500f61c
  Author: Alex Langford <apl at fb.com>
  Date:   2022-08-04 (Thu, 04 Aug 2022)

  Changed paths:
    M lldb/include/lldb/Core/Module.h
    M lldb/include/lldb/Symbol/SymbolFile.h
    M lldb/include/lldb/Symbol/SymbolFileOnDemand.h
    M lldb/source/Breakpoint/BreakpointResolverName.cpp
    M lldb/source/Core/Module.cpp
    M lldb/source/Core/ModuleList.cpp
    M lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
    M lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
    M lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
    M lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
    M lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
    M lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
    M lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
    M lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
    M lldb/source/Symbol/SymbolFile.cpp
    M lldb/source/Symbol/SymbolFileOnDemand.cpp
    M lldb/tools/lldb-test/lldb-test.cpp

  Log Message:
  -----------
  [lldb] Filter DIEs based on qualified name where possible

Context:
When setting a breakpoint by name, we invoke Module::FindFunctions to
find the function(s) in question. However, we use a Module::LookupInfo
to first process the user-provided name and figure out exactly what
we're looking for. When we actually perform the function lookup, we
search for the basename. After performing the search, we then filter out
the results using Module::LookupInfo::Prune. For example, given
a::b::foo we would first search for all instances of foo and then filter
out the results to just names that have a::b::foo in them. As one can
imagine, this involves a lot of debug info processing that we do not
necessarily need to be doing. Instead of doing one large post-processing
step after finding each instance of `foo`, we can filter them as we go
to save time.

Some numbers:
Debugging LLDB and placing a breakpoint on
llvm::itanium_demangle::StringView::begin without this change takes
approximately 70 seconds and resolves 31,920 DIEs. With this change,
placing the breakpoint takes around 30 seconds and resolves 8 DIEs.

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




More information about the All-commits mailing list