summaryrefslogtreecommitdiff
path: root/gdb/dve3900-rom.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-11-16 19:24:05 +0000
committerAndrew Cagney <cagney@redhat.com>2003-11-16 19:24:05 +0000
commit200a75a14861a9232b22821a2e295fe8a6ac4e3b (patch)
tree2188bf4d82d5125c7f983a3116b8719a9d69617e /gdb/dve3900-rom.c
parent4c196b2c76f9f3c5b648cb92fe2974f15dc7d5f5 (diff)
downloadgdb-200a75a14861a9232b22821a2e295fe8a6ac4e3b.tar.gz
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/dve3900-rom.c')
-rw-r--r--gdb/dve3900-rom.c64
1 files changed, 28 insertions, 36 deletions
diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c
index 665179ff327..fe2fcedce65 100644
--- a/gdb/dve3900-rom.c
+++ b/gdb/dve3900-rom.c
@@ -29,6 +29,7 @@
#include "gdb_string.h"
#include <time.h>
#include "regcache.h"
+#include "mips-tdep.h"
/* Type of function passed to bfd_map_over_sections. */
@@ -121,11 +122,11 @@ static char *r3900_regnames[] =
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
"S", /* PS_REGNUM */
- "l", /* LO_REGNUM */
- "h", /* HI_REGNUM */
- "B", /* BADVADDR_REGNUM */
- "Pcause", /* CAUSE_REGNUM */
- "p" /* PC_REGNUM */
+ "l", /* MIPS_EMBED_LO_REGNUM */
+ "h", /* MIPS_EMBED_HI_REGNUM */
+ "B", /* MIPS_EMBED_BADVADDR_REGNUM */
+ "Pcause", /* MIPS_EMBED_CAUSE_REGNUM */
+ "p" /* MIPS_EMBED_PC_REGNUM */
};
@@ -267,19 +268,19 @@ reg_table[] =
}
,
{
- "HI", HI_REGNUM
+ "HI", MIPS_EMBED_HI_REGNUM
}
,
{
- "LO", LO_REGNUM
+ "LO", MIPS_EMBED_LO_REGNUM
}
,
{
- "PC", PC_REGNUM
+ "PC", MIPS_EMBED_PC_REGNUM
}
,
{
- "BadV", BADVADDR_REGNUM
+ "BadV", MIPS_EMBED_BADVADDR_REGNUM
}
,
{
@@ -420,7 +421,7 @@ fetch_bad_vaddr (void)
monitor_printf ("xB\r");
monitor_expect ("BadV=", NULL, 0);
monitor_expect_prompt (buf, sizeof (buf));
- monitor_supply_register (BADVADDR_REGNUM, buf);
+ monitor_supply_register (mips_regnum (current_gdbarch)->badvaddr, buf);
}
@@ -485,20 +486,15 @@ fetch_bitmapped_register (int regno, struct bit_field *bf)
static void
r3900_fetch_registers (int regno)
{
- switch (regno)
- {
- case BADVADDR_REGNUM:
- fetch_bad_vaddr ();
- return;
- case PS_REGNUM:
- fetch_bitmapped_register (PS_REGNUM, status_fields);
- return;
- case CAUSE_REGNUM:
- fetch_bitmapped_register (CAUSE_REGNUM, cause_fields);
- return;
- default:
- orig_monitor_fetch_registers (regno);
- }
+ if (regno == mips_regnum (current_gdbarch)->badvaddr)
+ fetch_bad_vaddr ();
+ else if (regno == PS_REGNUM)
+ fetch_bitmapped_register (PS_REGNUM, status_fields);
+ else if (regno == mips_regnum (current_gdbarch)->cause)
+ fetch_bitmapped_register (mips_regnum (current_gdbarch)->cause,
+ cause_fields);
+ else
+ orig_monitor_fetch_registers (regno);
}
@@ -544,17 +540,13 @@ store_bitmapped_register (int regno, struct bit_field *bf)
static void
r3900_store_registers (int regno)
{
- switch (regno)
- {
- case PS_REGNUM:
- store_bitmapped_register (PS_REGNUM, status_fields);
- return;
- case CAUSE_REGNUM:
- store_bitmapped_register (CAUSE_REGNUM, cause_fields);
- return;
- default:
- orig_monitor_store_registers (regno);
- }
+ if (regno == PS_REGNUM)
+ store_bitmapped_register (PS_REGNUM, status_fields);
+ else if (regno == mips_regnum (current_gdbarch)->cause)
+ store_bitmapped_register (mips_regnum (current_gdbarch)->cause,
+ cause_fields);
+ else
+ orig_monitor_store_registers (regno);
}
@@ -648,7 +640,7 @@ debug_write (unsigned char *buf, int buflen)
static void
ignore_packet (void)
{
- int c;
+ int c = -1;
int len;
/* Ignore lots of trash (messages about section addresses, for example)