diff options
| author | David Blaikie <dblaikie@gmail.com> | 2013-09-19 23:01:29 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2013-09-19 23:01:29 +0000 |
| commit | 404d3047c00e9a0e3fa53ccc2d24161e9a82d33b (patch) | |
| tree | 545780e6bdb933a4de836bf0eab6d9aa2e945cbc /llvm/lib/DebugInfo | |
| parent | d09bb4614b81cb9969240f7db4b706dbd7f61ec6 (diff) | |
| download | bcm5719-llvm-404d3047c00e9a0e3fa53ccc2d24161e9a82d33b.tar.gz bcm5719-llvm-404d3047c00e9a0e3fa53ccc2d24161e9a82d33b.zip | |
DebugInfo: llvm-dwarfdump support for gnu_pubnames section
llvm-svn: 191050
Diffstat (limited to 'llvm/lib/DebugInfo')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.cpp | 22 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.h | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index baf2bb5b577..c87855e530b 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -120,6 +120,27 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) { } } + if (DumpType == DIDT_All || DumpType == DIDT_GnuPubnames) { + OS << "\n.debug_gnu_pubnames contents:\n"; + DataExtractor pubNames(getGnuPubNamesSection(), isLittleEndian(), 0); + offset = 0; + OS << "Length: " << pubNames.getU32(&offset) << "\n"; + OS << "Version: " << pubNames.getU16(&offset) << "\n"; + OS << "Offset in .debug_info: " << pubNames.getU32(&offset) << "\n"; + OS << "Size: " << pubNames.getU32(&offset) << "\n"; + OS << "Offset Linkage Kind Name\n"; + while (offset < getGnuPubNamesSection().size()) { + uint32_t dieRef = pubNames.getU32(&offset); + if (dieRef == 0) + break; + PubIndexEntryDescriptor desc(pubNames.getU8(&offset)); + OS << format("0x%8.8x ", dieRef) + << format("%-8s", dwarf::GDBIndexEntryLinkageString(desc.Linkage)) + << ' ' << dwarf::GDBIndexEntryKindString(desc.Kind) << ' ' + << pubNames.getCStr(&offset) << "\n"; + } + } + if (DumpType == DIDT_All || DumpType == DIDT_AbbrevDwo) { const DWARFDebugAbbrev *D = getDebugAbbrevDWO(); if (D) { @@ -566,6 +587,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) : .Case("debug_str", &StringSection) .Case("debug_ranges", &RangeSection) .Case("debug_pubnames", &PubNamesSection) + .Case("debug_gnu_pubnames", &GnuPubNamesSection) .Case("debug_info.dwo", &InfoDWOSection) .Case("debug_abbrev.dwo", &AbbrevDWOSection) .Case("debug_str.dwo", &StringDWOSection) diff --git a/llvm/lib/DebugInfo/DWARFContext.h b/llvm/lib/DebugInfo/DWARFContext.h index c491b4ca492..e4b640e4c90 100644 --- a/llvm/lib/DebugInfo/DWARFContext.h +++ b/llvm/lib/DebugInfo/DWARFContext.h @@ -125,6 +125,7 @@ public: virtual StringRef getStringSection() = 0; virtual StringRef getRangeSection() = 0; virtual StringRef getPubNamesSection() = 0; + virtual StringRef getGnuPubNamesSection() = 0; // Sections for DWARF5 split dwarf proposal. virtual StringRef getInfoDWOSection() = 0; @@ -166,6 +167,7 @@ class DWARFContextInMemory : public DWARFContext { StringRef StringSection; StringRef RangeSection; StringRef PubNamesSection; + StringRef GnuPubNamesSection; // Sections for DWARF5 split dwarf proposal. RelocAddrMap InfoDWORelocMap; @@ -195,6 +197,7 @@ public: virtual StringRef getStringSection() { return StringSection; } virtual StringRef getRangeSection() { return RangeSection; } virtual StringRef getPubNamesSection() { return PubNamesSection; } + virtual StringRef getGnuPubNamesSection() { return GnuPubNamesSection; } // Sections for DWARF5 split dwarf proposal. virtual StringRef getInfoDWOSection() { return InfoDWOSection; } |

