/* Target-dependent code for MIPS systems running NetBSD.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This file is part of GDB.
if (CANNOT_FETCH_REGISTER (i))
supply_register (i, NULL);
else
- supply_register (i, regs + (i * MIPS_REGSIZE));
+ supply_register (i, regs + (i * mips_regsize (current_gdbarch)));
}
}
}
for (i = 0; i <= PC_REGNUM; i++)
if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i))
- regcache_collect (i, regs + (i * MIPS_REGSIZE));
+ regcache_collect (i, regs + (i * mips_regsize (current_gdbarch)));
}
void
{
int i;
- for (i = FP0_REGNUM; i <= FCRIR_REGNUM; i++)
+ for (i = FP0_REGNUM;
+ i <= mips_regnum (current_gdbarch)->fp_implementation_revision;
+ i++)
{
if (regno == i || regno == -1)
{
if (CANNOT_FETCH_REGISTER (i))
supply_register (i, NULL);
else
- supply_register (i, fpregs + ((i - FP0_REGNUM) * MIPS_REGSIZE));
+ supply_register (i, fpregs + ((i - FP0_REGNUM) * mips_regsize (current_gdbarch)));
}
}
}
{
int i;
- for (i = FP0_REGNUM; i <= FCRCS_REGNUM; i++)
+ for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status;
+ i++)
if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i))
- regcache_collect (i, fpregs + ((i - FP0_REGNUM) * MIPS_REGSIZE));
+ regcache_collect (i, fpregs + ((i - FP0_REGNUM) * mips_regsize (current_gdbarch)));
}
static void
mipsnbsd_supply_reg (regs, -1);
/* Floating point registers. */
- mipsnbsd_supply_fpreg (regs, -1);
+ mipsnbsd_supply_fpreg (fpregs, -1);
}
static void
success. */
#define NBSD_MIPS_JB_PC (2 * 4)
-#define NBSD_MIPS_JB_ELEMENT_SIZE MIPS_REGSIZE
+#define NBSD_MIPS_JB_ELEMENT_SIZE mips_regsize (current_gdbarch)
#define NBSD_MIPS_JB_OFFSET (NBSD_MIPS_JB_PC * \
NBSD_MIPS_JB_ELEMENT_SIZE)
NBSD_MIPS_JB_ELEMENT_SIZE))
return 0;
- *pc = extract_address (buf, NBSD_MIPS_JB_ELEMENT_SIZE);
+ *pc = extract_unsigned_integer (buf, NBSD_MIPS_JB_ELEMENT_SIZE);
return 1;
}
mipsnbsd_cannot_fetch_register (int regno)
{
return (regno == ZERO_REGNUM
- || regno == FCRIR_REGNUM);
+ || regno == mips_regnum (current_gdbarch)->fp_implementation_revision);
}
static int
mipsnbsd_cannot_store_register (int regno)
{
return (regno == ZERO_REGNUM
- || regno == FCRIR_REGNUM);
+ || regno == mips_regnum (current_gdbarch)->fp_implementation_revision);
}
/* NetBSD/mips uses a slightly different link_map structure from the
void
_initialize_mipsnbsd_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_NETBSD_ELF,
mipsnbsd_init_abi);
add_core_fns (&mipsnbsd_core_fns);