* alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch)

instead of builtin_type_ macros.
	* amd64-tdep.c (amd64_register_type): Likewise.
	(amd64_get_longjmp_target): 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 (hppa32_convert_from_func_ptr_addr,
	hppa_skip_trampoline_code): Likewise.
	* i386-tdep.c (i386_register_type): Likewise.
	(i386_unwind_pc, i386_sse_type): Likewise.
	* ia64-tdep.c (ia64_register_type): Likewise.
	* m32r-tdep.c (m32r_register_type): Likewise.
	* m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
	* m88k-tdep.c (m88k_register_type): Likewise.
	* mep-tdep.c (mep_register_type): Likewise.
	* mips-tdep.c (mips_pseudo_register_type): Likewise.
	* mn10300-tdep.c (mn10300_register_type): Likewise.
	* mt-tdep.c (mt_copro_register_type): Likewise.
	* rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise.
	(rs6000_convert_register_p, rs6000_register_to_value,
	rs6000_value_to_register): Likewise.
	* s390-tdep.c (s390_register_type): Likewise.
	* sh64-tdep.c (sh64_register_type): Likewise.
	(sh64_build_float_register_type, sh64_do_fp_register): Likewise.
	* sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type,
	sh_sh4_build_float_register_type, sh_sh4_register_type,
	sh_default_register_type): Likewise.
	* sparc64-tdep.c (sparc64_register_type): Likewise.
	* sparc-tdep.c (sparc32_register_type): Likewise.
	* spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise.
	* v850-tdep.c (v850_register_type): Likewise.
	* vax-tdep.c (vax_register_type): Likewise.
	* xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc,
	xtensa_push_dummy_call): Likewise.

	* std-regs.c (value_of_builtin_frame_fp_reg,
	value_of_builtin_frame_pc_reg): Likewise.
	* target-descriptions.c (tdesc_register_type): Likewise.
This commit is contained in:
Ulrich Weigand 2008-09-11 14:23:15 +00:00
parent 6d84d3d833
commit 0dfff4cba7
30 changed files with 184 additions and 119 deletions

View File

@ -1,3 +1,47 @@
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
* alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch)
instead of builtin_type_ macros.
* amd64-tdep.c (amd64_register_type): Likewise.
(amd64_get_longjmp_target): 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 (hppa32_convert_from_func_ptr_addr,
hppa_skip_trampoline_code): Likewise.
* i386-tdep.c (i386_register_type): Likewise.
(i386_unwind_pc, i386_sse_type): Likewise.
* ia64-tdep.c (ia64_register_type): Likewise.
* m32r-tdep.c (m32r_register_type): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
* m88k-tdep.c (m88k_register_type): Likewise.
* mep-tdep.c (mep_register_type): Likewise.
* mips-tdep.c (mips_pseudo_register_type): Likewise.
* mn10300-tdep.c (mn10300_register_type): Likewise.
* mt-tdep.c (mt_copro_register_type): Likewise.
* rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise.
(rs6000_convert_register_p, rs6000_register_to_value,
rs6000_value_to_register): Likewise.
* s390-tdep.c (s390_register_type): Likewise.
* sh64-tdep.c (sh64_register_type): Likewise.
(sh64_build_float_register_type, sh64_do_fp_register): Likewise.
* sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type,
sh_sh4_build_float_register_type, sh_sh4_register_type,
sh_default_register_type): Likewise.
* sparc64-tdep.c (sparc64_register_type): Likewise.
* sparc-tdep.c (sparc32_register_type): Likewise.
* spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise.
* v850-tdep.c (v850_register_type): Likewise.
* vax-tdep.c (vax_register_type): Likewise.
* xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc,
xtensa_push_dummy_call): Likewise.
* std-regs.c (value_of_builtin_frame_fp_reg,
value_of_builtin_frame_pc_reg): Likewise.
* target-descriptions.c (tdesc_register_type): Likewise.
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
* ada-lang.c (ada_coerce_to_simple_array_type): Use builtin_type_int32

View File

