From 32c9a7957208ebe4d7a833cecbf552f3f852e733 Mon Sep 17 00:00:00 2001 From: Markus Deuling Date: Fri, 18 Jan 2008 17:07:40 +0000 Subject: * gdbarch.sh (function_list): Add new property bits_big_endian to gdbarch structure. * gdbarch.{c,h}: Regenerate. * value.c (struct value): Replace BITS_BIG_ENDIAN by gdbarch_bits_big_endian (comment). (unpack_field_as_long, modify_field): Likewise. * value.h: Likewise (comment). * valops.c (value_slice): Likewise. * valarith.c (value_subscript, value_bit_index): Likewise. * gdbtypes.h (field): Likewise (comment). * eval.c (evaluate_subexp_standard): Likewise. * dwarf2read.c (dwarf2_add_field): Likewise. * ada-lang.c (decode_packed_array, ada_value_primitive_packed_val) (move_bits, ada_value_assign, value_assign_to_component): Likewise. * defs.h (BITS_BIG_ENDIAN): Remove. * gdbint.texinfo (Target Conditionals): Replace the description of BITS_BIG_ENDIAN with a description of gdbarch_bits_big_endian. --- gdb/valarith.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/valarith.c') diff --git a/gdb/valarith.c b/gdb/valarith.c index 562be0c..173c7a5 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -230,7 +230,8 @@ value_subscript (struct value *array, struct value *idx) offset = index / TARGET_CHAR_BIT; byte = *((char *) value_contents (array) + offset); bit_index = index % TARGET_CHAR_BIT; - byte >>= (BITS_BIG_ENDIAN ? TARGET_CHAR_BIT - 1 - bit_index : bit_index); + byte >>= (gdbarch_bits_big_endian (current_gdbarch) ? + TARGET_CHAR_BIT - 1 - bit_index : bit_index); v = value_from_longest (LA_BOOL_TYPE, byte & 1); set_value_bitpos (v, bit_index); set_value_bitsize (v, 1); @@ -1575,7 +1576,7 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index) word = unpack_long (builtin_type_unsigned_char, valaddr + (rel_index / TARGET_CHAR_BIT)); rel_index %= TARGET_CHAR_BIT; - if (BITS_BIG_ENDIAN) + if (gdbarch_bits_big_endian (current_gdbarch)) rel_index = TARGET_CHAR_BIT - 1 - rel_index; return (word >> rel_index) & 1; } -- cgit v1.1