summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-10-08 21:14:36 +0000
committerAdrian Prantl <aprantl@apple.com>2019-10-08 21:14:36 +0000
commit6399db2f6fd64fa250093368be40eb5ae3af513b (patch)
treed80b0160d51ea472b59c029dfded6614fd1b2821 /lldb
parent1ea8bb39b9c4ec71bb53196a2cdfa001328e1cac (diff)
downloadbcm5719-llvm-6399db2f6fd64fa250093368be40eb5ae3af513b.tar.gz
bcm5719-llvm-6399db2f6fd64fa250093368be40eb5ae3af513b.zip
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 llvm-svn: 374117
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 1e04baca2c5..57e6d12a5a3 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -54,13 +54,19 @@ llvm::Expected<DWARFDebugAranges &> DWARFDebugInfo::GetCompileUnitAranges() {
// 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);
-
- dw_offset_t offset = cu->GetOffset();
- if (cus_with_data.find(offset) == cus_with_data.end())
- cu->BuildAddressRangeTable(m_cu_aranges_up.get());
+ //
+ // 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());
+ }
}
const bool minimize = true;
OpenPOWER on IntegriCloud