/* Remote debugging interface for Densan DVE-R3900 ROM monitor for
GDB, the GNU debugger.
- Copyright 1997 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
#include "command.h"
#include "gdb_string.h"
#include <time.h>
+#include "regcache.h"
/* Type of function passed to bfd_map_over_sections. */
different names than GDB does, and don't support all the registers
either. */
-static char *r3900_regnames[NUM_REGS] =
+static char *r3900_regnames[] =
{
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
{
unsigned long val;
unsigned char regbuf[MAX_REGISTER_RAW_SIZE];
+ char *regname = NULL;
- monitor_printf ("x%s\r", r3900_regnames[regno]);
+ if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0]))
+ internal_error (__FILE__, __LINE__,
+ "fetch_bitmapped_register: regno out of bounds");
+ else
+ regname = r3900_regnames[regno];
+
+ monitor_printf ("x%s\r", regname);
val = fetch_fields (bf);
monitor_printf (".\r");
monitor_expect_prompt (NULL, 0);
store_bitmapped_register (int regno, struct bit_field *bf)
{
unsigned long oldval, newval;
+ char *regname = NULL;
+
+ if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0]))
+ internal_error (__FILE__, __LINE__,
+ "fetch_bitmapped_register: regno out of bounds");
+ else
+ regname = r3900_regnames[regno];
/* Fetch the current value of the register. */
- monitor_printf ("x%s\r", r3900_regnames[regno]);
+ monitor_printf ("x%s\r", regname);
oldval = fetch_fields (bf);
newval = read_register (regno);
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
- inferior_pid = 0; /* No process now */
+ inferior_ptid = null_ptid; /* No process now */
/* This is necessary because many things were based on the PC at the
time that we attached to the monitor, which is no longer valid