diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-11-16 19:24:05 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-11-16 19:24:05 +0000 |
commit | 56cea623828ea5eea0cc592f7f55157b4b902bb4 (patch) | |
tree | 82c70cf0ac60b3dd7337465ef6f42739d704f633 /gdb/remote-mips.c | |
parent | 719ec22109a4b447266214fadba2fbb878192c96 (diff) | |
download | gdb-56cea623828ea5eea0cc592f7f55157b4b902bb4.zip gdb-56cea623828ea5eea0cc592f7f55157b4b902bb4.tar.gz gdb-56cea623828ea5eea0cc592f7f55157b4b902bb4.tar.bz2 |
2003-11-16 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (struct gdbarch_tdep): Add field "regnum".
(mips_fpa0_regnum, mips_regnum): New function.
(mips_gdbarch_init): Fill in the "regnum" fields.
* mips-tdep.h (struct mips_regnum): Define.
(mips_regnum): Declare.
* config/mips/tm-mips.h (BADVADDR_REGNUM): Delete macro.
(LO_REGNUM, HI_REGNUM, BADVADDR_REGNUM): Ditto.
(CAUSE_REGNUM, PC_REGNUM, FP0_REGNUM): Ditto.
(FCRCS_REGNUM, FCRIR_REGNUM, FPA0_REGNUM): Ditto.
* config/mips/tm-irix6.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* config/mips/tm-irix5.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* remote-mips.c: Include "mips-tdep.h". Update.
* mipsnbsd-tdep.c: Update.
* mipsv4-nat.c: Update.
* mips-tdep.c: Update.
* mips-nat.c: Update.
* mips-linux-tdep.c: Update.
* mips-linux-nat.c: Update.
* irix5-nat.c: Update.
* dve3900-rom.c: Include "mips-tdep.h". Update.
(ignore_packet): Supress GCC warning.
* config/mips/nm-riscos.h: Update.
* Makefile.in (dve3900-rom.o, remote-mips.o): Update dependencies.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r-- | gdb/remote-mips.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 8512e444..9b37160 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -36,6 +36,7 @@ #include "gdb_stat.h" #include "regcache.h" #include <ctype.h> +#include "mips-tdep.h" /* Breakpoint types. Values 0, 1, and 2 must agree with the watch @@ -1902,26 +1903,24 @@ mips_map_regno (int regno) { if (regno < 32) return regno; - if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32) - return regno - FP0_REGNUM + 32; - switch (regno) - { - case PC_REGNUM: - return REGNO_OFFSET + 0; - case CAUSE_REGNUM: - return REGNO_OFFSET + 1; - case HI_REGNUM: - return REGNO_OFFSET + 2; - case LO_REGNUM: - return REGNO_OFFSET + 3; - case FCRCS_REGNUM: - return REGNO_OFFSET + 4; - case FCRIR_REGNUM: - return REGNO_OFFSET + 5; - default: - /* FIXME: Is there a way to get the status register? */ - return 0; - } + if (regno >= mips_regnum (current_gdbarch)->fp0 + && regno < mips_regnum (current_gdbarch)->fp0 + 32) + return regno - mips_regnum (current_gdbarch)->fp0 + 32; + else if (regno == mips_regnum (current_gdbarch)->pc) + return REGNO_OFFSET + 0; + else if (regno == mips_regnum (current_gdbarch)->cause) + return REGNO_OFFSET + 1; + else if (regno == mips_regnum (current_gdbarch)->hi) + return REGNO_OFFSET + 2; + else if (regno == mips_regnum (current_gdbarch)->lo) + return REGNO_OFFSET + 3; + else if (regno == mips_regnum (current_gdbarch)->fp_control_status) + return REGNO_OFFSET + 4; + else if (regno == mips_regnum (current_gdbarch)->fp_implementation_revision) + return REGNO_OFFSET + 5; + else + /* FIXME: Is there a way to get the status register? */ + return 0; } /* Fetch the remote registers. */ |