[PATCH] D53155: [DWARF] Make llvm-dwarfdump display location lists in a .dwp file correctly. Fixes PR38990.

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 11 17:04:18 PDT 2018


wolfgangp added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFDie.cpp:117-120
+      if (auto *IndexEntry = U->getIndexEntry())
+        if (const auto *C = IndexEntry->getOffset(DW_SECT_LOC))
+          Offset += C->Offset;
+      DataExtractor Data(LocSection->Data, Ctx.isLittleEndian(), 0);
----------------
dblaikie wrote:
> Any chance this could be done when the unit is constructed, rather than every time a loc list is dumped? (ie: could the unit either be constructed with a StringRef of the LocSection already offset to the index entry - or have the unit constructor take the whole LocSection, examine its index entry, and then store the sub-section adjusted/computed using the index entry)
We still need a pointer or reference to the whole loc section, because there are relocations in it, so I'm keeping track of the data separately. The constructor then adjusts it if necessary.

The alternative is to use a StringRef as you say, and get the section from the context when needed. Not sure what's preferable, but using the section for construction seems slightly more consistent overall.


https://reviews.llvm.org/D53155





More information about the llvm-commits mailing list