This is an archive of the discontinued LLVM Phabricator instance.

DWARF: When parsing type unit headers take the length field into account.
ClosedPublic

Authored by wolfgangp on May 8 2017, 5:56 PM.

Details

Summary

This patch is split off from https://reviews.llvm.org/D32779. It fixes a bug in the parsing of type unit headers. The bug will not manifest with compiler-generated TU dies due to their size, but it is there nonetheless and will show up with hand-crafted TU dies for testing purposes. This is in preparation for DWARF5 work.

The DWARF64 portion of the fix is not tested (yet), because in order to do so the DWARFUnit class would have to support DWARF64. This is not the case at the moment.

Diff Detail

Repository
rL LLVM

Event Timeline

wolfgangp created this revision.May 8 2017, 5:56 PM
dblaikie accepted this revision.May 9 2017, 9:05 AM

Might be worth keeping the DWARF64 change separately until it's testable/valid, so test coverage can properly be assessed at that point.

test/DebugInfo/Inputs/typeunit-header.s
11–12 ↗(On Diff #98238)

Do you need to give it any attributes at all?

This revision is now accepted and ready to land.May 9 2017, 9:05 AM
wolfgangp added inline comments.May 9 2017, 10:20 AM
test/DebugInfo/Inputs/typeunit-header.s
11–12 ↗(On Diff #98238)

Technically no, but I thought it would lend a little more substance to the test.

dblaikie added inline comments.May 9 2017, 10:22 AM
test/DebugInfo/Inputs/typeunit-header.s
11–12 ↗(On Diff #98238)

I'd probably skip it entirely - otherwise it leads to the question "why exactly one? is there some special/interesting case there?" which may make it harder to modify the test in the future for fear that the reader is missing something important.

This revision was automatically updated to reflect the committed changes.