diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-09-23 22:44:47 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-09-23 22:44:47 +0000 |
commit | 03c089cf97e759300ad89f776481719f623f2489 (patch) | |
tree | aee883daf6b2972ff3f8d8bfd0214a5c44289d86 /llvm/lib/DebugInfo/DWARFContext.h | |
parent | 07e22449a3d3deb7c0e4f73a88d14bd3336fa24c (diff) | |
download | bcm5719-llvm-03c089cf97e759300ad89f776481719f623f2489.tar.gz bcm5719-llvm-03c089cf97e759300ad89f776481719f623f2489.zip |
llvm-dwarfdump/libDebugInfo support for type units
llvm-svn: 191234
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFContext.h')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.h b/llvm/lib/DebugInfo/DWARFContext.h index cda4475482d..242d186c696 100644 --- a/llvm/lib/DebugInfo/DWARFContext.h +++ b/llvm/lib/DebugInfo/DWARFContext.h @@ -16,6 +16,7 @@ #include "DWARFDebugLine.h" #include "DWARFDebugLoc.h" #include "DWARFDebugRangeList.h" +#include "DWARFTypeUnit.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/DebugInfo/DIContext.h" @@ -28,6 +29,7 @@ namespace llvm { /// methods that a concrete implementation provides. class DWARFContext : public DIContext { SmallVector<DWARFCompileUnit *, 1> CUs; + SmallVector<DWARFTypeUnit *, 1> TUs; OwningPtr<DWARFDebugAbbrev> Abbrev; OwningPtr<DWARFDebugLoc> Loc; OwningPtr<DWARFDebugAranges> Aranges; @@ -43,6 +45,9 @@ class DWARFContext : public DIContext { /// Read compile units from the debug_info section and store them in CUs. void parseCompileUnits(); + /// Read type units from the debug_types sections and store them in CUs. + void parseTypeUnits(); + /// Read compile units from the debug_info.dwo section and store them in /// DWOCUs. void parseDWOCompileUnits(); @@ -69,6 +74,13 @@ public: return CUs.size(); } + /// Get the number of compile units in this context. + unsigned getNumTypeUnits() { + if (TUs.empty()) + parseTypeUnits(); + return TUs.size(); + } + /// Get the number of compile units in the DWO context. unsigned getNumDWOCompileUnits() { if (DWOCUs.empty()) @@ -83,6 +95,13 @@ public: return CUs[index]; } + /// Get the type unit at the specified index for this compile unit. + DWARFTypeUnit *getTypeUnitAtIndex(unsigned index) { + if (TUs.empty()) + parseTypeUnits(); + return TUs[index]; + } + /// Get the compile unit at the specified index for the DWO compile units. DWARFCompileUnit *getDWOCompileUnitAtIndex(unsigned index) { if (DWOCUs.empty()) @@ -119,6 +138,7 @@ public: virtual bool isLittleEndian() const = 0; virtual uint8_t getAddressSize() const = 0; virtual const Section &getInfoSection() = 0; + virtual const std::map<object::SectionRef, Section> &getTypesSections() = 0; virtual StringRef getAbbrevSection() = 0; virtual const Section &getLocSection() = 0; virtual StringRef getARangeSection() = 0; @@ -157,6 +177,7 @@ class DWARFContextInMemory : public DWARFContext { bool IsLittleEndian; uint8_t AddressSize; Section InfoSection; + std::map<object::SectionRef, Section> TypesSections; StringRef AbbrevSection; Section LocSection; StringRef ARangeSection; @@ -183,6 +204,9 @@ public: virtual bool isLittleEndian() const { return IsLittleEndian; } virtual uint8_t getAddressSize() const { return AddressSize; } virtual const Section &getInfoSection() { return InfoSection; } + virtual const std::map<object::SectionRef, Section> &getTypesSections() { + return TypesSections; + } virtual StringRef getAbbrevSection() { return AbbrevSection; } virtual const Section &getLocSection() { return LocSection; } virtual StringRef getARangeSection() { return ARangeSection; } |