Page MenuHomePhabricator

[DWARF v5] Verifier: Add checks for DW_FORM_strx* forms.
ClosedPublic

Authored by wolfgangp on Nov 2 2018, 2:33 PM.

Details

Summary

Making the verifier validate the DWARF v5 strx forms, which index into the string offsets table.

Diff Detail

Repository
rL LLVM

Event Timeline

wolfgangp created this revision.Nov 2 2018, 2:33 PM
wolfgangp added inline comments.Nov 2 2018, 2:37 PM
test/DebugInfo/X86/dwarfdump-str-offsets.s
3 ↗(On Diff #172435)

Enhance this test case to pass the verifier. We're adding a DW_AT_base_type attribute to the variable DIEs to make it do so.

test/tools/llvm-dwarfdump/X86/verify_debug_info.s
10 ↗(On Diff #172435)

This test case was using DW_FORM_strx4 as an invalid form for DW_AT_stmt_list. Now that we're verifying strx4, this is causing confusion. Replace the strx4 with a different, suitable, invalid form, such as block4.

aprantl accepted this revision.Nov 2 2018, 2:43 PM
aprantl added inline comments.
lib/DebugInfo/DWARF/DWARFVerifier.cpp
643 ↗(On Diff #172435)

I'm pretty sure Optional::operator* already asserts.

This revision is now accepted and ready to land.Nov 2 2018, 2:43 PM
probinson added inline comments.Nov 2 2018, 2:49 PM
lib/DebugInfo/DWARF/DWARFVerifier.cpp
643 ↗(On Diff #172435)

In which case this could simplify to

uint64_t StringOffset = *DieCU->getStringOffsetSectionItem(Index);
if (StringOffset >= ...
wolfgangp added inline comments.Nov 2 2018, 3:07 PM
lib/DebugInfo/DWARF/DWARFVerifier.cpp
643 ↗(On Diff #172435)

I'm pretty sure Optional::operator* already asserts.

It sure does. I'll get rid of the assert in the final commit.

JDevlieghere accepted this revision.Nov 2 2018, 3:22 PM
This revision was automatically updated to reflect the committed changes.