X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fremote-vxmips.c;h=84e6c7dbb75bd8f66654a0279f8c0f8551a99b7e;hb=bcb3dc3d553e30a82bfab16b7cc3da7e4e416203;hp=a98ac13787bf577bc226abfcf0d0bea0e80ccc8d;hpb=72ec28b8afa357cdde70c612b4e0e9f37a34f8e4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/remote-vxmips.c b/gdb/remote-vxmips.c index a98ac13787..84e6c7dbb7 100644 --- a/gdb/remote-vxmips.c +++ b/gdb/remote-vxmips.c @@ -26,16 +26,15 @@ #include "vx-share/regPacket.h" #include "frame.h" #include "inferior.h" -#include "gdb_wait.h" #include "target.h" #include "gdbcore.h" #include "command.h" #include "symtab.h" -#include "symfile.h" /* for struct complaint */ +#include "symfile.h" +#include "regcache.h" #include "gdb_string.h" #include -#include #include #include #include @@ -67,8 +66,7 @@ extern void net_write_registers (); it is ignored. FIXME look at regno to improve efficiency. */ void -vx_read_register (regno) - int regno; +vx_read_register (int regno) { char mips_greg_packet[MIPS_GREG_PLEN]; char mips_fpreg_packet[MIPS_FPREG_PLEN]; @@ -105,18 +103,23 @@ vx_read_register (regno) /* Copy the general registers. */ - bcopy (&mips_greg_packet[MIPS_R_GP0], ®isters[0], 32 * MIPS_GREG_SIZE); + memcpy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0], + 32 * MIPS_GREG_SIZE); /* Copy SR, LO, HI, and PC. */ - bcopy (&mips_greg_packet[MIPS_R_SR], - ®isters[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE); - bcopy (&mips_greg_packet[MIPS_R_LO], - ®isters[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE); - bcopy (&mips_greg_packet[MIPS_R_HI], - ®isters[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE); - bcopy (&mips_greg_packet[MIPS_R_PC], - ®isters[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], + &mips_greg_packet[MIPS_R_SR], + MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], + &mips_greg_packet[MIPS_R_LO], + MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], + &mips_greg_packet[MIPS_R_HI], + MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], + &mips_greg_packet[MIPS_R_PC], + MIPS_GREG_SIZE); /* If the target has floating point registers, fetch them. Otherwise, zero the floating point register values in @@ -130,53 +133,57 @@ vx_read_register (regno) /* Copy the floating point registers. */ - bcopy (&mips_fpreg_packet[MIPS_R_FP0], - ®isters[REGISTER_BYTE (FP0_REGNUM)], - REGISTER_RAW_SIZE (FP0_REGNUM) * 32); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + &mips_fpreg_packet[MIPS_R_FP0], + register_size (current_gdbarch, FP0_REGNUM) * 32); /* Copy the floating point control/status register (fpcsr). */ - bcopy (&mips_fpreg_packet[MIPS_R_FPCSR], - ®isters[REGISTER_BYTE (FCRCS_REGNUM)], - REGISTER_RAW_SIZE (FCRCS_REGNUM)); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], + &mips_fpreg_packet[MIPS_R_FPCSR], + register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status)); } else { - bzero ((char *) ®isters[REGISTER_BYTE (FP0_REGNUM)], - REGISTER_RAW_SIZE (FP0_REGNUM) * 32); - bzero ((char *) ®isters[REGISTER_BYTE (FCRCS_REGNUM)], - REGISTER_RAW_SIZE (FCRCS_REGNUM)); + memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + 0, register_size (current_gdbarch, FP0_REGNUM) * 32); + memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], + 0, register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status)); } /* Mark the register cache valid. */ - registers_fetched (); + deprecated_registers_fetched (); } /* Store a register or registers into the VxWorks target. REGNO is the register to store, or -1 for all; currently, it is ignored. FIXME look at regno to improve efficiency. */ -vx_write_register (regno) - int regno; +vx_write_register (int regno) { char mips_greg_packet[MIPS_GREG_PLEN]; char mips_fpreg_packet[MIPS_FPREG_PLEN]; /* Store general registers. */ - bcopy (®isters[0], &mips_greg_packet[MIPS_R_GP0], 32 * MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0], + 32 * MIPS_GREG_SIZE); /* Copy SR, LO, HI, and PC. */ - bcopy (®isters[REGISTER_BYTE (PS_REGNUM)], - &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE); - bcopy (®isters[REGISTER_BYTE (LO_REGNUM)], - &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE); - bcopy (®isters[REGISTER_BYTE (HI_REGNUM)], - &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE); - bcopy (®isters[REGISTER_BYTE (PC_REGNUM)], - &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_SR], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], + MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_LO], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], + MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_HI], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], + MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_PC], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], + MIPS_GREG_SIZE); net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS); @@ -186,15 +193,15 @@ vx_write_register (regno) { /* Copy the floating point data registers. */ - bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], - &mips_fpreg_packet[MIPS_R_FP0], - REGISTER_RAW_SIZE (FP0_REGNUM) * 32); + memcpy (&mips_fpreg_packet[MIPS_R_FP0], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + register_size (current_gdbarch, FP0_REGNUM) * 32); /* Copy the floating point control/status register (fpcsr). */ - bcopy (®isters[REGISTER_BYTE (FCRCS_REGNUM)], - &mips_fpreg_packet[MIPS_R_FPCSR], - REGISTER_RAW_SIZE (FCRCS_REGNUM)); + memcpy (&mips_fpreg_packet[MIPS_R_FPCSR], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], + register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status)); net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN, PTRACE_SETFPREGS);