This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix reading location tables of v5 units in DWP.
ClosedPublic

Authored by ikudrin on Mar 31 2020, 7:32 AM.

Details

Summary

Without the patch, all version 5 compile units in a DWP file read location tables from the beginning of a .debug_loclists.dwo section. The patch fixes that by adjusting the reading offset the same way as for pre-v5 units. The section identifier to find the contribution entry corresponds to the version of the unit.

Diff Detail

Event Timeline

ikudrin created this revision.Mar 31 2020, 7:32 AM

Again, looks good, although I'm not up-to-speed on the .debug_loc/.debug_loclists format, so this should get a second pair of eyes on it.

labath accepted this revision.Apr 1 2020, 2:48 AM
labath added a subscriber: labath.

looks good to me too

This revision is now accepted and ready to land.Apr 1 2020, 2:48 AM
dblaikie added inline comments.Apr 1 2020, 3:51 PM
llvm/test/DebugInfo/X86/dwp-v2-loc.s
2–4

Was this not already tested?

labath added inline comments.Apr 2 2020, 1:59 AM
llvm/test/DebugInfo/X86/dwp-v2-loc.s
2–4

I was thinking the same thing. The v2 version of this patch (https://reviews.llvm.org/D53155) did include a test case, but that one was based on running llc+dwp. I think that this kind of a test is preferable for testing dumping. I was thinking about deleting the other test, but then then I thought, maybe it is still valueable as it also tests llvm-dwp?

dblaikie accepted this revision.Apr 2 2020, 4:00 PM
dblaikie added inline comments.
llvm/test/DebugInfo/X86/dwp-v2-loc.s
2–4

Ah, yep - I'll blame my past lazy self. I've not always been good about doing the Right Thing and adding the llvm-dwarfdump functionality separately (& testing it with object files or assembly tests) then adding the production functionality (& testing that with IR+llvm-dwarfdump). Yep, both testing makes sense.

ikudrin updated this revision to Diff 254804.Apr 3 2020, 7:57 AM
  • Rebase to the tip.
This revision was automatically updated to reflect the committed changes.