* 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:
Ulrich Weigand 2009-07-02 12:48:54 +00:00
parent df4df182b4
commit 270677457f
21 changed files with 252 additions and 194 deletions

View file

@ -1,3 +1,74 @@
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> 2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
* gdbtypes.h (builtin_type_int0, builtin_type_int8, builtin_type_uint8, * gdbtypes.h (builtin_type_int0, builtin_type_int8, builtin_type_uint8,

View file

@ -11177,21 +11177,18 @@ ada_language_arch_info (struct gdbarch *gdbarch,
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "character", (struct objfile *) NULL); 0, "character", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_float] = lai->primitive_type_vector [ada_primitive_type_float] =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_float_bit (gdbarch),
gdbarch_float_bit (gdbarch)/ TARGET_CHAR_BIT, "float", NULL);
0, "float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_double] = lai->primitive_type_vector [ada_primitive_type_double] =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_double_bit (gdbarch),
gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, "long_float", NULL);
0, "long_float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long_long] = lai->primitive_type_vector [ada_primitive_type_long_long] =
init_type (TYPE_CODE_INT, init_type (TYPE_CODE_INT,
gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT, gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT,
0, "long_long_integer", (struct objfile *) NULL); 0, "long_long_integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long_double] = lai->primitive_type_vector [ada_primitive_type_long_double] =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_double_bit (gdbarch),
gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, "long_long_float", NULL);
0, "long_long_float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_natural] = lai->primitive_type_vector [ada_primitive_type_natural] =
init_type (TYPE_CODE_INT, init_type (TYPE_CODE_INT,
gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,

View file

@ -102,7 +102,7 @@ alpha_register_type (struct gdbarch *gdbarch, int regno)
/* Don't need to worry about little vs big endian until /* Don't need to worry about little vs big endian until
some jerk tries to port to alpha-unicosmk. */ some jerk tries to port to alpha-unicosmk. */
if (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31) if (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31)
return builtin_type_ieee_double; return builtin_type (gdbarch)->builtin_double;
return builtin_type (gdbarch)->builtin_int64; return builtin_type (gdbarch)->builtin_int64;
} }
@ -314,7 +314,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (accumulate_size < sizeof (arg_reg_buffer) if (accumulate_size < sizeof (arg_reg_buffer)
&& TYPE_LENGTH (arg_type) == 4) && TYPE_LENGTH (arg_type) == 4)
{ {
arg_type = builtin_type_ieee_double; arg_type = builtin_type (gdbarch)->builtin_double;
arg = value_cast (arg_type, arg); arg = value_cast (arg_type, arg);
} }
/* Tru64 5.1 has a 128-bit long double, and passes this by /* Tru64 5.1 has a 128-bit long double, and passes this by

View file

@ -102,7 +102,7 @@ amd64_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM) if (regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM)
return builtin_type (gdbarch)->builtin_int32; return builtin_type (gdbarch)->builtin_int32;
if (regnum >= AMD64_ST0_REGNUM && regnum <= AMD64_ST0_REGNUM + 7) if (regnum >= AMD64_ST0_REGNUM && regnum <= AMD64_ST0_REGNUM + 7)
return builtin_type_i387_ext; return i387_ext_type (gdbarch);
if (regnum >= AMD64_FCTRL_REGNUM && regnum <= AMD64_FCTRL_REGNUM + 7) if (regnum >= AMD64_FCTRL_REGNUM && regnum <= AMD64_FCTRL_REGNUM + 7)
return builtin_type (gdbarch)->builtin_int32; return builtin_type (gdbarch)->builtin_int32;
if (regnum >= AMD64_XMM0_REGNUM && regnum <= AMD64_XMM0_REGNUM + 15) if (regnum >= AMD64_XMM0_REGNUM && regnum <= AMD64_XMM0_REGNUM + 15)

View file

@ -1593,6 +1593,20 @@ arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
print_fpu_flags (status); print_fpu_flags (status);
} }
/* Construct the ARM extended floating point type. */
static struct type *
arm_ext_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (!tdep->arm_ext_type)
tdep->arm_ext_type
= init_float_type (-1, "builtin_type_arm_ext",
floatformats_arm_ext);
return tdep->arm_ext_type;
}
/* Return the GDB type object for the "standard" data type of data in /* Return the GDB type object for the "standard" data type of data in
register N. */ register N. */
@ -1600,7 +1614,7 @@ static struct type *
arm_register_type (struct gdbarch *gdbarch, int regnum) arm_register_type (struct gdbarch *gdbarch, int regnum)
{ {
if (regnum >= ARM_F0_REGNUM && regnum < ARM_F0_REGNUM + NUM_FREGS) if (regnum >= ARM_F0_REGNUM && regnum < ARM_F0_REGNUM + NUM_FREGS)
return builtin_type_arm_ext; return arm_ext_type (gdbarch);
else if (regnum == ARM_SP_REGNUM) else if (regnum == ARM_SP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr; return builtin_type (gdbarch)->builtin_data_ptr;
else if (regnum == ARM_PC_REGNUM) else if (regnum == ARM_PC_REGNUM)

View file

@ -170,6 +170,9 @@ struct gdbarch_tdep
/* Cached core file helpers. */ /* Cached core file helpers. */
struct regset *gregset, *fpregset; struct regset *gregset, *fpregset;
/* ISA-specific data types. */
struct type *arm_ext_type;
}; };

View file

@ -391,49 +391,24 @@ build_fortran_types (struct gdbarch *gdbarch)
TYPE_FLAG_UNSIGNED, "logical*4", (struct objfile *) NULL); TYPE_FLAG_UNSIGNED, "logical*4", (struct objfile *) NULL);
builtin_f_type->builtin_real = builtin_f_type->builtin_real =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_float_bit (gdbarch),
gdbarch_float_bit (gdbarch) / TARGET_CHAR_BIT, "real", NULL);
0,
"real", (struct objfile *) NULL);
builtin_f_type->builtin_real_s8 = builtin_f_type->builtin_real_s8 =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_double_bit (gdbarch),
gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, "real*8", NULL);
0,
"real*8", (struct objfile *) NULL);
builtin_f_type->builtin_real_s16 = builtin_f_type->builtin_real_s16 =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_long_double_bit (gdbarch),
gdbarch_long_double_bit (gdbarch) / TARGET_CHAR_BIT, "real*16", NULL);
0,
"real*16", (struct objfile *) NULL);
builtin_f_type->builtin_complex_s8 = builtin_f_type->builtin_complex_s8 =
init_type (TYPE_CODE_COMPLEX, init_complex_type ("complex*8",
2 * gdbarch_float_bit (gdbarch) / TARGET_CHAR_BIT, builtin_f_type->builtin_real);
0,
"complex*8", (struct objfile *) NULL);
TYPE_TARGET_TYPE (builtin_f_type->builtin_complex_s8)
= builtin_f_type->builtin_real;
builtin_f_type->builtin_complex_s16 = builtin_f_type->builtin_complex_s16 =
init_type (TYPE_CODE_COMPLEX, init_complex_type ("complex*16",
2 * gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, builtin_f_type->builtin_real_s8);
0,
"complex*16", (struct objfile *) NULL);
TYPE_TARGET_TYPE (builtin_f_type->builtin_complex_s16)
= builtin_f_type->builtin_real_s8;
/* We have a new size == 4 double floats for the
complex*32 data type */
builtin_f_type->builtin_complex_s32 = builtin_f_type->builtin_complex_s32 =
init_type (TYPE_CODE_COMPLEX, init_complex_type ("complex*32",
2 * gdbarch_long_double_bit (gdbarch) / TARGET_CHAR_BIT, builtin_f_type->builtin_real_s16);
0,
"complex*32", (struct objfile *) NULL);
TYPE_TARGET_TYPE (builtin_f_type->builtin_complex_s32)
= builtin_f_type->builtin_real_s16;
return builtin_f_type; return builtin_f_type;
} }

