+2002-02-21 Richard Earnshaw <rearnsha@arm.com>
+
+ * armnbsd-nat.c: Include gdbcore.h.
+ (FETCH_INFERIOR_REGISTERS): Just error if this isn't defined.
+ (fetch_regs, fetch_fp_regs, store_regs, store_fp_regs): Add explicit
+ 'void' to declaration, to shut up ARI.
+ (fetch_core_registers): Make static. Rewrite using supply_register.
+ (arm_netbsd_core_fns): New core-file type specification.
+ (_initialize_arm_netbsd_nat): New function.
+
2002-02-21 Christopher Faylor <cgf@redhat.com>
* win32-nat.c (register_loaded_dll): Correctly check for invalid handle
#include "defs.h"
+#ifndef FETCH_INFERIOR_REGISTERS
+#error Not FETCH_INFERIOR_REGISTERS
+#endif /* !FETCH_INFERIOR_REGISTERS */
+
#include "arm-tdep.h"
-#ifdef FETCH_INFERIOR_REGISTERS
#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include <machine/frame.h>
#include "inferior.h"
#include "regcache.h"
+#include "gdbcore.h"
extern int arm_apcs_32;
}
static void
-fetch_regs ()
+fetch_regs (void)
{
struct reg inferior_registers;
int ret;
}
static void
-fetch_fp_regs ()
+fetch_fp_regs (void)
{
struct fpreg inferior_fp_registers;
int ret;
}
static void
-store_regs ()
+store_regs (void)
{
struct reg inferior_registers;
int ret;
}
static void
-store_fp_regs ()
+store_fp_regs (void)
{
struct fpreg inferior_fp_registers;
int ret;
struct fpreg freg;
};
-void
+static void
fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR ignore)
{
struct md_core *core_reg = (struct md_core *) core_reg_sect;
+ int regno;
+ CORE_ADDR r_pc;
+
+ /* Integer registers. */
+ for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
+ supply_register (regno, (char *) &core_reg->intreg.r[regno]);
+
+ supply_register (ARM_SP_REGNUM, (char *) &core_reg->intreg.r_sp);
+ supply_register (ARM_LR_REGNUM, (char *) &core_reg->intreg.r_lr);
+ /* This is ok: we're running native... */
+ r_pc = ADDR_BITS_REMOVE (core_reg->intreg.r_pc);
+ supply_register (ARM_PC_REGNUM, (char *) &r_pc);
+
+ if (arm_apcs_32)
+ supply_register (ARM_PS_REGNUM, (char *) &core_reg->intreg.r_cpsr);
+ else
+ supply_register (ARM_PS_REGNUM, (char *) &core_reg->intreg.r_pc);
- /* integer registers */
- memcpy (®isters[REGISTER_BYTE (0)], &core_reg->intreg,
- sizeof (struct reg));
- /* floating point registers */
- /* XXX */
+ /* Floating-point registers. */
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
+ supply_register
+ (regno, (char *) &core_reg->freg.fpr[regno - ARM_F0_REGNUM]);
+
+ supply_register (ARM_FPS_REGNUM, (char *) &core_reg->freg.fpr_fpsr);
}
-#else
-#error Not FETCH_INFERIOR_REGISTERS
-#endif /* !FETCH_INFERIOR_REGISTERS */
+static struct core_fns arm_netbsd_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flovour. */
+ default_check_format, /* check_format. */
+ default_core_sniffer, /* core_sniffer. */
+ fetch_core_registers, /* core_read_registers. */
+ NULL
+};
+
+void
+_initialize_arm_netbsd_nat (void)
+{
+ add_core_fns (&arm_netbsd_core_fns);
+}