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>
+
+ * 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
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. */
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)
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. */
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;
}
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. */
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;
}
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. */
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)
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
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;
{
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;
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;
/* 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;
}
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. */
}
/* 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);
}
}
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);
}
\f
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",
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;
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,
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
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;
}
}
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;
}
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;
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);
}
\f
/* Normal frames. */
/* 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;
}
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;
}
/* 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
static struct type *
mn10300_register_type (struct gdbarch *gdbarch, int reg)
{
- return builtin_type_int;
+ return builtin_type (gdbarch)->builtin_int;
}
static CORE_ADDR
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;
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",
&& 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
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
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);
}
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"));
}
{
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
{
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 *
{
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?
*/
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
&& 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
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);
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;
/* 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)
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"));
}
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";
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;
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;
}
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;
}
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\"",
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
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;
}
static struct type *
vax_register_type (struct gdbarch *gdbarch, int regnum)
{
- return builtin_type_int;
+ return builtin_type (gdbarch)->builtin_int;
}
\f
/* Core file support. */
+ 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)
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;
}
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. */
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);