10 #ifndef LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
11 #define LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
54 std::deque<DWARFUnitSection<DWARFTypeUnit>> TUs;
55 std::unique_ptr<DWARFUnitIndex> CUIndex;
56 std::unique_ptr<DWARFGdbIndex> GdbIndex;
57 std::unique_ptr<DWARFUnitIndex> TUIndex;
58 std::unique_ptr<DWARFDebugAbbrev> Abbrev;
59 std::unique_ptr<DWARFDebugLoc> Loc;
60 std::unique_ptr<DWARFDebugAranges> Aranges;
61 std::unique_ptr<DWARFDebugLine> Line;
62 std::unique_ptr<DWARFDebugFrame> DebugFrame;
63 std::unique_ptr<DWARFDebugFrame> EHFrame;
64 std::unique_ptr<DWARFDebugMacro> Macro;
67 std::deque<DWARFUnitSection<DWARFTypeUnit>> DWOTUs;
68 std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
69 std::unique_ptr<DWARFDebugLocDWO> LocDWO;
73 void parseCompileUnits();
77 void parseTypeUnits();
81 void parseDWOCompileUnits();
85 void parseDWOTypeUnits();
97 bool DumpEH =
false,
bool SummarizeTypes =
false)
override;
117 parseDWOCompileUnits();
141 parseDWOCompileUnits();
142 return DWOCUs.size();
148 return DWOTUs.size();
154 return CUs[index].get();
159 parseDWOCompileUnits();
160 return DWOCUs[index].get();
240 return version == 2 || version == 3 || version == 4 || version == 5;
256 virtual void anchor();
325 return TypesDWOSections;
332 return StringOffsetDWOSection;
345 #endif // LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
const DWARFUnitIndex & getTUIndex()
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.
const DWARFDebugFrame * getEHFrame()
Get a pointer to the parsed eh frame information object.
StringRef getGdbIndexSection() override
StringRef getStringOffsetDWOSection() override
const DWARFDebugFrame * getDebugFrame()
Get a pointer to the parsed frame information object.
StringRef getEHFrameSection() override
StringRef getTUIndexSection() override
A parsed .debug_frame or .eh_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
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
DWARFGdbIndex & getGdbIndex()
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.
void dump(raw_ostream &OS, DIDumpType DumpType=DIDT_All, bool DumpEH=false, bool SummarizeTypes=false) override
DIContextKind getKind() const
const DWARFSection & getInfoDWOSection() override
StringRef getARangeSection() override
StringRef getMacinfoSection() 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 getCUIndexSection()=0
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...
const DWARFDebugMacro * getDebugMacro()
Get a pointer to the parsed DebugMacro object.
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
StringRef getCUIndexSection() 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
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.
virtual StringRef getGdbIndexSection()=0
const DWARFSection & getInfoSection() override
virtual StringRef getARangeSection()=0
static bool classof(const DIContext *DICtx)
const DWARFUnitIndex & getCUIndex()
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.
iterator_range< decltype(TUs)::iterator > tu_section_iterator_range
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 getMacinfoSection()=0
virtual StringRef getDebugFrameSection()=0
virtual StringRef getGnuPubNamesSection()=0
virtual StringRef getEHFrameSection()=0
DWARFContext & operator=(DWARFContext &)=delete
virtual StringRef getTUIndexSection()=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