From d44e847372bc71608d46402a65034c8d40ba2e80 Mon Sep 17 00:00:00 2001 From: Markus Deuling Date: Fri, 23 May 2008 04:28:05 +0000 Subject: * valprint.c (print_hex_chars, print_octal_chars, print_decimal_chars, print_binary_chars, print_char_chars): Add byte_order parameter and replace gdbarch_byte_order. (print_decimal_chars): Replace START_P, NOT_END_P and NEXT_P by their expressions and remove them. Remove unused TWO_TO_FOURTH. (val_print_type_code_int): Introduce gdbarch_byte_order to get at the endianness. Update call to print_hex_chars. * valprint.h (print_hex_chars, print_octal_chars, print_decimal_chars, print_binary_chars, print_char_chars): Add byte_order parameter. * printcmd.c (print_scalar_formatted): Introduce gdbarch_byte_order to get at the endianness. Update print_*_char calls to use byte_order. --- gdb/printcmd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gdb/printcmd.c') diff --git a/gdb/printcmd.c b/gdb/printcmd.c index ad658b0..b63fbc1 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -322,6 +322,7 @@ print_scalar_formatted (const void *valaddr, struct type *type, { LONGEST val_long = 0; unsigned int len = TYPE_LENGTH (type); + enum bfd_endian byte_order = gdbarch_byte_order (current_gdbarch); /* If we get here with a string format, try again without it. Go all the way back to the language printers, which may call us @@ -340,20 +341,20 @@ print_scalar_formatted (const void *valaddr, struct type *type, switch (format) { case 'o': - print_octal_chars (stream, valaddr, len); + print_octal_chars (stream, valaddr, len, byte_order); return; case 'u': case 'd': - print_decimal_chars (stream, valaddr, len); + print_decimal_chars (stream, valaddr, len, byte_order); return; case 't': - print_binary_chars (stream, valaddr, len); + print_binary_chars (stream, valaddr, len, byte_order); return; case 'x': - print_hex_chars (stream, valaddr, len); + print_hex_chars (stream, valaddr, len, byte_order); return; case 'c': - print_char_chars (stream, valaddr, len); + print_char_chars (stream, valaddr, len, byte_order); return; default: break; -- cgit v1.1