This is an archive of the discontinued LLVM Phabricator instance.

Fix recursive attribute fetching in DWARFDie
ClosedPublic

Authored by clayborg on Nov 16 2017, 4:01 PM.

Details

Summary

The previous implementation would only look 1 DW_AT_specification or DW_AT_abstract_origin deep. This means DWARFDie::getName() would fail in certain cases. I ran into such a case while creating a tool that used the LLVM DWARF parser to generate a symbolication format so I have seen this in the wild.

Diff Detail

Repository
rL LLVM

Event Timeline

clayborg created this revision.Nov 16 2017, 4:01 PM

This change also stops extra calls to the Die.find() when a new Die wasn't fetched using Die.getAttributeValueAsReferencedDie as it was always calling Die.Find() even with the old Die...

probinson edited edge metadata.Nov 20 2017, 1:02 PM

It looks like the test exercises a recursive DW_AT_abstract_origin but not a recursive DW_AT_specification? The code does both, so the test should verify both.

I can add a test that does this if needed.

aprantl accepted this revision.Nov 27 2017, 1:38 PM
This revision is now accepted and ready to land.Nov 27 2017, 1:38 PM
This revision was automatically updated to reflect the committed changes.