summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2020-07-12 17:28:09 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-14 21:33:57 -0400
commitc9f65c369a60467dcaf2b37d5f41f00565b4fe25 (patch)
tree5f7ffd3bd31a98de5f3125f7f68cf102a7adab0f
parente0db878a789e58c2a1aba2e73d42857008174124 (diff)
downloadhaskell-c9f65c369a60467dcaf2b37d5f41f00565b4fe25.tar.gz
rts/Disassembler.c: Use FMT_HexWord for printing values in hex format
-rw-r--r--includes/stg/Types.h2
-rw-r--r--rts/Disassembler.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/includes/stg/Types.h b/includes/stg/Types.h
index b9bb48228c..696df3e206 100644
--- a/includes/stg/Types.h
+++ b/includes/stg/Types.h
@@ -76,6 +76,7 @@ typedef uint8_t StgWord8;
#define STG_WORD8_MAX UINT8_MAX
#define FMT_Word8 PRIu8
+#define FMT_HexWord8 PRIx8
typedef int16_t StgInt16;
typedef uint16_t StgWord16;
@@ -85,6 +86,7 @@ typedef uint16_t StgWord16;
#define STG_WORD16_MAX UINT16_MAX
#define FMT_Word16 PRIu16
+#define FMT_HexWord16 PRIx16
typedef int32_t StgInt32;
typedef uint32_t StgWord32;
diff --git a/rts/Disassembler.c b/rts/Disassembler.c
index d5593c8a07..67a451e7e6 100644
--- a/rts/Disassembler.c
+++ b/rts/Disassembler.c
@@ -80,7 +80,7 @@ disInstr ( StgBCO *bco, int pc )
instrs[pc], (signed int)instrs[pc+1]);
pc += 2; break;
case bci_CCALL:
- debugBelch("CCALL marshaller at 0x%" FMT_Word "\n",
+ debugBelch("CCALL marshaller at 0x%" FMT_HexWord "\n",
literals[instrs[pc]] );
pc += 1; break;
case bci_STKCHECK: {
@@ -159,26 +159,23 @@ disInstr ( StgBCO *bco, int pc )
pc += 1; break;
case bci_PUSH_UBX8:
debugBelch(
- "PUSH_UBX8 0x%" FMT_Word8 " ",
+ "PUSH_UBX8 0x%" FMT_HexWord8 "\n",
(StgWord8) literals[instrs[pc]] );
- debugBelch("\n");
pc += 1; break;
case bci_PUSH_UBX16:
debugBelch(
- "PUSH_UBX16 0x%" FMT_Word16 " ",
+ "PUSH_UBX16 0x%" FMT_HexWord16 "\n",
(StgWord16) literals[instrs[pc]] );
- debugBelch("\n");
pc += 1; break;
case bci_PUSH_UBX32:
debugBelch(
- "PUSH_UBX32 0x%" FMT_Word32 " ",
+ "PUSH_UBX32 0x%" FMT_HexWord32 "\n",
(StgWord32) literals[instrs[pc]] );
- debugBelch("\n");
pc += 1; break;
case bci_PUSH_UBX:
debugBelch("PUSH_UBX ");
for (i = 0; i < instrs[pc+1]; i++)
- debugBelch("0x%" FMT_Word " ", literals[i + instrs[pc]] );
+ debugBelch("0x%" FMT_HexWord " ", literals[i + instrs[pc]] );
debugBelch("\n");
pc += 2; break;
case bci_PUSH_APPLY_N: