1 /* Remote target code for the Array Tech LSI33k based RAID disk controller board.
3 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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. */
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".
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",
50 "", "", "", "", "", "", "",
51 "", "", "", "", "", "", "", "",
52 "", "", "", "", "", "", "", "",
53 "", "", "", "", "", "", "", "",
54 "", "", "", "", "", "", "", "",
55 "", "", "", "", "", "", "", "",
56 "", "", "", "", "", "", "", ""
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.
65 struct target_ops array_ops
= {
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).",
76 monitor_fetch_register
,
77 monitor_store_register
,
78 monitor_prepare_to_store
,
79 monitor_xfer_inferior_memory
,
81 monitor_insert_breakpoint
,
82 monitor_remove_breakpoint
, /* Breakpoints */
87 0, /* Terminal handling */
89 monitor_load
, /* load */
90 0, /* lookup_symbol */
91 monitor_create_inferior
,
92 monitor_mourn_inferior
,
94 0, /* notice_signals */
102 1, /* all mem, mem, stack, regs, exec */
104 0, /* Section pointers */
105 OPS_MAGIC
, /* Always the last thing */
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 */
118 "p %x %x\n", /* set memory */
123 "g %x %x\n", /* get memory */
128 "p %s %x\n", /* set a register */
129 "", /* delimiter between registers */
133 "g %s\n", /* get a register */
134 "", /* delimiter between registers */
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 */
149 struct target_ops gdb_ops
= {
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).",
160 monitor_fetch_registers
,
161 monitor_store_registers
,
162 monitor_prepare_to_store
,
163 monitor_xfer_inferior_memory
,
165 monitor_insert_breakpoint
,
166 monitor_remove_breakpoint
, /* Breakpoints */
171 0, /* Terminal handling */
173 monitor_load
, /* load */
174 0, /* lookup_symbol */
175 monitor_create_inferior
,
176 monitor_mourn_inferior
,
179 0, /* notice_signals */
187 1, /* all mem, mem, stack, regs, exec */
189 0, /* Section pointers */
190 OPS_MAGIC
, /* Always the last thing */
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 */
203 "M%8x,%4x:%8x", /* set memory */
208 "m%8x,%4x", /* get memory */
213 "G%8x", /* set registers */
214 "", /* delimiter between registers */
218 "g", /* get registers */
219 "", /* delimiter between registers */
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 */
235 gdb_open(args
, from_tty
)
239 target_preopen(from_tty
);
240 push_target (&gdb_ops
);
241 push_monitor (&gdb_cmds
);
242 monitor_open (args
, "gdb", from_tty
);
246 _initialize_gdb_proto ()
248 add_target (&gdb_ops
);
252 array_open(args
, from_tty
)
256 target_preopen(from_tty
);
257 push_target (&array_ops
);
258 push_monitor (&array_cmds
);
259 monitor_open (args
, "array", from_tty
);
265 add_target (&array_ops
);
267 /* this is the default, since it's the only baud rate supported by the hardware */