This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwp] Add support for DWARFv5 type units ...
ClosedPublic

Authored by kimanh on May 3 2021, 11:55 PM.

Details

Summary

This patch adds support for DWARFv5 type units: parsing from
the .debug_info section, and writing index to the type unit index.
Previously, the type units were part of the .debug_types section
which is no longer used in DWARFv5.

Diff Detail

Event Timeline

kimanh created this revision.May 3 2021, 11:55 PM
kimanh requested review of this revision.May 3 2021, 11:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2021, 11:55 PM
kimanh retitled this revision from Add support for DWARFv5 type units (and v5 index) to llvm-dwp ... to Add support for DWARFv5 type units (and v5 index) to llvm-dwp ....May 3 2021, 11:56 PM
kimanh edited the summary of this revision. (Show Details)
kimanh updated this revision to Diff 342659.May 4 2021, 12:03 AM

Updated comment, and added extra output check to test.

kimanh updated this revision to Diff 343003.May 5 2021, 4:58 AM

Update variable name (clang-tidy).

I think maybe combining the new index support with TU support might be complicating this patch a bit more than ideal - maybe pulling the new index support into a separate patch would be good (perhaps the new-in-v5 debug_macro section could be used to demonstrate that the v5 index is being used)

llvm/test/tools/llvm-dwp/X86/tu_units_v5.s
14–16

Could you fix the alignment so these fields line up with their headers?

73

Please add the newline at the end here

llvm/test/tools/llvm-dwp/X86/type_dedup_v5.s
1 ↗(On Diff #342659)

Might be worth a bit more detail somewhere in here that explains that the DWARF in this test is a bit bogus (two TUs with the same signature in the same input file - and TUs with invalid DIE offsets/no DIEs in the unit) but good enough for dwp.

Hmm, maybe it isn't good enough for dumping, though - I'd expect this still to produce some errors about missing DIEs in the dwarfdump?

15 ↗(On Diff #342659)

Might be nice to include which unit type this is in the comment - improvements to llvm's verbose asm output to do this automatically would be great. (but you can add it by hand here too/instead)

kimanh updated this revision to Diff 344707.May 12 2021, 1:09 AM

Splitting up CLs, addressing feedback.

kimanh retitled this revision from Add support for DWARFv5 type units (and v5 index) to llvm-dwp ... to [llvm-dwp] Add support for DWARFv5 type units ....May 12 2021, 1:36 AM
kimanh updated this revision to Diff 344765.May 12 2021, 4:27 AM
kimanh marked 4 inline comments as done.

Some cleanup.

kimanh edited the summary of this revision. (Show Details)EditedMay 12 2021, 4:35 AM

Thanks a lot for the review!

I have split up the original CL into three (dependent) CLs now:

  1. Making llvm-dwp aware of multiple debug info sections (as a preparation to further support DWARFv5 dwos and type units) https://reviews.llvm.org/D102312
  2. Support reading and writing v5 index https://reviews.llvm.org/D102315
  3. (this CL) add type unit support

I hope it's easier to review this way. The other CL for rnglists and loclists support (https://reviews.llvm.org/D101894) is dependent on this CL.

llvm/test/tools/llvm-dwp/X86/type_dedup_v5.s
1 ↗(On Diff #342659)

Yes you were right, that it would not be fine for dumping.

I have updated the test to actually use two separate files now, and added more information for dumping to at least not produce errors on not being able to parse the type unit.

15 ↗(On Diff #342659)

I have added info on that manually now.

dblaikie accepted this revision.May 21 2021, 8:14 PM

Looks alright, thanks!

This revision is now accepted and ready to land.May 21 2021, 8:14 PM
kimanh updated this revision to Diff 349230.Jun 2 2021, 4:37 AM

Rebase and upload to trigger premerge checks.

This revision was automatically updated to reflect the committed changes.