[PATCH] D32722: Verify that all references point to actual DIEs in "llvm-dwarfdump --verify"

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 16:11:39 PDT 2017


On Mon, May 1, 2017 at 4:07 PM Greg Clayton via Phabricator <
reviews at reviews.llvm.org> wrote:

> clayborg created this revision.
> Herald added a subscriber: mehdi_amini.
>
> LTO and other fancy linking previously led to DWARF that contained invalid
> references. We already validate that CU relative references fall into the
> CU, and the DW_FORM_ref_addr references fall inside the .debug_info
> section, but we didn't validate that the references pointed to correct DIE
> offsets. This new verification will ensure that all references refer to
> actual DIEs and not an offset in between.
>

This seems strictly stronger than the bounds check. Is it worth having the
bounds check if we have this stronger check?


>
> This caught a bug in DWARFUnit::getDIEForOffset() where if you gave it any
> offset, it would match the DIE that mathes the offset _or_ the next DIE.
> This has been fixed.
>
>
> https://reviews.llvm.org/D32722
>
> Files:
>   include/llvm/DebugInfo/DWARF/DWARFContext.h
>   include/llvm/DebugInfo/DWARF/DWARFUnit.h
>   lib/DebugInfo/DWARF/DWARFContext.cpp
>   unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170501/c05f4599/attachment.html>


More information about the llvm-commits mailing list