[PATCH] D35166: [DWARF] Introduce verification for the unit header chain in .debug_info section to llvm-dwarfdump.

Spyridoula Gravani via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 9 06:14:57 PDT 2017


sgravani created this revision.

This patch adds verification checks for the unit header chain in the .debug_info section.

Specifically, for each unit in the .debug_info section, the verifier checks that:

1. The unit length is valid (i.e. the unit can actually fit in the .debug_info section)
2. The dwarf version of the unit is valid
3. The address size is valid (4 or 8)
4. The unit type (if the unit is in dwarf5) is valid
5. The debug_abbrev_offset is valid

I'm still working on test cases, but I wanted to submit the patch here in order to get feedback.


https://reviews.llvm.org/D35166

Files:
  include/llvm/DebugInfo/DWARF/DWARFUnit.h
  include/llvm/DebugInfo/DWARF/DWARFVerifier.h
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFVerifier.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35166.105731.patch
Type: text/x-patch
Size: 6539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170709/db488057/attachment-0001.bin>


More information about the llvm-commits mailing list