18#include "llvm/Support/Casting.h"
34 : m_dwarf(
dwarf), m_context(context), m_units(), m_cu_aranges_up() {}
48 std::set<dw_offset_t> cus_with_data;
52 cus_with_data.insert(offset);
64 for (
size_t idx = 0; idx < num_units; ++idx) {
68 if (cus_with_data.find(offset) == cus_with_data.end())
73 const bool minimize =
true;
89 llvm::consumeError(unit_sp.takeError());
96 offset = (*unit_sp)->GetNextUnitOffset();
98 if (
auto *type_unit = llvm::dyn_cast<DWARFTypeUnit>(unit_sp->get())) {
100 unit_sp.get()->GetID());
131 auto pos = llvm::upper_bound(
132 m_units, std::make_pair(section, offset),
133 [](
const std::pair<DIERef::Section, dw_offset_t> &lhs,
135 return lhs < std::make_pair(rhs->GetDebugSection(), rhs->GetOffset());
137 uint32_t idx = std::distance(
m_units.begin(), pos);
148 if (result && result->
GetOffset() != cu_offset) {
173 std::make_pair(hash, 0u), llvm::less_first());
std::shared_ptr< DWARFUnit > DWARFUnitSP
Identifies a DWARF debug info entry within a given Module.
dw_offset_t die_offset() const
DWARFDebugInfo(SymbolFileDWARF &dwarf, lldb_private::DWARFContext &context)
SymbolFileDWARF & m_dwarf
DWARFTypeUnit * GetTypeUnitForHash(uint64_t hash)
DWARFUnit * GetUnitAtOffset(DIERef::Section section, dw_offset_t cu_offset, uint32_t *idx_ptr=nullptr)
uint32_t FindUnitIndex(DIERef::Section section, dw_offset_t offset)
const DWARFDebugAranges & GetCompileUnitAranges()
void ParseUnitsFor(DIERef::Section section)
void ParseUnitHeadersIfNeeded()
DWARFDIE GetDIE(const DIERef &die_ref)
DWARFUnit * GetUnitContainingDIEOffset(DIERef::Section section, dw_offset_t die_offset)
DWARFUnit * GetUnitAtIndex(size_t idx)
std::vector< std::pair< uint64_t, uint32_t > > m_type_hash_to_unit_index
llvm::once_flag m_units_once_flag
std::unique_ptr< DWARFDebugAranges > m_cu_aranges_up
DWARFUnit * GetUnit(const DIERef &die_ref)
lldb_private::DWARFContext & m_context
virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges)=0
static llvm::Expected< DWARFUnitSP > extract(SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid, const lldb_private::DWARFDataExtractor &debug_info, DIERef::Section section, lldb::offset_t *offset_ptr)
bool ContainsDIEOffset(dw_offset_t die_offset) const
DWARFUnit & GetNonSkeletonUnit()
DWARFDIE GetDIE(dw_offset_t die_offset)
dw_offset_t GetOffset() const
const DWARFDataExtractor & getOrLoadArangesData()
const DWARFDataExtractor & getOrLoadDebugTypesData()
const DWARFDataExtractor & getOrLoadDebugInfoData()
A plug-in interface definition class for object file parsers.
virtual bool CanTrustAddressRanges()
Can we trust the address ranges accelerator associated with this object file to be complete.
ObjectFile * GetObjectFile() override
#define DW_INVALID_OFFSET
A class that represents a running process on the host machine.