This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] Support DWARF64 in DWARFDebugArangeSet.
ClosedPublic

Authored by ikudrin on Dec 25 2019, 4:17 AM.

Details

Summary

This allows parsing Address Range Tables in 64-bit DWARF format.

Diff Detail

Event Timeline

ikudrin created this revision.Dec 25 2019, 4:17 AM
dblaikie accepted this revision.Dec 25 2019, 10:25 AM

Looks good - thanks!

This revision is now accepted and ready to land.Dec 25 2019, 10:25 AM
ikudrin updated this revision to Diff 235422.Dec 27 2019, 8:19 AM
  • Updated as the parent patch is changed;
  • Added more tests.
dblaikie added inline comments.Dec 27 2019, 11:23 AM
llvm/test/DebugInfo/X86/dwarfdump-debug-aranges-error-cases.s
71–72 ↗(On Diff #235422)

Not sure if this needs its own test case - since it's the same error/code path for both 32 and 64 bit lengths. (& having only one test for length overrun would enable all the tests to be done in one object file/run, rather than separate RUN lines for each one (some systems, like Windows, have significant per-process overhead so it's nice to keep the total number of separate command invocations down if practical/convenient))

llvm/test/DebugInfo/X86/dwarfdump-debug-aranges.s
81

Similar feedback given on other cases - this is probably overcomplicated (given it already has the magic number 7 and 8 - so maybe hardcoding the exact value, rather than this formula, would be simpler - and include a comment about what this achieves)

ikudrin updated this revision to Diff 237664.Jan 13 2020, 6:42 AM
  • Hardcode paddings.
  • Move some tests to the gtest-based suite.
ikudrin marked 2 inline comments as done.Jan 13 2020, 6:53 AM
ikudrin added inline comments.
llvm/test/DebugInfo/X86/dwarfdump-debug-aranges-error-cases.s
71–72 ↗(On Diff #235422)

This checks that we handle the difference in the length of the initial length field in both formats appropriately. Running additional tests is not a problem anymore, as the tests are moved into a gtest-based suite.

As for continuing processing the table after an error, that requires its own patch, where it should be carefully considered, which errors are recoverable. It might be sophisticated, and I am a bit reluctant to do that without a good sample.

ikudrin updated this revision to Diff 239106.Jan 20 2020, 6:12 AM
  • Simplify a bit by using an extracted function dwarf::getDwarfOffsetByteSize().
This revision was automatically updated to reflect the committed changes.