[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.

Spyridoula Gravani via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 14:06:19 PDT 2017


sgravani added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:218
+  for (auto Range : Die.getAddressRanges()) {
+    if (Range.LowPC > Range.HighPC) {
+      ++NumErrors;
----------------
aprantl wrote:
> 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.
Yes, it should be >= since the case that Adrian describes won't have a highPC attribute to start with. 
Thanks!


Repository:
  rL LLVM

https://reviews.llvm.org/D35733





More information about the llvm-commits mailing list