1 /* Remote target glue for the WinBond ROM monitor running on the "Cougar"
4 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
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".
38 static 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",
42 "r30", "r31", "sar", "pc", "", "", "",
43 "eiem", "iir", "iva", "ior", "ipsw","", "", "", "", "",
44 "", "", "", "", "", "", "", "ccr", "", "",
45 "tr0", "tr1", "", "", "", "", "",
46 "", "", "", "", "", "", "", "",
47 "", "", "", "", "", "", "", "",
48 "", "", "", "", "", "", "", "",
49 "", "", "", "", "", "", "", "",
50 "", "", "", "", "", "", "", "",
51 "", "", "", "", "", "", "", "",
52 "", "", "", "", "", "", "", "",
53 "", "", "", "", "", "", "", ""
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.
62 struct target_ops w89k_ops = {
64 "WinBond's debug monitor for the W89k Eval board",
65 "Debug on a WinBond W89K eval board.\n\
66 Specify the serial device it is connected to (e.g. /dev/ttya).",
73 monitor_fetch_register,
74 monitor_store_register,
75 monitor_prepare_to_store,
76 monitor_xfer_inferior_memory,
78 monitor_insert_breakpoint,
79 monitor_remove_breakpoint, /* Breakpoints */
84 0, /* Terminal handling */
86 monitor_load, /* load */
87 0, /* lookup_symbol */
88 monitor_create_inferior,
89 monitor_mourn_inferior,
91 0, /* notice_signals */
99 1, /* all mem, mem, stack, regs, exec */
101 0, /* Section pointers */
102 OPS_MAGIC, /* Always the last thing */
105 struct monitor_ops w89k_cmds = {
106 1, /* 1 for ASCII, 0 for binary */
107 "\n", /* monitor init string */
108 "g = %x\n", /* execute or usually GO command */
109 "g\n", /* continue command */
110 "t\n", /* single step */
111 "bp %x\n", /* set a breakpoint */
112 "bc %x\n", /* clear a breakpoint */
113 0, /* 0 for number, 1 for address */
115 "e %x %x\n", /* set memory */
120 "db %x %x\n", /* get memory */
125 "r %s %x\n", /* set a register */
126 "", /* delimiter between registers */
130 "r %s\n", /* get a register */
131 "", /* delimiter between registers */
134 "u\n", /* download command */
135 "ROM>", /* monitor command prompt */
136 "", /* end-of-command delimitor */
137 "", /* optional command terminator */
138 &w89k_ops, /* target operations */
139 "none,srec,default", /* load types */
140 "none,xmodem", /* load protocols */
141 "9600", /* supported baud rates */
142 1, /* number of stop bits */
143 w89k_regnames /* registers names */
147 w89k_open(args, from_tty)
151 target_preopen(from_tty);
152 push_target (&w89k_ops);
153 push_monitor (&w89k_cmds);
154 monitor_open (args, "w89k", from_tty);
160 add_target (&w89k_ops);
162 /* this is the default, since it's the only baud rate supported by the hardware */