Patchwork microblaze: Fix two format specifiers in disassembler

login
register
mail settings
Submitter Stefan Weil
Date April 9, 2010, 8:49 p.m.
Message ID <1270846193-5667-1-git-send-email-weil@mail.berlios.de>
Download mbox | patch
Permalink /patch/49867/
State New
Headers show

Comments

Stefan Weil - April 9, 2010, 8:49 p.m.
inst is unsigned long, so use %04lx instead of %04x.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 microblaze-dis.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Thomas Monjalon - April 10, 2010, 11:44 a.m.
Stefan Weil wrote:
> inst is unsigned long, so use %04lx instead of %04x.
> 
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>

I've sent a patch
(http://lists.gnu.org/archive/html/qemu-devel/2010-04/msg00637.html)
which include this change and fix a bug, as explained by Paolo Bonzini:
http://lists.gnu.org/archive/html/qemu-devel/2010-04/msg00638.html

Patch

diff --git a/microblaze-dis.c b/microblaze-dis.c
index b26572f..9235fd8 100644
--- a/microblaze-dis.c
+++ b/microblaze-dis.c
@@ -826,7 +826,7 @@  print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
   prev_insn_vma = curr_insn_vma;
 
   if (op->name == 0) {
-    fprintf (stream, ".short 0x%04x", inst);
+    fprintf (stream, ".short 0x%04lx", inst);
   }
   else
     {
@@ -959,7 +959,7 @@  print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
      break;
   default:
 	  /* if the disassembler lags the instruction set */
-	  fprintf (stream, "\tundecoded operands, inst is 0x%04x", inst);
+	  fprintf (stream, "\tundecoded operands, inst is 0x%04lx", inst);
 	  break;
 	}
     }