diff options
Diffstat (limited to 'gdb/armnbsd-nat.c')
-rw-r--r-- | gdb/armnbsd-nat.c | 133 |
1 files changed, 80 insertions, 53 deletions
diff --git a/gdb/armnbsd-nat.c b/gdb/armnbsd-nat.c index 88396c06a14..2f10ec12528 100644 --- a/gdb/armnbsd-nat.c +++ b/gdb/armnbsd-nat.c @@ -1,5 +1,6 @@ /* Native-dependent code for BSD Unix running on ARM's, for GDB. - Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002 + + Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -45,18 +46,22 @@ supply_gregset (struct reg *gregset) /* Integer registers. */ for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++) - supply_register (regno, (char *) &gregset->r[regno]); + regcache_raw_supply (current_regcache, regno, (char *) &gregset->r[regno]); - supply_register (ARM_SP_REGNUM, (char *) &gregset->r_sp); - supply_register (ARM_LR_REGNUM, (char *) &gregset->r_lr); + regcache_raw_supply (current_regcache, ARM_SP_REGNUM, + (char *) &gregset->r_sp); + regcache_raw_supply (current_regcache, ARM_LR_REGNUM, + (char *) &gregset->r_lr); /* This is ok: we're running native... */ r_pc = ADDR_BITS_REMOVE (gregset->r_pc); - supply_register (ARM_PC_REGNUM, (char *) &r_pc); + regcache_raw_supply (current_regcache, ARM_PC_REGNUM, (char *) &r_pc); if (arm_apcs_32) - supply_register (ARM_PS_REGNUM, (char *) &gregset->r_cpsr); + regcache_raw_supply (current_regcache, ARM_PS_REGNUM, + (char *) &gregset->r_cpsr); else - supply_register (ARM_PS_REGNUM, (char *) &gregset->r_pc); + regcache_raw_supply (current_regcache, ARM_PS_REGNUM, + (char *) &gregset->r_pc); } static void @@ -65,10 +70,11 @@ supply_fparegset (struct fpreg *fparegset) int regno; for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++) - supply_register - (regno, (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]); + regcache_raw_supply (current_regcache, regno, + (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]); - supply_register (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr); + regcache_raw_supply (current_regcache, ARM_FPS_REGNUM, + (char *) &fparegset->fpr_fpsr); } static void @@ -78,7 +84,7 @@ fetch_register (int regno) int ret; ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) { @@ -89,28 +95,34 @@ fetch_register (int regno) switch (regno) { case ARM_SP_REGNUM: - supply_register (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp); + regcache_raw_supply (current_regcache, ARM_SP_REGNUM, + (char *) &inferior_registers.r_sp); break; case ARM_LR_REGNUM: - supply_register (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr); + regcache_raw_supply (current_regcache, ARM_LR_REGNUM, + (char *) &inferior_registers.r_lr); break; case ARM_PC_REGNUM: /* This is ok: we're running native... */ inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc); - supply_register (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc); + regcache_raw_supply (current_regcache, ARM_PC_REGNUM, + (char *) &inferior_registers.r_pc); break; case ARM_PS_REGNUM: if (arm_apcs_32) - supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr); + regcache_raw_supply (current_regcache, ARM_PS_REGNUM, + (char *) &inferior_registers.r_cpsr); else - supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_pc); + regcache_raw_supply (current_regcache, ARM_PS_REGNUM, + (char *) &inferior_registers.r_pc); break; default: - supply_register (regno, (char *) &inferior_registers.r[regno]); + regcache_raw_supply (current_regcache, regno, + (char *) &inferior_registers.r[regno]); break; } } @@ -123,7 +135,7 @@ fetch_regs (void) int regno; ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) { @@ -141,7 +153,7 @@ fetch_fp_register (int regno) int ret; ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) { @@ -152,13 +164,13 @@ fetch_fp_register (int regno) switch (regno) { case ARM_FPS_REGNUM: - supply_register (ARM_FPS_REGNUM, - (char *) &inferior_fp_registers.fpr_fpsr); + regcache_raw_supply (current_regcache, ARM_FPS_REGNUM, + (char *) &inferior_fp_registers.fpr_fpsr); break; default: - supply_register - (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); + regcache_raw_supply (current_regcache, regno, + (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); break; } } @@ -171,7 +183,7 @@ fetch_fp_regs (void) int regno; ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) { @@ -207,7 +219,7 @@ store_register (int regno) int ret; ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) { @@ -218,21 +230,25 @@ store_register (int regno) switch (regno) { case ARM_SP_REGNUM: - regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp); + regcache_raw_collect (current_regcache, ARM_SP_REGNUM, + (char *) &inferior_registers.r_sp); break; case ARM_LR_REGNUM: - regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr); + regcache_raw_collect (current_regcache, ARM_LR_REGNUM, + (char *) &inferior_registers.r_lr); break; case ARM_PC_REGNUM: if (arm_apcs_32) - regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc); + regcache_raw_collect (current_regcache, ARM_PC_REGNUM, + (char *) &inferior_registers.r_pc); else { unsigned pc_val; - regcache_collect (ARM_PC_REGNUM, (char *) &pc_val); + regcache_raw_collect (current_regcache, ARM_PC_REGNUM, + (char *) &pc_val); pc_val = ADDR_BITS_REMOVE (pc_val); inferior_registers.r_pc @@ -243,12 +259,14 @@ store_register (int regno) case ARM_PS_REGNUM: if (arm_apcs_32) - regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr); + regcache_raw_collect (current_regcache, ARM_PS_REGNUM, + (char *) &inferior_registers.r_cpsr); else { unsigned psr_val; - regcache_collect (ARM_PS_REGNUM, (char *) &psr_val); + regcache_raw_collect (current_regcache, ARM_PS_REGNUM, + (char *) &psr_val); psr_val ^= ADDR_BITS_REMOVE (psr_val); inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc); @@ -257,12 +275,13 @@ store_register (int regno) break; default: - regcache_collect (regno, (char *) &inferior_registers.r[regno]); + regcache_raw_collect (current_regcache, regno, + (char *) &inferior_registers.r[regno]); break; } ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) warning ("unable to write register %d to inferior", regno); @@ -277,23 +296,30 @@ store_regs (void) for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++) - regcache_collect (regno, (char *) &inferior_registers.r[regno]); + regcache_raw_collect (current_regcache, regno, + (char *) &inferior_registers.r[regno]); - regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp); - regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr); + regcache_raw_collect (current_regcache, ARM_SP_REGNUM, + (char *) &inferior_registers.r_sp); + regcache_raw_collect (current_regcache, ARM_LR_REGNUM, + (char *) &inferior_registers.r_lr); if (arm_apcs_32) { - regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc); - regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr); + regcache_raw_collect (current_regcache, ARM_PC_REGNUM, + (char *) &inferior_registers.r_pc); + regcache_raw_collect (current_regcache, ARM_PS_REGNUM, + (char *) &inferior_registers.r_cpsr); } else { unsigned pc_val; unsigned psr_val; - regcache_collect (ARM_PC_REGNUM, (char *) &pc_val); - regcache_collect (ARM_PS_REGNUM, (char *) &psr_val); + regcache_raw_collect (current_regcache, ARM_PC_REGNUM, + (char *) &pc_val); + regcache_raw_collect (current_regcache, ARM_PS_REGNUM, + (char *) &psr_val); pc_val = ADDR_BITS_REMOVE (pc_val); psr_val ^= ADDR_BITS_REMOVE (psr_val); @@ -302,7 +328,7 @@ store_regs (void) } ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) warning ("unable to store general registers"); @@ -315,7 +341,7 @@ store_fp_register (int regno) int ret; ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) { @@ -326,18 +352,18 @@ store_fp_register (int regno) switch (regno) { case ARM_FPS_REGNUM: - regcache_collect (ARM_FPS_REGNUM, - (char *) &inferior_fp_registers.fpr_fpsr); + regcache_raw_collect (current_regcache, ARM_FPS_REGNUM, + (char *) &inferior_fp_registers.fpr_fpsr); break; default: - regcache_collect - (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); + regcache_raw_collect (current_regcache, regno, + (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); break; } ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) warning ("unable to write register %d to inferior", regno); @@ -352,13 +378,14 @@ store_fp_regs (void) for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++) - regcache_collect - (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); + regcache_raw_collect (current_regcache, regno, + (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]); - regcache_collect (ARM_FPS_REGNUM, (char *) &inferior_fp_registers.fpr_fpsr); + regcache_raw_collect (current_regcache, ARM_FPS_REGNUM, + (char *) &inferior_fp_registers.fpr_fpsr); ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); + (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) warning ("unable to store floating-point registers"); @@ -459,6 +486,6 @@ static struct core_fns arm_netbsd_elfcore_fns = void _initialize_arm_netbsd_nat (void) { - add_core_fns (&arm_netbsd_core_fns); - add_core_fns (&arm_netbsd_elfcore_fns); + deprecated_add_core_fns (&arm_netbsd_core_fns); + deprecated_add_core_fns (&arm_netbsd_elfcore_fns); } |