From adc176bb645a05d8cd5ef6ee13957e03cc73a9f9 Mon Sep 17 00:00:00 2001 From: John Metzler Date: Mon, 27 Apr 1998 21:11:07 +0000 Subject: Mon Apr 27 13:46:40 1998 John Metzler * rom68k-rom.c (_initialize_rom68k init_rom68k_cmds): * abug-rom.c (_initialize_abug_rom init_abug-cmds): * cpu32bug-rom.c (_initialize_cpu32bug_rom init_cpu32bug_cmds): * mon960-rom.c (initialize_mon960 init_mon960_cmds): * op50-rom.c (initialize_op50n init_op50n_cmds) : * ppcbug-rom.c (_initialize_ppcbug_rom init_ppc_cmds) : * sh3-rom.c (_initialize_sh3_rom init_sh3_cmds) : * sparclet-rom.c (_initialize_sparcletinit_sparclet_cmds ) : * remote-est.c ( _initialize_est init_est_cmds) : * remote-hms.c ( _initialize_remote_hms init_hms_cmds) : Convert all static initializations of monitor ops structures to executable initializations in oreer tat additions to the data structure definition can me made without repeating this editing exercise --- gdb/ChangeLog | 16 +++++++ gdb/abug-rom.c | 103 +++++++++++++++++++++----------------------- gdb/cpu32bug-rom.c | 102 +++++++++++++++++++++---------------------- gdb/mon960-rom.c | 119 ++++++++++++++++++++++++-------------------------- gdb/op50-rom.c | 116 ++++++++++++++++++++++++------------------------- gdb/ppcbug-rom.c | 108 ++++++++++++++++++++++------------------------ gdb/remote-est.c | 104 +++++++++++++++++++++----------------------- gdb/remote-hms.c | 103 +++++++++++++++++++++----------------------- gdb/rom68k-rom.c | 104 +++++++++++++++++++++----------------------- gdb/sh3-rom.c | 104 +++++++++++++++++++++----------------------- gdb/sparclet-rom.c | 124 +++++++++++++++++++++++++---------------------------- 11 files changed, 528 insertions(+), 575 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2e1bf02..dad132d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,19 @@ +Mon Apr 27 13:46:40 1998 John Metzler + + * rom68k-rom.c (_initialize_rom68k init_rom68k_cmds): + * abug-rom.c (_initialize_abug_rom init_abug-cmds): + * cpu32bug-rom.c (_initialize_cpu32bug_rom init_cpu32bug_cmds): + * mon960-rom.c (initialize_mon960 init_mon960_cmds): + * op50-rom.c (initialize_op50n init_op50n_cmds) : + * ppcbug-rom.c (_initialize_ppcbug_rom init_ppc_cmds) : + * sh3-rom.c (_initialize_sh3_rom init_sh3_cmds) : + * sparclet-rom.c (_initialize_sparcletinit_sparclet_cmds ) : + * remote-est.c ( _initialize_est init_est_cmds) : + * remote-hms.c ( _initialize_remote_hms init_hms_cmds) : + Convert all static initializations of monitor ops structures to + executable initializations in oreer tat additions to the data structure + definition can me made without repeating this editing exercise. + Mon Apr 27 10:43:04 1998 Jason Molenda (crash@bugshack.cygnus.com) * gdb_string.h (strdup): Don't specify arguments in prototype. diff --git a/gdb/abug-rom.c b/gdb/abug-rom.c index 4c02b96..8720c99 100644 --- a/gdb/abug-rom.c +++ b/gdb/abug-rom.c @@ -92,61 +92,55 @@ static struct target_ops abug_ops; static char *abug_inits[] = {"\r", NULL}; -static struct monitor_ops abug_cmds = +static struct monitor_ops abug_cmds ; + +static void init_abug_cmds(void) { - MO_CLR_BREAK_USES_ADDR, - abug_inits, /* Init strings */ - "g\r", /* continue command */ - "t\r", /* single step */ - NULL, /* interrupt command */ - "br %x\r", /* set a breakpoint */ - "nobr %x\r", /* clear a breakpoint */ - "nobr\r", /* clear all breakpoints */ - "bf %x:%x %x;b\r", /* fill (start count val) */ - { - "ms %x %02x\r", /* setmem.cmdb (addr, value) */ - "ms %x %04x\r", /* setmem.cmdw (addr, value) */ - "ms %x %08x\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "md %x:%x;b\r", /* getmem.cmdb (addr, len) */ - "md %x:%x;b\r", /* getmem.cmdw (addr, len) */ - "md %x:%x;b\r", /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - " ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, - { - "rm %s %x\r", /* setreg.cmd (name, value) */ - "=", /* setreg.resp_delim */ - "? ", /* setreg.term */ - ".\r" /* setreg.term_cmd */ - }, - { - "rm %s\r", /* getreg.cmd (name) */ - "=", /* getreg.resp_delim */ - "? ", /* getreg.term */ - ".\r" /* getreg.term_cmd */ - }, - "rd\r", /* dump_registers */ - "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)", /* register_pattern */ - abug_supply_register, /* supply_register */ - NULL, /* load_routine (defaults to SRECs) */ - "lo 0\r", /* download command */ - "\n", /* load response */ - "135Bug>", /* monitor command prompt */ - "\r", /* end-of-line terminator */ - NULL, /* optional command terminator */ - &abug_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - abug_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ - }; + abug_cmds.flags = MO_CLR_BREAK_USES_ADDR; + abug_cmds.init = abug_inits; /* Init strings */ + abug_cmds.cont = "g\r"; /* continue command */ + abug_cmds.step = "t\r"; /* single step */ + abug_cmds.stop = NULL; /* interrupt command */ + abug_cmds.set_break = "br %x\r"; /* set a breakpoint */ + abug_cmds.clr_break = "nobr %x\r"; /* clear a breakpoint */ + abug_cmds.clr_all_break = "nobr\r"; /* clear all breakpoints */ + abug_cmds.fill = "bf %x:%x %x;b\r"; /* fill (start count val) */ + abug_cmds.setmem.cmdb = "ms %x %02x\r"; /* setmem.cmdb (addr, value) */ + abug_cmds.setmem.cmdw = "ms %x %04x\r"; /* setmem.cmdw (addr, value) */ + abug_cmds.setmem.cmdl = "ms %x %08x\r"; /* setmem.cmdl (addr, value) */ + abug_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + abug_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */ + abug_cmds.setmem.term = NULL; /* setreg.term */ + abug_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */ + abug_cmds.getmem.cmdb = "md %x:%x;b\r"; /* getmem.cmdb (addr, len) */ + abug_cmds.getmem.cmdw = "md %x:%x;b\r"; /* getmem.cmdw (addr, len) */ + abug_cmds.getmem.cmdl = "md %x:%x;b\r"; /* getmem.cmdl (addr, len) */ + abug_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + abug_cmds.getmem.resp_delim = " "; /* getmem.resp_delim */ + abug_cmds.getmem.term = NULL; /* getmem.term */ + abug_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ + abug_cmds.setreg.cmd = "rm %s %x\r"; /* setreg.cmd (name, value) */ + abug_cmds.setreg.resp_delim = "="; /* setreg.resp_delim */ + abug_cmds.setreg.term = "? "; /* setreg.term */ + abug_cmds.setreg.term_cmd = ".\r" ; /* setreg.term_cmd */ + abug_cmds.getreg.cmd = "rm %s\r"; /* getreg.cmd (name) */ + abug_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */ + abug_cmds.getreg.term = "? "; /* getreg.term */ + abug_cmds.getreg.term_cmd = ".\r" ; /* getreg.term_cmd */ + abug_cmds.dump_registers = "rd\r"; /* dump_registers */ + abug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ + abug_cmds.supply_register = abug_supply_register; /* supply_register */ + abug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ + abug_cmds.load = "lo 0\r"; /* download command */ + abug_cmds.loadresp = "\n"; /* load response */ + abug_cmds.prompt = "135Bug>"; /* monitor command prompt */ + abug_cmds.line_term = "\r"; /* end-of-line terminator */ + abug_cmds.cmd_end = NULL; /* optional command terminator */ + abug_cmds.target = &abug_ops; /* target operations */ + abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + abug_cmds.regnames = abug_regnames; /* registers names */ + abug_cmds.magic = MONITOR_OPS_MAGIC ; /* magic */ +}; static void abug_open(args, from_tty) @@ -159,6 +153,7 @@ abug_open(args, from_tty) void _initialize_abug_rom () { + init_abug_cmds() ; init_monitor_ops (&abug_ops); abug_ops.to_shortname = "abug"; diff --git a/gdb/cpu32bug-rom.c b/gdb/cpu32bug-rom.c index 58052c8..29a1fc2 100644 --- a/gdb/cpu32bug-rom.c +++ b/gdb/cpu32bug-rom.c @@ -92,61 +92,54 @@ static struct target_ops cpu32bug_ops; static char *cpu32bug_inits[] = {"\r", NULL}; -static struct monitor_ops cpu32bug_cmds = +static struct monitor_ops cpu32bug_cmds ; +static void init_cpu32bug_cmds(void) { - MO_CLR_BREAK_USES_ADDR, - cpu32bug_inits, /* Init strings */ - "g\r", /* continue command */ - "t\r", /* single step */ - NULL, /* interrupt command */ - "br %x\r", /* set a breakpoint */ - "nobr %x\r", /* clear a breakpoint */ - "nobr\r", /* clear all breakpoints */ - "bf %x:%x %x;b\r", /* fill (start count val) */ - { - "ms %x %02x\r", /* setmem.cmdb (addr, value) */ - "ms %x %04x\r", /* setmem.cmdw (addr, value) */ - "ms %x %08x\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "md %x:%x;b\r", /* getmem.cmdb (addr, len) */ - "md %x:%x;b\r", /* getmem.cmdw (addr, len) */ - "md %x:%x;b\r", /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - " ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, - { - "rs %s %x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - "rs %s\r", /* getreg.cmd (name) */ - "=", /* getreg.resp_delim */ - NULL, /* getreg.term */ - NULL /* getreg.term_cmd */ - }, - "rd\r", /* dump_registers */ - "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)", /* register_pattern */ - cpu32bug_supply_register, /* supply_register */ - NULL, /* load_routine (defaults to SRECs) */ - "lo\r", /* download command */ - "\n", /* load response */ - "CPU32Bug>", /* monitor command prompt */ - "\r", /* end-of-line terminator */ - NULL, /* optional command terminator */ - &cpu32bug_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - cpu32bug_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ - }; + cpu32bug_cmds.flags = MO_CLR_BREAK_USES_ADDR; + cpu32bug_cmds.init = cpu32bug_inits; /* Init strings */ + cpu32bug_cmds.cont = "g\r"; /* continue command */ + cpu32bug_cmds.step = "t\r"; /* single step */ + cpu32bug_cmds.stop = NULL; /* interrupt command */ + cpu32bug_cmds.set_break = "br %x\r"; /* set a breakpoint */ + cpu32bug_cmds.clr_break = "nobr %x\r"; /* clear a breakpoint */ + cpu32bug_cmds.clr_all_break = "nobr\r"; /* clear all breakpoints */ + cpu32bug_cmds.fill = "bf %x:%x %x;b\r"; /* fill (start count val) */ + cpu32bug_cmds.setmem.cmdb = "ms %x %02x\r"; /* setmem.cmdb (addr, value) */ + cpu32bug_cmds.setmem.cmdw = "ms %x %04x\r"; /* setmem.cmdw (addr, value) */ + cpu32bug_cmds.setmem.cmdl = "ms %x %08x\r"; /* setmem.cmdl (addr, value) */ + cpu32bug_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + cpu32bug_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */ + cpu32bug_cmds.setmem.term = NULL; /* setreg.term */ + cpu32bug_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */ + cpu32bug_cmds.getmem.cmdb = "md %x:%x;b\r"; /* getmem.cmdb (addr, len) */ + cpu32bug_cmds.getmem.cmdw = "md %x:%x;b\r"; /* getmem.cmdw (addr, len) */ + cpu32bug_cmds.getmem.cmdl = "md %x:%x;b\r"; /* getmem.cmdl (addr, len) */ + cpu32bug_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + cpu32bug_cmds.getmem.resp_delim = " "; /* getmem.resp_delim */ + cpu32bug_cmds.getmem.term = NULL; /* getmem.term */ + cpu32bug_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ + cpu32bug_cmds.setreg.cmd = "rs %s %x\r"; /* setreg.cmd (name, value) */ + cpu32bug_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ + cpu32bug_cmds.setreg.term = NULL; /* setreg.term */ + cpu32bug_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */ + cpu32bug_cmds.getreg.cmd = "rs %s\r"; /* getreg.cmd (name) */ + cpu32bug_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */ + cpu32bug_cmds.getreg.term = NULL; /* getreg.term */ + cpu32bug_cmds.getreg.term_cmd = NULL ; /* getreg.term_cmd */ + cpu32bug_cmds.dump_registers = "rd\r"; /* dump_registers */ + cpu32bug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ + cpu32bug_cmds.supply_register = cpu32bug_supply_register; /* supply_register */ + cpu32bug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ + cpu32bug_cmds.load = "lo\r"; /* download command */ + cpu32bug_cmds.loadresp = "\n"; /* load response */ + cpu32bug_cmds.prompt = "CPU32Bug>"; /* monitor command prompt */ + cpu32bug_cmds.line_term = "\r"; /* end-of-line terminator */ + cpu32bug_cmds.cmd_end = NULL; /* optional command terminator */ + cpu32bug_cmds.target = &cpu32bug_ops; /* target operations */ + cpu32bug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + cpu32bug_cmds.regnames = cpu32bug_regnames; /* registers names */ + cpu32bug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */ +}; /* init_cpu32bug_cmds */ static void cpu32bug_open(args, from_tty) @@ -159,6 +152,7 @@ cpu32bug_open(args, from_tty) void _initialize_cpu32bug_rom () { + init_cpu32bug_cmds() ; init_monitor_ops (&cpu32bug_ops); cpu32bug_ops.to_shortname = "cpu32bug"; diff --git a/gdb/mon960-rom.c b/gdb/mon960-rom.c index b7684e7..f5adbc7 100644 --- a/gdb/mon960-rom.c +++ b/gdb/mon960-rom.c @@ -148,75 +148,66 @@ static char *mon960_inits[] = {"\n\r\r\r\r\r\r\r\r\r\r\r\r\r\r\n\r\n\r\n", NULL} static char *mon960_inits[] = { "\r", NULL}; #endif -static struct monitor_ops mon960_cmds = +static struct monitor_ops mon960_cmds ; +static void init_mon960_cmds(void) { - MO_CLR_BREAK_USES_ADDR - | MO_NO_ECHO_ON_OPEN - | MO_SEND_BREAK_ON_STOP - | MO_GETMEM_READ_SINGLE, /* flags */ - mon960_inits, /* Init strings */ - "go\n\r", /* continue command */ - "st\n\r", /* single step */ - NULL, /* break interrupts the program */ - NULL, /* set a breakpoint */ - /* can't use "br" because only 2 hw bps are supported */ - NULL, /* clear a breakpoint - "de" is for hw bps */ + mon960_cmds.flags = MO_CLR_BREAK_USES_ADDR + | MO_NO_ECHO_ON_OPEN | MO_SEND_BREAK_ON_STOP | MO_GETMEM_READ_SINGLE ; /* flags */ + mon960_cmds.init = mon960_inits; /* Init strings */ + mon960_cmds.cont = "go\n\r"; /* continue command */ + mon960_cmds.step = "st\n\r"; /* single step */ + mon960_cmds.stop = NULL; /* break interrupts the program */ + mon960_cmds.set_break = NULL; /* set a breakpoint */ + mon960_cmds.clr_break = /* can't use "br" because only 2 hw bps are supported */ + mon960_cmds.clr_all_break = NULL; /* clear a breakpoint - "de" is for hw bps */ NULL, /* clear all breakpoints */ - NULL, /* fill (start end val) */ - /* can't use "fi" because it takes words, not bytes */ - { - /* can't use "mb", "md" or "mo" because they require interaction */ - NULL, /* setmem.cmdb (addr, value) */ - NULL, /* setmem.cmdw (addr, value) */ - "md %x %x\n\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setmem.resp_delim */ - NULL, /* setmem.term */ - NULL, /* setmem.term_cmd */ - }, - { - /* since the parsing of multiple bytes is difficult due to - interspersed addresses, we'll only read 1 value at a time, - even tho these can handle a count */ - "db %x\n\r", /* getmem.cmdb (addr, #bytes) */ - "ds %x\n\r", /* getmem.cmdw (addr, #swords) */ - "di %x\n\r", /* getmem.cmdl (addr, #words) */ - "dd %x\n\r", /* getmem.cmdll (addr, #dwords) */ - " : ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, - { - "md %s %x\n\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - "di %s\n\r", /* getreg.cmd (name) */ - " : ", /* getreg.resp_delim */ - NULL, /* getreg.term */ - NULL, /* getreg.term_cmd */ - }, - "re\n\r", /* dump_registers */ - "\\(\\w+\\)=\\([0-9a-fA-F]+\\)", /* register_pattern */ - NULL, /* supply_register */ + mon960_cmds.fill = NULL; /* fill (start end val) */ + /* can't use "fi" because it takes words, not bytes */ + /* can't use "mb", "md" or "mo" because they require interaction */ + mon960_cmds.setmem.cmdb = NULL; /* setmem.cmdb (addr, value) */ + mon960_cmds.setmem.cmdw = NULL; /* setmem.cmdw (addr, value) */ + mon960_cmds.setmem.cmdl = "md %x %x\n\r"; /* setmem.cmdl (addr, value) */ + mon960_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + mon960_cmds.setmem.resp_delim = NULL; /* setmem.resp_delim */ + mon960_cmds.setmem.term = NULL; /* setmem.term */ + mon960_cmds.setmem.term_cmd = NULL; /* setmem.term_cmd */ + /* since the parsing of multiple bytes is difficult due to + interspersed addresses, we'll only read 1 value at a time, + even tho these can handle a count */ + mon960_cmds.getmem.cmdb = "db %x\n\r"; /* getmem.cmdb (addr, #bytes) */ + mon960_cmds.getmem.cmdw = "ds %x\n\r"; /* getmem.cmdw (addr, #swords) */ + mon960_cmds.getmem.cmdl = "di %x\n\r"; /* getmem.cmdl (addr, #words) */ + mon960_cmds.getmem.cmdll = "dd %x\n\r"; /* getmem.cmdll (addr, #dwords) */ + mon960_cmds.getmem.resp_delim = " : "; /* getmem.resp_delim */ + mon960_cmds.getmem.term = NULL; /* getmem.term */ + mon960_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ + mon960_cmds.setreg.cmd = "md %s %x\n\r"; /* setreg.cmd (name, value) */ + mon960_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ + mon960_cmds.setreg.term = NULL; /* setreg.term */ + mon960_cmds.setreg.term_cmd = NULL, /* setreg.term_cmd */ + mon960_cmds.getreg.cmd = "di %s\n\r"; /* getreg.cmd (name) */ + mon960_cmds.getreg.resp_delim = " : "; /* getreg.resp_delim */ + mon960_cmds.getreg.term = NULL; /* getreg.term */ + mon960_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ + mon960_cmds.dump_registers = "re\n\r"; /* dump_registers */ + mon960_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */ + mon960_cmds.supply_register = NULL; /* supply_register */ #ifdef USE_GENERIC_LOAD - NULL, /* load_routine (defaults to SRECs) */ - NULL, /* download command */ - NULL, /* load response */ + mon960_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ + mon960_cmds.load = NULL; /* download command */ + mon960_cmds.loadresp = NULL; /* load response */ #else - mon960_load, /* load_routine (defaults to SRECs) */ - "do\n\r", /* download command */ - "Downloading\n\r", /* load response */ + mon960_cmds.load_routine = mon960_load ; /* load_routine (defaults to SRECs) */ + mon960_cmds.load = "do\n\r"; /* download command */ + mon960_cmds.loadresp = "Downloading\n\r" ;/* load response */ #endif - "=>", /* monitor command prompt */ - "\n\r", /* end-of-command delimitor */ - NULL, /* optional command terminator */ - &mon960_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - mon960_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ + mon960_cmds.prompt = "=>"; /* monitor command prompt */ + mon960_cmds.line_term = "\n\r"; /* end-of-command delimitor */ + mon960_cmds.cmd_end = NULL; /* optional command terminator */ + mon960_cmds.target = &mon960_ops; /* target operations */ + mon960_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + mon960_cmds.regnames = mon960_regnames; /* registers names */ + mon960_cmds.magic = MONITOR_OPS_MAGIC; /* magic */ }; static void diff --git a/gdb/op50-rom.c b/gdb/op50-rom.c index f8cb7fa..b12e1df 100644 --- a/gdb/op50-rom.c +++ b/gdb/op50-rom.c @@ -55,73 +55,66 @@ static struct target_ops op50n_ops; static char *op50n_inits[] = {".\r", NULL}; -static struct monitor_ops op50n_cmds = +static struct monitor_ops op50n_cmds ; +static void init_op50n_cmds(void) { - MO_CLR_BREAK_USES_ADDR /*| MO_GETMEM_READ_SINGLE*/, /* flags */ - op50n_inits, /* Init strings */ - "g\r", /* continue command */ - "t\r", /* single step */ - "\003.\r", /* Interrupt char */ - "b %x\r", /* set a breakpoint */ - "b %x,0\r", /* clear breakpoint at addr */ - "bx\r", /* clear all breakpoints */ - "fx %x s%x %x\r", /* memory fill cmd (addr, len, val) */ - { - "sx %x %x\r", /* setmem.cmdb (addr, value) */ - "sh %x %x\r", /* setmem.cmdw (addr, value) */ - "s %x %x\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setmem.resp_delim */ - NULL, /* setmem.term */ - NULL, /* setmem.term_cmd */ - }, + op50n_cmds.flags = MO_CLR_BREAK_USES_ADDR /*| MO_GETMEM_READ_SINGLE*/; /* flags */ + op50n_cmds.init = op50n_inits; /* Init strings */ + op50n_cmds.cont = "g\r"; /* continue command */ + op50n_cmds.step = "t\r"; /* single step */ + op50n_cmds.stop = "\003.\r"; /* Interrupt char */ + op50n_cmds.set_break = "b %x\r"; /* set a breakpoint */ + op50n_cmds.clr_break = "b %x;0\r"; /* clear breakpoint at addr */ + op50n_cmds.clr_all_break = "bx\r"; /* clear all breakpoints */ + op50n_cmds.fill = "fx %x s%x %x\r"; /* memory fill cmd (addr, len, val) */ + op50n_cmds.setmem.cmdb = "sx %x %x\r"; /* setmem.cmdb (addr, value) */ + op50n_cmds.setmem.cmdw = "sh %x %x\r"; /* setmem.cmdw (addr, value) */ + op50n_cmds.setmem.cmdl = "s %x %x\r"; /* setmem.cmdl (addr, value) */ + op50n_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + op50n_cmds.setmem.resp_delim = NULL; /* setmem.resp_delim */ + op50n_cmds.setmem.term = NULL; /* setmem.term */ + op50n_cmds.setmem.term_cmd = NULL; /* setmem.term_cmd */ #if 0 { "sx %x\r", /* getmem.cmdb (addr, len) */ - "sh %x\r", /* getmem.cmdw (addr, len) */ - "s %x\r", /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - " : ", /* getmem.resp_delim */ - " ", /* getmem.term */ - ".\r", /* getmem.term_cmd */ - }, + "sh %x\r", /* getmem.cmdw (addr, len) */ + "s %x\r", /* getmem.cmdl (addr, len) */ + NULL, /* getmem.cmdll (addr, len) */ + " : ", /* getmem.resp_delim */ + " ", /* getmem.term */ + ".\r", /* getmem.term_cmd */ + } ; #else - { - "dx %x s%x\r", /* getmem.cmdb (addr, len) */ - NULL, /* getmem.cmdw (addr, len) */ - NULL, /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - " : ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, + op50n_cmds.getmem.cmdb = "dx %x s%x\r"; /* getmem.cmdb (addr, len) */ + op50n_cmds.getmem.cmdw = NULL; /* getmem.cmdw (addr, len) */ + op50n_cmds.getmem.cmdl = NULL; /* getmem.cmdl (addr, len) */ + op50n_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + op50n_cmds.getmem.resp_delim = " : "; /* getmem.resp_delim */ + op50n_cmds.getmem.term = NULL; /* getmem.term */ + op50n_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ #endif - { - "x %s %x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "x %s\r", /* getreg.cmd (name) */ - "=", /* getreg.resp_delim */ - " ", /* getreg.term */ - ".\r", /* getreg.term_cmd */ - }, - NULL, /* dump_registers */ - NULL, /* register_pattern */ - NULL, /* supply_register */ - NULL, /* load routine */ - "r 0\r", /* download command */ - NULL, /* load response */ - "\n#", /* monitor command prompt */ - "\r", /* end-of-command delimitor */ - NULL, /* optional command terminator */ - &op50n_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - op50n_regnames, /* register names */ - MONITOR_OPS_MAGIC /* magic */ - }; + op50n_cmds.setreg.cmd = "x %s %x\r"; /* setreg.cmd (name, value) */ + op50n_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ + op50n_cmds.setreg.term = NULL; /* setreg.term */ + op50n_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */ + op50n_cmds.getreg.cmd = "x %s\r"; /* getreg.cmd (name) */ + op50n_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */ + op50n_cmds.getreg.term = " "; /* getreg.term */ + op50n_cmds.getreg.term_cmd = ".\r"; /* getreg.term_cmd */ + op50n_cmds.dump_registers = NULL; /* dump_registers */ + op50n_cmds.register_pattern = NULL; /* register_pattern */ + op50n_cmds.supply_register = NULL; /* supply_register */ + op50n_cmds.load_routine = NULL; /* load routine */ + op50n_cmds.load = "r 0\r"; /* download command */ + op50n_cmds.loadresp = NULL; /* load response */ + op50n_cmds.prompt = "\n#"; /* monitor command prompt */ + op50n_cmds.line_term = "\r"; /* end-of-command delimitor */ + op50n_cmds.cmd_end = NULL; /* optional command terminator */ + op50n_cmds.target = &op50n_ops; /* target operations */ + op50n_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + op50n_cmds.regnames = op50n_regnames; /* register names */ + op50n_cmds.magic = MONITOR_OPS_MAGIC; /* magic */ +}; static void op50n_open (args, from_tty) @@ -134,6 +127,7 @@ op50n_open (args, from_tty) void _initialize_op50n () { + init_op50n_cmds() ; init_monitor_ops (&op50n_ops); op50n_ops.to_shortname = "op50n"; diff --git a/gdb/ppcbug-rom.c b/gdb/ppcbug-rom.c index 6c7432b..76dd5be 100644 --- a/gdb/ppcbug-rom.c +++ b/gdb/ppcbug-rom.c @@ -132,65 +132,59 @@ static struct target_ops ppcbug_ops1; static char *ppcbug_inits[] = {"\r", NULL}; -#define PPC_CMDS(LOAD_CMD, OPS) \ -{ \ - MO_CLR_BREAK_USES_ADDR | MO_HANDLE_NL, \ - ppcbug_inits, /* Init strings */ \ - "g\r", /* continue command */ \ - "t\r", /* single step */ \ - NULL, /* interrupt command */ \ - "br %x\r", /* set a breakpoint */ \ - "nobr %x\r", /* clear a breakpoint */ \ - "nobr\r", /* clear all breakpoints */ \ - "bf %x:%x %x;b\r", /* fill (start count val) */ \ - { \ - "ms %x %02x\r", /* setmem.cmdb (addr, value) */ \ - "ms %x %04x\r", /* setmem.cmdw (addr, value) */ \ - "ms %x %08x\r", /* setmem.cmdl (addr, value) */ \ - NULL, /* setmem.cmdll (addr, value) */ \ - NULL, /* setreg.resp_delim */ \ - NULL, /* setreg.term */ \ - NULL, /* setreg.term_cmd */ \ - }, \ - { \ - "md %x:%x;b\r", /* getmem.cmdb (addr, len) */ \ - "md %x:%x;b\r", /* getmem.cmdw (addr, len) */ \ - "md %x:%x;b\r", /* getmem.cmdl (addr, len) */ \ - NULL, /* getmem.cmdll (addr, len) */ \ - " ", /* getmem.resp_delim */ \ - NULL, /* getmem.term */ \ - NULL, /* getmem.term_cmd */ \ - }, \ - { \ - "rs %s %x\r", /* setreg.cmd (name, value) */ \ - NULL, /* setreg.resp_delim */ \ - NULL, /* setreg.term */ \ - NULL /* setreg.term_cmd */ \ - }, \ - { \ - "rs %s\r", /* getreg.cmd (name) */ \ - "=", /* getreg.resp_delim */ \ - NULL, /* getreg.term */ \ - NULL /* getreg.term_cmd */ \ - }, \ - "rd\r", /* dump_registers */ \ - "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)", /* register_pattern */ \ - ppcbug_supply_register, /* supply_register */ \ - NULL, /* load_routine (defaults to SRECs) */ \ - LOAD_CMD, /* download command */ \ - NULL, /* load response */ \ - "PPC1-Bug>", /* monitor command prompt */ \ - "\r", /* end-of-line terminator */ \ - NULL, /* optional command terminator */ \ - &OPS, /* target operations */ \ - SERIAL_1_STOPBITS, /* number of stop bits */ \ - ppcbug_regnames, /* registers names */ \ - MONITOR_OPS_MAGIC /* magic */ \ +static void init_ppc_cmds( + char * LOAD_CMD, + struct monitor_ops * OPS, + struct target_ops * targops) +{ + OPS->flags = MO_CLR_BREAK_USES_ADDR | MO_HANDLE_NL; + OPS->init = ppcbug_inits; /* Init strings */ + OPS->cont = "g\r"; /* continue command */ + OPS->step = "t\r"; /* single step */ + OPS->stop = NULL; /* interrupt command */ + OPS->set_break = "br %x\r"; /* set a breakpoint */ + OPS->clr_break = "nobr %x\r"; /* clear a breakpoint */ + OPS->clr_all_break = "nobr\r"; /* clear all breakpoints */ + OPS->fill = "bf %x:%x %x;b\r"; /* fill (start count val) */ + OPS->setmem.cmdb = "ms %x %02x\r"; /* setmem.cmdb (addr, value) */ + OPS->setmem.cmdw = "ms %x %04x\r"; /* setmem.cmdw (addr, value) */ + OPS->setmem.cmdl = "ms %x %08x\r"; /* setmem.cmdl (addr, value) */ + OPS->setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + OPS->setmem.resp_delim = NULL; /* setreg.resp_delim */ + OPS->setmem.term = NULL; /* setreg.term */ + OPS->setmem.term_cmd = NULL; /* setreg.term_cmd */ + OPS->getmem.cmdb = "md %x:%x;b\r"; /* getmem.cmdb (addr, len) */ + OPS->getmem.cmdw = "md %x:%x;b\r"; /* getmem.cmdw (addr, len) */ + OPS->getmem.cmdl = "md %x:%x;b\r"; /* getmem.cmdl (addr, len) */ + OPS->getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + OPS->getmem.resp_delim = " "; /* getmem.resp_delim */ + OPS->getmem.term = NULL; /* getmem.term */ + OPS->getmem.term_cmd = NULL; /* getmem.term_cmd */ + OPS->setreg.cmd = "rs %s %x\r"; /* setreg.cmd (name, value) */ + OPS->setreg.resp_delim = NULL; /* setreg.resp_delim */ + OPS->setreg.term = NULL; /* setreg.term */ + OPS->setreg.term_cmd = NULL ; /* setreg.term_cmd */ + OPS->getreg.cmd = "rs %s\r"; /* getreg.cmd (name) */ + OPS->getreg.resp_delim = "="; /* getreg.resp_delim */ + OPS->getreg.term = NULL; /* getreg.term */ + OPS->getreg.term_cmd = NULL ; /* getreg.term_cmd */ + OPS->register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ + OPS->supply_register = ppcbug_supply_register; /* supply_register */ + OPS->load_routine = NULL; /* load_routine (defaults to SRECs) */ + OPS->load = LOAD_CMD; /* download command */ + OPS->loadresp = NULL; /* load response */ + OPS->prompt = "PPC1-Bug>"; /* monitor command prompt */ + OPS->line_term = "\r"; /* end-of-line terminator */ + OPS->cmd_end = NULL; /* optional command terminator */ + OPS->target = targops ; /* target operations */ + OPS->stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + OPS->regnames = ppcbug_regnames; /* registers names */ + OPS->magic = MONITOR_OPS_MAGIC ; /* magic */ } -static struct monitor_ops ppcbug_cmds0 = PPC_CMDS("lo 0\r", ppcbug_ops0); -static struct monitor_ops ppcbug_cmds1 = PPC_CMDS("lo 1\r", ppcbug_ops1); +static struct monitor_ops ppcbug_cmds0 ; +static struct monitor_ops ppcbug_cmds1 ; static void ppcbug_open0(args, from_tty) @@ -211,6 +205,8 @@ ppcbug_open1(args, from_tty) void _initialize_ppcbug_rom () { + init_ppc_cmds("lo 0\r", &ppcbug_cmds0, &ppcbug_ops0) ; + init_ppc_cmds("lo 1\r", &ppcbug_cmds1, &ppcbug_ops1); init_monitor_ops (&ppcbug_ops0); ppcbug_ops0.to_shortname = "ppcbug"; diff --git a/gdb/remote-est.c b/gdb/remote-est.c index 8862cc3..00d23b0 100644 --- a/gdb/remote-est.c +++ b/gdb/remote-est.c @@ -95,62 +95,55 @@ static struct target_ops est_ops; static char *est_inits[] = {"he\r", /* Resets the prompt, and clears repeated cmds */ NULL}; -static struct monitor_ops est_cmds = +static struct monitor_ops est_cmds ; +static void init_est_cmds(void) { - MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_NEED_REGDUMP_AFTER_CONT | - MO_SREC_ACK | MO_SREC_ACK_PLUS, - est_inits, /* Init strings */ - "go\r", /* continue command */ - "sidr\r", /* single step */ - "\003", /* ^C interrupts the program */ - "sb %x\r", /* set a breakpoint */ - "rb %x\r", /* clear a breakpoint */ - "rb\r", /* clear all breakpoints */ - "bfb %x %x %x\r", /* fill (start end val) */ - { - "smb %x %x\r", /* setmem.cmdb (addr, value) */ - "smw %x %x\r", /* setmem.cmdw (addr, value) */ - "sml %x %x\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "dmb %x %x\r", /* getmem.cmdb (addr, len) */ - "dmw %x %x\r", /* getmem.cmdw (addr, len) */ - "dml %x %x\r", /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - ": ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, - { - "sr %s %x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - "dr %s\r", /* getreg.cmd (name) */ - " = ", /* getreg.resp_delim */ - NULL, /* getreg.term */ - NULL /* getreg.term_cmd */ - }, - "dr\r", /* dump_registers */ - "\\(\\w+\\) = \\([0-9a-fA-F]+\\)", /* register_pattern */ - est_supply_register, /* supply_register */ - NULL, /* load_routine (defaults to SRECs) */ - "dl\r", /* download command */ - "+", /* load response */ - ">BKM>", /* monitor command prompt */ - "\r", /* end-of-line terminator */ - NULL, /* optional command terminator */ - &est_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - est_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ - }; + est_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_NEED_REGDUMP_AFTER_CONT | + MO_SREC_ACK | MO_SREC_ACK_PLUS ; + est_cmds.init = est_inits; /* Init strings */ + est_cmds.cont = "go\r"; /* continue command */ + est_cmds.step = "sidr\r"; /* single step */ + est_cmds.stop = "\003"; /* ^C interrupts the program */ + est_cmds.set_break = "sb %x\r"; /* set a breakpoint */ + est_cmds.clr_break = "rb %x\r"; /* clear a breakpoint */ + est_cmds.clr_all_break = "rb\r"; /* clear all breakpoints */ + est_cmds.fill = "bfb %x %x %x\r"; /* fill (start end val) */ + est_cmds.setmem.cmdb = "smb %x %x\r"; /* setmem.cmdb (addr, value) */ + est_cmds.setmem.cmdw = "smw %x %x\r"; /* setmem.cmdw (addr, value) */ + est_cmds.setmem.cmdl = "sml %x %x\r"; /* setmem.cmdl (addr, value) */ + est_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + est_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */ + est_cmds.setmem.term = NULL; /* setreg.term */ + est_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */ + est_cmds.getmem.cmdb = "dmb %x %x\r"; /* getmem.cmdb (addr, len) */ + est_cmds.getmem.cmdw = "dmw %x %x\r"; /* getmem.cmdw (addr, len) */ + est_cmds.getmem.cmdl = "dml %x %x\r"; /* getmem.cmdl (addr, len) */ + est_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + est_cmds.getmem.resp_delim = ": "; /* getmem.resp_delim */ + est_cmds.getmem.term = NULL; /* getmem.term */ + est_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ + est_cmds.setreg.cmd = "sr %s %x\r"; /* setreg.cmd (name, value) */ + est_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ + est_cmds.setreg.term = NULL; /* setreg.term */ + est_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */ + est_cmds.getreg.cmd = "dr %s\r"; /* getreg.cmd (name) */ + est_cmds.getreg.resp_delim = " = "; /* getreg.resp_delim */ + est_cmds.getreg.term = NULL; /* getreg.term */ + est_cmds.getreg.term_cmd = NULL ; /* getreg.term_cmd */ + est_cmds.dump_registers = "dr\r"; /* dump_registers */ + est_cmds.register_pattern = "\\(\\w+\\) = \\([0-9a-fA-F]+\\)"; /* register_pattern */ + est_cmds.supply_register = est_supply_register; /* supply_register */ + est_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ + est_cmds.load = "dl\r"; /* download command */ + est_cmds.loadresp = "+"; /* load response */ + est_cmds.prompt = ">BKM>"; /* monitor command prompt */ + est_cmds.line_term = "\r"; /* end-of-line terminator */ + est_cmds.cmd_end = NULL; /* optional command terminator */ + est_cmds.target = &est_ops; /* target operations */ + est_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + est_cmds.regnames = est_regnames; /* registers names */ + est_cmds.magic = MONITOR_OPS_MAGIC ; /* magic */ +} /* init_est_cmds */ static void est_open(args, from_tty) @@ -163,6 +156,7 @@ est_open(args, from_tty) void _initialize_est () { + init_est_cmds() ; init_monitor_ops (&est_ops); est_ops.to_shortname = "est"; diff --git a/gdb/remote-hms.c b/gdb/remote-hms.c index 6051c4f..2486505 100644 --- a/gdb/remote-hms.c +++ b/gdb/remote-hms.c @@ -26,7 +26,6 @@ #include "serial.h" static void hms_open PARAMS ((char *args, int from_tty)); - static void hms_supply_register (regname, regnamelen, val, vallen) char *regname; @@ -83,61 +82,54 @@ static char *hms_inits[] = {"\003", /* Resets the prompt, and clears repeated cmds */ NULL}; -static struct monitor_ops hms_cmds = +static struct monitor_ops hms_cmds ; +static void init_hms_cmds(void) { - MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_GETMEM_NEEDS_RANGE, - hms_inits, /* Init strings */ - "g\r", /* continue command */ - "s\r", /* single step */ - "\003", /* ^C interrupts the program */ - "b %x\r", /* set a breakpoint */ - "b - %x\r", /* clear a breakpoint */ - "b -\r", /* clear all breakpoints */ - "f %x %x %x\r", /* fill (start end val) */ - { - "m.b %x=%x\r", /* setmem.cmdb (addr, value) */ - "m.w %x=%x\r", /* setmem.cmdw (addr, value) */ - NULL, /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "m.b %x %x\r", /* getmem.cmdb (addr, addr) */ - "m.w %x %x\r", /* getmem.cmdw (addr, addr) */ - NULL, /* getmem.cmdl (addr, addr) */ - NULL, /* getmem.cmdll (addr, addr) */ - ": ", /* getmem.resp_delim */ - ">", /* getmem.term */ - "\003", /* getmem.term_cmd */ - }, - { - "r %s=%x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - "r %s\r", /* getreg.cmd (name) */ - " (", /* getreg.resp_delim */ - ":", /* getreg.term */ - "\003", /* getreg.term_cmd */ - }, - "r\r", /* dump_registers */ - "\\(\\w+\\)=\\([0-9a-fA-F]+\\)", /* register_pattern */ - hms_supply_register, /* supply_register */ - NULL, /* load_routine (defaults to SRECs) */ - "tl\r", /* download command */ - NULL, /* load response */ - ">", /* monitor command prompt */ - "\r", /* end-of-command delimitor */ - NULL, /* optional command terminator */ - &hms_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - hms_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ -}; + hms_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_GETMEM_NEEDS_RANGE; + hms_cmds.init = hms_inits; /* Init strings */ + hms_cmds.cont = "g\r"; /* continue command */ + hms_cmds.step = "s\r"; /* single step */ + hms_cmds.stop = "\003"; /* ^C interrupts the program */ + hms_cmds.set_break = "b %x\r"; /* set a breakpoint */ + hms_cmds.clr_break = "b - %x\r"; /* clear a breakpoint */ + hms_cmds.clr_all_break = "b -\r"; /* clear all breakpoints */ + hms_cmds.fill = "f %x %x %x\r"; /* fill (start end val) */ + hms_cmds.setmem.cmdb = "m.b %x=%x\r"; /* setmem.cmdb (addr, value) */ + hms_cmds.setmem.cmdw = "m.w %x=%x\r"; /* setmem.cmdw (addr, value) */ + hms_cmds.setmem.cmdl = NULL; /* setmem.cmdl (addr, value) */ + hms_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + hms_cmds.setmem.resp_delim = NULL;/* setreg.resp_delim */ + hms_cmds.setmem.term = NULL; /* setreg.term */ + hms_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */ + hms_cmds.getmem.cmdb = "m.b %x %x\r"; /* getmem.cmdb (addr, addr) */ + hms_cmds.getmem.cmdw = "m.w %x %x\r"; /* getmem.cmdw (addr, addr) */ + hms_cmds.getmem.cmdl = NULL; /* getmem.cmdl (addr, addr) */ + hms_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, addr) */ + hms_cmds.getmem.resp_delim = ": ";/* getmem.resp_delim */ + hms_cmds.getmem.term = ">"; /* getmem.term */ + hms_cmds.getmem.term_cmd = "\003";/* getmem.term_cmd */ + hms_cmds.setreg.cmd = "r %s=%x\r";/* setreg.cmd (name, value) */ + hms_cmds.setreg.resp_delim = NULL;/* setreg.resp_delim */ + hms_cmds.setreg.term = NULL; /* setreg.term */ + hms_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */ + hms_cmds.getreg.cmd = "r %s\r"; /* getreg.cmd (name) */ + hms_cmds.getreg.resp_delim = " (";/* getreg.resp_delim */ + hms_cmds.getreg.term = ":"; /* getreg.term */ + hms_cmds.getreg.term_cmd = "\003";/* getreg.term_cmd */ + hms_cmds.dump_registers = "r\r"; /* dump_registers */ + hms_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */ + hms_cmds.supply_register = hms_supply_register; /* supply_register */ + hms_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ + hms_cmds.load = "tl\r"; /* download command */ + hms_cmds.loadresp = NULL; /* load response */ + hms_cmds.prompt = ">"; /* monitor command prompt */ + hms_cmds.line_term = "\r"; /* end-of-command delimitor */ + hms_cmds.cmd_end = NULL; /* optional command terminator */ + hms_cmds.target = &hms_ops; /* target operations */ + hms_cmds.stopbits = SERIAL_1_STOPBITS;/* number of stop bits */ + hms_cmds.regnames = hms_regnames; /* registers names */ + hms_cmds.magic = MONITOR_OPS_MAGIC; /* magic */ +} /* init_hms-cmds */ static void hms_open (args, from_tty) @@ -152,6 +144,7 @@ int write_dos_tick_delay; void _initialize_remote_hms () { + init_hms_cmds() ; init_monitor_ops (&hms_ops); hms_ops.to_shortname = "hms"; diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index 208d9aa..0adb87e 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -93,62 +93,55 @@ static struct target_ops rom68k_ops; static char *rom68k_inits[] = {".\r\r", NULL}; /* Exits pm/pr & download cmds */ -static struct monitor_ops rom68k_cmds = +static struct monitor_ops rom68k_cmds ; +static void init_rom68k_cmds(void) { - 0, /* flags */ - rom68k_inits, /* monitor init string */ - "go\r", /* continue command */ - "st\r", /* single step */ - NULL, /* No way to interrupt program */ - "db %x\r", /* set a breakpoint */ - "cb %x\r", /* clear a breakpoint */ - "cb *\r", /* clear all breakpoints */ - "fm %x %x %x\r", /* fill (start len val) */ - { - "pm %x %x\r", /* setmem.cmdb (addr, value) */ - "pm.w %x %x\r", /* setmem.cmdw (addr, value) */ - "pm.l %x %x\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "dm %x %x\r", /* getmem.cmdb (addr, len) */ - "dm.w %x %x\r", /* getmem.cmdw (addr, len) */ - "dm.l %x %x\r", /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - " ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, - { - "pr %s %x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - "pr %s\r", /* getreg.cmd (name) */ - ": ", /* getreg.resp_delim */ - "= ", /* getreg.term */ - ".\r" /* getreg.term_cmd */ - }, - "dr\r", /* dump_registers */ - /* register_pattern */ - "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)", - rom68k_supply_register, /* supply_register */ - NULL, /* load_routine (defaults to SRECs) */ - "dc\r", /* download command */ - "Waiting for S-records from host... ", /* Load response */ - "ROM68K :-> ", /* monitor command prompt */ - "\r", /* end-of-line terminator */ - ".\r", /* optional command terminator */ - &rom68k_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - rom68k_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ -}; + rom68k_cmds.flags = 0; + rom68k_cmds.init = rom68k_inits; /* monitor init string */ + rom68k_cmds.cont = "go\r"; + rom68k_cmds.step = "st\r"; + rom68k_cmds.stop = NULL; + rom68k_cmds.set_break = "db %x\r"; + rom68k_cmds.clr_break = "cb %x\r"; + rom68k_cmds.clr_all_break = "cb *\r"; + rom68k_cmds.fill = "fm %x %x %x\r"; + rom68k_cmds.setmem.cmdb = "pm %x %x\r"; + rom68k_cmds.setmem.cmdw = "pm;w %x %x\r"; + rom68k_cmds.setmem.cmdl = "pm;l %x %x\r"; + rom68k_cmds.setmem.cmdll = NULL; + rom68k_cmds.setmem.resp_delim = NULL; + rom68k_cmds.setmem.term = NULL; + rom68k_cmds.setmem.term_cmd = NULL; + rom68k_cmds.getmem.cmdb = "dm %x %x\r"; + rom68k_cmds.getmem.cmdw = "dm;w %x %x\r"; + rom68k_cmds.getmem.cmdl = "dm;l %x %x\r"; + rom68k_cmds.getmem.cmdll = NULL; + rom68k_cmds.getmem.resp_delim = " "; + rom68k_cmds.getmem.term = NULL; + rom68k_cmds.getmem.term_cmd = NULL; + rom68k_cmds.setreg.cmd = "pr %s %x\r"; + rom68k_cmds.setreg.resp_delim = NULL; + rom68k_cmds.setreg.term = NULL; + rom68k_cmds.setreg.term_cmd = NULL ; + rom68k_cmds.getreg.cmd = "pr %s\r" ; + rom68k_cmds.getreg.resp_delim = ": " ; + rom68k_cmds.getreg.term = "= " ; + rom68k_cmds.getreg.term_cmd = ";\r" ; + rom68k_cmds.dump_registers = "dr\r" ; + rom68k_cmds.register_pattern = + "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)" ; + rom68k_cmds.supply_register = rom68k_supply_register; + rom68k_cmds.load_routine = NULL; + rom68k_cmds.load = "dc\r"; + rom68k_cmds.loadresp = "Waiting for S-records from host;.. "; + rom68k_cmds.prompt = "ROM68K :-> "; + rom68k_cmds.line_term = "\r"; + rom68k_cmds.cmd_end = ";\r"; + rom68k_cmds.target = &rom68k_ops; + rom68k_cmds.stopbits = SERIAL_1_STOPBITS; + rom68k_cmds.regnames = rom68k_regnames; + rom68k_cmds.magic = MONITOR_OPS_MAGIC ; +} /* init_rom68k_cmds */ static void rom68k_open (args, from_tty) @@ -161,6 +154,7 @@ rom68k_open (args, from_tty) void _initialize_rom68k () { + init_rom_68k_cmds() ; init_monitor_ops (&rom68k_ops); rom68k_ops.to_shortname = "rom68k"; diff --git a/gdb/sh3-rom.c b/gdb/sh3-rom.c index 8d8705c..77eb093 100644 --- a/gdb/sh3-rom.c +++ b/gdb/sh3-rom.c @@ -183,63 +183,54 @@ static struct target_ops sh3_ops, sh3e_ops; static char *sh3_inits[] = {"\003", NULL}; /* Exits sub-command mode & download cmds */ -static struct monitor_ops sh3_cmds = +static struct monitor_ops sh3_cmds ; +static void init_sh3_cmds(void) { - MO_CLR_BREAK_USES_ADDR - | MO_GETMEM_READ_SINGLE, /* flags */ - sh3_inits, /* monitor init string */ - "g\r", /* continue command */ - "s\r", /* single step */ - "\003", /* Interrupt program */ - "b %x\r", /* set a breakpoint */ - "b -%x\r", /* clear a breakpoint */ - "b -\r", /* clear all breakpoints */ - "f %x @%x %x\r", /* fill (start len val) */ - { - "m %x %x\r", /* setmem.cmdb (addr, value) */ - "m %x %x;w\r", /* setmem.cmdw (addr, value) */ - "m %x %x;l\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL, /* setreg.term_cmd */ - }, - { - "m %x\r", /* getmem.cmdb (addr, len) */ - "m %x;w\r", /* getmem.cmdw (addr, len) */ - "m %x;l\r", /* getmem.cmdl (addr, len) */ - NULL, /* getmem.cmdll (addr, len) */ - "^ [0-9A-F]+ ", /* getmem.resp_delim */ - "? ", /* getmem.term */ - ".\r", /* getmem.term_cmd */ - }, - { - ".%s %x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - ".%s\r", /* getreg.cmd (name) */ - "=", /* getreg.resp_delim */ - "? ", /* getreg.term */ - ".\r" /* getreg.term_cmd */ - }, - "r\r", /* dump_registers */ - /* register_pattern */ - "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)", - sh3_supply_register, /* supply_register */ - sh3_load, /* load_routine */ - NULL, /* download command */ - NULL, /* Load response */ - "\n:", /* monitor command prompt */ - "\r", /* end-of-line terminator */ - ".\r", /* optional command terminator */ - &sh3_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - sh3_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ -}; + sh3_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_GETMEM_READ_SINGLE ; /* flags */ + sh3_cmds.init = sh3_inits; /* monitor init string */ + sh3_cmds.cont = "g\r"; /* continue command */ + sh3_cmds.step = "s\r"; /* single step */ + sh3_cmds.stop = "\003"; /* Interrupt program */ + sh3_cmds.set_break = "b %x\r"; /* set a breakpoint */ + sh3_cmds.clr_break = "b -%x\r"; /* clear a breakpoint */ + sh3_cmds.clr_all_break = "b -\r"; /* clear all breakpoints */ + sh3_cmds.fill = "f %x @%x %x\r"; /* fill (start len val) */ + sh3_cmds.setmem.cmdb = "m %x %x\r"; /* setmem.cmdb (addr, value) */ + sh3_cmds.setmem.cmdw = "m %x %x;w\r"; /* setmem.cmdw (addr, value) */ + sh3_cmds.setmem.cmdl = "m %x %x;l\r"; /* setmem.cmdl (addr, value) */ + sh3_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + sh3_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */ + sh3_cmds.setmem.term = NULL; /* setreg.term */ + sh3_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */ + sh3_cmds.getmem.cmdb = "m %x\r"; /* getmem.cmdb (addr, len) */ + sh3_cmds.getmem.cmdw = "m %x;w\r"; /* getmem.cmdw (addr, len) */ + sh3_cmds.getmem.cmdl = "m %x;l\r"; /* getmem.cmdl (addr, len) */ + sh3_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + sh3_cmds.getmem.resp_delim = "^ [0-9A-F]+ "; /* getmem.resp_delim */ + sh3_cmds.getmem.term = "? "; /* getmem.term */ + sh3_cmds.getmem.term_cmd = ".\r"; /* getmem.term_cmd */ + sh3_cmds.setreg.cmd = ".%s %x\r"; /* setreg.cmd (name, value) */ + sh3_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ + sh3_cmds.setreg.term = NULL; /* setreg.term */ + sh3_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */ + sh3_cmds.getreg.cmd = ".%s\r"; /* getreg.cmd (name) */ + sh3_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */ + sh3_cmds.getreg.term = "? "; /* getreg.term */ + sh3_cmds.getreg.term_cmd = ".\r" ; /* getreg.term_cmd */ + sh3_cmds.dump_registers = "r\r"; /* dump_registers */ + sh3_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)"; + sh3_cmds.supply_register = sh3_supply_register ; /* supply_register */ + sh3_cmds.load_routine = sh3_load; /* load_routine */ + sh3_cmds.load = NULL; /* download command */ + sh3_cmds.loadresp = NULL; /* Load response */ + sh3_cmds.prompt = "\n:"; /* monitor command prompt */ + sh3_cmds.line_term = "\r"; /* end-of-line terminator */ + sh3_cmds.cmd_end = ".\r"; /* optional command terminator */ + sh3_cmds.target = &sh3_ops; /* target operations */ + sh3_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + sh3_cmds.regnames = sh3_regnames; /* registers names */ + sh3_cmds.magic = MONITOR_OPS_MAGIC ; /* magic */ +} /* init_sh3_cmds */ /* This monitor structure is identical except for a couple slots, so we will fill it in from the base structure when needed. */ @@ -350,6 +341,7 @@ sh3_close (quitting) void _initialize_sh3_rom () { + init_sh3_cmds() ; init_monitor_ops (&sh3_ops); sh3_ops.to_shortname = "sh3"; diff --git a/gdb/sparclet-rom.c b/gdb/sparclet-rom.c index 50cde7f..24484cd 100644 --- a/gdb/sparclet-rom.c +++ b/gdb/sparclet-rom.c @@ -194,73 +194,66 @@ sparclet_load (desc, file, hashmark) static char *sparclet_inits[] = {"\n\r\r\n", NULL}; -static struct monitor_ops sparclet_cmds = +static struct monitor_ops sparclet_cmds ; +static void init_sparclet_cmds(void) { - MO_CLR_BREAK_USES_ADDR | - MO_HEX_PREFIX | - MO_NO_ECHO_ON_OPEN | - MO_NO_ECHO_ON_SETMEM | - MO_RUN_FIRST_TIME | - MO_GETMEM_READ_SINGLE, /* flags */ - sparclet_inits, /* Init strings */ - "cont\r", /* continue command */ - "step\r", /* single step */ - "\r", /* break interrupts the program */ - "+bp %x\r", /* set a breakpoint */ - /* can't use "br" because only 2 hw bps are supported */ - "-bp %x\r", /* clear a breakpoint */ - "-bp\r", /* clear all breakpoints */ - "fill %x -n %x -v %x -b\r", /* fill (start length val) */ - /* can't use "fi" because it takes words, not bytes */ - { - /* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */ - "ex %x -b\r%x\rq\r", /* setmem.cmdb (addr, value) */ - "ex %x -s\r%x\rq\r", /* setmem.cmdw (addr, value) */ - "ex %x -l\r%x\rq\r", /* setmem.cmdl (addr, value) */ - NULL, /* setmem.cmdll (addr, value) */ - NULL, /*": " */ /* setmem.resp_delim */ - NULL, /*"? " */ /* setmem.term */ - NULL, /*"q\r" */ /* setmem.term_cmd */ - }, - { - /* since the parsing of multiple bytes is difficult due to - interspersed addresses, we'll only read 1 value at a time, - even tho these can handle a count */ - /* we can use -n to set count to read, but may have to parse? */ - "ex %x -n 1 -b\r", /* getmem.cmdb (addr, #bytes) */ - "ex %x -n 1 -s\r", /* getmem.cmdw (addr, #swords) */ - "ex %x -n 1 -l\r", /* getmem.cmdl (addr, #words) */ - NULL, /* getmem.cmdll (addr, #dwords) */ - ": ", /* getmem.resp_delim */ - NULL, /* getmem.term */ - NULL, /* getmem.term_cmd */ - }, - { - "reg %s 0x%x\r", /* setreg.cmd (name, value) */ - NULL, /* setreg.resp_delim */ - NULL, /* setreg.term */ - NULL /* setreg.term_cmd */ - }, - { - "reg %s\r", /* getreg.cmd (name) */ - " ", /* getreg.resp_delim */ - NULL, /* getreg.term */ - NULL, /* getreg.term_cmd */ - }, - "reg\r", /* dump_registers */ - "\\(\\w+\\)=\\([0-9a-fA-F]+\\)", /* register_pattern */ - sparclet_supply_register, /* supply_register */ - sparclet_load, /* load_routine */ - NULL, /* download command (srecs on console) */ - NULL, /* load response */ - "monitor>", /* monitor command prompt */ + sparclet_cmds.flags = MO_CLR_BREAK_USES_ADDR | + MO_HEX_PREFIX | + MO_NO_ECHO_ON_OPEN | + MO_NO_ECHO_ON_SETMEM | + MO_RUN_FIRST_TIME | + MO_GETMEM_READ_SINGLE ; /* flags */ + sparclet_cmds.init = sparclet_inits; /* Init strings */ + sparclet_cmds.cont = "cont\r"; /* continue command */ + sparclet_cmds.step = "step\r"; /* single step */ + sparclet_cmds.stop = "\r"; /* break interrupts the program */ + sparclet_cmds.set_break = "+bp %x\r"; /* set a breakpoint */ + sparclet_cmds.clr_break = "-bp %x\r" ; /* can't use "br" because only 2 hw bps are supported */ + sparclet_cmds.clr_all_break = "-bp %x\r"; /* clear a breakpoint */ + "-bp\r" ; /* clear all breakpoints */ + sparclet_cmds.fill = "fill %x -n %x -v %x -b\r"; /* fill (start length val) */ + /* can't use "fi" because it takes words, not bytes */ + /* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */ + sparclet_cmds.setmem.cmdb = "ex %x -b\r%x\rq\r"; /* setmem.cmdb (addr, value) */ + sparclet_cmds.setmem.cmdw = "ex %x -s\r%x\rq\r"; /* setmem.cmdw (addr, value) */ + sparclet_cmds.setmem.cmdl = "ex %x -l\r%x\rq\r"; /* setmem.cmdl (addr, value) */ + sparclet_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + sparclet_cmds.setmem.resp_delim = NULL; /*": " */ /* setmem.resp_delim */ + sparclet_cmds.setmem.term = NULL; /*"? " */ /* setmem.term */ + sparclet_cmds.setmem.term_cmd = NULL; /*"q\r" */ /* setmem.term_cmd */ + /* since the parsing of multiple bytes is difficult due to + interspersed addresses, we'll only read 1 value at a time, + even tho these can handle a count */ + /* we can use -n to set count to read, but may have to parse? */ + sparclet_cmds.getmem.cmdb = "ex %x -n 1 -b\r"; /* getmem.cmdb (addr, #bytes) */ + sparclet_cmds.getmem.cmdw = "ex %x -n 1 -s\r"; /* getmem.cmdw (addr, #swords) */ + sparclet_cmds.getmem.cmdl = "ex %x -n 1 -l\r"; /* getmem.cmdl (addr, #words) */ + sparclet_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, #dwords) */ + sparclet_cmds.getmem.resp_delim = ": "; /* getmem.resp_delim */ + sparclet_cmds.getmem.term = NULL; /* getmem.term */ + sparclet_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ + sparclet_cmds.setreg.cmd = "reg %s 0x%x\r"; /* setreg.cmd (name, value) */ + sparclet_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ + sparclet_cmds.setreg.term = NULL; /* setreg.term */ + sparclet_cmds.setreg.term_cmd = NULL ; /* setreg.term_cmd */ + sparclet_cmds.getreg.cmd = "reg %s\r"; /* getreg.cmd (name) */ + sparclet_cmds.getreg.resp_delim = " "; /* getreg.resp_delim */ + sparclet_cmds.getreg.term = NULL; /* getreg.term */ + sparclet_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ + sparclet_cmds.dump_registers = "reg\r"; /* dump_registers */ + sparclet_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */ + sparclet_cmds.supply_register = sparclet_supply_register; /* supply_register */ + sparclet_cmds.load_routine = sparclet_load; /* load_routine */ + sparclet_cmds.load = NULL; /* download command (srecs on console) */ + sparclet_cmds.loadresp = NULL; /* load response */ + sparclet_cmds.prompt = "monitor>"; /* monitor command prompt */ /* yikes! gdb core dumps without this delimitor!! */ - "\r", /* end-of-command delimitor */ - NULL, /* optional command terminator */ - &sparclet_ops, /* target operations */ - SERIAL_1_STOPBITS, /* number of stop bits */ - sparclet_regnames, /* registers names */ - MONITOR_OPS_MAGIC /* magic */ + sparclet_cmds.line_term = "\r"; /* end-of-command delimitor */ + sparclet_cmds.cmd_end = NULL; /* optional command terminator */ + sparclet_cmds.target = &sparclet_ops; /* target operations */ + sparclet_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + sparclet_cmds.regnames = sparclet_regnames; /* registers names */ + sparclet_cmds.magic = MONITOR_OPS_MAGIC ; /* magic */ }; static void @@ -275,6 +268,7 @@ void _initialize_sparclet () { int i; + init_sparclet_cmds() ; for (i = 0; i < NUM_REGS; i++) if (sparclet_regnames[i][0] == 'c' || -- cgit v1.1