@ -95,9 +95,9 @@ static struct type *
alpha_register_type (struct gdbarch *gdbarch, int regno)
{
if (regno == ALPHA_SP_REGNUM || regno == ALPHA_GP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
if (regno == ALPHA_PC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
/* Don't need to worry about little vs big endian until
some jerk tries to port to alpha-unicosmk. */

View File

@ -90,11 +90,11 @@ amd64_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum >= AMD64_RAX_REGNUM && regnum <= AMD64_RDI_REGNUM)
return builtin_type_int64;
if (regnum == AMD64_RBP_REGNUM || regnum == AMD64_RSP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
if (regnum >= AMD64_R8_REGNUM && regnum <= AMD64_R15_REGNUM)
return builtin_type_int64;
if (regnum == AMD64_RIP_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == AMD64_EFLAGS_REGNUM)
return i386_eflags_type;
if (regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM)
@ -1277,7 +1277,7 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
CORE_ADDR jb_addr;
struct gdbarch *gdbarch = get_frame_arch (frame);
int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset;
int len = TYPE_LENGTH (builtin_type_void_func_ptr);
int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr);
/* If JB_PC_OFFSET is -1, we have no way to find out where the
longjmp will land. */
@ -1285,11 +1285,12 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
return 0;
get_frame_register (frame, AMD64_RDI_REGNUM, buf);
jb_addr = extract_typed_address (buf, builtin_type_void_data_ptr);
jb_addr= extract_typed_address
(buf, builtin_type (gdbarch)->builtin_data_ptr);
if (target_read_memory (jb_addr + jb_pc_offset, buf, len))
return 0;
*pc = extract_typed_address (buf, builtin_type_void_func_ptr);
*pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
return 1;
}

View File

@ -1605,9 +1605,9 @@ arm_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum >= ARM_F0_REGNUM && regnum < ARM_F0_REGNUM + NUM_FREGS)
return builtin_type_arm_ext;
else if (regnum == ARM_SP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else if (regnum == ARM_PC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
else if (regnum >= ARRAY_SIZE (arm_register_names))
/* These registers are only supported on targets which supply
an XML description. */

View File

@ -213,7 +213,7 @@ avr_register_type (struct gdbarch *gdbarch, int reg_nr)
if (reg_nr == AVR_PC_REGNUM)
return builtin_type_uint32;
if (reg_nr == AVR_SP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else
return builtin_type_uint8;
}

View File

@ -1650,10 +1650,10 @@ static struct type *
cris_register_type (struct gdbarch *gdbarch, int regno)
{
if (regno == gdbarch_pc_regnum (gdbarch))
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
else if (regno == gdbarch_sp_regnum (gdbarch)
|| regno == CRIS_FP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else if ((regno >= 0 && regno < gdbarch_sp_regnum (gdbarch))
|| (regno >= MOF_REGNUM && regno <= USP_REGNUM))
/* Note: R8 taken care of previous clause. */
@ -1671,10 +1671,10 @@ static struct type *
crisv32_register_type (struct gdbarch *gdbarch, int regno)
{
if (regno == gdbarch_pc_regnum (gdbarch))
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
else if (regno == gdbarch_sp_regnum (gdbarch)
|| regno == CRIS_FP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else if ((regno >= 0 && regno <= ACR_REGNUM)
|| (regno >= EXS_REGNUM && regno <= SPC_REGNUM)
|| (regno == PID_REGNUM)

View File

@ -292,7 +292,7 @@ static struct type *
frv_register_type (struct gdbarch *gdbarch, int reg)
{
if (reg >= first_fpr_regnum && reg <= last_fpr_regnum)
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else if (reg == iacc0_regnum)
return builtin_type_int64;
else

View File

@ -1112,10 +1112,10 @@ h8300_register_type (struct gdbarch *gdbarch, int regno)
switch (regno)
{
case E_PC_REGNUM:
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
case E_SP_REGNUM:
case E_FP_REGNUM:
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
default:
if (regno == E_PSEUDO_CCR_REGNUM (gdbarch))
return builtin_type_uint8;

View File

@ -1245,8 +1245,9 @@ hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
{
if (addr & 2)
{
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
CORE_ADDR plabel = addr & ~3;
return read_memory_typed_address (plabel, builtin_type_void_func_ptr);
return read_memory_typed_address (plabel, func_ptr_type);
}
return addr;
@ -2898,6 +2899,9 @@ hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name)
CORE_ADDR
hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
unsigned int insn[HPPA_MAX_INSN_PATTERN_LEN];
int dp_rel;
@ -2908,7 +2912,7 @@ hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
/* PLABELs have bit 30 set; if it's a PLABEL, then dereference it. */
if (pc & 0x2)
pc = read_memory_typed_address (pc & ~0x3, builtin_type_void_func_ptr);
pc = read_memory_typed_address (pc & ~0x3, func_ptr_type);
return pc;
}
@ -2929,7 +2933,7 @@ hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
if (in_plt_section (pc, NULL))
{
pc = read_memory_typed_address (pc, builtin_type_void_func_ptr);
pc = read_memory_typed_address (pc, func_ptr_type);
/* If the PLT slot has not yet been resolved, the target will be
the PLT stub. */
@ -2943,7 +2947,7 @@ hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
}
/* This should point to the fixup routine. */
pc = read_memory_typed_address (pc + 8, builtin_type_void_func_ptr);
pc = read_memory_typed_address (pc + 8, func_ptr_type);
}
}

View File

@ -1275,7 +1275,7 @@ i386_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
gdb_byte buf[8];
frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
return extract_typed_address (buf, builtin_type_void_func_ptr);
return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
}
@ -2071,9 +2071,11 @@ i386_sse_type (struct gdbarch *gdbarch)
t = init_composite_type ("__gdb_builtin_type_vec128i", TYPE_CODE_UNION);
append_composite_type_field (t, "v4_float",
init_vector_type (builtin_type_float, 4));
init_vector_type (builtin_type (gdbarch)
->builtin_float, 4));
append_composite_type_field (t, "v2_double",
init_vector_type (builtin_type_double, 2));
init_vector_type (builtin_type (gdbarch)
->builtin_double, 2));
append_composite_type_field (t, "v16_int8",
init_vector_type (builtin_type_int8, 16));
append_composite_type_field (t, "v8_int16",
@ -2100,13 +2102,13 @@ static struct type *
i386_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum == I386_EIP_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == I386_EFLAGS_REGNUM)
return i386_eflags_type;
if (regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
if (i386_fp_regnum_p (gdbarch, regnum))
return builtin_type_i387_ext;
@ -2120,7 +2122,7 @@ i386_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum == I387_MXCSR_REGNUM (gdbarch_tdep (gdbarch)))
return i386_mxcsr_type;
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
/* Map a cooked register onto a raw register or memory. For the i386,

View File

@ -309,7 +309,7 @@ ia64_register_type (struct gdbarch *arch, int reg)
if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM)
return builtin_type_ia64_ext;
else
return builtin_type_long;
return builtin_type (arch)->builtin_long;
}
static int

View File

@ -231,9 +231,9 @@ static struct type *
m32r_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == M32R_PC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
else if (reg_nr == M32R_SP_REGNUM || reg_nr == M32R_FP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else
return builtin_type_int32;
}

View File

@ -120,7 +120,7 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum)
}
if (regnum == M68K_FPI_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == M68K_FPC_REGNUM || regnum == M68K_FPS_REGNUM)
return builtin_type_int32;
@ -132,10 +132,10 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum)
}
if (regnum == gdbarch_pc_regnum (gdbarch))
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum >= M68K_A0_REGNUM && regnum <= M68K_A0_REGNUM + 7)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
if (regnum == M68K_PS_REGNUM)
return m68k_ps_type;
@ -832,7 +832,7 @@ m68k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
gdb_byte buf[8];
frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
return extract_typed_address (buf, builtin_type_void_func_ptr);
return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
}
/* Normal frames. */

View File

@ -75,11 +75,11 @@ m88k_register_type (struct gdbarch *gdbarch, int regnum)
/* SXIP, SNIP, SFIP and R1 contain code addresses. */
if ((regnum >= M88K_SXIP_REGNUM && regnum <= M88K_SFIP_REGNUM)
|| regnum == M88K_R1_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
/* R30 and R31 typically contains data addresses. */
if (regnum == M88K_R30_REGNUM || regnum == M88K_R31_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
return builtin_type_int32;
}

View File

@ -1097,14 +1097,14 @@ mep_register_type (struct gdbarch *gdbarch, int reg_nr)
if (size == 32)
{
if (mep_pseudo_cr_is_float (reg_nr))
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else
return builtin_type_uint32;
}
else if (size == 64)
{
if (mep_pseudo_cr_is_float (reg_nr))
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
else
return builtin_type_uint64;
}

View File

@ -737,12 +737,13 @@ mips_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
/* Use pointer types for registers if we can. For n32 we can not,
since we do not have a 64-bit pointer type. */
if (mips_abi_regsize (gdbarch) == TYPE_LENGTH (builtin_type_void_data_ptr))
if (mips_abi_regsize (gdbarch)
== TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr))
{
if (rawnum == MIPS_SP_REGNUM || rawnum == MIPS_EMBED_BADVADDR_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else if (rawnum == MIPS_EMBED_PC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
}
if (mips_abi_regsize (gdbarch) == 4 && TYPE_LENGTH (rawtype) == 8

View File

@ -265,7 +265,7 @@ am33_2_register_name (struct gdbarch *gdbarch, int reg)
static struct type *
mn10300_register_type (struct gdbarch *gdbarch, int reg)
{
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
static CORE_ADDR

View File

@ -226,9 +226,9 @@ mt_copro_register_type (struct gdbarch *arch, int regnum)
case MT_MAC_REGNUM:
return builtin_type_uint32;
case MT_CONTEXT_REGNUM:
return builtin_type_long_long;
return builtin_type (arch)->builtin_long_long;
case MT_FLAG_REGNUM:
return builtin_type_unsigned_char;
return builtin_type (arch)->builtin_unsigned_char;
default:
if (regnum >= MT_CPR0_REGNUM && regnum <= MT_CPR15_REGNUM)
return builtin_type_int16;

View File

@ -2264,7 +2264,8 @@ rs6000_builtin_type_vec64 (struct gdbarch *gdbarch)
t = init_composite_type ("__ppc_builtin_type_vec64", TYPE_CODE_UNION);
append_composite_type_field (t, "uint64", builtin_type_int64);
append_composite_type_field (t, "v2_float",
init_vector_type (builtin_type_float, 2));
init_vector_type (builtin_type (gdbarch)
->builtin_float, 2));
append_composite_type_field (t, "v2_int32",
init_vector_type (builtin_type_int32, 2));
append_composite_type_field (t, "v4_int16",
@ -2462,7 +2463,8 @@ rs6000_convert_register_p (struct gdbarch *gdbarch, int regnum,
&& regnum >= tdep->ppc_fp0_regnum
&& regnum < tdep->ppc_fp0_regnum + ppc_num_fprs
&& TYPE_CODE (type) == TYPE_CODE_FLT
&& TYPE_LENGTH (type) != TYPE_LENGTH (builtin_type_double));
&& TYPE_LENGTH (type)
!= TYPE_LENGTH (builtin_type (gdbarch)->builtin_double));
}
static void
@ -2471,12 +2473,14 @@ rs6000_register_to_value (struct frame_info *frame,
struct type *type,
gdb_byte *to)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte from[MAX_REGISTER_SIZE];
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
get_frame_register (frame, regnum, from);
convert_typed_floating (from, builtin_type_double, to, type);
convert_typed_floating (from, builtin_type (gdbarch)->builtin_double,
to, type);
}
static void
@ -2485,11 +2489,13 @@ rs6000_value_to_register (struct frame_info *frame,
struct type *type,
const gdb_byte *from)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte to[MAX_REGISTER_SIZE];
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
convert_typed_floating (from, type, to, builtin_type_double);
convert_typed_floating (from, type,
to, builtin_type (gdbarch)->builtin_double);
put_frame_register (frame, regnum, to);
}

View File

@ -96,19 +96,19 @@ static struct type *
s390_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum == S390_PSWM_REGNUM || regnum == S390_PSWA_REGNUM)
return builtin_type_long;
return builtin_type (gdbarch)->builtin_long;
if (regnum >= S390_R0_REGNUM && regnum <= S390_R15_REGNUM)
return builtin_type_long;
return builtin_type (gdbarch)->builtin_long;
if (regnum >= S390_A0_REGNUM && regnum <= S390_A15_REGNUM)
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
if (regnum == S390_FPC_REGNUM)
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM)
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
if (regnum == S390_PC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == S390_CC_REGNUM)
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}

