]> git.proxmox.com Git - qemu.git/blobdiff - arm-dis.c
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
[qemu.git] / arm-dis.c
index af217397d4c4c6420708fe385e93636052ee9d68..6bc4d716981ae5a357912b9d1af6d44336bb590b 100644 (file)
--- a/arm-dis.c
+++ b/arm-dis.c
@@ -1624,7 +1624,7 @@ arm_decode_shift (long given, fprintf_function func, void *stream,
 }
 
 /* Print one coprocessor instruction on INFO->STREAM.
-   Return true if the instuction matched, false if this is not a
+   Return true if the instruction matched, false if this is not a
    recognised coprocessor instruction.  */
 
 static bfd_boolean
@@ -2214,7 +2214,7 @@ print_arm_address (bfd_vma pc, struct disassemble_info *info, long given)
 }
 
 /* Print one neon instruction on INFO->STREAM.
-   Return true if the instuction matched, false if this is not a
+   Return true if the instruction matched, false if this is not a
    recognised neon instruction.  */
 
 static bfd_boolean
@@ -3927,7 +3927,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
            n = last_mapping_sym - 1;
 
          /* No mapping symbol found at this address.  Look backwards
-            for a preceeding one.  */
+            for a preceding one.  */
          for (; n >= 0; n--)
            {
              if (get_sym_code_type (info, n, &type))
@@ -4101,6 +4101,30 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
        addresses, since the addend is not currently pc-relative.  */
     pc = 0;
 
+  /* We include the hexdump of the instruction. The format here
+     matches that used by objdump and the ARM ARM (in particular,
+     32 bit Thumb instructions are displayed as pairs of halfwords,
+     not as a single word.)  */
+  if (is_thumb)
+    {
+      if (size == 2)
+       {
+         info->fprintf_func(info->stream, "%04lx       ",
+                            ((unsigned long)given) & 0xffff);
+       }
+      else
+       {
+         info->fprintf_func(info->stream, "%04lx %04lx  ",
+                            (((unsigned long)given) >> 16) & 0xffff,
+                            ((unsigned long)given) & 0xffff);
+       }
+    }
+  else
+    {
+      info->fprintf_func(info->stream, "%08lx      ",
+                        ((unsigned long)given) & 0xffffffff);
+    }
+
   printer (pc, info, given);
 
   if (is_thumb)