This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix printing of DW_LNS_set_isa
ClosedPublic

Authored by jhenderson on Dec 10 2019, 7:42 AM.

Details

Summary

The Isa register is a uint8_t, but at least on windows this is internally an unsigned char, which meant that prior to this patch it got formatted as an ASCII character, rather than a decimal number. This patch fixes this by casting it to a uint64_t before printing. I did it this way instead of using a uint8_t formatter because a) it is simpler, and b) it allows us to change the internal type of Isa in the future without this code breaking.

I also took the opportunity to test the printing of the other standard opcodes.

Diff Detail

Event Timeline

jhenderson created this revision.Dec 10 2019, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2019, 7:42 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
jhenderson edited the summary of this revision. (Show Details)Dec 10 2019, 7:42 AM
probinson accepted this revision.Dec 10 2019, 9:22 AM

LGTM.

llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
711

Put a FIXME here? as you just filed PR44261 about this.

This revision is now accepted and ready to land.Dec 10 2019, 9:22 AM
jhenderson marked 2 inline comments as done.Dec 11 2019, 4:17 AM
jhenderson added inline comments.
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
711

Done. I also had to add OS.flush() after the parseNext call as otherwise Output didn't contain the expected output when running on my Linux machine.

This revision was automatically updated to reflect the committed changes.
jhenderson marked an inline comment as done.