Reuse print_hex_chars.
authorAndrew Burgess <aburgess@broadcom.com>
Mon, 23 Sep 2013 09:18:44 +0000 (09:18 +0000)
committerAndrew Burgess <aburgess@broadcom.com>
Mon, 23 Sep 2013 09:18:44 +0000 (09:18 +0000)
  https://sourceware.org/ml/gdb-patches/2013-09/msg00768.html

gdb/ChangeLog

        * sh64-tdep.c (sh64_do_fp_register): Use print_hex_chars.

gdb/ChangeLog
gdb/sh64-tdep.c

index a71cc5ce9b7750f5d5151326102c433a37774452..b016136ad2d2b9dc37079141574e5c5dc4abd6a8 100644 (file)
@@ -1,3 +1,7 @@
+2013-09-23  Andrew Burgess  <aburgess@broadcom.com>
+
+       * sh64-tdep.c (sh64_do_fp_register): Use print_hex_chars.
+
 2013-09-19  Pedro Alves  <palves@redhat.com>
 
        * breakpoint.c (remove_threaded_breakpoints): Skip non-user
index e9ce42bef9d482cf6815578264bbc50b3a428cd6..9425e9f1510bbeb27a085026c8fdbe321971dcc2 100644 (file)
@@ -1948,14 +1948,10 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
     fprintf_filtered (file, "%-10.9g", flt);
 
   /* Print the fp register as hex.  */
-  fprintf_filtered (file, "\t(raw 0x");
-  for (j = 0; j < register_size (gdbarch, regnum); j++)
-    {
-      int idx = gdbarch_byte_order (gdbarch)
-               == BFD_ENDIAN_BIG ? j : register_size
-               (gdbarch, regnum) - 1 - j;
-      fprintf_filtered (file, "%02x", raw_buffer[idx]);
-    }
+  fprintf_filtered (file, "\t(raw ");
+  print_hex_chars (file, raw_buffer,
+                  register_size (gdbarch, regnum),
+                  gdbarch_byte_order (gdbarch));
   fprintf_filtered (file, ")");
   fprintf_filtered (file, "\n");
 }