View File

@ -2124,11 +2124,11 @@ sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if ((reg_nr >= gdbarch_fp0_regnum (gdbarch)
&& (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
else
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
/* Return the GDB type object for the "standard" data type
@ -2138,18 +2138,18 @@ sh_sh3e_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if ((reg_nr >= gdbarch_fp0_regnum (gdbarch)
&& (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
static struct type *
sh_sh4_build_float_register_type (int high)
sh_sh4_build_float_register_type (struct gdbarch *gdbarch, int high)
{
struct type *temp;
temp = create_range_type (NULL, builtin_type_int32, 0, high);
return create_array_type (NULL, builtin_type_float, temp);
return create_array_type (NULL, builtin_type (gdbarch)->builtin_float, temp);
}
static struct type *
@ -2157,19 +2157,19 @@ sh_sh4_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if ((reg_nr >= gdbarch_fp0_regnum (gdbarch)
&& (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
else if (reg_nr >= FV0_REGNUM && reg_nr <= FV_LAST_REGNUM)
return sh_sh4_build_float_register_type (3);
return sh_sh4_build_float_register_type (gdbarch, 3);
else
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
static struct type *
sh_default_register_type (struct gdbarch *gdbarch, int reg_nr)
{
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
/* Is a register in a reggroup?

View File

@ -1495,12 +1495,12 @@ REGISTER_BYTE returns the register byte for the base register.
*/
static struct type *
sh64_build_float_register_type (int high)
sh64_build_float_register_type (struct gdbarch *gdbarch, int high)
{
struct type *temp;
temp = create_range_type (NULL, builtin_type_int32, 0, high);
return create_array_type (NULL, builtin_type_float, temp);
return create_array_type (NULL, builtin_type (gdbarch)->builtin_float, temp);
}
/* Return the GDB type object for the "standard" data type
@ -1512,27 +1512,27 @@ sh64_register_type (struct gdbarch *gdbarch, int reg_nr)
&& reg_nr <= FP_LAST_REGNUM)
|| (reg_nr >= FP0_C_REGNUM
&& reg_nr <= FP_LAST_C_REGNUM))
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else if ((reg_nr >= DR0_REGNUM
&& reg_nr <= DR_LAST_REGNUM)
|| (reg_nr >= DR0_C_REGNUM
&& reg_nr <= DR_LAST_C_REGNUM))
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
else if (reg_nr >= FPP0_REGNUM
&& reg_nr <= FPP_LAST_REGNUM)
return sh64_build_float_register_type (1);
return sh64_build_float_register_type (gdbarch, 1);
else if ((reg_nr >= FV0_REGNUM
&& reg_nr <= FV_LAST_REGNUM)
||(reg_nr >= FV0_C_REGNUM
&& reg_nr <= FV_LAST_C_REGNUM))
return sh64_build_float_register_type (3);
return sh64_build_float_register_type (gdbarch, 3);
else if (reg_nr == FPSCR_REGNUM)
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
else if (reg_nr >= R0_C_REGNUM
&& reg_nr < FP0_C_REGNUM)
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
else
return builtin_type_long_long;
return builtin_type (gdbarch)->builtin_long_long;
}
static void
@ -1989,7 +1989,7 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
regnum, gdbarch_register_name (gdbarch, regnum));
/* Get the register as a number */
flt = unpack_double (builtin_type_float, raw_buffer, &inv);
flt = unpack_double (builtin_type (gdbarch)->builtin_float, raw_buffer, &inv);
/* Print the name and some spaces. */
fputs_filtered (gdbarch_register_name (gdbarch, regnum), file);

View File

@ -332,16 +332,16 @@ static struct type *
sparc32_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM)
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
if (regnum >= SPARC32_D0_REGNUM && regnum <= SPARC32_D30_REGNUM)
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
if (regnum == SPARC_SP_REGNUM || regnum == SPARC_FP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
if (regnum == SPARC32_PC_REGNUM || regnum == SPARC32_NPC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == SPARC32_PSR_REGNUM)
return sparc_psr_type;

View File

@ -247,15 +247,15 @@ sparc64_register_type (struct gdbarch *gdbarch, int regnum)
/* Raw registers. */
if (regnum == SPARC_SP_REGNUM || regnum == SPARC_FP_REGNUM)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
if (regnum >= SPARC_G0_REGNUM && regnum <= SPARC_I7_REGNUM)
return builtin_type_int64;
if (regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM)
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
if (regnum >= SPARC64_F32_REGNUM && regnum <= SPARC64_F62_REGNUM)
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
if (regnum == SPARC64_PC_REGNUM || regnum == SPARC64_NPC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
/* This raw register contains the contents of %cwp, %pstate, %asi
and %ccr as laid out in a %tstate register. */
if (regnum == SPARC64_STATE_REGNUM)
@ -280,9 +280,9 @@ sparc64_register_type (struct gdbarch *gdbarch, int regnum)
if (regnum == SPARC64_CCR_REGNUM)
return builtin_type_int64;
if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM)
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)
return builtin_type_long_double;
return builtin_type (gdbarch)->builtin_long_double;
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}

View File

@ -74,9 +74,11 @@ spu_builtin_type_vec128 (struct gdbarch *gdbarch)
append_composite_type_field (t, "v16_int8",
init_vector_type (builtin_type_int8, 16));
append_composite_type_field (t, "v2_double",
init_vector_type (builtin_type_double, 2));
init_vector_type (builtin_type (gdbarch)
->builtin_double, 2));
append_composite_type_field (t, "v4_float",
init_vector_type (builtin_type_float, 4));
init_vector_type (builtin_type (gdbarch)
->builtin_float, 4));
TYPE_VECTOR (t) = 1;
TYPE_NAME (t) = "spu_builtin_type_vec128";
@ -137,10 +139,10 @@ spu_register_type (struct gdbarch *gdbarch, int reg_nr)
return builtin_type_uint32;
case SPU_PC_REGNUM:
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
case SPU_SP_REGNUM:
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
case SPU_FPSCR_REGNUM:
return builtin_type_uint128;

