220a049c4b64b4f908cdffe88359a5d695a0e020
1 /* Remote target glue for the ROM68K ROM monitor.
2 Copyright 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
26 static void rom68k_open
PARAMS ((char *, int));
29 rom68k_supply_register (regname
, regnamelen
, val
, vallen
)
46 if (regname
[1] == 'R')
50 if (regname
[1] == 'C')
54 if (regname
[1] != 'R')
60 if (regname
[1] != 'R')
67 else if (regnamelen
== 3)
72 if (regname
[1] == 'S' && regname
[2] == 'P')
79 val
= monitor_supply_register (regno
++, val
);
82 /* This array of registers need to match the indexes used by GDB.
83 This exists because the various ROM monitors use different strings
84 than does GDB, and don't necessarily support all the registers
85 either. So, typing "info reg sp" becomes a "r30". */
87 static char *rom68k_regnames
[NUM_REGS
] = {
88 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
89 "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 may include formatting
94 strings. We also need a CR or LF on the end. */
96 static struct target_ops rom68k_ops
;
98 static char *rom68k_loadtypes
[] = {"srec", NULL
};
99 static char *rom68k_loadprotos
[] = {"none", NULL
};
101 static char *rom68k_inits
[] = {".\r\r", NULL
}; /* Exits pm/pr & download cmds */
103 static struct monitor_ops rom68k_cmds
=
106 rom68k_inits
, /* monitor init string */
107 "go\r", /* continue command */
108 "st\r", /* single step */
109 NULL
, /* No way to interrupt program */
110 "db %x\r", /* set a breakpoint */
111 "cb %x\r", /* clear a breakpoint */
112 "cb *\r", /* clear all breakpoints */
113 "fm %x %x %x\r", /* fill (start len val) */
115 "pm %x %x\r", /* setmem.cmdb (addr, value) */
116 "pm.w %x %x\r", /* setmem.cmdw (addr, value) */
117 "pm.l %x %x\r", /* setmem.cmdl (addr, value) */
118 NULL
, /* setmem.cmdll (addr, value) */
119 NULL
, /* setreg.resp_delim */
120 NULL
, /* setreg.term */
121 NULL
, /* setreg.term_cmd */
124 "dm %x %x\r", /* getmem.cmdb (addr, len) */
125 "dm.w %x %x\r", /* getmem.cmdw (addr, len) */
126 "dm.l %x %x\r", /* getmem.cmdl (addr, len) */
127 NULL
, /* getmem.cmdll (addr, len) */
128 " ", /* getmem.resp_delim */
129 NULL
, /* getmem.term */
130 NULL
, /* getmem.term_cmd */
133 "pr %s %x\r", /* setreg.cmd (name, value) */
134 NULL
, /* setreg.resp_delim */
135 NULL
, /* setreg.term */
136 NULL
/* setreg.term_cmd */
139 "pr %s\r", /* getreg.cmd (name) */
140 ": ", /* getreg.resp_delim */
141 "= ", /* getreg.term */
142 ".\r" /* getreg.term_cmd */
144 "dr\r", /* dump_registers */
145 /* register_pattern */
146 "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)",
147 rom68k_supply_register
, /* supply_register */
148 "dc\r", /* download command */
149 "Waiting for S-records from host... ", /* Load response */
150 "ROM68K :->", /* monitor command prompt */
151 "=", /* end-of-command delimitor */
152 ".\r", /* optional command terminator */
153 &rom68k_ops
, /* target operations */
154 rom68k_loadtypes
, /* loadtypes */
155 rom68k_loadprotos
, /* loadprotos */
156 "9600", /* supported baud rates */
157 SERIAL_1_STOPBITS
, /* number of stop bits */
158 rom68k_regnames
, /* registers names */
159 MONITOR_OPS_MAGIC
/* magic */
163 rom68k_open (args
, from_tty
)
167 monitor_open (args
, &rom68k_cmds
, from_tty
);
171 _initialize_rom68k ()
173 init_monitor_ops (&rom68k_ops
);
175 rom68k_ops
.to_shortname
= "rom68k";
176 rom68k_ops
.to_longname
= "Rom68k debug monitor for the IDP Eval board";
177 rom68k_ops
.to_doc
= "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\
178 Specify the serial device it is connected to (e.g. /dev/ttya).";
179 rom68k_ops
.to_open
= rom68k_open
;
181 add_target (&rom68k_ops
);
183 /* This is the default, since it's the only baud rate supported by
This page took 0.033405 seconds and 4 git commands to generate.