This patch verifies the .debug_line:
- verify all addresses in a line table sequence have ascending addresses
- verify that all line table file indexes are valid
Unit tests added for both cases.
Paths
| Differential D32765
Add line table verification to lldb-dwarfdump --verify. AbandonedPublic ClosedPublic Authored by clayborg on May 2 2017, 3:33 PM.
Details Summary This patch verifies the .debug_line:
Unit tests added for both cases.
Diff Detail
Event TimelineComment Actions Woops, nice copy and paste error in the title. Sorry about that. Phabricator is getting worse for copy and paste these days... Comment Actions Paul: A future patch will add verification of unique DW_AT_stmt_list values and for verifying that all lines entries are in the CU ranges. I need to get another patch in before I do this as this other patch keeps track of all DW_TAG_subprogram address ranges, CU ranges, and verifies all DW_TAG_lexical_block and DW_TAG_inlined_subroutine are contained in their parents. Once I get that in, I can then verify each row address is found in the CU ranges (if available) and also agains the .debug_aranges (if available). Comment Actions Following up on my comment in the other review:
A type unit can certainly point to the same line table as its CU; but type units are not themselves CUs. (In v4 they are in .debug_types not .debug_info, while in v5 they have a distinct unit-type code, so the verifier can easily tell them apart.) So the uniqueness check should not apply to TUs. I am hard-pressed to imagine a situation where two CUs could reasonably share a line table. In a split-DWARF package file, there is no actual line table, but sharing the directory/file tables implies a coherent use of file/directory numbers across two CUs, or the packager rewriting the CUs to make them consistent, which is *really* hard to justify. So, unless somebody can come up with a solid use-case, I'd say it should be an error for two CUs to have the same DW_AT_stmt_list offset. (Maybe this should be in the .debug_info verification instead of the line-table verification, though.) Comment Actions
Awesome, thanks! Comment Actions
I can add the unique DW_AT_stmt_list to this patch then. I will save the range one for later. dblaikie added inline comments.
This revision is now accepted and ready to land.May 2 2017, 3:45 PM Comment Actions Paul: I will submit a follow up patch for the DW_AT_stmt_list not being found multiple times since this patch is accepted.
Closed by commit rL301984: Add line table verification to lldb-dwarfdump --verify (authored by gclayton). · Explain WhyMay 2 2017, 4:02 PM This revision was automatically updated to reflect the committed changes. Comment Actions
WFM.
Revision Contents
Diff 97517 llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
|