diff options
author | Pavel Labath <pavel@labath.sk> | 2019-05-06 07:45:28 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-05-06 07:45:28 +0000 |
commit | 2a0cfcce6a272f64432d6eb18fa922e6f4631f77 (patch) | |
tree | 818017feb4b6e44c490a7b932e58661c138f5d87 /lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h | |
parent | a778074165ca9554c9556b9bbeee6ca4e2babe96 (diff) | |
download | bcm5719-llvm-2a0cfcce6a272f64432d6eb18fa922e6f4631f77.tar.gz bcm5719-llvm-2a0cfcce6a272f64432d6eb18fa922e6f4631f77.zip |
[DWARF] Reimplement/simplify DWARFUnit::GetID
Summary:
The implementation of GetID used a relatively complicated algorithm,
which returned some kind of an offset of the unit in some file
(depending on the debug info flavour). The only thing this ID was used
for was to enable subseqent retrieval of the unit from the SymbolFile.
This can be made simpler if we just make the "ID" of the unit an index
into the list of the units belonging to the symbol file. We already
support indexed access to the units, so each unit already has a well
"index" -- this just makes it accessible from within the unit.
To make the distincion between "id" and "offset" clearer (and help catch
any misuses), I also rename DWARFDebugInfo::GetCompileUnit (which
accesses by offset) into DWARFDebugInfo::GetCompileUnitAtOffset.
On its own, this only brings a minor simplification, but it enables
further simplifications in the DIERef class (coming in a follow-up
patch).
Reviewers: JDevlieghere, clayborg, aprantl
Subscribers: arphaman, jdoerfert, lldb-commits, tberghammer, jankratochvil
Differential Revision: https://reviews.llvm.org/D61481
llvm-svn: 360014
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index 4c8e0700743..dee657228e8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -40,8 +40,9 @@ public: void SetDwarfData(SymbolFileDWARF *dwarf2Data); size_t GetNumCompileUnits(); - DWARFUnit *GetCompileUnitAtIndex(uint32_t idx); - DWARFUnit *GetCompileUnit(dw_offset_t cu_offset, uint32_t *idx_ptr = NULL); + DWARFUnit *GetCompileUnitAtIndex(lldb::user_id_t idx); + DWARFUnit *GetCompileUnitAtOffset(dw_offset_t cu_offset, + uint32_t *idx_ptr = NULL); DWARFUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset); DWARFUnit *GetCompileUnit(const DIERef &die_ref); DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset); |