View file

@ -86,13 +86,6 @@ const struct floatformat *floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN] = {
&floatformat_ibm_long_double &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; int opaque_type_resolution = 1;
static void static void
@ -3036,8 +3029,8 @@ copy_type (const struct type *type)
return new_type; return new_type;
} }
static struct type * struct type *
build_flt (int bit, char *name, const struct floatformat **floatformats) init_float_type (int bit, char *name, const struct floatformat **floatformats)
{ {
struct type *t; struct type *t;
@ -3054,6 +3047,16 @@ build_flt (int bit, char *name, const struct floatformat **floatformats)
return t; 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; static struct gdbarch_data *gdbtypes_data;
const struct builtin_type * const struct builtin_type *
@ -3062,17 +3065,6 @@ builtin_type (struct gdbarch *gdbarch)
return gdbarch_data (gdbarch, gdbtypes_data); 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 * static void *
gdbtypes_post_init (struct gdbarch *gdbarch) gdbtypes_post_init (struct gdbarch *gdbarch)
{ {
@ -3134,20 +3126,18 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
TYPE_FLAG_UNSIGNED, "unsigned long long", TYPE_FLAG_UNSIGNED, "unsigned long long",
(struct objfile *) NULL); (struct objfile *) NULL);
builtin_type->builtin_float builtin_type->builtin_float
= build_flt (gdbarch_float_bit (gdbarch), "float", = init_float_type (gdbarch_float_bit (gdbarch),
gdbarch_float_format (gdbarch)); "float", gdbarch_float_format (gdbarch));
builtin_type->builtin_double builtin_type->builtin_double
= build_flt (gdbarch_double_bit (gdbarch), "double", = init_float_type (gdbarch_double_bit (gdbarch),
gdbarch_double_format (gdbarch)); "double", gdbarch_double_format (gdbarch));
builtin_type->builtin_long_double builtin_type->builtin_long_double
= build_flt (gdbarch_long_double_bit (gdbarch), "long double", = init_float_type (gdbarch_long_double_bit (gdbarch),
gdbarch_long_double_format (gdbarch)); "long double", gdbarch_long_double_format (gdbarch));
builtin_type->builtin_complex builtin_type->builtin_complex
= build_complex (gdbarch_float_bit (gdbarch), "complex", = init_complex_type ("complex", builtin_type->builtin_float);
builtin_type->builtin_float);
builtin_type->builtin_double_complex builtin_type->builtin_double_complex
= build_complex (gdbarch_double_bit (gdbarch), "double complex", = init_complex_type ("double complex", builtin_type->builtin_double);
builtin_type->builtin_double);
builtin_type->builtin_string = builtin_type->builtin_string =
init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, 0,
@ -3402,26 +3392,6 @@ _initialize_gdbtypes (void)
gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init);
objfile_type_data = register_objfile_data (); 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, _("\ add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\
Set debugging of C++ overloading."), _("\ Set debugging of C++ overloading."), _("\
Show debugging of C++ overloading."), _("\ Show debugging of C++ overloading."), _("\

View file

@ -1084,14 +1084,6 @@ extern const struct floatformat *floatformats_vax_f[BFD_ENDIAN_UNKNOWN];
extern const struct floatformat *floatformats_vax_d[BFD_ENDIAN_UNKNOWN]; extern const struct floatformat *floatformats_vax_d[BFD_ENDIAN_UNKNOWN];
extern const struct floatformat *floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN]; extern const struct floatformat *floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN];
extern struct type *builtin_type_ieee_single;
extern struct type *builtin_type_ieee_double;
extern struct type *builtin_type_i387_ext;
extern struct type *builtin_type_m68881_ext;
extern struct type *builtin_type_arm_ext;
extern struct type *builtin_type_ia64_spill;
extern struct type *builtin_type_ia64_quad;
/* Maximum and minimum values of built-in types */ /* Maximum and minimum values of built-in types */
@ -1151,6 +1143,10 @@ extern void append_flags_type_flag (struct type *type, int bitpos, char *name);
extern void make_vector_type (struct type *array_type); extern void make_vector_type (struct type *array_type);
extern struct type *init_vector_type (struct type *elt_type, int n); extern struct type *init_vector_type (struct type *elt_type, int n);
extern struct type *init_float_type (int bit, char *name,
const struct floatformat **floatformats);
extern struct type *init_complex_type (char *name, struct type *target_type);
extern struct type *lookup_reference_type (struct type *); extern struct type *lookup_reference_type (struct type *);
extern struct type *make_reference_type (struct type *, struct type **); extern struct type *make_reference_type (struct type *, struct type **);

View file

@ -2612,7 +2612,7 @@ hppa32_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum < HPPA_FP4_REGNUM) if (regnum < HPPA_FP4_REGNUM)
return builtin_type (gdbarch)->builtin_uint32; return builtin_type (gdbarch)->builtin_uint32;
else else
return builtin_type_ieee_single; return builtin_type (gdbarch)->builtin_float;
} }
static struct type * static struct type *
@ -2621,7 +2621,7 @@ hppa64_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum < HPPA64_FP4_REGNUM) if (regnum < HPPA64_FP4_REGNUM)
return builtin_type (gdbarch)->builtin_uint64; return builtin_type (gdbarch)->builtin_uint64;
else else
return builtin_type_ieee_double; return builtin_type (gdbarch)->builtin_double;
} }
/* Return non-zero if REGNUM is not a register available to the user /* Return non-zero if REGNUM is not a register available to the user

View file

@ -1787,7 +1787,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
exactly how it would happen on the target itself, but it is exactly how it would happen on the target itself, but it is
the best we can do. */ the best we can do. */
regcache_raw_read (regcache, I386_ST0_REGNUM, buf); regcache_raw_read (regcache, I386_ST0_REGNUM, buf);
convert_typed_floating (buf, builtin_type_i387_ext, valbuf, type); convert_typed_floating (buf, i387_ext_type (gdbarch), valbuf, type);
} }
else else
{ {
@ -1841,7 +1841,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
floating-point format used by the FPU. This is probably floating-point format used by the FPU. This is probably
not exactly how it would happen on the target itself, but not exactly how it would happen on the target itself, but
it is the best we can do. */ it is the best we can do. */
convert_typed_floating (valbuf, type, buf, builtin_type_i387_ext); convert_typed_floating (valbuf, type, buf, i387_ext_type (gdbarch));
regcache_raw_write (regcache, I386_ST0_REGNUM, buf); regcache_raw_write (regcache, I386_ST0_REGNUM, buf);
/* Set the top of the floating-point register stack to 7. The /* Set the top of the floating-point register stack to 7. The
@ -2044,6 +2044,19 @@ i386_init_types (void)
i386_mxcsr_type = type; i386_mxcsr_type = type;
} }
struct type *
i387_ext_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (!tdep->i387_ext_type)
tdep->i387_ext_type
= init_float_type (-1, "builtin_type_i387_ext",
floatformats_i387_ext);
return tdep->i387_ext_type;
}
/* Construct vector type for MMX registers. */ /* Construct vector type for MMX registers. */
struct type * struct type *
i386_mmx_type (struct gdbarch *gdbarch) i386_mmx_type (struct gdbarch *gdbarch)
@ -2150,7 +2163,7 @@ i386_register_type (struct gdbarch *gdbarch, int regnum)
return builtin_type (gdbarch)->builtin_data_ptr; return builtin_type (gdbarch)->builtin_data_ptr;
if (i386_fp_regnum_p (gdbarch, regnum)) if (i386_fp_regnum_p (gdbarch, regnum))
return builtin_type_i387_ext; return i387_ext_type (gdbarch);
if (i386_mmx_regnum_p (gdbarch, regnum)) if (i386_mmx_regnum_p (gdbarch, regnum))
return i386_mmx_type (gdbarch); return i386_mmx_type (gdbarch);

View file

@ -106,6 +106,7 @@ struct gdbarch_tdep
/* ISA-specific data types. */ /* ISA-specific data types. */
struct type *i386_mmx_type; struct type *i386_mmx_type;
struct type *i386_sse_type; struct type *i386_sse_type;
struct type *i387_ext_type;
/* Process record/replay target. */ /* Process record/replay target. */
/* Parse intx80 args. */ /* Parse intx80 args. */
@ -164,6 +165,7 @@ extern struct type *i386_mxcsr_type;
extern struct type *i386_mmx_type (struct gdbarch *gdbarch); extern struct type *i386_mmx_type (struct gdbarch *gdbarch);
extern struct type *i386_sse_type (struct gdbarch *gdbarch); extern struct type *i386_sse_type (struct gdbarch *gdbarch);
extern struct type *i387_ext_type (struct gdbarch *gdbarch);
/* Segment selectors. */ /* Segment selectors. */
#define I386_SEL_RPL 0x0003 /* Requester's Privilege Level mask. */ #define I386_SEL_RPL 0x0003 /* Requester's Privilege Level mask. */

View file

@ -37,7 +37,8 @@
/* Print the floating point number specified by RAW. */ /* Print the floating point number specified by RAW. */
static void static void
print_i387_value (const gdb_byte *raw, struct ui_file *file) print_i387_value (struct gdbarch *gdbarch,
const gdb_byte *raw, struct ui_file *file)
{ {
DOUBLEST value; DOUBLEST value;
@ -45,7 +46,7 @@ print_i387_value (const gdb_byte *raw, struct ui_file *file)
of certain numbers such as NaNs, even if GDB is running natively. of certain numbers such as NaNs, even if GDB is running natively.
This is fine since our caller already detects such special This is fine since our caller already detects such special
numbers and we print the hexadecimal representation anyway. */ numbers and we print the hexadecimal representation anyway. */
value = extract_typed_floating (raw, builtin_type_i387_ext); value = extract_typed_floating (raw, i387_ext_type (gdbarch));
/* We try to print 19 digits. The last digit may or may not contain /* We try to print 19 digits. The last digit may or may not contain
garbage, but we'd better print one too many. We need enough room garbage, but we'd better print one too many. We need enough room
@ -61,7 +62,8 @@ print_i387_value (const gdb_byte *raw, struct ui_file *file)
/* Print the classification for the register contents RAW. */ /* Print the classification for the register contents RAW. */
static void static void
print_i387_ext (const gdb_byte *raw, struct ui_file *file) print_i387_ext (struct gdbarch *gdbarch,
const gdb_byte *raw, struct ui_file *file)
{ {
int sign; int sign;
int integer; int integer;
@ -92,11 +94,11 @@ print_i387_ext (const gdb_byte *raw, struct ui_file *file)
} }
else if (exponent < 0x7fff && exponent > 0x0000 && integer) else if (exponent < 0x7fff && exponent > 0x0000 && integer)
/* Normal. */ /* Normal. */
print_i387_value (raw, file); print_i387_value (gdbarch, raw, file);
else if (exponent == 0x0000) else if (exponent == 0x0000)
{ {
/* Denormal or zero. */ /* Denormal or zero. */
print_i387_value (raw, file); print_i387_value (gdbarch, raw, file);
if (integer) if (integer)
/* Pseudo-denormal. */ /* Pseudo-denormal. */
@ -258,7 +260,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
fprintf_filtered (file, "%02x", raw[i]); fprintf_filtered (file, "%02x", raw[i]);
if (tag != 3) if (tag != 3)
print_i387_ext (raw, file); print_i387_ext (gdbarch, raw, file);
fputs_filtered ("\n", file); fputs_filtered ("\n", file);
} }
@ -290,7 +292,7 @@ i387_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
{ {
/* Floating point registers must be converted unless we are /* Floating point registers must be converted unless we are
accessing them in their hardware type. */ accessing them in their hardware type. */
if (type == builtin_type_i387_ext) if (type == i387_ext_type (gdbarch))
return 0; return 0;
else else
return 1; return 1;
@ -306,9 +308,10 @@ void
i387_register_to_value (struct frame_info *frame, int regnum, i387_register_to_value (struct frame_info *frame, int regnum,
struct type *type, gdb_byte *to) struct type *type, gdb_byte *to)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte from[I386_MAX_REGISTER_SIZE]; gdb_byte from[I386_MAX_REGISTER_SIZE];
gdb_assert (i386_fp_regnum_p (get_frame_arch (frame), regnum)); gdb_assert (i386_fp_regnum_p (gdbarch, regnum));
/* We only support floating-point values. */ /* We only support floating-point values. */
if (TYPE_CODE (type) != TYPE_CODE_FLT) if (TYPE_CODE (type) != TYPE_CODE_FLT)
@ -320,7 +323,7 @@ i387_register_to_value (struct frame_info *frame, int regnum,
/* Convert to TYPE. */ /* Convert to TYPE. */
get_frame_register (frame, regnum, from); get_frame_register (frame, regnum, from);
convert_typed_floating (from, builtin_type_i387_ext, to, type); convert_typed_floating (from, i387_ext_type (gdbarch), to, type);
} }
/* Write the contents FROM of a value of type TYPE into register /* Write the contents FROM of a value of type TYPE into register
@ -330,9 +333,10 @@ void
i387_value_to_register (struct frame_info *frame, int regnum, i387_value_to_register (struct frame_info *frame, int regnum,
struct type *type, const gdb_byte *from) struct type *type, const gdb_byte *from)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte to[I386_MAX_REGISTER_SIZE]; gdb_byte to[I386_MAX_REGISTER_SIZE];
gdb_assert (i386_fp_regnum_p (get_frame_arch (frame), regnum)); gdb_assert (i386_fp_regnum_p (gdbarch, regnum));
/* We only support floating-point values. */ /* We only support floating-point values. */
if (TYPE_CODE (type) != TYPE_CODE_FLT) if (TYPE_CODE (type) != TYPE_CODE_FLT)
@ -343,7 +347,7 @@ i387_value_to_register (struct frame_info *frame, int regnum,
} }
/* Convert from TYPE. */ /* Convert from TYPE. */
convert_typed_floating (from, type, to, builtin_type_i387_ext); convert_typed_floating (from, type, to, i387_ext_type (gdbarch));
put_frame_register (frame, regnum, to); put_frame_register (frame, regnum, to);
} }

View file

@ -125,8 +125,6 @@ static gdbarch_skip_prologue_ftype ia64_skip_prologue;
static struct type *is_float_or_hfa_type (struct type *t); static struct type *is_float_or_hfa_type (struct type *t);
static CORE_ADDR ia64_find_global_pointer (CORE_ADDR faddr); static CORE_ADDR ia64_find_global_pointer (CORE_ADDR faddr);
static struct type *builtin_type_ia64_ext;
#define NUM_IA64_RAW_REGS 462 #define NUM_IA64_RAW_REGS 462
static int sp_regnum = IA64_GR12_REGNUM; static int sp_regnum = IA64_GR12_REGNUM;
@ -280,6 +278,37 @@ struct ia64_frame_cache
}; };
static int
floatformat_valid (const struct floatformat *fmt, const void *from)
{
return 1;
}
static const struct floatformat floatformat_ia64_ext =
{
floatformat_little, 82, 0, 1, 17, 65535, 0x1ffff, 18, 64,
floatformat_intbit_yes, "floatformat_ia64_ext", floatformat_valid, NULL
};
static const struct floatformat *floatformats_ia64_ext[2] =
{
&floatformat_ia64_ext,
&floatformat_ia64_ext
};
static struct type *
ia64_ext_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (!tdep->ia64_ext_type)
tdep->ia64_ext_type
= init_float_type (128, "builtin_type_ia64_ext",
floatformats_ia64_ext);
return tdep->ia64_ext_type;
}
static int static int
ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum, ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group) struct reggroup *group)
@ -313,7 +342,7 @@ struct type *
ia64_register_type (struct gdbarch *arch, int reg) ia64_register_type (struct gdbarch *arch, int reg)
{ {
if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM) if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM)
return builtin_type_ia64_ext; return ia64_ext_type (arch);
else else
return builtin_type (arch)->builtin_long; return builtin_type (arch)->builtin_long;
} }
@ -326,24 +355,6 @@ ia64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
return reg; return reg;
} }
static int
floatformat_valid (const struct floatformat *fmt, const void *from)
{
return 1;
}
const struct floatformat floatformat_ia64_ext =
{
floatformat_little, 82, 0, 1, 17, 65535, 0x1ffff, 18, 64,
floatformat_intbit_yes, "floatformat_ia64_ext", floatformat_valid, NULL
};
const struct floatformat *floatformats_ia64_ext[2] =
{
&floatformat_ia64_ext,
&floatformat_ia64_ext
};
/* Extract ``len'' bits from an instruction bundle starting at /* Extract ``len'' bits from an instruction bundle starting at
bit ``from''. */ bit ``from''. */
@ -1048,24 +1059,26 @@ static int
ia64_convert_register_p (struct gdbarch *gdbarch, int regno, struct type *type) ia64_convert_register_p (struct gdbarch *gdbarch, int regno, struct type *type)
{ {
return (regno >= IA64_FR0_REGNUM && regno <= IA64_FR127_REGNUM return (regno >= IA64_FR0_REGNUM && regno <= IA64_FR127_REGNUM
&& type != builtin_type_ia64_ext); && type != ia64_ext_type (gdbarch));
} }
static void static void
ia64_register_to_value (struct frame_info *frame, int regnum, ia64_register_to_value (struct frame_info *frame, int regnum,
struct type *valtype, gdb_byte *out) struct type *valtype, gdb_byte *out)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame);
char in[MAX_REGISTER_SIZE]; char in[MAX_REGISTER_SIZE];
frame_register_read (frame, regnum, in); frame_register_read (frame, regnum, in);
convert_typed_floating (in, builtin_type_ia64_ext, out, valtype); convert_typed_floating (in, ia64_ext_type (gdbarch), out, valtype);
} }
static void static void
ia64_value_to_register (struct frame_info *frame, int regnum, ia64_value_to_register (struct frame_info *frame, int regnum,
struct type *valtype, const gdb_byte *in) struct type *valtype, const gdb_byte *in)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame);
char out[MAX_REGISTER_SIZE]; char out[MAX_REGISTER_SIZE];
convert_typed_floating (in, valtype, out, builtin_type_ia64_ext); convert_typed_floating (in, valtype, out, ia64_ext_type (gdbarch));
put_frame_register (frame, regnum, out); put_frame_register (frame, regnum, out);
} }
@ -2985,6 +2998,7 @@ static void
ia64_extract_return_value (struct type *type, struct regcache *regcache, ia64_extract_return_value (struct type *type, struct regcache *regcache,
gdb_byte *valbuf) gdb_byte *valbuf)
{ {
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct type *float_elt_type; struct type *float_elt_type;
float_elt_type = is_float_or_hfa_type (type); float_elt_type = is_float_or_hfa_type (type);
@ -2998,7 +3012,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache,
while (n-- > 0) while (n-- > 0)
{ {
regcache_cooked_read (regcache, regnum, from); regcache_cooked_read (regcache, regnum, from);
convert_typed_floating (from, builtin_type_ia64_ext, convert_typed_floating (from, ia64_ext_type (gdbarch),
(char *)valbuf + offset, float_elt_type); (char *)valbuf + offset, float_elt_type);
offset += TYPE_LENGTH (float_elt_type); offset += TYPE_LENGTH (float_elt_type);
regnum++; regnum++;
@ -3009,8 +3023,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache,
ULONGEST val; ULONGEST val;
int offset = 0; int offset = 0;
int regnum = IA64_GR8_REGNUM; int regnum = IA64_GR8_REGNUM;
int reglen = TYPE_LENGTH (register_type (get_regcache_arch (regcache), int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM));
IA64_GR8_REGNUM));
int n = TYPE_LENGTH (type) / reglen; int n = TYPE_LENGTH (type) / reglen;
int m = TYPE_LENGTH (type) % reglen; int m = TYPE_LENGTH (type) % reglen;
@ -3035,6 +3048,7 @@ static void
ia64_store_return_value (struct type *type, struct regcache *regcache, ia64_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf) const gdb_byte *valbuf)
{ {
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct type *float_elt_type; struct type *float_elt_type;
float_elt_type = is_float_or_hfa_type (type); float_elt_type = is_float_or_hfa_type (type);
@ -3048,7 +3062,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache,
while (n-- > 0) while (n-- > 0)
{ {
convert_typed_floating ((char *)valbuf + offset, float_elt_type, convert_typed_floating ((char *)valbuf + offset, float_elt_type,
to, builtin_type_ia64_ext); to, ia64_ext_type (gdbarch));
regcache_cooked_write (regcache, regnum, to); regcache_cooked_write (regcache, regnum, to);
offset += TYPE_LENGTH (float_elt_type); offset += TYPE_LENGTH (float_elt_type);
regnum++; regnum++;
@ -3059,8 +3073,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache,
ULONGEST val; ULONGEST val;
int offset = 0; int offset = 0;
int regnum = IA64_GR8_REGNUM; int regnum = IA64_GR8_REGNUM;
int reglen = TYPE_LENGTH (register_type (get_regcache_arch (regcache), int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM));
IA64_GR8_REGNUM));
int n = TYPE_LENGTH (type) / reglen; int n = TYPE_LENGTH (type) / reglen;
int m = TYPE_LENGTH (type) % reglen; int m = TYPE_LENGTH (type) % reglen;
@ -3520,7 +3533,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{ {
char to[MAX_REGISTER_SIZE]; char to[MAX_REGISTER_SIZE];
convert_typed_floating (value_contents (arg) + argoffset, float_elt_type, convert_typed_floating (value_contents (arg) + argoffset, float_elt_type,
to, builtin_type_ia64_ext); to, ia64_ext_type (gdbarch));
regcache_cooked_write (regcache, floatreg, (void *)to); regcache_cooked_write (regcache, floatreg, (void *)to);
floatreg++; floatreg++;
argoffset += TYPE_LENGTH (float_elt_type); argoffset += TYPE_LENGTH (float_elt_type);
@ -3691,11 +3704,5 @@ extern initialize_file_ftype _initialize_ia64_tdep; /* -Wmissing-prototypes */
void void
_initialize_ia64_tdep (void) _initialize_ia64_tdep (void)
{ {
/* Define the ia64 floating-point format to gdb. */
builtin_type_ia64_ext =
init_type (TYPE_CODE_FLT, 128 / 8,
0, "builtin_type_ia64_ext", NULL);
TYPE_FLOATFORMAT (builtin_type_ia64_ext) = floatformats_ia64_ext;
gdbarch_register (bfd_arch_ia64, ia64_gdbarch_init, NULL); gdbarch_register (bfd_arch_ia64, ia64_gdbarch_init, NULL);
} }

View file

@ -198,6 +198,9 @@ struct gdbarch_tdep
{ {
CORE_ADDR (*sigcontext_register_address) (CORE_ADDR, int); CORE_ADDR (*sigcontext_register_address) (CORE_ADDR, int);
int (*pc_in_sigtramp) (CORE_ADDR); int (*pc_in_sigtramp) (CORE_ADDR);
/* ISA-specific data types. */
struct type *ia64_ext_type;
}; };
extern void ia64_write_pc (struct regcache *, CORE_ADDR); extern void ia64_write_pc (struct regcache *, CORE_ADDR);

View file

@ -1182,9 +1182,9 @@ build_java_types (struct gdbarch *gdbarch)
builtin_java_type->builtin_char builtin_java_type->builtin_char
= init_type (TYPE_CODE_CHAR, 2, TYPE_FLAG_UNSIGNED, "char", NULL); = init_type (TYPE_CODE_CHAR, 2, TYPE_FLAG_UNSIGNED, "char", NULL);
builtin_java_type->builtin_float builtin_java_type->builtin_float
= init_type (TYPE_CODE_FLT, 4, 0, "float", NULL); = init_float_type (32, "float", NULL);
builtin_java_type->builtin_double builtin_java_type->builtin_double
= init_type (TYPE_CODE_FLT, 8, 0, "double", NULL); = init_float_type (64, "double", NULL);
builtin_java_type->builtin_void builtin_java_type->builtin_void
= init_type (TYPE_CODE_VOID, 1, 0, "void", NULL); = init_type (TYPE_CODE_VOID, 1, 0, "void", NULL);

View file

@ -416,10 +416,7 @@ build_m2_types (struct gdbarch *gdbarch)
TYPE_FLAG_UNSIGNED, TYPE_FLAG_UNSIGNED,
"CARDINAL", (struct objfile *) NULL); "CARDINAL", (struct objfile *) NULL);
builtin_m2_type->builtin_real = builtin_m2_type->builtin_real =
init_type (TYPE_CODE_FLT, init_float_type (gdbarch_float_bit (gdbarch), "REAL", NULL);
gdbarch_float_bit (gdbarch) / TARGET_CHAR_BIT,
0,
"REAL", (struct objfile *) NULL);
builtin_m2_type->builtin_char = builtin_m2_type->builtin_char =
init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT, init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, TYPE_FLAG_UNSIGNED,

View file

@ -96,6 +96,19 @@ m68k_init_types (void)
m68k_ps_type = type; m68k_ps_type = type;
} }
static struct type *
m68881_ext_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (!tdep->m68881_ext_type)
tdep->m68881_ext_type
= init_float_type (-1, "builtin_type_m68881_ext",
floatformats_m68881_ext);
return tdep->m68881_ext_type;
}
/* Return the GDB type object for the "standard" data type of data in /* Return the GDB type object for the "standard" data type of data in
register N. This should be int for D0-D7, SR, FPCONTROL and register N. This should be int for D0-D7, SR, FPCONTROL and
FPSTATUS, long double for FP0-FP7, and void pointer for all others FPSTATUS, long double for FP0-FP7, and void pointer for all others
@ -117,7 +130,7 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum)
if (tdep->flavour == m68k_coldfire_flavour) if (tdep->flavour == m68k_coldfire_flavour)
return builtin_type (gdbarch)->builtin_double; return builtin_type (gdbarch)->builtin_double;
else else
return builtin_type_m68881_ext; return m68881_ext_type (gdbarch);
} }
if (regnum == M68K_FPI_REGNUM) if (regnum == M68K_FPI_REGNUM)
@ -174,7 +187,7 @@ m68k_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
if (!gdbarch_tdep (gdbarch)->fpregs_present) if (!gdbarch_tdep (gdbarch)->fpregs_present)
return 0; return 0;
return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7 return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7
&& type != builtin_type_m68881_ext); && type != m68881_ext_type (gdbarch));
} }
/* Read a value of type TYPE from register REGNUM in frame FRAME, and /* Read a value of type TYPE from register REGNUM in frame FRAME, and

View file

@ -92,6 +92,9 @@ struct gdbarch_tdep
/* Flag set if the floating point registers are present, or assumed /* Flag set if the floating point registers are present, or assumed
to be present. */ to be present. */
int fpregs_present; int fpregs_present;
/* ISA-specific data types. */
struct type *m68881_ext_type;
}; };
/* Initialize a SVR4 architecture variant. */ /* Initialize a SVR4 architecture variant. */

