summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFContext.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-01-09 05:08:24 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-01-09 05:08:24 +0000
commita34ec4a961503e1ceb6c6c3ce0b59911960b8fa1 (patch)
treee47861d4a1b522985bb14c9a463e5eacae5a0765 /lib/DebugInfo/DWARFContext.h
parent3ca4db23ed3bf1798e238722319633e07ed39f44 (diff)
downloadllvm-a34ec4a961503e1ceb6c6c3ce0b59911960b8fa1.tar.gz
llvm-a34ec4a961503e1ceb6c6c3ce0b59911960b8fa1.tar.bz2
llvm-a34ec4a961503e1ceb6c6c3ce0b59911960b8fa1.tar.xz
llvm-dwarfdump: type unit dwo support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.h')
-rw-r--r--lib/DebugInfo/DWARFContext.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h
index e74b5baaa0..9bac69d6e5 100644
--- a/lib/DebugInfo/DWARFContext.h
+++ b/lib/DebugInfo/DWARFContext.h
@@ -38,6 +38,7 @@ class DWARFContext : public DIContext {
OwningPtr<DWARFDebugFrame> DebugFrame;
SmallVector<DWARFCompileUnit *, 1> DWOCUs;
+ SmallVector<DWARFTypeUnit *, 1> DWOTUs;
OwningPtr<DWARFDebugAbbrev> AbbrevDWO;
DWARFContext(DWARFContext &) LLVM_DELETED_FUNCTION;
@@ -53,6 +54,10 @@ class DWARFContext : public DIContext {
/// DWOCUs.
void parseDWOCompileUnits();
+ /// Read type units from the debug_types.dwo section and store them in
+ /// DWOTUs.
+ void parseDWOTypeUnits();
+
public:
struct Section {
StringRef Data;
@@ -89,6 +94,13 @@ public:
return DWOCUs.size();
}
+ /// Get the number of compile units in the DWO context.
+ unsigned getNumDWOTypeUnits() {
+ if (DWOTUs.empty())
+ parseDWOTypeUnits();
+ return DWOTUs.size();
+ }
+
/// Get the compile unit at the specified index for this compile unit.
DWARFCompileUnit *getCompileUnitAtIndex(unsigned index) {
if (CUs.empty())
@@ -110,6 +122,13 @@ public:
return DWOCUs[index];
}
+ /// Get the type unit at the specified index for the DWO type units.
+ DWARFTypeUnit *getDWOTypeUnitAtIndex(unsigned index) {
+ if (DWOTUs.empty())
+ parseDWOTypeUnits();
+ return DWOTUs[index];
+ }
+
/// Get a pointer to the parsed DebugAbbrev object.
const DWARFDebugAbbrev *getDebugAbbrev();
@@ -156,6 +175,7 @@ public:
// Sections for DWARF5 split dwarf proposal.
virtual const Section &getInfoDWOSection() = 0;
+ virtual const TypeSectionMap &getTypesDWOSections() = 0;
virtual StringRef getAbbrevDWOSection() = 0;
virtual StringRef getStringDWOSection() = 0;
virtual StringRef getStringOffsetDWOSection() = 0;
@@ -197,6 +217,7 @@ class DWARFContextInMemory : public DWARFContext {
// Sections for DWARF5 split dwarf proposal.
Section InfoDWOSection;
+ TypeSectionMap TypesDWOSections;
StringRef AbbrevDWOSection;
StringRef StringDWOSection;
StringRef StringOffsetDWOSection;
@@ -226,6 +247,9 @@ public:
// Sections for DWARF5 split dwarf proposal.
virtual const Section &getInfoDWOSection() { return InfoDWOSection; }
+ virtual const TypeSectionMap &getTypesDWOSections() {
+ return TypesDWOSections;
+ }
virtual StringRef getAbbrevDWOSection() { return AbbrevDWOSection; }
virtual StringRef getStringDWOSection() { return StringDWOSection; }
virtual StringRef getStringOffsetDWOSection() {