JDevlieghere updated this revision to Diff 487509.
JDevlieghere added a comment.
> Apparently for very small / gapless programs, clang emits single-value
> DW_AT_low_pc/high_pc in the compile unit, and dsymutil does not rewrite that
> into DW_AT_ranges.
Although this statement is correct, it shouldn't affect this patch. Even when
the compile units uses DW_AT_low_pc/high_pc, dsymutil still emits the correct
aranges. Without a counter-example we should go ahead with this patch.
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;
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;
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits