mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 11:01:35 +08:00
* 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.
This commit is contained in:
@ -86,13 +86,6 @@ const struct floatformat *floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN] = {
|
||||
&floatformat_ibm_long_double
|
||||
};
|
||||
|
||||
struct type *builtin_type_ieee_single;
|
||||
struct type *builtin_type_ieee_double;
|
||||
struct type *builtin_type_i387_ext;
|
||||
struct type *builtin_type_m68881_ext;
|
||||
struct type *builtin_type_arm_ext;
|
||||
struct type *builtin_type_ia64_spill;
|
||||
struct type *builtin_type_ia64_quad;
|
||||
|
||||
int opaque_type_resolution = 1;
|
||||
static void
|
||||
@ -3036,8 +3029,8 @@ copy_type (const struct type *type)
|
||||
return new_type;
|
||||
}
|
||||
|
||||
static struct type *
|
||||
build_flt (int bit, char *name, const struct floatformat **floatformats)
|
||||
struct type *
|
||||
init_float_type (int bit, char *name, const struct floatformat **floatformats)
|
||||
{
|
||||
struct type *t;
|
||||
|
||||
@ -3054,6 +3047,16 @@ build_flt (int bit, char *name, const struct floatformat **floatformats)
|
||||
return t;
|
||||
}
|
||||
|
||||
struct type *
|
||||
init_complex_type (char *name, struct type *target_type)
|
||||
{
|
||||
struct type *t;
|
||||
t = init_type (TYPE_CODE_COMPLEX, 2 * TYPE_LENGTH (target_type),
|
||||
0, name, (struct objfile *) NULL);
|
||||
TYPE_TARGET_TYPE (t) = target_type;
|
||||
return t;
|
||||
}
|
||||
|
||||
static struct gdbarch_data *gdbtypes_data;
|
||||
|
||||
const struct builtin_type *
|
||||
@ -3062,17 +3065,6 @@ builtin_type (struct gdbarch *gdbarch)
|
||||
return gdbarch_data (gdbarch, gdbtypes_data);
|
||||
}
|
||||
|
||||
|
||||
static struct type *
|
||||
build_complex (int bit, char *name, struct type *target_type)
|
||||
{
|
||||
struct type *t;
|
||||
t = init_type (TYPE_CODE_COMPLEX, 2 * bit / TARGET_CHAR_BIT,
|
||||
0, name, (struct objfile *) NULL);
|
||||
TYPE_TARGET_TYPE (t) = target_type;
|
||||
return t;
|
||||
}
|
||||
|
||||
static void *
|
||||
gdbtypes_post_init (struct gdbarch *gdbarch)
|
||||
{
|
||||
@ -3134,20 +3126,18 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
|
||||
TYPE_FLAG_UNSIGNED, "unsigned long long",
|
||||
(struct objfile *) NULL);
|
||||
builtin_type->builtin_float
|
||||
= build_flt (gdbarch_float_bit (gdbarch), "float",
|
||||
gdbarch_float_format (gdbarch));
|
||||
= init_float_type (gdbarch_float_bit (gdbarch),
|
||||
"float", gdbarch_float_format (gdbarch));
|
||||
builtin_type->builtin_double
|
||||
= build_flt (gdbarch_double_bit (gdbarch), "double",
|
||||
gdbarch_double_format (gdbarch));
|
||||
= init_float_type (gdbarch_double_bit (gdbarch),
|
||||
"double", gdbarch_double_format (gdbarch));
|
||||
builtin_type->builtin_long_double
|
||||
= build_flt (gdbarch_long_double_bit (gdbarch), "long double",
|
||||
gdbarch_long_double_format (gdbarch));
|
||||
= init_float_type (gdbarch_long_double_bit (gdbarch),
|
||||
"long double", gdbarch_long_double_format (gdbarch));
|
||||
builtin_type->builtin_complex
|
||||
= build_complex (gdbarch_float_bit (gdbarch), "complex",
|
||||
builtin_type->builtin_float);
|
||||
= init_complex_type ("complex", builtin_type->builtin_float);
|
||||
builtin_type->builtin_double_complex
|
||||
= build_complex (gdbarch_double_bit (gdbarch), "double complex",
|
||||
builtin_type->builtin_double);
|
||||
= init_complex_type ("double complex", builtin_type->builtin_double);
|
||||
builtin_type->builtin_string =
|
||||
init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
|
||||
0,
|
||||
@ -3402,26 +3392,6 @@ _initialize_gdbtypes (void)
|
||||
gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init);
|
||||
objfile_type_data = register_objfile_data ();
|
||||
|
||||
/* FIXME: The following types are architecture-neutral. However,
|
||||
they contain pointer_type and reference_type fields potentially
|
||||
caching pointer or reference types that *are* architecture
|
||||
dependent. */
|
||||
|
||||
builtin_type_ieee_single =
|
||||
build_flt (-1, "builtin_type_ieee_single", floatformats_ieee_single);
|
||||
builtin_type_ieee_double =
|
||||
build_flt (-1, "builtin_type_ieee_double", floatformats_ieee_double);
|
||||
builtin_type_i387_ext =
|
||||
build_flt (-1, "builtin_type_i387_ext", floatformats_i387_ext);
|
||||
builtin_type_m68881_ext =
|
||||
build_flt (-1, "builtin_type_m68881_ext", floatformats_m68881_ext);
|
||||
builtin_type_arm_ext =
|
||||
build_flt (-1, "builtin_type_arm_ext", floatformats_arm_ext);
|
||||
builtin_type_ia64_spill =
|
||||
build_flt (-1, "builtin_type_ia64_spill", floatformats_ia64_spill);
|
||||
builtin_type_ia64_quad =
|
||||
build_flt (-1, "builtin_type_ia64_quad", floatformats_ia64_quad);
|
||||
|
||||
add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\
|
||||
Set debugging of C++ overloading."), _("\
|
||||
Show debugging of C++ overloading."), _("\
|
||||
|
Reference in New Issue
Block a user