dwarfdump: DWP type unit index dumping skeleton
[oota-llvm.git] / lib / DebugInfo / DWARF / DWARFContext.cpp
index 9d5a78a05708a5fa19860dce6e5daab48f7ec5c5..d6ed6f842070c87cc1ba503d081a210c996ffd09 100644 (file)
@@ -165,6 +165,15 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
     CUIndex.dump(OS);
   }
 
+  if (DumpType == DIDT_All || DumpType == DIDT_TUIndex) {
+    OS << "\n.debug_tu_index contents:\n";
+    DataExtractor TUIndexData(getTUIndexSection(), isLittleEndian(),
+                              savedAddressByteSize);
+    DWARFUnitIndex TUIndex;
+    TUIndex.parse(TUIndexData);
+    TUIndex.dump(OS);
+  }
+
   if (DumpType == DIDT_All || DumpType == DIDT_LineDwo) {
     OS << "\n.debug_line.dwo contents:\n";
     unsigned stmtOffset = 0;
@@ -619,6 +628,7 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj,
             .Case("apple_namespac", &AppleNamespacesSection.Data)
             .Case("apple_objc", &AppleObjCSection.Data)
             .Case("debug_cu_index", &CUIndexSection)
+            .Case("debug_tu_index", &TUIndexSection)
             // Any more debug info sections go here.
             .Default(nullptr);
     if (SectionData) {