Inconsistency in disassembler printing numbers for error traps
Describe the bug
We are somewhat inconsistent in how the error trap codes are always printed in hex, with #x
marker.
To Reproduce
Steps to reproduce the behavior:
- Compile this:
(defun bar (x) (declare (double-float x)) (sin x))
(disassemble 'bar)
- Look at the end of the disassembly to see the
.byte
:
c060: L3: ud1 ecx, edx ; Trap 10: Error trap
c063: .byte #x02
c064: .byte #x1a ; INVALID-ARGUMENT-COUNT-ERROR
c065: .byte #x4f ; ECX
- Now try
(disassem:disassemble 'bar :base 8)
- The error trap doesn't honor the base; it's always printed as hex. The other numerical constants in the disassembly are printed in octal. Almost. We do have:
c019: call #o13700000010 ; #x5f000008: alloc_overflow_sse2
Expected behavior
I think we purposely decided (when adding ud1 support) to print the bytes in hex with a radix marker. I think historically they were always printed this way. It was in 18d.
But should the base be honored?
Note that if !135 (closed) lands, then the radix marker will be printed by default.
Desktop (please complete the following information):
- OS: Linux (and probably all others)
- Version: snapshot-2021-07 to at least 18d.
Additional context
Should we honor the base for printing out the error trap constants? Should notes also honor the base?