This is an archive of the discontinued LLVM Phabricator instance.

[WIP] Add debug location check to verifier.
Needs ReviewPublic

Authored by JDevlieghere on May 22 2018, 11:01 AM.

Details

Reviewers
aprantl
vsk
Summary

Verify that at least one entry in the location list overlaps with the parent’s address range.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.May 22 2018, 11:01 AM

Increment number of errors so we have a non-zero exit code when this is hit.

This would be very useful to find bugs in LLVM. That said, this looks like it is more a quality-of-implementation issue, and not a DWARF correctness issue. Should we separate the two? Or does DWARF mandate this?

We require that the child's (instruction) address range is contained within the parent's address range; I think it's equally sensible to verify that the location-list ranges are contained within the address range.
I don't know that DWARF explicitly requires this contained-ness, but it's clearly implicit in some of the sections I looked at while trying to answer that question.