Commit | Line | Data |
---|---|---|
b04a78d4 | 1 | /* Remote target code for the Array Tech LSI33k based RAID disk controller board. |
2e1b3b03 RS |
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 | ||
b04a78d4 | 29 | void gdb_open(); |
2e1b3b03 RS |
30 | void monitor_open(); |
31 | ||
32 | /* | |
33 | * this array of registers need to match the indexes used by GDB. The | |
34 | * whole reason this exists is cause the various ROM monitors use | |
35 | * different strings than GDB does, and doesn't support all the | |
36 | * registers either. So, typing "info reg sp" becomes a "r30". | |
37 | */ | |
1b552670 RS |
38 | static char *array_regnames[] = REGISTER_NAMES; |
39 | ||
40 | #if 0 | |
2e1b3b03 RS |
41 | static char *array_regnames[] = { |
42 | "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", | |
43 | "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", | |
44 | "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", | |
45 | "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", | |
46 | "sr", "lo", "hi", "bad", "cause","pc", | |
47 | "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", | |
48 | "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", | |
49 | "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", | |
50 | "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", | |
51 | "fsr", "fir", "fp", | |
52 | "", "", "", "", "", "", "", | |
53 | "", "", "", "", "", "", "", "", | |
54 | "", "", "", "", "", "", "", "", | |
55 | "", "", "", "", "", "", "", "", | |
56 | "", "", "", "", "", "", "", "", | |
57 | "", "", "", "", "", "", "", "", | |
58 | "", "", "", "", "", "", "", "" | |
59 | }; | |
1b552670 | 60 | #endif |
2e1b3b03 RS |
61 | |
62 | /* | |
63 | * Define the monitor command strings. Since these are passed directly | |
64 | * through to a printf style function, we need can include formatting | |
65 | * strings. We also need a CR or LF on the end. | |
66 | */ | |
67 | ||
68 | struct target_ops array_ops = { | |
69 | "array", | |
b04a78d4 RS |
70 | "Debug using the standard GDB remote protocol for the Array Tech target.", |
71 | "Debug using the standard GDB remote protocol for the Array Tech target.\n\ | |
72 | Specify the serial device it is connected to (e.g. /dev/ttya).", | |
73 | gdb_open, | |
74 | monitor_close, | |
75 | monitor_attach, | |
76 | monitor_detach, | |
77 | monitor_resume, | |
78 | monitor_wait, | |
79 | monitor_fetch_registers, | |
80 | monitor_store_registers, | |
81 | monitor_prepare_to_store, | |
82 | monitor_xfer_inferior_memory, | |
83 | monitor_files_info, | |
84 | monitor_insert_breakpoint, | |
85 | monitor_remove_breakpoint, /* Breakpoints */ | |
86 | 0, | |
87 | 0, | |
88 | 0, | |
89 | 0, | |
90 | 0, /* Terminal handling */ | |
91 | monitor_kill, | |
92 | monitor_load, /* load */ | |
93 | 0, /* lookup_symbol */ | |
94 | monitor_create_inferior, | |
95 | monitor_mourn_inferior, | |
96 | ||
97 | 0, /* can_run */ | |
98 | 0, /* notice_signals */ | |
99 | 0, /* to_stop */ | |
100 | process_stratum, | |
101 | 0, /* next */ | |
102 | 1, | |
103 | 1, | |
104 | 1, | |
105 | 1, | |
106 | 1, /* all mem, mem, stack, regs, exec */ | |
107 | 0, | |
108 | 0, /* Section pointers */ | |
109 | OPS_MAGIC, /* Always the last thing */ | |
110 | }; | |
111 | ||
1b552670 | 112 | struct monitor_ops array_cmds = { |
b04a78d4 RS |
113 | 0, /* 1 for ASCII, 0 for binary */ |
114 | "$?#b8+\n", /* monitor init string */ | |
115 | "go %x", /* execute or usually GO command */ | |
116 | "c", /* continue command */ | |
117 | "s", /* single step */ | |
118 | "brk %x", /* set a breakpoint */ | |
119 | "unbrk %x", /* clear a breakpoint */ | |
120 | 0, /* 0 for number, 1 for address */ | |
121 | { | |
122 | "M%8x,%4x:%8x", /* set memory */ | |
123 | "", /* delimiter */ | |
124 | "", /* the result */ | |
125 | }, | |
126 | { | |
127 | "m%8x,%4x", /* get memory */ | |
128 | "", /* delimiter */ | |
129 | "", /* the result */ | |
130 | }, | |
131 | { | |
132 | "G%8x", /* set registers */ | |
133 | "", /* delimiter between registers */ | |
134 | "", /* the result */ | |
135 | }, | |
136 | { | |
137 | "g", /* get registers */ | |
138 | "", /* delimiter between registers */ | |
139 | "", /* the result */ | |
140 | }, | |
141 | "sload -a tty(0)\r\n", /* download command */ | |
142 | ">> ", /* monitor command prompt */ | |
143 | "", /* end-of-command delimitor */ | |
144 | "", /* optional command terminator */ | |
1b552670 | 145 | &array_ops, /* target operations */ |
b04a78d4 RS |
146 | "none,srec,default", /* load types */ |
147 | "none", /* load protocols */ | |
148 | "4800", /* supported baud rates */ | |
149 | 2, /* number of stop bits */ | |
150 | array_regnames /* registers names */ | |
151 | }; | |
152 | ||
153 | void | |
154 | gdb_open(args, from_tty) | |
155 | char *args; | |
156 | int from_tty; | |
2e1b3b03 RS |
157 | { |
158 | target_preopen(from_tty); | |
159 | push_target (&array_ops); | |
160 | push_monitor (&array_cmds); | |
161 | monitor_open (args, "array", from_tty); | |
162 | } | |
163 | ||
164 | void | |
165 | _initialize_array () | |
166 | { | |
167 | add_target (&array_ops); | |
2e1b3b03 RS |
168 | baud_rate = 4800; |
169 | } | |
b04a78d4 RS |
170 | |
171 | ||
172 | ||
173 |