This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Have the verifier accept missing linkage name for anything other than subprograms.
ClosedPublic

Authored by JDevlieghere on Aug 29 2018, 6:14 AM.

Details

Summary

According to the standard, for the .debug_names (the "dwarf accelerator tables):

If a subprogram or inlined subroutine is included, and has a DW_AT_linkage_name attribute, there will be an additional index entry for the linkage name.

For Swift we generate DW_structure_types with a linkage name and the verifier was incorrectly rejecting this. This patch fixes that. The test is the "reduced" debug info of the failing swift test on swift.org. If there's a way to generate a smaller test case I'm very much open to suggestions.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Aug 29 2018, 6:14 AM
JDevlieghere edited the summary of this revision. (Show Details)Aug 29 2018, 6:15 AM

You are correct that we were being too strict in our requirements here. Though if these structs do have linkage names they could actually be useful (eg as a substitute for the "qualified name hash" in lldb) and we could consider adding them as an extension.

For the test,have you tried writing some dwarf by hand (or more like, modifying an existing .s file to add a linkage name attribute. There should be some .s files in the debug names dumper test suite that can serve as a reasonable starting point)?

The test seem really long, perhaps try running delta on it using a script that runs dwarfdump | FileChecks on it and checks for the one TAG you are actually interested in?

Hmm.. no. Because of the offsets that won't work well in assembler. You'd have reduce the llvm IR or source code instead.

  • Reduce test
labath accepted this revision.Sep 3 2018, 2:59 AM

looks good to me

This revision is now accepted and ready to land.Sep 3 2018, 2:59 AM
This revision was automatically updated to reflect the committed changes.