This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] make default_print_one_register_info print_hex_chars


The following patch makes default_print_one_register_info
use print_hex_chars.

OK to apply?

Thanks,
Andrew

gdb/ChangeLog

2013-07-08  Andrew Burgess  <aburgess@broadcom.com>

	* infcmd.c (default_print_one_register_info): Reuse code in
	print_hex_chars.

diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 30621e4..1ae5680 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2052,17 +2052,8 @@ default_print_one_register_info (struct ui_file *file,
 		 value_embedded_offset (val), 0,
 		 file, 0, val, &opts, current_language);
 
-      fprintf_filtered (file, "\t(raw 0x");
-      for (j = 0; j < TYPE_LENGTH (regtype); j++)
-	{
-	  int idx;
-
-	  if (byte_order == BFD_ENDIAN_BIG)
-	    idx = j;
-	  else
-	    idx = TYPE_LENGTH (regtype) - 1 - j;
-	  fprintf_filtered (file, "%02x", (unsigned char) valaddr[idx]);
-	}
+      fprintf_filtered (file, "\t(raw ");
+      print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order);
       fprintf_filtered (file, ")");
     }
   else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]