+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * arch-utils.c (selected_byte_order): Return target_byte_order_user.
+ (show_endian): Use target_byte_order_user if specified; otherwise
+ use get_current_arch () instead of current_gdbarch.
+ (show_architecture): Use set_architecture_string if specified;
+ otherwise use get_current_arch () instead of current_gdbarch.
+ (get_current_arch): New function.
+ * arch-utils.h (get_current_arch): Add prototype.
+
+ * osabi.c (show_osabi): Use get_current_arch () instead of
+ current_gdbarch.
+
+ * findcmd.c: Include "arch-utils.h".
+ (parse_find_args): Add BIG_P argument. Use it instead of byte order
+ of current_gdbarch.
+ (find_command): Use get_current_arch () instead of current_gdbarch.
+ Pass byte order to parse_find_args.
+
+ * maint.c: Include "arch-utils.h".
+ (maintenance_print_architecture): Use get_current_arch () instead
+ of current_gdbarch.
+
+ * reggroups.c: Include "arch-utils.h".
+ (maintenance_print_reggroups): Use get_current_arch () instead
+ of current_gdbarch.
+
+ * symfile.c: Include "arch-utils.h".
+ (overlay_load_command): Use get_current_arch () instead of
+ current_gdbarch.
+
+ * value.c: Include "arch-utils.h".
+ (show_convenience): Use get_current_arch () instead of
+ current_gdbarch.
+
+ * tui/tui-regs.c: Include "arch-utils.h".
+ (tui_reg_next_command): Use get_current_arch () instead of
+ current_gdbarch.
+
+ * mi/mi-main.c: Include "arch-utils.h".
+ (mi_cmd_data_read_memory): Use get_current_arch () instead of
+ current_gdbarch.
+
+ * parse.c: Include "arch-utils.h".
+ (parse_exp_in_context): Use get_current_arch () instead of
+ current_gdbarch.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * 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.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.h (TYPE_OBJFILE_OWNED, TYPE_OWNER): New macros.
+ (TYPE_OBJFILE, TYPE_ALLOC, TYPE_ZALLOC): Reimplement.
+ (alloc_type_arch): Add prototype.
+ (alloc_type_copy): Likewise.
+ (get_type_arch): Likewise.
+ (arch_type): Likewise.
+ (arch_integer_type): Likewise.
+ (arch_character_type): Likewise.
+ (arch_boolean_type): Likewise.
+ (init_float_type): Remove, replace by ...
+ (arch_float_type): ... this.
+ (init_complex_type): Remove, replace by ...
+ (arch_complex_type): ... this.
+ (init_flags_type): Remove, replace by ...
+ (arch_flags_type): ... this.
+ (init_composite_type): Remove, replace by ...
+ (arch_composite_type): ... this.
+
+ * gdbtypes.c (alloc_type): No longer support NULL objfile.
+ (init_type): Likewise.
+ (alloc_type_arch): New function.
+ (alloc_type_copy): New function.
+ (get_type_arch): New function.
+
+ (smash_type): Preserve type ownership information.
+ (make_pointer_type, make_reference_type, make_function_type,
+ smash_to_memberptr_type, smash_to_method_type): No longer
+ preserve OBJFILE across smash_type calls.
+ (make_pointer_type, make_reference_type, make_function_type,
+ lookup_memberptr_type, lookup_methodptr_type, allocate_stub_method,
+ create_range_type, create_array_type, create_set_type, copy_type):
+ Use alloc_type_copy when allocating types.
+ (check_typedef): Use alloc_type_arch.
+ (copy_type_recursive): Likewise. Preserve type ownership data
+ after copying type.
+ (recursive_dump_type): Dump type ownership data.
+ (alloc_type_instance): Update type ownership check.
+ (copy_type, copy_type_recursive): Likewise.
+
+ (arch_type): New function.
+ (arch_integer_type): Likewise.
+ (arch_character_type): Likewise.
+ (arch_boolean_type): Likewise.
+ (init_float_type): Remove, replace by ...
+ (arch_float_type): ... this.
+ (init_complex_type): Remove, replace by ...
+ (arch_complex_type): ... this.
+ (init_flags_type): Remove, replace by ...
+ (arch_flags_type): ... this.
+ (append_flags_type_flag): Move down.
+ (init_composite_type): Remove, replace by ...
+ (arch_composite_type): ... this.
+ (append_composite_type_field_aligned,
+ append_composite_type_field): Move down.
+
+ * gdbarch.c (gdbtypes_post_init): Allocate all types
+ using per-architecture routines.
+ * ada-lang.c (ada_language_arch_info): Likewise.
+ * f-lang.c (build_fortran_types): Likewise.
+ * jv-lang.c (build_java_types): Likewise.
+ * m2-lang.c (build_m2_types): Likewise.
+ * scm-lang.c (build_scm_types): Likewise.
+
+ * ada-lang.c (ada_type_of_array): Use alloc_type_copy.
+ (packed_array_type): Likewise.
+ (ada_template_to_fixed_record_type_1): Likewise.
+ (template_to_static_fixed_type): Likewise.
+ (to_record_with_fixed_variant_part): Likewise.
+ (to_fixed_variant_branch_type): Likewise.
+ (to_fixed_array_type): Likewise.
+ (to_fixed_range_type): Likewise.
+ (empty_record): Use type instead of objfile argument.
+ Use alloc_type_copy.
+ (to_fixed_variant_branch_type): Update call to empty_record.
+ * jv-lang.c (type_from_class): Use alloc_type_arch.
+
+ * arm-tdep.c (arm_ext_type): Allocate per-architecture type.
+ * i386-tdep.c (i386_eflags_type, i386_mxcsr_type, i387_ext_type,
+ i386_mmx_type, i386_sse_type): Likewise.
+ * ia64-tdep.c (ia64_ext_type): Likewise.
+ * m32c-tdep.c (make_types): Likewise.
+ * m68k-tdep.c (m68k_ps_type, m68881_ext_type): Likewise.
+ * rs6000-tdep.c (rs6000_builtin_type_vec64,
+ rs6000_builtin_type_vec128): Likewise.
+ * sparc-tdep.c (sparc_psr_type, sparc_fsr_type): Likewise.
+ * sparc64-tdep.c (sparc64_pstate_type, sparc64_fsr_type,
+ sparc64_fprs_type): Likewise.
+ * spu-tdep.c (spu_builtin_type_vec128): Likewise.
+ * xtensa-tdep.c (xtensa_register_type): Likewise.
+ * linux-tdep.c (linux_get_siginfo_type): Likewise.
+ * target-descriptions.c (tdesc_gdb_type): Likewise.
+ * gnu-v3-abi.c (build_gdb_vtable_type): Likewise.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * i386-tdep.h (struct gdbarch_tdep): Add i386_eflags_type and
+ i386_mxcsr_type members.
+ (i386_eflags_type): Make into function.
+ (i386_mxcsr_type): Likewise.
+ * i386-tdep.c (i386_eflags_type): Make into function.
+ (i386_mxcsr_type): Likewise.
+ (i386_register_type): Update uses.
+ (i386_init_types): Remove.
+ (_initialize_i386_tdep): Do not call it.
+ * amd64-tdep.c (amd64_register_type): Update uses.
+
+ * m68k-tdep.h (struct gdbarch_tdep): Add m68k_ps_type member.
+ * m68k-tdep.c (m68k_ps_type): Make into function.
+ (m68k_register_type): Update use.
+ (m68k_init_types): Remove.
+ (_initialize_m68k_tdep): Do not call it.
+
+ * sparc-tdep.h (struct gdbarch_tdep): Add sparc_psr_type,
+ sparc_fsr_type, sparc64_pstate_type, sparc64_fsr_type, and
+ sparc64_fprs_type members.
+ * sparc-tdep.c (sparc_psr_type): Make into function.
+ (sparc_fsr_type): Likewise.
+ (sparc32_register_type): Update uses.
+ (sparc_init_types): Remove.
+ (_initialize_sparc_tdep): Do not call it.
+ * sparc64-tdep.c (sparc64_pstate_type): Make into function.
+ (sparc64_fsr_type): Likewise.
+ (sparc64_fprs_type): Likewise.
+ (sparc64_register_type): Update uses.
+ (sparc64_init_types): Remove.
+ (_initialize_sparc64_tdep): Likewise.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.h (builtin_type_ieee_single, builtin_type_ieee_double,
+ builtin_type_i387_ext, builtin_type_m68881_ext, builtin_type_arm_ext,
+ builtin_type_ia64_spill, builtin_type_ia64_quad): Remove.
+ (init_float_type, init_complex_type): Add prototypes.
+ * gdbtypes.c (builtin_type_ieee_single, builtin_type_ieee_double,
+ builtin_type_i387_ext, builtin_type_m68881_ext, builtin_type_arm_ext,
+ builtin_type_ia64_spill, builtin_type_ia64_quad): Remove.
+ (_initialize_gdbtypes): Do not initialize them.
+ (build_flt): Rename to ...
+ (init_float_type): ... this. Make global.
+ (build_complex): Rename to ...
+ (init_complex_type): ... this. Make global. Remove BIT argument.
+ (gdbtypes_post_init): Update calls.
+
+ * ada-lang.c (ada_language_arch_info): Use init_float_type.
+ * jv-lang.c (build_java_types): Likewise.
+ * m2-lang.c (build_m2_types): Likewise.
+ * f-lang.c (build_fortran_types): Use init_float_type and
+ init_complex_type.
+
+ * target-descriptions.c (tdesc_gdb_type): Call init_float_type instead
+ of using builtin_type_ieee_single, builtin_type_ieee_double, or
+ builtin_type_arm_ext.
+
+ * ia64-tdep.h (struct gdbarch_tdep): Add ia64_ext_type member.
+ * ia64-tdep.c (builtin_type_ia64_ext): Remove.
+ (_initialize_ia64_tdep): Do not initialize it.
+ (floatformat_valid, floatformat_ia64_ext, floatformats_ia64_ext):
+ Move up.
+ (ia64_ext_type): New function.
+ (ia64_register_reggroup_p, ia64_convert_register_p,
+ ia64_register_to_value, ia64_value_to_register,
+ ia64_extract_return_value, ia64_store_return_value): Use ia64_ext_type
+ instead of builtin_type_ia64_ext.
+
+ * i386-tdep.h (struct gdbarch_tdep): Add i387_ext_type member.
+ (i387_ext_type): Add prototype.
+ * i386-tdep.c (i387_ext_type): New function.
+ (i386_extract_return_value, i386_store_return_value,
+ i386_register_type): Use it instead of builtin_type_i387_ext.
+ * amd64-tdep.c (amd64_register_type): Likewise.
+ * i387-tdep.c (print_i387_value, i387_register_to_value,
+ i387_value_to_register): Likewise.
+ (print_i387_value, print_i387_ext): Add GDBARCH argument.
+ (print_i387_ext, i387_print_float_info): Pass to subroutines.
+
+ * m68k-tdep.h (struct gdbarch_tdep): Add m68881_ext_type member.
+ * m68k-tdep.c (m68881_ext_type): New function.
+ (m68k_register_type, m68k_convert_register_p): Use it instead
+ of builtin_type_m68881_ext.
+
+ * arm-tdep.h (struct gdbarch_tdep): Add arm_ext_type member.
+ * arm-tdep.c (arm_ext_type): New function.
+ (arm_register_type): Use it instead of builtin_type_arm_ext.
+
+ * alpha-tdep.c (alpha_register_type): Use builtin types
+ instead of builtin_type_ieee_double.
+
+ * mips-tdep.c (mips_float_register_type, mips_double_register_type):
+ Remove.
+ (mips_register_type): Use builtin types instead of
+ builtin_type_ieee_single and builtin_type_ieee_double.
+ (mips_print_fp_register): Use builtin types instead of
+ mips_float_register_type and mips_double_register_type.
+
+ * hppa-tdep.c (hppa32_register_type, hppa64_register_type):
+ Use builtin types instead of builtin_type_ieee_single and
+ builtin_type_ieee_double.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.h (builtin_type_int0, builtin_type_int8, builtin_type_uint8,
+ builtin_type_int16, builtin_type_uint16, builtin_type_int32,
+ builtin_type_uint32, builtin_type_int64, builtin_type_uint64,
+ builtin_type_int128, builtin_type_uint128): Remove.
+ (struct builtin_type): New members builtin_int0, builtin_int8,
+ builtin_uint8, builtin_int16, builtin_uint16, builtin_int32,
+ builtin_uint32, builtin_int64, builtin_uint64, builtin_int128,
+ and builtin_uint128.
+ * gdbtypes.c (builtin_type_int0, builtin_type_int8, builtin_type_uint8,
+ builtin_type_int16, builtin_type_uint16, builtin_type_int32,
+ builtin_type_uint32, builtin_type_int64, builtin_type_uint64,
+ builtin_type_int128, builtin_type_uint128): Remove.
+ (_initialize_gdbtypes): Do not initialize them.
+ (gdbtypes_post_init): Initialize fixed-size integer types.
+
+ * dwarf2expr.c (unsigned_address_type, signed_address_type): Add
+ GDBARCH argument. Return platform-specific type.
+ (dwarf2_read_address, execute_stack_op): Update calls.
+
+ * target-descriptions.c (tdesc_gdb_type): Use platform-specific types
+ instead of global builtin_int_... variables.
+ * mi/mi-main.c (mi_cmd_data_read_memory): Likewise.
+ * printcmd.c (do_examine): Likewise.
+ * jv-exp.y (parse_number): Likewise.
+
+ * alpha-tdep.c (alpha_register_type, alpha_push_dummy_call,
+ alpha_store_return_value): Likewise.
+ * amd64-linux-tdep.c (amd64_linux_register_type): Likewise.
+ * amd64-tdep.c (amd64_register_type): Likewise.
+ * arm-tdep.c (arm_register_type): Likewise.
+ * avr-tdep.c (avr_register_type): Likewise.
+ * cris-tdep.c (cris_register_type, crisv32_register_type): Likewise.
+ * frv-tdep.c (frv_register_type): Likewise.
+ * h8300-tdep.c h8300_register_type): Likewise.
+ * hppa-tdep.c (hppa64_push_dummy_call, hppa32_register_type,
+ hppa64_register_type): Likewise.
+ * i386-tdep.c (i386_mmx_type, i386_sse_type): Likewise.
+ * iq2000-tdep.c (iq2000_register_type): Likewise.
+ * lm32-tdep.c (lm32_register_type, lm32_push_dummy_call): Likewise.
+ * m32r-tdep.c (m32r_register_type): Likewise.
+ * m68hc11-tdep.c (m68hc11_register_type, m68hc11_pseudo_register_read,
+ m68hc11_pseudo_register_write): Likewise.
+ * m68k-tdep.c (m68k_register_type): Likewise.
+ * m88k-tdep.c (m88k_register_type, m88k_store_arguments): Likewise.
+ * mep-tdep.c (mep_register_type): Likewise.
+ * mips-tdep.c (mips_register_type, mips_pseudo_register_type,
+ mips_print_fp_register): Likewise.
+ * moxie-tdep.c (moxie_register_type): Likewise.
+ * mt-tdep.c (mt_copro_register_type, mt_register_type): Likewise.
+ * rs6000-tdep.c (rs6000_builtin_type_vec64,
+ rs6000_builtin_type_vec128): Likewise.
+ * score-tdep.c (score_register_type): Likewise.
+ * sparc-tdep.c (sparc32_register_type, sparc32_store_arguments):
+ Likewise.
+ * sparc64-tdep.c (sparc64_register_type, sparc64_store_arguments):
+ Likewise.
+ * spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise.
+ * v850-tdep.c (v850_register_type): Likewise.
+ * xstormy16-tdep.c (xstormy16_register_type): Likewise.
+ * xtensa-tdep.c (xtensa_register_type): Likewise.
+
+ * mt-tdep.c (struct gdbarch_tdep): New data structure.
+ (mt_gdbarch_init): Alloc TDEP structures.
+ (mt_register_type): Cache coprocessor type in TDEP instead of
+ static global variable.
+
+ * xtensa-tdep.h (struct gdbarch_tdep): Add type_entries member.
+ * xtensa-tdep.c (type_entries): Remove.
+ (xtensa_register_type): Cache fixed-size types in TDEP instead
+ of in global variable.
+
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
* gdbtypes.h (builtin_type_true_char): Remove.