LookupAddress makes no sense for DWARFTypeUnit.
Also make GetNonSkeletonUnit to preserve the called type.
Differential Revision: https://reviews.llvm.org/D89646
}
}
}
+
+DWARFCompileUnit &DWARFCompileUnit::GetNonSkeletonUnit() {
+ return llvm::cast<DWARFCompileUnit>(DWARFUnit::GetNonSkeletonUnit());
+}
+
+DWARFDIE DWARFCompileUnit::LookupAddress(const dw_addr_t address) {
+ if (DIE()) {
+ const DWARFDebugAranges &func_aranges = GetFunctionAranges();
+
+ // Re-check the aranges auto pointer contents in case it was created above
+ if (!func_aranges.IsEmpty())
+ return GetDIE(func_aranges.FindAddress(address));
+ }
+ return DWARFDIE();
+}
static bool classof(const DWARFUnit *unit) { return !unit->IsTypeUnit(); }
+ DWARFCompileUnit &GetNonSkeletonUnit();
+
+ DWARFDIE LookupAddress(const dw_addr_t address);
+
private:
DWARFCompileUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid,
const DWARFUnitHeader &header,
m_dwo = std::shared_ptr<DWARFUnit>(std::move(dwo_symbol_file), dwo_cu);
}
-DWARFDIE DWARFUnit::LookupAddress(const dw_addr_t address) {
- if (DIE()) {
- const DWARFDebugAranges &func_aranges = GetFunctionAranges();
-
- // Re-check the aranges auto pointer contents in case it was created above
- if (!func_aranges.IsEmpty())
- return GetDIE(func_aranges.FindAddress(address));
- }
- return DWARFDIE();
-}
-
size_t DWARFUnit::GetDebugInfoSize() const {
return GetLengthByteSize() + GetLength() - GetHeaderByteSize();
}
};
ScopedExtractDIEs ExtractDIEsScoped();
- DWARFDIE LookupAddress(const dw_addr_t address);
bool Verify(lldb_private::Stream *s) const;
virtual void Dump(lldb_private::Stream *s) const = 0;
/// Get the data that contains the DIE information for this unit.
bool lookup_block,
SymbolContext &sc) {
assert(sc.comp_unit);
- DWARFUnit &cu = GetDWARFCompileUnit(sc.comp_unit)->GetNonSkeletonUnit();
+ DWARFCompileUnit &cu =
+ GetDWARFCompileUnit(sc.comp_unit)->GetNonSkeletonUnit();
DWARFDIE function_die = cu.LookupAddress(file_vm_addr);
DWARFDIE block_die;
if (function_die) {