check makefile.in for arc, rce stuff
[deliverable/binutils-gdb.git] / gdb / array-rom.c
1 /* Remote target code for the Array Tech LSI33k based RAID disk controller board.
2
3 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 #include "defs.h"
22 #include "gdbcore.h"
23 #include "target.h"
24 #include "monitor.h"
25 #include "serial.h"
26
27 extern int baud_rate;
28
29 void array_open();
30 void gdb_open();
31 void monitor_open();
32
33 /*
34 * this array of registers need to match the indexes used by GDB. The
35 * whole reason this exists is cause the various ROM monitors use
36 * different strings than GDB does, and doesn't support all the
37 * registers either. So, typing "info reg sp" becomes a "r30".
38 */
39 static char *array_regnames[] = {
40 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
41 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
42 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
43 "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
44 "sr", "lo", "hi", "bad", "cause","pc",
45 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
46 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
47 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
48 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
49 "fsr", "fir", "fp",
50 "", "", "", "", "", "", "",
51 "", "", "", "", "", "", "", "",
52 "", "", "", "", "", "", "", "",
53 "", "", "", "", "", "", "", "",
54 "", "", "", "", "", "", "", "",
55 "", "", "", "", "", "", "", "",
56 "", "", "", "", "", "", "", ""
57 };
58
59 /*
60 * Define the monitor command strings. Since these are passed directly
61 * through to a printf style function, we need can include formatting
62 * strings. We also need a CR or LF on the end.
63 */
64
65 struct target_ops array_ops = {
66 "array",
67 "Array Tech's custom debug monitor for their LSI based RAID controller board",
68 "Debug on an Array Tech RAID controller.\n\
69 Specify the serial device it is connected to (e.g. /dev/ttya).",
70 array_open,
71 monitor_close,
72 monitor_attach,
73 monitor_detach,
74 monitor_resume,
75 monitor_wait,
76 monitor_fetch_register,
77 monitor_store_register,
78 monitor_prepare_to_store,
79 monitor_xfer_inferior_memory,
80 monitor_files_info,
81 monitor_insert_breakpoint,
82 monitor_remove_breakpoint, /* Breakpoints */
83 0,
84 0,
85 0,
86 0,
87 0, /* Terminal handling */
88 monitor_kill,
89 monitor_load, /* load */
90 0, /* lookup_symbol */
91 monitor_create_inferior,
92 monitor_mourn_inferior,
93 0, /* can_run */
94 0, /* notice_signals */
95 0, /* to_stop */
96 process_stratum,
97 0, /* next */
98 1,
99 1,
100 1,
101 1,
102 1, /* all mem, mem, stack, regs, exec */
103 0,
104 0, /* Section pointers */
105 OPS_MAGIC, /* Always the last thing */
106 };
107
108 struct monitor_ops array_cmds = {
109 1, /* 1 for ASCII, 0 for binary */
110 "\003.\r\n", /* monitor init string */
111 "go %x\n", /* execute or usually GO command */
112 "c\n", /* continue command */
113 "s\n", /* single step */
114 "brk %x\n", /* set a breakpoint */
115 "unbrk %x\n", /* clear a breakpoint */
116 0, /* 0 for number, 1 for address */
117 {
118 "p %x %x\n", /* set memory */
119 "", /* delimiter */
120 "", /* the result */
121 },
122 {
123 "g %x %x\n", /* get memory */
124 "", /* delimiter */
125 "", /* the result */
126 },
127 {
128 "p %s %x\n", /* set a register */
129 "", /* delimiter between registers */
130 "", /* the result */
131 },
132 {
133 "g %s\n", /* get a register */
134 "", /* delimiter between registers */
135 "", /* the result */
136 },
137 "sload -a tty(0)\r\n", /* download command */
138 ">> ", /* monitor command prompt */
139 "", /* end-of-command delimitor */
140 "", /* optional command terminator */
141 &array_ops, /* target operations */
142 "none,srec,default", /* load types */
143 "none", /* load protocols */
144 "4800", /* supported baud rates */
145 2, /* number of stop bits */
146 array_regnames /* registers names */
147 };
148
149 struct target_ops gdb_ops = {
150 "gdb",
151 "Debug using the standard GDB remote protocol for the Array Tech target.",
152 "Debug using the standard GDB remote protocol for the Array Tech target.\n\
153 Specify the serial device it is connected to (e.g. /dev/ttya).",
154 gdb_open,
155 monitor_close,
156 monitor_attach,
157 monitor_detach,
158 monitor_resume,
159 monitor_wait,
160 monitor_fetch_registers,
161 monitor_store_registers,
162 monitor_prepare_to_store,
163 monitor_xfer_inferior_memory,
164 monitor_files_info,
165 monitor_insert_breakpoint,
166 monitor_remove_breakpoint, /* Breakpoints */
167 0,
168 0,
169 0,
170 0,
171 0, /* Terminal handling */
172 monitor_kill,
173 monitor_load, /* load */
174 0, /* lookup_symbol */
175 monitor_create_inferior,
176 monitor_mourn_inferior,
177
178 0, /* can_run */
179 0, /* notice_signals */
180 0, /* to_stop */
181 process_stratum,
182 0, /* next */
183 1,
184 1,
185 1,
186 1,
187 1, /* all mem, mem, stack, regs, exec */
188 0,
189 0, /* Section pointers */
190 OPS_MAGIC, /* Always the last thing */
191 };
192
193 struct monitor_ops gdb_cmds = {
194 0, /* 1 for ASCII, 0 for binary */
195 "$?#b8+\n", /* monitor init string */
196 "go %x", /* execute or usually GO command */
197 "c", /* continue command */
198 "s", /* single step */
199 "brk %x", /* set a breakpoint */
200 "unbrk %x", /* clear a breakpoint */
201 0, /* 0 for number, 1 for address */
202 {
203 "M%8x,%4x:%8x", /* set memory */
204 "", /* delimiter */
205 "", /* the result */
206 },
207 {
208 "m%8x,%4x", /* get memory */
209 "", /* delimiter */
210 "", /* the result */
211 },
212 {
213 "G%8x", /* set registers */
214 "", /* delimiter between registers */
215 "", /* the result */
216 },
217 {
218 "g", /* get registers */
219 "", /* delimiter between registers */
220 "", /* the result */
221 },
222 "sload -a tty(0)\r\n", /* download command */
223 ">> ", /* monitor command prompt */
224 "", /* end-of-command delimitor */
225 "", /* optional command terminator */
226 &gdb_ops, /* target operations */
227 "none,srec,default", /* load types */
228 "none", /* load protocols */
229 "4800", /* supported baud rates */
230 2, /* number of stop bits */
231 array_regnames /* registers names */
232 };
233
234 void
235 gdb_open(args, from_tty)
236 char *args;
237 int from_tty;
238 {
239 target_preopen(from_tty);
240 push_target (&gdb_ops);
241 push_monitor (&gdb_cmds);
242 monitor_open (args, "gdb", from_tty);
243 }
244
245 void
246 _initialize_gdb_proto ()
247 {
248 add_target (&gdb_ops);
249 }
250
251 void
252 array_open(args, from_tty)
253 char *args;
254 int from_tty;
255 {
256 target_preopen(from_tty);
257 push_target (&array_ops);
258 push_monitor (&array_cmds);
259 monitor_open (args, "array", from_tty);
260 }
261
262 void
263 _initialize_array ()
264 {
265 add_target (&array_ops);
266
267 /* this is the default, since it's the only baud rate supported by the hardware */
268 baud_rate = 4800;
269 }
270
271
272
273
274
This page took 0.034824 seconds and 4 git commands to generate.