This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix printing values of forms which depend on the DWARF format.
ClosedPublic

Authored by ikudrin on Apr 29 2020, 7:59 AM.

Details

Summary

The values are 8 bytes long in DWARF64, so they should not be cut to uint32_t on dumping.

Diff Detail

Event Timeline

ikudrin created this revision.Apr 29 2020, 7:59 AM

If the value to be printed is only 10 digits wide, I think we do not get 6 leading zeros? Is that how we are formatting 64-bit values in general?

If the value to be printed is only 10 digits wide, I think we do not get 6 leading zeros? Is that how we are formatting 64-bit values in general?

Yes, that is how we print such values in most cases. I am going to prepare a separate patch to print DWARF64 values with extended width, based on the suggestion by @dblaikie in D78208.

This revision is now accepted and ready to land.Apr 30 2020, 7:42 AM
jhenderson added inline comments.May 1 2020, 1:53 AM
llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
375–380

It might be worth adding a test case where not all 16 digits are produced, to show that we don't print leading zeroes.

Also, is it worth DWARF32 test cases? Not sure, and maybe not.

ikudrin updated this revision to Diff 262658.May 7 2020, 8:15 AM
ikudrin marked an inline comment as done.
  • Shortened values in the test.
  • Added DWARF32 test cases for the same forms. They might be useful later to show the difference in dumping DWARF32/64 variants.
This revision was automatically updated to reflect the committed changes.

Reverted a git revision as a follow-up of this in https://github.com/llvm/llvm-project/commit/c5e0967e4cf0f1337bec772949e6cede4c01354b because of:

Newly added test fails:
FAIL: LLVM::DW_OP_call_ref_unexpected.s

http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/28298