/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
- Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
{
floatformat_big, 128, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
- "floatformat_ieee_double_big",
+ "floatformat_n32n64_long_double_big",
n32n64_floatformat_always_valid
};
+static const struct floatformat *floatformats_n32n64_long[BFD_ENDIAN_UNKNOWN] =
+{
+ &floatformat_n32n64_long_double_big,
+ &floatformat_n32n64_long_double_big
+};
+
const struct mips_regnum *
mips_regnum (struct gdbarch *gdbarch)
{
{
/* The floating-point registers raw, or cooked, always match
mips_isa_regsize(), and also map 1:1, byte for byte. */
- switch (gdbarch_byte_order (gdbarch))
- {
- case BFD_ENDIAN_BIG:
- if (mips_isa_regsize (gdbarch) == 4)
- return builtin_type_ieee_single_big;
- else
- return builtin_type_ieee_double_big;
- case BFD_ENDIAN_LITTLE:
- if (mips_isa_regsize (gdbarch) == 4)
- return builtin_type_ieee_single_little;
- else
- return builtin_type_ieee_double_little;
- case BFD_ENDIAN_UNKNOWN:
- default:
- internal_error (__FILE__, __LINE__, _("bad switch"));
- }
+ if (mips_isa_regsize (gdbarch) == 4)
+ return builtin_type_ieee_single;
+ else
+ return builtin_type_ieee_double;
}
else if (regnum < NUM_REGS)
{
{
struct mips_frame_cache *info = mips_insn16_frame_cache (next_frame,
this_cache);
- (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
+ (*this_id) = frame_id_build (info->base,
+ frame_func_unwind (next_frame, NORMAL_FRAME));
}
static void
static const struct frame_unwind *
mips_insn16_frame_sniffer (struct frame_info *next_frame)
{
- CORE_ADDR pc = frame_pc_unwind (next_frame);
+ CORE_ADDR pc = frame_unwind_address_in_block (next_frame, NORMAL_FRAME);
if (mips_pc_is_mips16 (pc))
return &mips_insn16_frame_unwind;
return NULL;
{
struct mips_frame_cache *info = mips_insn32_frame_cache (next_frame,
this_cache);
- (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
+ (*this_id) = frame_id_build (info->base,
+ frame_func_unwind (next_frame, NORMAL_FRAME));
}
static void
static const struct frame_unwind *
mips_insn32_frame_sniffer (struct frame_info *next_frame)
{
- CORE_ADDR pc = frame_pc_unwind (next_frame);
+ CORE_ADDR pc = frame_unwind_address_in_block (next_frame, NORMAL_FRAME);
if (! mips_pc_is_mips16 (pc))
return &mips_insn32_frame_unwind;
return NULL;
mips_stub_frame_sniffer (struct frame_info *next_frame)
{
struct obj_section *s;
- CORE_ADDR pc = frame_pc_unwind (next_frame);
+ CORE_ADDR pc = frame_unwind_address_in_block (next_frame, NORMAL_FRAME);
if (in_plt_section (pc, NULL))
return &mips_stub_frame_unwind;
static struct type *
mips_float_register_type (void)
{
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- return builtin_type_ieee_single_big;
- else
- return builtin_type_ieee_single_little;
+ return builtin_type_ieee_single;
}
static struct type *
mips_double_register_type (void)
{
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- return builtin_type_ieee_double_big;
- else
- return builtin_type_ieee_double_little;
+ return builtin_type_ieee_double;
}
/* Copy a 32-bit single-precision value from the current frame
gdb_byte raw_buffer[MAX_REGISTER_SIZE];
int offset;
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
{
mips_print_fp_register (file, frame, regnum);
return;
offset = 0;
print_scalar_formatted (raw_buffer + offset,
- gdbarch_register_type (gdbarch, regnum), 'x', 0,
+ register_type (gdbarch, regnum), 'x', 0,
file);
}
{
if (*REGISTER_NAME (regnum) == '\0')
continue; /* unused register */
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
break; /* end the row: reached FP register */
if (col == 0)
{
if (*REGISTER_NAME (regnum) == '\0')
continue; /* unused register */
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
break; /* end row: reached FP register */
/* OK: get the data in raw format. */
regnum = NUM_REGS;
while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
{
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
{
if (all) /* true for "INFO ALL-REGISTERS" command */
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_long_double_bit (gdbarch, 128);
- set_gdbarch_long_double_format (gdbarch,
- &floatformat_n32n64_long_double_big);
+ set_gdbarch_long_double_format (gdbarch, floatformats_n32n64_long);
break;
case MIPS_ABI_N64:
set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call);
set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_long_double_bit (gdbarch, 128);
- set_gdbarch_long_double_format (gdbarch,
- &floatformat_n32n64_long_double_big);
+ set_gdbarch_long_double_format (gdbarch, floatformats_n32n64_long);
break;
default:
internal_error (__FILE__, __LINE__, _("unknown ABI in switch"));