Improve DWARFDebugFrame::parse to also handle __eh_frame.
[oota-llvm.git] / include / llvm / DebugInfo / DWARF / DWARFContext.h
index ce253a05bf89f4b7c22947e0eb481c032ace59e5..71d5f25a420b25da0e68dc5ca938c901d669361a 100644 (file)
@@ -48,6 +48,7 @@ class DWARFContext : public DIContext {
   std::unique_ptr<DWARFDebugAranges> Aranges;
   std::unique_ptr<DWARFDebugLine> Line;
   std::unique_ptr<DWARFDebugFrame> DebugFrame;
+  std::unique_ptr<DWARFDebugFrame> EHFrame;
   std::unique_ptr<DWARFDebugMacro> Macro;
 
   DWARFUnitSection<DWARFCompileUnit> DWOCUs;
@@ -81,7 +82,8 @@ public:
     return DICtx->getKind() == CK_DWARF;
   }
 
-  void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override;
+  void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All,
+            bool DumpEH = false) override;
 
   typedef DWARFUnitSection<DWARFCompileUnit>::iterator_range cu_iterator_range;
   typedef DWARFUnitSection<DWARFTypeUnit>::iterator_range tu_iterator_range;
@@ -168,6 +170,9 @@ public:
   /// Get a pointer to the parsed frame information object.
   const DWARFDebugFrame *getDebugFrame();
 
+  /// Get a pointer to the parsed eh frame information object.
+  const DWARFDebugFrame *getEHFrame();
+
   /// Get a pointer to the parsed DebugMacro object.
   const DWARFDebugMacro *getDebugMacro();
 
@@ -191,6 +196,7 @@ public:
   virtual const DWARFSection &getLocSection() = 0;
   virtual StringRef getARangeSection() = 0;
   virtual StringRef getDebugFrameSection() = 0;
+  virtual StringRef getEHFrameSection() = 0;
   virtual const DWARFSection &getLineSection() = 0;
   virtual StringRef getStringSection() = 0;
   virtual StringRef getRangeSection() = 0;
@@ -242,6 +248,7 @@ class DWARFContextInMemory : public DWARFContext {
   DWARFSection LocSection;
   StringRef ARangeSection;
   StringRef DebugFrameSection;
+  StringRef EHFrameSection;
   DWARFSection LineSection;
   StringRef StringSection;
   StringRef RangeSection;
@@ -281,6 +288,7 @@ public:
   const DWARFSection &getLocSection() override { return LocSection; }
   StringRef getARangeSection() override { return ARangeSection; }
   StringRef getDebugFrameSection() override { return DebugFrameSection; }
+  StringRef getEHFrameSection() override { return EHFrameSection; }
   const DWARFSection &getLineSection() override { return LineSection; }
   StringRef getStringSection() override { return StringSection; }
   StringRef getRangeSection() override { return RangeSection; }