]> Git Repo - binutils.git/blame - gdb/array-rom.c
* mpw-make.in (init.c): Use open-brace instead of mpw-open-brace.
[binutils.git] / gdb / array-rom.c
CommitLineData
2e1b3b03
RS
1/* Remote target glue for the WinBond ROM monitor running on the "Cougar"
2Array eval board.
3
4 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
5
6This file is part of GDB.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program; if not, write to the Free Software
20Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21
22#include "defs.h"
23#include "gdbcore.h"
24#include "target.h"
25#include "monitor.h"
26#include "serial.h"
27
28extern int baud_rate;
29
30void array_open();
31void 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 */
39static 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
65struct 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\
69Specify 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
108struct 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
149void
150array_open(args, from_tty)
151 char *args;
152 int from_tty;
153{
154 target_preopen(from_tty);
155 push_target (&array_ops);
156 push_monitor (&array_cmds);
157 monitor_open (args, "array", from_tty);
158}
159
160void
161_initialize_array ()
162{
163 add_target (&array_ops);
164
165 /* this is the default, since it's the only baud rate supported by the hardware */
166 baud_rate = 4800;
167}
This page took 0.040396 seconds and 4 git commands to generate.