View File

@ -42,12 +42,13 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
frame);
else
{
struct value *val = allocate_value (builtin_type_void_data_ptr);
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
struct value *val = allocate_value (data_ptr_type);
gdb_byte *buf = value_contents_raw (val);
if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val)));
else
gdbarch_address_to_pointer (gdbarch, builtin_type_void_data_ptr,
gdbarch_address_to_pointer (gdbarch, data_ptr_type,
buf, get_frame_base_address (frame));
return val;
}
@ -61,12 +62,13 @@ value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
return value_of_register (gdbarch_pc_regnum (gdbarch), frame);
else
{
struct value *val = allocate_value (builtin_type_void_func_ptr);
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
struct value *val = allocate_value (func_ptr_type);
gdb_byte *buf = value_contents_raw (val);
if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val)));
else
gdbarch_address_to_pointer (gdbarch, builtin_type_void_func_ptr,
gdbarch_address_to_pointer (gdbarch, func_ptr_type,
buf, get_frame_pc (frame));
return val;
}

View File

@ -552,32 +552,32 @@ tdesc_register_type (struct gdbarch *gdbarch, int regno)
if (strcmp (reg->type, "float") == 0)
{
if (reg->bitsize == gdbarch_float_bit (gdbarch))
return builtin_type_float;
return builtin_type (gdbarch)->builtin_float;
else if (reg->bitsize == gdbarch_double_bit (gdbarch))
return builtin_type_double;
return builtin_type (gdbarch)->builtin_double;
else if (reg->bitsize == gdbarch_long_double_bit (gdbarch))
return builtin_type_long_double;
return builtin_type (gdbarch)->builtin_long_double;
}
else if (strcmp (reg->type, "int") == 0)
{
if (reg->bitsize == gdbarch_long_bit (gdbarch))
return builtin_type_long;
return builtin_type (gdbarch)->builtin_long;
else if (reg->bitsize == TARGET_CHAR_BIT)
return builtin_type_char;
return builtin_type (gdbarch)->builtin_char;
else if (reg->bitsize == gdbarch_short_bit (gdbarch))
return builtin_type_short;
return builtin_type (gdbarch)->builtin_short;
else if (reg->bitsize == gdbarch_int_bit (gdbarch))
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
else if (reg->bitsize == gdbarch_long_long_bit (gdbarch))
return builtin_type_long_long;
return builtin_type (gdbarch)->builtin_long_long;
else if (reg->bitsize == gdbarch_ptr_bit (gdbarch))
/* A bit desperate by this point... */
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
}
else if (strcmp (reg->type, "code_ptr") == 0)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
else if (strcmp (reg->type, "data_ptr") == 0)
return builtin_type_void_data_ptr;
return builtin_type (gdbarch)->builtin_data_ptr;
else
internal_error (__FILE__, __LINE__,
"Register \"%s\" has an unknown type \"%s\"",
@ -585,7 +585,7 @@ tdesc_register_type (struct gdbarch *gdbarch, int regno)
warning (_("Register \"%s\" has an unsupported size (%d bits)"),
reg->name, reg->bitsize);
return builtin_type_long;
return builtin_type (gdbarch)->builtin_long;
}
static int

