[PATCH] D45323: DWARFVerifier: validate information in name index entries

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 07:44:19 PDT 2018


labath created this revision.
labath added reviewers: JDevlieghere, aprantl, dblaikie.

This patch add checks to verify that the information in the name index
entries is consistent with the debug_info section. Specifically, we
check that entries point to valid DIEs, and their names, tags, and
compile units match the information in the debug_info sections.

These checks are only run if the previous checks did not find any errors
in the name index headers. Attempting to proceed with the checks anyway
would likely produce a lot of spurious errors and the verification code
would need to be very careful to avoid crashing.

I also add a couple of more checks to the abbreviation-validation code
to verify that some attributes are always present (an index without a
DW_IDX_die_offset attribute is fairly useless).

The entry verification works only on indexes without any type units - I
haven't attempted to extend it to type units, as we don't even have a
DWARF v5-compatible type unit generator at the moment.


Repository:
  rL LLVM

https://reviews.llvm.org/D45323

Files:
  include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
  include/llvm/DebugInfo/DWARF/DWARFVerifier.h
  lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
  lib/DebugInfo/DWARF/DWARFVerifier.cpp
  test/tools/llvm-dwarfdump/X86/debug-names-verify-abbrev-forms.s
  test/tools/llvm-dwarfdump/X86/debug-names-verify-entries.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45323.141154.patch
Type: text/x-patch
Size: 23594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180405/4d4fa3f4/attachment.bin>


More information about the llvm-commits mailing list