+Wed Mar 15 15:09:29 1995 Stu Grossman (grossman@cygnus.com)
+
+ * findvar.c (read_register_bytes write_register_bytes): Make
+ these routines much smarter about updating registers from the
+ target, only doing so when absolutely necessary. This really
+ speeds up register modification on some remote targets.
+
+ * monitor.c: More cleanups. Get rid of monitor_load_ascii_srec.
+ BFD makes this unnecessary. Lots of debugging speedups.
+ * (expect): NULL terminate return string.
+ * (monitor_open monitor_supply_register parse_register_dump
+ monitor_wait monitor_fetch_register): Switch to using GNU regexp
+ library to parse multi-register displays.
+ * (monitor_read_memory): Read multiple bytes (up to 16) at once.
+ * (monitor_create_inferior): Call clear_proceed_status to make run
+ command notice first breakpoint.
+ * (monitor_load): Clean up. Reset inferior_pid, set pc to start
+ address and reset symbol table stuff to make loads put things into
+ a fresh state.
+ * (monitor_load_srec): Lower sleep time to 1 second.
+
+ * monitor.h (struct monitor_ops): Add register_pattern and
+ supply_register to monitor_ops.
+
+ * rom68k-rom.c: Add new support for handling register dumps.
+
Wed Mar 15 15:18:27 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
* utils.c, defs.h (putchar_unfiltered, fputc_unfiltered): Make
struct cmd_resp getmem; /* display memory */
struct cmd_resp setreg; /* set a register */
struct cmd_resp getreg; /* get a register */
+ /* Some commands can dump a bunch of registers
+ at once. This comes as a set of REG=VAL
+ pairs. This should be called for each pair
+ of registers that we can parse to supply
+ GDB with the value of a register. */
+ char *register_pattern; /* Pattern that picks out register from reg dump */
+ void (*supply_register) PARAMS ((char *name, int namelen, char *val, int vallen));
char *load; /* load command */
char *prompt; /* monitor command prompt */
char *cmd_delim; /* end-of-command delimitor */
#define REG_DELIM (current_monitor->regset.delim)
extern void monitor_open PARAMS ((char *args, struct monitor_ops *ops, int from_tty));
+extern char *monitor_supply_register PARAMS ((int regno, char *valstr));
#include "monitor.h"
#include "serial.h"
-void rom68k_open();
+static void rom68k_open PARAMS ((char *args, int from_tty));
+
+static void
+rom68k_supply_register (regname, regnamelen, val, vallen)
+ char *regname;
+ int regnamelen;
+ char *val;
+ int vallen;
+{
+ int numregs;
+ int regno;
+
+ numregs = 1;
+ regno = -1;
+
+ if (regnamelen == 2)
+ switch (regname[0])
+ {
+ case 'S':
+ if (regname[1] == 'R')
+ regno = PS_REGNUM;
+ break;
+ case 'P':
+ if (regname[1] == 'C')
+ regno = PC_REGNUM;
+ break;
+ case 'D':
+ if (regname[1] != 'R')
+ break;
+ regno = D0_REGNUM;
+ numregs = 8;
+ break;
+ case 'A':
+ if (regname[1] != 'R')
+ break;
+ regno = A0_REGNUM;
+ numregs = 7;
+ break;
+ }
+ else if (regnamelen == 3)
+ switch (regname[0])
+ {
+ case 'I':
+ if (regname[1] == 'S' && regname[2] == 'P')
+ regno = SP_REGNUM;
+ }
+
+ if (regno >= 0)
+ while (numregs-- > 0)
+ val = monitor_supply_register (regno++, val);
+}
/*
* this array of registers need to match the indexes used by GDB. The
NULL, /* setreg.term_cmd */
},
{
- "dm %x 1\r", /* getmem.cmd (addr) */
+ "dm %x %x\r", /* getmem.cmd (addr, len) */
" ", /* getmem.resp_delim */
NULL, /* getmem.term */
NULL, /* getmem.term_cmd */
"= ", /* getreg.term */
".\r" /* getreg.term_cmd */
},
+ /* register_pattern */
+ "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)",
+ rom68k_supply_register, /* supply_register */
"dc\r", /* download command */
"ROM68K :->", /* monitor command prompt */
"=", /* end-of-command delimitor */