View File

@ -183,7 +183,7 @@ static struct type *
v850_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum == E_PC_REGNUM)
return builtin_type_void_func_ptr;
return builtin_type (gdbarch)->builtin_func_ptr;
return builtin_type_int32;
}

View File

@ -61,7 +61,7 @@ vax_register_name (struct gdbarch *gdbarch, int regnum)
static struct type *
vax_register_type (struct gdbarch *gdbarch, int regnum)
{
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
}
/* Core file support. */

View File

@ -229,7 +229,7 @@ xtensa_register_type (struct gdbarch *gdbarch, int regnum)
+ gdbarch_tdep (gdbarch)->num_aregs)
|| (regnum >= gdbarch_tdep (gdbarch)->a0_base
&& regnum < gdbarch_tdep (gdbarch)->a0_base + 16))
return builtin_type_int;
return builtin_type (gdbarch)->builtin_int;
if (regnum == gdbarch_pc_regnum (gdbarch)
|| regnum == gdbarch_tdep (gdbarch)->a0_base + 1)
@ -1015,15 +1015,16 @@ static CORE_ADDR
xtensa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
gdb_byte buf[8];
CORE_ADDR pc;
DEBUGTRACE ("xtensa_unwind_pc (next_frame = %p)\n", next_frame);
frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
DEBUGINFO ("[xtensa_unwind_pc] pc = 0x%08x\n", (unsigned int)
extract_typed_address (buf, builtin_type_void_func_ptr));
DEBUGINFO ("[xtensa_unwind_pc] pc = 0x%08x\n", (unsigned int) pc);
return extract_typed_address (buf, builtin_type_void_func_ptr);
return pc;
}
@ -1677,9 +1678,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
case TYPE_CODE_ENUM:
/* Cast argument to long if necessary as the mask does it too. */
if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long))
if (TYPE_LENGTH (arg_type)
< TYPE_LENGTH (builtin_type (gdbarch)->builtin_long))
{
arg_type = builtin_type_long;
arg_type = builtin_type (gdbarch)->builtin_long;
arg = value_cast (arg_type, arg);
}
/* Aligment is equal to the type length for the basic types. */
@ -1689,15 +1691,16 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
case TYPE_CODE_FLT:
/* Align doubles correctly. */
if (TYPE_LENGTH (arg_type) == TYPE_LENGTH (builtin_type_double))
info->align = TYPE_LENGTH (builtin_type_double);
if (TYPE_LENGTH (arg_type)
== TYPE_LENGTH (builtin_type (gdbarch)->builtin_double))
info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_double);
else
info->align = TYPE_LENGTH (builtin_type_long);
info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
break;
case TYPE_CODE_STRUCT:
default:
info->align = TYPE_LENGTH (builtin_type_long);
info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
break;
}
info->length = TYPE_LENGTH (arg_type);