[Lldb-commits] [PATCH] D129682: [lldb] Filter DIEs based on qualified name when possible

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 13 12:06:33 PDT 2022


bulbazord created this revision.
bulbazord added reviewers: clayborg, jingham, JDevlieghere, labath.
Herald added a subscriber: arphaman.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.

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.

The main portion of this change is in `DWARFIndex::ProcessFunctionDIE` and `DWARFDebugInfoEntry::GetQualifiedNameWithParams`. We take a portion of `Module::LookupInfo::Prune` and put it in `ProcessFunctionDIE` to avoid processing large amounts of debug information. In order to accomplish this, I added a function that gets the fully qualified name of a function DIE with the parameters included. The remaining bits of the change require piping a `LookupInfo` object through various functions to make sure we have both the name we want to use to look things up and the user-provided name for filtering.

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.

Seeing as this is a large change, I can break it up into smaller, more digestible pieces as necessary.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129682

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129682.444368.patch
Type: text/x-patch
Size: 34276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220713/518f2012/attachment-0001.bin>


More information about the lldb-commits mailing list