[PATCH] D28386: Add the ability to iterate across all attributes in a DIE.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 11:06:42 PST 2017


probinson added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFDie.cpp:455
+      // This is the begin iterator so we extract the value for this->Index.
+      AttrValue.Offset = D.getOffset() + getULEB128Size(AbbrDecl->getCode());
+      extractValueForIndex();
----------------
probinson wrote:
> dblaikie wrote:
> > Does the existing dumping code do this getULEB128Size thing? That seems like something that'd be nice to avoid (not that it's costly - it just strikes me as a bit strange to have to compute the size of the ULEB after we've parsed it to figure out which bytes to read again (are ULEBs guaranteed to be the minimal/same size for the same value? Or could DWARF have a large ULEB encoding for a small value?))
> Re. minimal LEB encoding, the "syntax" of the encoding doesn't require that it is minimal (a too-long encoded value will still decode correctly) but DWARF section 7.6 specifies that the encoded value is minimal.
Not that minimalist encoding matters here.  It looks like the iterator has to keep track of the offset-within-DIE for each attribute's value as it steps through the attributes, because the caller won't necessarily extract the value for each attribute.


https://reviews.llvm.org/D28386





More information about the llvm-commits mailing list