summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-01-25 22:02:36 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-01-25 22:02:36 +0000
commitb6aa01ca9928e4413d3a832685b05a69f9f76c50 (patch)
treeb86522b4377ca8dc7f3375430cfbcf1928da85e8 /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
parent8410c3746548f63c8471a34c696543fb51e22afb (diff)
downloadbcm5719-llvm-b6aa01ca9928e4413d3a832685b05a69f9f76c50.tar.gz
bcm5719-llvm-b6aa01ca9928e4413d3a832685b05a69f9f76c50.zip
[DWARFv5] Support DW_FORM_line_strp in llvm-dwarfdump.
This form is like DW_FORM_strp, but points to .debug_line_str instead of .debug_str as the string section. It's intended to be used from the line-table header, and allows string-pooling of directory and filenames across compilation units. Differential Revision: https://reviews.llvm.org/D42553 llvm-svn: 323476
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFContext.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 76be5d7e6e7..aa55294ff4c 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -459,6 +459,16 @@ void DWARFContext::dump(
strDWOOffset = offset;
}
}
+ if (shouldDump(Explicit, ".debug_line_str", DIDT_ID_DebugLineStr,
+ DObj->getLineStringSection())) {
+ DataExtractor strData(DObj->getLineStringSection(), isLittleEndian(), 0);
+ uint32_t offset = 0;
+ uint32_t strOffset = 0;
+ while (const char *s = strData.getCStr(&offset)) {
+ OS << format("0x%8.8x: \"%s\"\n", strOffset, s);
+ strOffset = offset;
+ }
+ }
if (shouldDump(Explicit, ".debug_ranges", DIDT_ID_DebugRanges,
DObj->getRangeSection().Data)) {
@@ -1193,6 +1203,7 @@ class DWARFObjInMemory final : public DWARFObject {
StringRef CUIndexSection;
StringRef GdbIndexSection;
StringRef TUIndexSection;
+ StringRef LineStringSection;
SmallVector<SmallString<32>, 4> UncompressedSections;
@@ -1215,6 +1226,7 @@ class DWARFObjInMemory final : public DWARFObject {
.Case("debug_cu_index", &CUIndexSection)
.Case("debug_tu_index", &TUIndexSection)
.Case("gdb_index", &GdbIndexSection)
+ .Case("debug_line_str", &LineStringSection)
// Any more debug info sections go here.
.Default(nullptr);
}
@@ -1433,6 +1445,7 @@ public:
const DWARFSection &getStringOffsetSection() const override {
return StringOffsetSection;
}
+ StringRef getLineStringSection() const override { return LineStringSection; }
// Sections for DWARF5 split dwarf proposal.
const DWARFSection &getInfoDWOSection() const override {
OpenPOWER on IntegriCloud