View file

@ -364,9 +364,6 @@ static CORE_ADDR heuristic_proc_start (struct gdbarch *, CORE_ADDR);
static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *);
static struct type *mips_float_register_type (void);
static struct type *mips_double_register_type (void);
/* The list of available "set mips " and "show mips " commands */ /* The list of available "set mips " and "show mips " commands */
static struct cmd_list_element *setmipscmdlist = NULL; static struct cmd_list_element *setmipscmdlist = NULL;
@ -670,9 +667,9 @@ mips_register_type (struct gdbarch *gdbarch, int regnum)
/* The floating-point registers raw, or cooked, always match /* The floating-point registers raw, or cooked, always match
mips_isa_regsize(), and also map 1:1, byte for byte. */ mips_isa_regsize(), and also map 1:1, byte for byte. */
if (mips_isa_regsize (gdbarch) == 4) if (mips_isa_regsize (gdbarch) == 4)
return builtin_type_ieee_single; return builtin_type (gdbarch)->builtin_float;
else else
return builtin_type_ieee_double; return builtin_type (gdbarch)->builtin_double;
} }
else if (regnum < gdbarch_num_regs (gdbarch)) else if (regnum < gdbarch_num_regs (gdbarch))
{ {
@ -4282,18 +4279,6 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct type *func_type,
regs could be 32 bits wide in one frame and 64 on the frame above regs could be 32 bits wide in one frame and 64 on the frame above
and below). */ and below). */
static struct type *
mips_float_register_type (void)
{
return builtin_type_ieee_single;
}
static struct type *
mips_double_register_type (void)
{
return builtin_type_ieee_double;
}
/* Copy a 32-bit single-precision value from the current frame /* Copy a 32-bit single-precision value from the current frame
into rare_buffer. */ into rare_buffer. */
@ -4393,7 +4378,7 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
/* 4-byte registers: Print hex and floating. Also print even /* 4-byte registers: Print hex and floating. Also print even
numbered registers as doubles. */ numbered registers as doubles. */
mips_read_fp_register_single (frame, regnum, raw_buffer); mips_read_fp_register_single (frame, regnum, raw_buffer);
flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1); flt1 = unpack_double (builtin_type (gdbarch)->builtin_float, raw_buffer, &inv1);
get_formatted_print_options (&opts, 'x'); get_formatted_print_options (&opts, 'x');
print_scalar_formatted (raw_buffer, print_scalar_formatted (raw_buffer,
@ -4409,8 +4394,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
if ((regnum - gdbarch_num_regs (gdbarch)) % 2 == 0) if ((regnum - gdbarch_num_regs (gdbarch)) % 2 == 0)
{ {
mips_read_fp_register_double (frame, regnum, raw_buffer); mips_read_fp_register_double (frame, regnum, raw_buffer);
doub = unpack_double (mips_double_register_type (), raw_buffer, doub = unpack_double (builtin_type (gdbarch)->builtin_double,
&inv2); raw_buffer, &inv2);
fprintf_filtered (file, " dbl: "); fprintf_filtered (file, " dbl: ");
if (inv2) if (inv2)
@ -4425,10 +4410,12 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
/* Eight byte registers: print each one as hex, float and double. */ /* Eight byte registers: print each one as hex, float and double. */
mips_read_fp_register_single (frame, regnum, raw_buffer); mips_read_fp_register_single (frame, regnum, raw_buffer);
flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1); flt1 = unpack_double (builtin_type (gdbarch)->builtin_float,
raw_buffer, &inv1);
mips_read_fp_register_double (frame, regnum, raw_buffer); mips_read_fp_register_double (frame, regnum, raw_buffer);
doub = unpack_double (mips_double_register_type (), raw_buffer, &inv2); doub = unpack_double (builtin_type (gdbarch)->builtin_double,
raw_buffer, &inv2);
get_formatted_print_options (&opts, 'x'); get_formatted_print_options (&opts, 'x');
print_scalar_formatted (raw_buffer, print_scalar_formatted (raw_buffer,

View file

@ -488,13 +488,16 @@ tdesc_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *tdesc_type)
return builtin_type (gdbarch)->builtin_data_ptr; return builtin_type (gdbarch)->builtin_data_ptr;
case TDESC_TYPE_IEEE_SINGLE: case TDESC_TYPE_IEEE_SINGLE:
return builtin_type_ieee_single; return init_float_type (-1, "builtin_type_ieee_single",
floatformats_ieee_single);
case TDESC_TYPE_IEEE_DOUBLE: case TDESC_TYPE_IEEE_DOUBLE:
return builtin_type_ieee_double; return init_float_type (-1, "builtin_type_ieee_double",
floatformats_ieee_double);
case TDESC_TYPE_ARM_FPA_EXT: case TDESC_TYPE_ARM_FPA_EXT:
return builtin_type_arm_ext; return init_float_type (-1, "builtin_type_arm_ext",
floatformats_arm_ext);
/* Types defined by a target feature. */ /* Types defined by a target feature. */
case TDESC_TYPE_VECTOR: case TDESC_TYPE_VECTOR: