[PATCH] D35444: [DWARF] Modification of code for the verification of .debug_info section.

Spyridoula Gravani via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 13:03:30 PDT 2017


sgravani added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:101
+  }
+  return NumDebugInfoErrors == 0;
+}
----------------
aprantl wrote:
> It looks like this might also return false if the unit is correct, but there were previous errors? Is that what we want here?
No this is not what we want. We want to know if each unit has errors or not.
I fixed it, thanks.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:141
+      case dwarf::DW_UT_partial:
+      default: {
+        DWARFUnitSection<DWARFCompileUnit> CUSection{};
----------------
aprantl wrote:
> I think it might be better to handle the default: case separately and have it produce a verification error.
I think what makes the best sense here is to handle the cases for all valid types and UnitType = 0 ( meaning that we are verifying a compile unit in dwarf4 version), and have llvm_unreachable() for default case.



https://reviews.llvm.org/D35444





More information about the llvm-commits mailing list