1 /* Remote target glue for the rom68k ROM monitor. This was running on a
4 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
28 static void rom68k_open
PARAMS ((char *args
, int from_tty
));
31 rom68k_supply_register (regname
, regnamelen
, val
, vallen
)
47 if (regname
[1] == 'R')
51 if (regname
[1] == 'C')
55 if (regname
[1] != 'R')
61 if (regname
[1] != 'R')
67 else if (regnamelen
== 3)
71 if (regname
[1] == 'S' && regname
[2] == 'P')
77 val
= monitor_supply_register (regno
++, val
);
81 * this array of registers need to match the indexes used by GDB. The
82 * whole reason this exists is cause the various ROM monitors use
83 * different strings than GDB does, and doesn't support all the
84 * registers either. So, typing "info reg sp" becomes a "r30".
86 static char *rom68k_regnames
[NUM_REGS
] = {
87 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
88 "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
92 * Define the monitor command strings. Since these are passed directly
93 * through to a printf style function, we need can include formatting
94 * strings. We also need a CR or LF on the end.
97 static struct target_ops rom68k_ops
;
99 static char *rom68k_loadtypes
[] = {"none", "srec", "default", NULL
};
100 static char *rom68k_loadprotos
[] = {"none", NULL
};
102 static struct monitor_ops rom68k_cmds
=
104 1, /* 1 for ASCII, 0 for binary */
105 ".\r\r", /* monitor init string */
106 "go \r", /* execute or usually GO command */
107 "go \r", /* continue command */
108 "st \r", /* single step */
109 "db %x\r", /* set a breakpoint */
110 "cb %x\r", /* clear a breakpoint */
111 0, /* 0 for number, 1 for address */
113 "pm %x %x\r", /* setmem.cmd (addr, value) */
114 NULL
, /* setreg.resp_delim */
115 NULL
, /* setreg.term */
116 NULL
, /* setreg.term_cmd */
119 "dm %x %x\r", /* getmem.cmd (addr, len) */
120 " ", /* getmem.resp_delim */
121 NULL
, /* getmem.term */
122 NULL
, /* getmem.term_cmd */
125 "pr %s %x\r", /* setreg.cmd (name, value) */
126 NULL
, /* setreg.resp_delim */
127 NULL
, /* setreg.term */
128 NULL
/* setreg.term_cmd */
131 "pr %s\r", /* getreg.cmd (name) */
132 ": ", /* getreg.resp_delim */
133 "= ", /* getreg.term */
134 ".\r" /* getreg.term_cmd */
136 /* register_pattern */
137 "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)",
138 rom68k_supply_register
, /* supply_register */
139 "dc\r", /* download command */
140 "ROM68K :->", /* monitor command prompt */
141 "=", /* end-of-command delimitor */
142 ".\r", /* optional command terminator */
143 &rom68k_ops
, /* target operations */
144 rom68k_loadtypes
, /* loadtypes */
145 rom68k_loadprotos
, /* loadprotos */
146 "9600", /* supported baud rates */
147 SERIAL_1_STOPBITS
, /* number of stop bits */
148 rom68k_regnames
/* registers names */
152 rom68k_open(args
, from_tty
)
156 monitor_open (args
, &rom68k_cmds
, from_tty
);
160 _initialize_rom68k ()
162 init_monitor_ops (&rom68k_ops
);
164 rom68k_ops
.to_shortname
= "rom68k";
165 rom68k_ops
.to_longname
= "Rom68k debug monitor for the IDP Eval board";
166 rom68k_ops
.to_doc
= "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\
167 Specify the serial device it is connected to (e.g. /dev/ttya).";
168 rom68k_ops
.to_open
= rom68k_open
;
170 add_target (&rom68k_ops
);
172 /* this is the default, since it's the only baud rate supported by the hardware */
This page took 0.033465 seconds and 4 git commands to generate.