[PATCH] D35733: [DWARF] Added verification check for die ranges. If highPC is an address, then it should be greater or equal to lowPC for each range.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 15:42:54 PDT 2017


aprantl added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:218
+  for (auto Range : Die.getAddressRanges()) {
+    if (Range.LowPC > Range.HighPC) {
+      ++NumErrors;
----------------
aprantl wrote:
> dblaikie wrote:
> > Should this be >=? Or is it intentional that empty ranges are allowed to account for things like comdat functions being omitted by the linker & resolving the addresses to zero? (I forget exactly how those work)
> I assume that this is just copying darwin-dwarfdump behavior, but it also looks like DWARF allows a single DW_AT_low_pc to be attached to a DW_TAG_label, which would then show up as an entity of size 0. (cf. 2.17.1 Single Address)
> 
... and DW_TAG_label is commonly generated from assembler sources.


https://reviews.llvm.org/D35733





More information about the llvm-commits mailing list