* gdb.base/list.exp: Adjust some alternate expect patterns to
[deliverable/binutils-gdb.git] / gdb / w89k-rom.c
CommitLineData
50e183a2
RS
1/* Remote target glue for the WinBond ROM monitor running on the "Cougar"
2W89k eval board.
3
50e183a2
RS
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
e8b73ba7
RS
22#include "defs.h"
23#include "gdbcore.h"
24#include "target.h"
25#include "monitor.h"
26
27e889bf
RS
27extern int baud_rate;
28
e8b73ba7 29void w89k_open();
27e889bf
RS
30void 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 */
38static char *w89k_regnames[] = {
39 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
40 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
41 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29",
7804e5bc 42 "r30", "r31", "sar", "pc", "", "", "",
27e889bf
RS
43 "eiem", "iir", "iva", "ior", "ipsw","", "", "", "", "",
44 "", "", "", "", "", "", "", "ccr", "", "",
45 "tr0", "tr1", "", "", "", "", "",
46 "", "", "", "", "", "", "", "",
47 "", "", "", "", "", "", "", "",
48 "", "", "", "", "", "", "", "",
49 "", "", "", "", "", "", "", "",
50 "", "", "", "", "", "", "", "",
51 "", "", "", "", "", "", "", "",
52 "", "", "", "", "", "", "", "",
53 "", "", "", "", "", "", "", ""
54};
e8b73ba7
RS
55
56/*
57 * Define the monitor command strings. Since these are passed directly
58 * through to a printf style function, we need can include formatting
59 * strings. We also need a CR or LF on the end.
60 */
61
1265e2d8
SG
62static struct target_ops w89k_ops =
63{
e8b73ba7
RS
64 "w89k",
65 "WinBond's debug monitor for the W89k Eval board",
66 "Debug on a WinBond W89K eval board.\n\
67Specify the serial device it is connected to (e.g. /dev/ttya).",
68 w89k_open,
69 monitor_close,
1265e2d8 70 NULL,
e8b73ba7
RS
71 monitor_detach,
72 monitor_resume,
73 monitor_wait,
74 monitor_fetch_register,
75 monitor_store_register,
76 monitor_prepare_to_store,
77 monitor_xfer_inferior_memory,
78 monitor_files_info,
79 monitor_insert_breakpoint,
80 monitor_remove_breakpoint, /* Breakpoints */
81 0,
82 0,
83 0,
84 0,
85 0, /* Terminal handling */
86 monitor_kill,
87 monitor_load, /* load */
88 0, /* lookup_symbol */
89 monitor_create_inferior,
90 monitor_mourn_inferior,
91 0, /* can_run */
92 0, /* notice_signals */
6c27841f 93 0, /* to_stop */
e8b73ba7
RS
94 process_stratum,
95 0, /* next */
96 1,
97 1,
98 1,
99 1,
100 1, /* all mem, mem, stack, regs, exec */
101 0,
102 0, /* Section pointers */
103 OPS_MAGIC, /* Always the last thing */
104};
105
1265e2d8
SG
106static char *loadtypes[] = {"none", "srec", "default", NULL};
107static char *loadprotos[] = {"none", "xmodem", NULL};
108
109static struct monitor_ops w89k_cmds =
110{
27e889bf 111 1, /* 1 for ASCII, 0 for binary */
7804e5bc 112 "\n", /* monitor init string */
e6fa5bd6 113 "g = %x\n", /* execute or usually GO command */
7804e5bc
RS
114 "g\n", /* continue command */
115 "t\n", /* single step */
116 "bp %x\n", /* set a breakpoint */
117 "bc %x\n", /* clear a breakpoint */
118 0, /* 0 for number, 1 for address */
51d6a954
RS
119 {
120 "e %x %x\n", /* set memory */
121 "", /* delimiter */
122 "", /* the result */
123 },
124 {
125 "db %x %x\n", /* get memory */
126 "", /* delimiter */
127 "", /* the result */
128 },
e6fa5bd6 129 {
51d6a954 130 "r %s %x\n", /* set a register */
27e889bf
RS
131 "", /* delimiter between registers */
132 "", /* the result */
133 },
134 {
e6fa5bd6 135 "r %s\n", /* get a register */
27e889bf
RS
136 "", /* delimiter between registers */
137 "", /* the result */
138 },
50e183a2 139 "u\n", /* download command */
e8b73ba7
RS
140 "ROM>", /* monitor command prompt */
141 "", /* end-of-command delimitor */
7804e5bc 142 "", /* optional command terminator */
27e889bf 143 &w89k_ops, /* target operations */
1265e2d8
SG
144 w89k_loadtypes, /* loadtypes */
145 w89k_loadprotos, /* loadprotos */
cf51c601 146 "9600", /* supported baud rates */
1265e2d8 147 SERIAL_1_STOPBITS, /* number of stop bits */
27e889bf 148 w89k_regnames /* registers names */
e8b73ba7
RS
149};
150
151void
152w89k_open(args, from_tty)
153 char *args;
154 int from_tty;
155{
1265e2d8 156 monitor_open (args, &w89k_cmds, from_tty);
e8b73ba7
RS
157}
158
159void
160_initialize_w89k ()
161{
162 add_target (&w89k_ops);
27e889bf
RS
163
164 /* this is the default, since it's the only baud rate supported by the hardware */
165 baud_rate = 9600;
e8b73ba7 166}
This page took 0.059703 seconds and 4 git commands to generate.