From 65a8efe441f466dd044224247ec05b9fe5ea2f26 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 11 Nov 2015 19:28:21 +0000 Subject: dwarfdump: First piece of support for DWP dumping Just a tiny piece of index dumping - the header in this instance. llvm-svn: 252781 --- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp') diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index aecd991ff0d..7ece6787d07 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -12,6 +12,7 @@ #include "llvm/ADT/StringSwitch.h" #include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h" #include "llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h" +#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h" #include "llvm/Support/Compression.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/Format.h" @@ -155,6 +156,14 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) { } } + if (DumpType == DIDT_All || DumpType == DIDT_CUIndex) { + OS << "\n.debug_cu_index contents:\n"; + DataExtractor CUIndexData(getCUIndexSection(), isLittleEndian(), savedAddressByteSize); + DWARFUnitIndex CUIndex; + CUIndex.parse(CUIndexData); + CUIndex.dump(OS); + } + if (DumpType == DIDT_All || DumpType == DIDT_LineDwo) { OS << "\n.debug_line.dwo contents:\n"; unsigned stmtOffset = 0; @@ -608,6 +617,7 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj, .Case("apple_namespaces", &AppleNamespacesSection.Data) .Case("apple_namespac", &AppleNamespacesSection.Data) .Case("apple_objc", &AppleObjCSection.Data) + .Case("debug_cu_index", &CUIndexSection) // Any more debug info sections go here. .Default(nullptr); if (SectionData) { -- cgit v1.2.3