This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] sh64 - reuse print_hex_chars
- From: "Andrew Burgess" <aburgess at broadcom dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 20 Sep 2013 16:55:08 +0100
- Subject: [PATCH] sh64 - reuse print_hex_chars
- Authentication-results: sourceware.org; auth=none
I think the following patch is obvious, I'll
commit in a few days if nobody objects.
Thanks,
Andrew
gdb/ChangeLog
2013-09-20 Andrew Burgess <aburgess@broadcom.com>
* sh64-tdep.c (sh64_do_fp_register): Use print_hex_chars;
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index e9ce42b..9425e9f 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -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");
}