[llvm] r253392 - dwarfdump: support indexed string dumping in dwp based on the STR_OFFSETS component of the index

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 14:39:23 PST 2015


Author: dblaikie
Date: Tue Nov 17 16:39:23 2015
New Revision: 253392

URL: http://llvm.org/viewvc/llvm-project?rev=253392&view=rev
Log:
dwarfdump: support indexed string dumping in dwp based on the STR_OFFSETS component of the index

Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
    llvm/trunk/test/DebugInfo/dwarfdump-dwp.test

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=253392&r1=253391&r2=253392&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp Tue Nov 17 16:39:23 2015
@@ -37,7 +37,11 @@ DWARFUnit::DWARFUnit(DWARFContext &DC, c
                      const DWARFUnitSectionBase &UnitSection,
                      const DWARFUnitIndex::Entry *IndexEntry)
     : Context(DC), InfoSection(Section), Abbrev(DA), RangeSection(RS),
-      LineSection(LS), StringSection(SS), StringOffsetSection(SOS),
+      LineSection(LS), StringSection(SS), StringOffsetSection([&]() {
+        if (const auto *C = IndexEntry->getOffset(DW_SECT_STR_OFFSETS))
+          return SOS.slice(C->Offset, C->Offset + C->Length);
+        return SOS;
+      }()),
       AddrOffsetSection(AOS), isLittleEndian(LE), UnitSection(UnitSection),
       IndexEntry(IndexEntry) {
   clear();

Modified: llvm/trunk/test/DebugInfo/dwarfdump-dwp.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-dwp.test?rev=253392&r1=253391&r2=253392&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/dwarfdump-dwp.test (original)
+++ llvm/trunk/test/DebugInfo/dwarfdump-dwp.test Tue Nov 17 16:39:23 2015
@@ -17,8 +17,7 @@ RUN: llvm-dwarfdump %p/Inputs/dwarfdump-
 ; CHECK-SAME: abbr_offset = 0x0043
 ; CHECK: DW_TAG_compile_unit
 ; CHECK-NOT: DW_TAG
-; FIXME: Implement str_offsets support so we find b.cpp here \/
-; CHECK:   DW_AT_name {{.*}} "a.cpp"
+; CHECK:   DW_AT_name {{.*}} "b.cpp"
 
 ; Verify that abbreviations are decoded using the abbrev offset in the index
 ; CHECK:   DW_TAG_structure_type




More information about the llvm-commits mailing list