This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Add entry_value locations to variable display
ClosedPublic

Authored by ostannard on Feb 19 2020, 8:44 AM.

Details

Summary

This adds the DW_OP_entry_value and DW_OP_stack_value opcodes to the DWARF expression printer, needed to display variable locations which refer to the value of an expression at entry to the function.

Diff Detail

Event Timeline

ostannard created this revision.Feb 19 2020, 8:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2020, 8:44 AM
aprantl added inline comments.Feb 19 2020, 1:37 PM
llvm/test/tools/llvm-objdump/ARM/debug-vars-entry-value.s
1 ↗(On Diff #245422)

It would be a lot more efficient to test this in unittests/DebugInfo/dwarf, but just dumping the expression bytes themselves. Otherwise the canonical place to test dwarf dumping facilities is usually llvm-dwarfdump.

I'm kind of worried that this test will need to be updated every time someone tunes the output formatting of objdump

jhenderson added inline comments.Feb 25 2020, 1:35 AM
llvm/test/tools/llvm-objdump/ARM/debug-vars-entry-value.s
1 ↗(On Diff #245422)

+1 to this. The prettyPrint function looks ripe for gtest unit testing. I wouldn't necessarily worry about covering every code path in the first instance, but you could work towards it that way.

ostannard updated this revision to Diff 246930.Feb 27 2020, 6:33 AM

Convert tests to unit tests.

aprantl added inline comments.Feb 27 2020, 8:39 AM
llvm/test/tools/llvm-objdump/ARM/debug-vars-entry-value.s
1 ↗(On Diff #245422)

I think this test should be deleted now, it doesn't add anything over the unit test, right?

llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
105

Nice.

ostannard updated this revision to Diff 246968.Feb 27 2020, 8:49 AM
  • Delete old test
aprantl accepted this revision.Feb 27 2020, 8:53 AM
This revision is now accepted and ready to land.Feb 27 2020, 8:53 AM
djtodoro accepted this revision.Feb 27 2020, 11:42 PM
jhenderson accepted this revision.Feb 28 2020, 2:11 AM

LGTM too.

This revision was automatically updated to reflect the committed changes.