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

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 10:55:37 PST 2017


clayborg added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFFormValue.cpp:401
     default:
+      assert(false && "unsupported form");
       return false;
----------------
dblaikie wrote:
> clayborg wrote:
> > This is not unreachable. Newer DWARF might be passed to this at some point and it needs to fail correctly and just not parse the DIE which will cause all DIEs in a DWARFUnit to not be parsed or returned.
> Then there cannot be an assert(false) here. There must be a test case demonstrating that this situation is correctly handled (with a hardcoded unknown form).
> 
> But shouldn't the failure have surfaced earlier - never reaching the code that would attempt to parse the value in the DIE? The attempt to walk the DIE would fail because the size could not be determined for an unknown form.
I can change this to use llvm_unreachable this and make a test that a bad form fails to parse the DIEs for a compile unit. This would be caught in DWARFFormValue::skipValue() which calls through to skipFormValue in DWARFFormValue.cpp.


https://reviews.llvm.org/D28386





More information about the llvm-commits mailing list