Page MenuHomeFreeBSD

arm64: print '0x' before hex values
ClosedPublic

Authored by christos on Jun 17 2023, 12:46 PM.
Tags
None
Referenced Files
F146957678: D40583.id123365.diff
Sat, Mar 7, 3:10 AM
F146957662: D40583.id123365.diff
Sat, Mar 7, 3:10 AM
F146918686: D40583.id123365.diff
Fri, Mar 6, 6:30 PM
Unknown Object (File)
Fri, Mar 6, 12:36 PM
Unknown Object (File)
Wed, Mar 4, 2:32 PM
Unknown Object (File)
Sun, Mar 1, 8:17 AM
Unknown Object (File)
Fri, Feb 27, 5:00 AM
Unknown Object (File)
Jan 21 2026, 10:42 PM
Subscribers

Details

Summary

Not making it explicit that we're printing values in hex can be
misleading when the number doesn't contain hex-only symbols (a-f). A
good example of this is print_gp_register(), where we print "(func +
offset)"; if the offset doesn't contain a-f symbols, it's not
immediately clear if that value is in decimal or hex.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Use '0x' instead of '#', fix width issues.

What was wrong with #? We use it all over the place.

This revision is now accepted and ready to land.Jun 17 2023, 2:45 PM
In D40583#924040, @imp wrote:

What was wrong with #? We use it all over the place.

It doesn't print '0x' if the value is 0, and it also messes up column alignment. We could replace '0x' with '#' wherever we do not care about alignment, if you insist, however.

In D40583#924040, @imp wrote:

What was wrong with #? We use it all over the place.

It doesn't print '0x' if the value is 0, and it also messes up column alignment. We could replace '0x' with '#' wherever we do not care about alignment, if you insist, however.

Ah, I didn't know that detail. That's a decent enough reason to just be consistent.

Approved.

It doesn't print '0x' if the value is 0, and it also messes up column alignment.

I would mention this in the commit log.

This revision was automatically updated to reflect the committed changes.