[Lldb-commits] [lldb] r374117 - Trust the arange accelerator tables in dSYMs

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 8 14:14:36 PDT 2019


Author: adrian
Date: Tue Oct  8 14:14:36 2019
New Revision: 374117

URL: http://llvm.org/viewvc/llvm-project?rev=374117&view=rev
Log:
Trust the arange accelerator tables in dSYMs

When ingesting aranges from a dSYM it makes sense to always trust the
contents of the accelerator table since it always comes from
dsymutil. According to Instruments, skipping the decoding of all CU
DIEs to get at the DW_AT_ranges attribute removes ~3.5 seconds from
setting a breakpoint by file/line when debugging clang with a
dSYM. Interestingly on the wall clock the speedup is less noticeable,
but still present.

rdar://problem/56057688

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

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=374117&r1=374116&r2=374117&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Tue Oct  8 14:14:36 2019
@@ -54,13 +54,19 @@ llvm::Expected<DWARFDebugAranges &> DWAR
 
   // Manually build arange data for everything that wasn't in the
   // .debug_aranges table.
-  const size_t num_units = GetNumUnits();
-  for (size_t idx = 0; idx < num_units; ++idx) {
-    DWARFUnit *cu = GetUnitAtIndex(idx);
+  //
+  // This step is skipped for dSYMs and other debug-info-only
+  // objects, which are always trusted to have a complete table.
+  auto *obj = m_dwarf.GetObjectFile();
+  if (!obj || obj->GetType() != ObjectFile::eTypeDebugInfo) {
+    const size_t num_units = GetNumUnits();
+    for (size_t idx = 0; idx < num_units; ++idx) {
+      DWARFUnit *cu = GetUnitAtIndex(idx);
 
-    dw_offset_t offset = cu->GetOffset();
-    if (cus_with_data.find(offset) == cus_with_data.end())
-      cu->BuildAddressRangeTable(m_cu_aranges_up.get());
+      dw_offset_t offset = cu->GetOffset();
+      if (cus_with_data.find(offset) == cus_with_data.end())
+        cu->BuildAddressRangeTable(m_cu_aranges_up.get());
+    }
   }
 
   const bool minimize = true;




More information about the lldb-commits mailing list