* 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.
This commit is contained in:
parent
e9bb382b83
commit
5081068481
25 changed files with 220 additions and 147 deletions
|
@ -291,8 +291,8 @@ make_pointer_type (struct type *type, struct type **typeptr)
|
|||
/* FIXME! Assume the machine has only one representation for
|
||||
pointers! */
|
||||
|
||||
TYPE_LENGTH (ntype) =
|
||||
gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT;
|
||||
TYPE_LENGTH (ntype)
|
||||
= gdbarch_ptr_bit (get_type_arch (type)) / TARGET_CHAR_BIT;
|
||||
TYPE_CODE (ntype) = TYPE_CODE_PTR;
|
||||
|
||||
/* Mark pointers as unsigned. The target converts between pointers
|
||||
|
@ -369,7 +369,8 @@ make_reference_type (struct type *type, struct type **typeptr)
|
|||
references, and that it matches the (only) representation for
|
||||
pointers! */
|
||||
|
||||
TYPE_LENGTH (ntype) = gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT;
|
||||
TYPE_LENGTH (ntype) =
|
||||
gdbarch_ptr_bit (get_type_arch (type)) / TARGET_CHAR_BIT;
|
||||
TYPE_CODE (ntype) = TYPE_CODE_REF;
|
||||
|
||||
if (!TYPE_REFERENCE_TYPE (type)) /* Remember it, if don't have one. */
|
||||
|
@ -438,9 +439,8 @@ lookup_function_type (struct type *type)
|
|||
/* Identify address space identifier by name --
|
||||
return the integer flag defined in gdbtypes.h. */
|
||||
extern int
|
||||
address_space_name_to_int (char *space_identifier)
|
||||
address_space_name_to_int (struct gdbarch *gdbarch, char *space_identifier)
|
||||
{
|
||||
struct gdbarch *gdbarch = current_gdbarch;
|
||||
int type_flags;
|
||||
/* Check for known address space delimiters. */
|
||||
if (!strcmp (space_identifier, "code"))
|
||||
|
@ -460,9 +460,8 @@ address_space_name_to_int (char *space_identifier)
|
|||
gdbtypes.h -- return the string version of the adress space name. */
|
||||
|
||||
const char *
|
||||
address_space_int_to_name (int space_flag)
|
||||
address_space_int_to_name (struct gdbarch *gdbarch, int space_flag)
|
||||
{
|
||||
struct gdbarch *gdbarch = current_gdbarch;
|
||||
if (space_flag & TYPE_INSTANCE_FLAG_CODE_SPACE)
|
||||
return "code";
|
||||
else if (space_flag & TYPE_INSTANCE_FLAG_DATA_SPACE)
|
||||
|
@ -855,7 +854,7 @@ struct type *
|
|||
lookup_array_range_type (struct type *element_type,
|
||||
int low_bound, int high_bound)
|
||||
{
|
||||
struct gdbarch *gdbarch = current_gdbarch;
|
||||
struct gdbarch *gdbarch = get_type_arch (element_type);
|
||||
struct type *index_type = builtin_type (gdbarch)->builtin_int;
|
||||
struct type *range_type
|
||||
= create_range_type (NULL, index_type, low_bound, high_bound);
|
||||
|
@ -978,7 +977,8 @@ smash_to_memberptr_type (struct type *type, struct type *domain,
|
|||
TYPE_DOMAIN_TYPE (type) = domain;
|
||||
/* Assume that a data member pointer is the same size as a normal
|
||||
pointer. */
|
||||
TYPE_LENGTH (type) = gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT;
|
||||
TYPE_LENGTH (type)
|
||||
= gdbarch_ptr_bit (get_type_arch (to_type)) / TARGET_CHAR_BIT;
|
||||
TYPE_CODE (type) = TYPE_CODE_MEMBERPTR;
|
||||
}
|
||||
|
||||
|
@ -1535,7 +1535,7 @@ safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
|
|||
static void
|
||||
check_stub_method (struct type *type, int method_id, int signature_id)
|
||||
{
|
||||
struct gdbarch *gdbarch = current_gdbarch;
|
||||
struct gdbarch *gdbarch = get_type_arch (type);
|
||||
struct fn_field *f;
|
||||
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
|
||||
char *demangled_name = cplus_demangle (mangled_name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue