[PATCH] D32707: lldb-dwarfdump -verify [-quiet]

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 11:05:17 PDT 2017


clayborg created this revision.

Adds initial llvm-dwarfdump --verify support with unit tests.

lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR.

The first part of the verify does the following:

- verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets
- verifies that all DW_FORM_ref_addr references have valid .debug_info offsets
- verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets
- verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets
- verifies that all DW_FORM_strp attributes have valid .debug_str offsets

Unit tests were added for each of the above cases.


https://reviews.llvm.org/D32707

Files:
  include/llvm/DebugInfo/DIContext.h
  include/llvm/DebugInfo/DWARF/DWARFContext.h
  include/llvm/DebugInfo/DWARF/DWARFFormValue.h
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFFormValue.cpp
  tools/llvm-dwarfdump/llvm-dwarfdump.cpp
  unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32707.97310.patch
Type: text/x-patch
Size: 17508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170501/6c8192c0/attachment.bin>


More information about the llvm-commits mailing list