disas/hppa: Show hexcode of instruction along with disassembly
authorHelge Deller <deller@gmx.de>
Fri, 17 Nov 2023 10:26:02 +0000 (11:26 +0100)
committerHelge Deller <deller@gmx.de>
Fri, 17 Nov 2023 17:36:36 +0000 (18:36 +0100)
On hppa many instructions can be expressed by different bytecodes.
To be able to debug qemu translation bugs it's therefore necessary to see the
currently executed byte codes without the need to lookup the sequence without
the full executable.
With this patch the instruction byte code is shown beside the disassembly.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
disas/hppa.c

index dcf9a47f348932ea7ddaafe810f2e1d04c146583..cce4f4aa374179bbfc95df14684a5df462af6f49 100644 (file)
@@ -1968,6 +1968,10 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
 
   insn = bfd_getb32 (buffer);
 
+  info->fprintf_func(info->stream, " %02x %02x %02x %02x   ",
+                (insn >> 24) & 0xff, (insn >> 16) & 0xff,
+                (insn >>  8) & 0xff, insn & 0xff);
+
   for (i = 0; i < NUMOPCODES; ++i)
     {
       const struct pa_opcode *opcode = &pa_opcodes[i];
@@ -2826,6 +2830,6 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
          return sizeof (insn);
        }
     }
-  (*info->fprintf_func) (info->stream, "#%8x", insn);
+  info->fprintf_func(info->stream, "<unknown>");
   return sizeof (insn);
 }