[Lldb-commits] [PATCH] D68655: Trust the arange accelerator tables in dSYMs

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 9 14:35:12 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8b259fe573e1: [lldb] Trust the arange accelerator tables in dSYMs (authored by JDevlieghere).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68655/new/

https://reviews.llvm.org/D68655

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp


Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -53,13 +53,20 @@
   }
 
   // Manually build arange data for everything that wasn't in .debug_aranges.
-  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());
+  // Skip this step for dSYMs as we can trust dsymutil to have emitted complete
+  // aranges.
+  const bool is_dsym =
+      m_dwarf.GetObjectFile() &&
+      m_dwarf.GetObjectFile()->GetType() == ObjectFile::eTypeDebugInfo;
+  if (!is_dsym) {
+    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());
+    }
   }
 
   const bool minimize = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68655.487557.patch
Type: text/x-patch
Size: 1256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230109/94e275fb/attachment-0001.bin>


More information about the lldb-commits mailing list