[Git][ghc/ghc][master] rts/Disassembler.c: Use FMT_HexWord for printing values in hex format

Marge Bot gitlab at gitlab.haskell.org
Wed Jul 15 01:34:06 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
c9f65c36 by Stefan Schulze Frielinghaus at 2020-07-14T21:33:57-04:00
rts/Disassembler.c: Use FMT_HexWord for printing values in hex format

- - - - -


2 changed files:

- includes/stg/Types.h
- rts/Disassembler.c


Changes:

=====================================
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;


=====================================
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:



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c9f65c369a60467dcaf2b37d5f41f00565b4fe25

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c9f65c369a60467dcaf2b37d5f41f00565b4fe25
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200714/dd81e188/attachment-0001.html>


More information about the ghc-commits mailing list