summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--lib/DebugInfo/DWARFContext.cpp22
-rw-r--r--lib/DebugInfo/DWARFContext.h3
3 files changed, 27 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a5b5905f3b..a8ebf45e6e 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2404,7 +2404,7 @@ void DwarfDebug::emitDebugPubNames(bool GnuStyle) {
dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheCU, Entity);
Asm->OutStreamer.AddComment(
"Kind: " + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " +
- dwarf::GDBIndexEntryLinkageString(Desc.Static));
+ dwarf::GDBIndexEntryLinkageString(Desc.Linkage));
Asm->EmitInt8(Desc.toBits());
}
@@ -2466,7 +2466,7 @@ void DwarfDebug::emitDebugPubTypes(bool GnuStyle) {
dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheCU, Entity);
Asm->OutStreamer.AddComment(
"Kind: " + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " +
- dwarf::GDBIndexEntryLinkageString(Desc.Static));
+ dwarf::GDBIndexEntryLinkageString(Desc.Linkage));
Asm->EmitInt8(Desc.toBits());
}
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; }