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

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 16:07:09 PDT 2017


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 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 --------------
A non-text attachment was scrubbed...
Name: D32722.97356.patch
Type: text/x-patch
Size: 13763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170501/15f6a1d8/attachment.bin>


More information about the llvm-commits mailing list