Page MenuHomePhabricator

[DebugInfo][test] Replace pre-canned binary test
ClosedPublic

Authored by jhenderson on Feb 7 2020, 1:27 AM.

Details

Summary

The DebugInfo/dwarfdump-invalid-line-table test used a pre-canned binary generated by a fuzzer to demonstrate a bug fix. Unfortunately, the binary is rigid and requires hand-editing if we change behaviour, such as rejecting certain properties within it (as I plan on doing in another change).

Rather than hand-edit the binary, I have replaced it with two tests. The first tests the high-level code path from the debug line parser that produces the same error as this test previously did, and the second is a set of unit test cases that comprehensively cover the FormValue::skipValue method, which in turn covers the area that the original bug fix touched.

Diff Detail

Event Timeline

jhenderson created this revision.Feb 7 2020, 1:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2020, 1:27 AM
Herald added a subscriber: aprantl. · View Herald Transcript
dblaikie accepted this revision.Feb 7 2020, 11:46 AM

Sounds good

This revision is now accepted and ready to land.Feb 7 2020, 11:46 AM
MaskRay accepted this revision.Feb 9 2020, 5:53 PM
MaskRay added inline comments.
llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
124

StringRef -> ArrayRef<uint8_t>

137

vector<uint8_t>

144

The StringRef conversion can be removed.

163

Use ArrayRef<uint8_t> instead of StringRef.

There is now a DWARFDataExtractor constructor which takes ArrayRef<uint8_t> instead of StringRef.

MaskRay added inline comments.Feb 9 2020, 5:55 PM
llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
176

public can be deleted.

This revision was automatically updated to reflect the committed changes.
jhenderson marked 5 inline comments as done.