summaryrefslogtreecommitdiff
path: root/lib/DebugInfo
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-09-19 23:01:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-09-19 23:01:29 +0000
commit994c37fcb001bc5a53bf2c676009b327b882d765 (patch)
tree5e8e0f8fc2404ad657e5156c81141adf98426b3d /lib/DebugInfo
parentceb3b4649086c4aa6aa535440748c5860093f6e6 (diff)
downloadllvm-994c37fcb001bc5a53bf2c676009b327b882d765.tar.gz
llvm-994c37fcb001bc5a53bf2c676009b327b882d765.tar.bz2
llvm-994c37fcb001bc5a53bf2c676009b327b882d765.tar.xz
DebugInfo: llvm-dwarfdump support for gnu_pubnames section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARFContext.cpp22
-rw-r--r--lib/DebugInfo/DWARFContext.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp
index baf2bb5b57..c87855e530 100644
--- a/lib/DebugInfo/DWARFContext.cpp
+++ b/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/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h
index c491b4ca49..e4b640e4c9 100644
--- a/lib/DebugInfo/DWARFContext.h
+++ b/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; }