10 #ifndef LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
11 #define LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
42 std::vector<DWARFUnitSection<DWARFTypeUnit>> TUs;
43 std::unique_ptr<DWARFDebugAbbrev> Abbrev;
44 std::unique_ptr<DWARFDebugLoc> Loc;
45 std::unique_ptr<DWARFDebugAranges> Aranges;
46 std::unique_ptr<DWARFDebugLine> Line;
47 std::unique_ptr<DWARFDebugFrame> DebugFrame;
50 std::vector<DWARFUnitSection<DWARFTypeUnit>> DWOTUs;
51 std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
52 std::unique_ptr<DWARFDebugLocDWO> LocDWO;
59 void parseCompileUnits();
63 void parseTypeUnits();
67 void parseDWOCompileUnits();
71 void parseDWOTypeUnits();
100 parseDWOCompileUnits();
124 parseDWOCompileUnits();
125 return DWOCUs.size();
131 return DWOTUs.size();
137 return CUs[index].get();
142 parseDWOCompileUnits();
143 return DWOCUs[index].get();
208 return version == 2 || version == 3 || version == 4;
223 virtual void anchor();
283 return TypesDWOSections;
290 return StringOffsetDWOSection;
virtual StringRef getAbbrevSection()=0
StringRef getPubTypesSection() override
virtual StringRef getAddrSection()=0
DWARFCompileUnit * getDWOCompileUnitAtIndex(unsigned index)
Get the compile unit at the specified index for the DWO compile units.
StringRef getStringOffsetDWOSection() override
const DWARFDebugFrame * getDebugFrame()
Get a pointer to the parsed frame information object.
A parsed .debug_frame section.
const DWARFDebugLocDWO * getDebugLocDWO()
Get a pointer to the parsed DebugLoc object.
StringRef getDebugFrameSection() override
const DWARFDebugLoc * getDebugLoc()
Get a pointer to the parsed DebugLoc object.
virtual StringRef getStringOffsetDWOSection()=0
virtual StringRef getRangeDWOSection()=0
virtual const DWARFSection & getLineSection()=0
virtual const DWARFSection & getAppleTypesSection()=0
DWARFUnitSection< DWARFCompileUnit >::iterator_range cu_iterator_range
unsigned getNumDWOCompileUnits()
Get the number of compile units in the DWO context.
This class is the base class for all object file types.
StringRef getRangeSection() override
This class implements a map that also provides access to all stored values in a deterministic order...
unsigned getNumTypeUnits()
Get the number of compile units in this context.
const DWARFDebugAbbrev * getDebugAbbrevDWO()
Get a pointer to the parsed dwo abbreviations object.
virtual StringRef getStringDWOSection()=0
virtual uint8_t getAddressSize() const =0
virtual const DWARFSection & getAppleNamesSection()=0
bool isLittleEndian() const override
virtual const DWARFSection & getInfoDWOSection()=0
const DWARFSection & getLocSection() override
virtual const DWARFSection & getAppleObjCSection()=0
StringRef getGnuPubTypesSection() override
virtual StringRef getGnuPubTypesSection()=0
virtual const TypeSectionMap & getTypesDWOSections()=0
DILineInfo - a format-neutral container for source line information.
DIContextKind getKind() const
const DWARFSection & getInfoDWOSection() override
StringRef getARangeSection() override
void dump(raw_ostream &OS, DIDumpType DumpType=DIDT_All) override
virtual const DWARFSection & getLocSection()=0
unsigned getNumCompileUnits()
Get the number of compile units in this context.
virtual StringRef getPubTypesSection()=0
unsigned getNumDWOTypeUnits()
Get the number of compile units in the DWO context.
StringRef getGnuPubNamesSection() override
const DWARFSection & getLocDWOSection() override
virtual StringRef getRangeSection()=0
const DWARFDebugAranges * getDebugAranges()
Get a pointer to the parsed DebugAranges object.
const DWARFDebugAbbrev * getDebugAbbrev()
Get a pointer to the parsed DebugAbbrev object.
DWARFCompileUnit * getCompileUnitAtIndex(unsigned index)
Get the compile unit at the specified index for this compile unit.
DWARFContextInMemory is the simplest possible implementation of a DWARFContext.
StringRef getAbbrevDWOSection() override
StringRef getAbbrevSection() override
virtual StringRef getPubNamesSection()=0
const TypeSectionMap & getTypesDWOSections() override
virtual const TypeSectionMap & getTypesSections()=0
DILineInfoSpecifier - controls which fields of DILineInfo container should be filled with data...
DIInliningInfo - a format-neutral container for inlined code description.
DIDumpType
Selects which debug sections get dumped.
DILineInfo getLineInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
const DWARFSection & getAppleNamespacesSection() override
const TypeSectionMap & getTypesSections() override
StringRef getStringSection() override
StringRef getRangeDWOSection() override
StringRef getAddrSection() override
MapVector< object::SectionRef, DWARFSection, std::map< object::SectionRef, unsigned > > TypeSectionMap
iterator_range< std::vector< DWARFUnitSection< DWARFTypeUnit > >::iterator > tu_section_iterator_range
const DWARFSection & getAppleTypesSection() override
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Concrete instance of DWARFUnitSection, specialized for one Unit type.
DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
const DWARFSection & getLineDWOSection() override
tu_section_iterator_range dwo_type_unit_sections()
Get type units in the DWO context.
StringRef getPubNamesSection() override
A range adaptor for a pair of iterators.
DWARFUnitSection< DWARFTypeUnit >::iterator_range tu_iterator_range
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
virtual const DWARFSection & getInfoSection()=0
virtual StringRef getAbbrevDWOSection()=0
static bool isSupportedVersion(unsigned version)
StringRef getStringDWOSection() override
DWARFContextInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L=nullptr)
cu_iterator_range compile_units()
Get compile units in this context.
const DWARFSection & getInfoSection() override
virtual StringRef getARangeSection()=0
static bool classof(const DIContext *DICtx)
cu_iterator_range dwo_compile_units()
Get compile units in the DWO context.
virtual const DWARFSection & getLineDWOSection()=0
virtual const DWARFSection & getAppleNamespacesSection()=0
const DWARFDebugLine::LineTable * getLineTableForUnit(DWARFUnit *cu)
Get a pointer to a parsed line table corresponding to a compile unit.
virtual const DWARFSection & getLocDWOSection()=0
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
virtual StringRef getStringSection()=0
const DWARFSection & getLineSection() override
tu_section_iterator_range type_unit_sections()
Get type units in this context.
virtual StringRef getDebugFrameSection()=0
virtual StringRef getGnuPubNamesSection()=0
DenseMap< uint64_t, std::pair< uint8_t, int64_t > > RelocAddrMap
virtual bool isLittleEndian() const =0
const DWARFSection & getAppleNamesSection() override
const DWARFSection & getAppleObjCSection() override
This is a value type class that represents a single section in the list of sections in the object fil...
uint8_t getAddressSize() const override