diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2018-07-16 09:52:14 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-07-17 07:18:14 -0400 |
commit | 941d810725ad48cc21948f4cff8cf70fa2a67cf9 (patch) | |
tree | c2d012f87491d0f3637b9e61cb7eb93f3f603b8b | |
parent | 021c91791a5e7e85c567452f1be3e4c2c6cb6063 (diff) |
powerpc/xmon: Fix disassembly since printf changes
The recent change to add printf annotations to xmon inadvertently made
the disassembly output ugly, eg:
c00000002001e058 7ee00026 mfcr r23
c00000002001e05c fffffffffae101a0 std r23,416(r1)
c00000002001e060 fffffffff8230000 std r1,0(r3)
The problem being that negative 32-bit values are being displayed in
full 64-bits.
The printf conversion was actually correct, we are passing unsigned
long so it should use "lx". But powerpc instructions are only 4 bytes
and the code only reads 4 bytes, so inst should really just be
unsigned int, and that also fixes the printing to look the way we
want:
c00000002001e058 7ee00026 mfcr r23
c00000002001e05c fae101a0 std r23,416(r1)
c00000002001e060 f8230000 std r1,0(r3)
Fixes: e70d8f55268b ("powerpc/xmon: Add __printf annotation to xmon_printf()")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 47166ad2a669..196978733e64 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -2734,7 +2734,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr, | |||
2734 | { | 2734 | { |
2735 | int nr, dotted; | 2735 | int nr, dotted; |
2736 | unsigned long first_adr; | 2736 | unsigned long first_adr; |
2737 | unsigned long inst, last_inst = 0; | 2737 | unsigned int inst, last_inst = 0; |
2738 | unsigned char val[4]; | 2738 | unsigned char val[4]; |
2739 | 2739 | ||
2740 | dotted = 0; | 2740 | dotted = 0; |
@@ -2758,7 +2758,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr, | |||
2758 | dotted = 0; | 2758 | dotted = 0; |
2759 | last_inst = inst; | 2759 | last_inst = inst; |
2760 | if (praddr) | 2760 | if (praddr) |
2761 | printf(REG" %.8lx", adr, inst); | 2761 | printf(REG" %.8x", adr, inst); |
2762 | printf("\t"); | 2762 | printf("\t"); |
2763 | dump_func(inst, adr); | 2763 | dump_func(inst, adr); |
2764 | printf("\n"); | 2764 | printf("\n"); |