summaryrefslogtreecommitdiff
path: root/gdb/valarith.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:57:14 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:57:14 +0000
commit5b86fd99d277d035b218d3f7e6df6a36cebe8624 (patch)
tree27a766d6447dd5208407f6de0f0fae38f86cf657 /gdb/valarith.c
parentf139ea31f3fc9b82f94e6478abd6d94869576ef8 (diff)
downloadgdb-5b86fd99d277d035b218d3f7e6df6a36cebe8624.tar.gz
* gdbtypes.c (make_pointer_type, make_reference_type,
smash_to_memberptr_type, lookup_array_range_type, check_stub_method): Use type architecture instead of current_gdbarch. * gdbtypes.h (address_space_name_to_int, address_space_int_to_name): Add GDBARCH paramter. * gdbtypes.c (address_space_name_to_int, address_space_int_to_name): Add GDBARCH parameter. Use it instead of current_gdbarch. * c-typeprint.c (c_type_print_modifier): Update call. * parse.c (push_type_address_space): Likewise. * findvar.c (extract_typed_address, store_typed_address): Use type architecture instead of current_gdbarch. * value.c (value_as_address, unpack_field_as_long): Use type architecture instead of current_gdbarch. * doublest.c (floatformat_from_length): Add GDBARCH argument. Use it instead of current_gdbarch. (floatformat_from_type): Pass type architecture. * infcall.c (find_function_addr): Use type architecture instead of current_gdbarch. * valarith.c (value_bitstring_subscript, value_x_binop, value_neg, value_bit_index): Use type architecture instead of current_gdbarch. * valops.c (value_cast, value_slice): Likewise. * value.h (modify_field): Add TYPE argument. * value.c (modify_field): Add TYPE argument. Use type architecture instead of current_gdbarch. (set_internalvar_component): Likewise. * eval.c (evaluate_struct_tuple): Update call. * valops.c (value_assign): Likewise. * ada-lang.c (modify_general_field): Likewise. Add TYPE argument. (make_array_descriptor): Update calls. (move_bits): Add BITS_BIG_ENDIAN_P argument. Use it instead of current_gdbarch. (ada_value_assign, value_assign_to_component): Update calls. (decode_packed_array, ada_value_primitive_packed_val, ada_value_assign, value_assign_to_component): Use type arch instead of current_gdbarch. * printcmd.c (float_type_from_length): Remove GDBARCH argument, use type architecture instead. (print_scalar_formatted, printf_command): Update calls. Use type architecture instead of current_gdbarch. * valprint.c (val_print_type_code_int): Use type architecture instead of current_gdbarch. * varobj.c (value_get_print_value): Likewise. * python/python-prettyprint.c (print_string_repr): Add GDBARCH argument. Use it instead of current_gdbarch. (apply_val_pretty_printer): Update call. * ada-valprint.c (ada_val_print_1): Use type architecture instead of current_gdbarch. * c-valprint.c (print_function_pointer_address): Add GDBARCH argument. Use it instead of current_gdbarch. (c_val_print): Update calls passing type architecture. * f-valprint.c (f_val_print): Use type architecture instead of current_gdbarch. * jv-valprint (java_value_print): Likewise. * m2-valprint.c (print_function_pointer_address): Add GDBARCH argument. Use it instead of current_gdbarch. (print_unpacked_pointer): Update calls passing type architecture. * scm-valprint.c (scm_scmval_print): Use type architecture instead of current_gdbarch. * gnu-v3-abi.c (get_class_arch): Remove. (gnuv3_rtti_type): Use get_type_arch instead of get_class_arch. Remove special-case check for Java classes. (gnuv3_virtual_fn_field, gnuv3_baseclass_offset, gnuv3_print_method_ptr, gnuv3_method_ptr_size, gnuv3_make_method_ptr, gnuv3_method_ptr_to_value): Use get_type_arch instead of get_class_arch.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r--gdb/valarith.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 0ee25d2b480..975a49ee5fa 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -233,7 +233,7 @@ value_bitstring_subscript (struct type *type,
byte = *((char *) value_contents (bitstring) + offset);
bit_index = index % TARGET_CHAR_BIT;
- byte >>= (gdbarch_bits_big_endian (current_gdbarch) ?
+ byte >>= (gdbarch_bits_big_endian (get_type_arch (bitstring_type)) ?
TARGET_CHAR_BIT - 1 - bit_index : bit_index);
v = value_from_longest (type, byte & 1);
@@ -471,7 +471,7 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
struct value *
value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
{
- struct gdbarch *gdbarch = current_gdbarch;
+ struct gdbarch *gdbarch = get_type_arch (value_type (arg1));
struct value **argvec;
char *ptr, *mangle_ptr;
char tstr[13], mangle_tstr[13];
@@ -1479,7 +1479,7 @@ value_neg (struct value *arg1)
memcpy (decbytes, value_contents (arg1), len);
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
+ if (gdbarch_byte_order (get_type_arch (type)) == BFD_ENDIAN_LITTLE)
decbytes[len-1] = decbytes[len - 1] | 0x80;
else
decbytes[0] = decbytes[0] | 0x80;
@@ -1521,6 +1521,7 @@ value_complement (struct value *arg1)
int
value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
LONGEST low_bound, high_bound;
LONGEST word;
unsigned rel_index;
@@ -1532,7 +1533,7 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
rel_index = index - low_bound;
word = extract_unsigned_integer (valaddr + (rel_index / TARGET_CHAR_BIT), 1);
rel_index %= TARGET_CHAR_BIT;
- if (gdbarch_bits_big_endian (current_gdbarch))
+ if (gdbarch_bits_big_endian (gdbarch))
rel_index = TARGET_CHAR_BIT - 1 - rel_index;
return (word >> rel_index) & 1;
}