This patch add the framework for verifying DWARF using llvm-dwarfdump as the front end.
This patch currently verifies:
- All DW_TAG_subprogram DIEs ranges have any child ranges (DW_AT_lexical_block and DW_AT_inlined_subroutine) verified to ensure that all ranges are in the parent ranges.
- Make sure that no DW_TAG_subprogram address ranges overlap
- If a DW_TAG_compile_unit has DW_AT_ranges, then ensure that all DW_TAG_subprogram ranges are in the CU ranges.
- All DW_AT_ranges attributes have valid .debug_ranges offsets
- All DW_AT_stmt_list attributes have valid .debug_line offsets
- All DW_FORM_strp attributes have valid .debug_str offsets
- All reference attributes (DW_FORM_ref1,DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata, DW_FORM_ref_addr) have values that point to actual valid DIE offsets.
- If .debug_aranges is available, we parse only the information in there and verify that all function ranges are accounted for and point to the correct CU offset
- Verifies all line table rows have valid increasing addresses within each sequence
- Verifies all line table rows have valid file indexes
// No verifier? Just say things went well.
return true;