Commit | Line | Data |
---|---|---|
50e183a2 RS |
1 | /* Remote target glue for the Oki op50n based eval board. |
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 | ||
e8b73ba7 RS |
21 | #include "defs.h" |
22 | #include "gdbcore.h" | |
23 | #include "target.h" | |
24 | #include "monitor.h" | |
25 | ||
26 | void op50n_open(); | |
27e889bf RS |
27 | void monitor_open(); |
28 | ||
29 | /* | |
30 | * this array of registers need to match the indexes used by GDB. The | |
31 | * whole reason this exists is cause the various ROM monitors use | |
32 | * different strings than GDB does, and doesn't support all the | |
33 | * registers either. So, typing "info reg sp" becomes a "r30". | |
34 | */ | |
35 | static char *op50n_regnames[] = { | |
4e149f91 RS |
36 | "r0", "r1", "r2", "r3", "r4", "r5", "r6", |
37 | "r7", "r8", "r9", "r10", "r11", "r12", "r13", | |
38 | "r14", "r15", "r16", "r17", "r18", "r19", "r20", | |
39 | "r21", "r22", "r23", "r24", "r25", "r26", "r27", | |
1703d664 RS |
40 | "r28", "r29", "r30", "r31", "cr11","p", "", |
41 | "", "", "cr15", "cr19", "cr20", "cr21", "cr22", | |
42 | "", "", "", "", "", "", "", | |
43 | "", "", "cr0", "cr8", "cr9", "cr10","cr12", "cr13", | |
44 | "cr24", "cr25", "cr26", "", "", "", "", | |
4e149f91 RS |
45 | "", "", "", "", "", "", "", "", |
46 | "", "", "", "", "", "", "", "", | |
47 | "", "", "", "", "", "", "", "", | |
48 | "", "", "", "", "", "", "", "", | |
49 | "", "", "", "", "", "", "", "", | |
50 | "", "", "", "", "", "", "", "", | |
51 | "", "", "", "", "", "", "", "", | |
52 | "", "", "", "", "", "", "", "" | |
27e889bf | 53 | }; |
e8b73ba7 RS |
54 | |
55 | /* | |
56 | * Define the monitor command strings. Since these are passed directly | |
57 | * through to a printf style function, we need can include formatting | |
58 | * strings. We also need a CR or LF on the end. | |
59 | */ | |
60 | ||
1265e2d8 SG |
61 | static struct target_ops op50n_ops = |
62 | { | |
e8b73ba7 RS |
63 | "op50n", |
64 | "Oki's debug monitor for the Op50n Eval board", | |
51d6a954 | 65 | |
e8b73ba7 RS |
66 | "Debug on a Oki OP50N eval board.\n\ |
67 | Specify the serial device it is connected to (e.g. /dev/ttya).", | |
68 | op50n_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 */ | |
78b459a7 | 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 |
106 | static char *op50n_loadtype[] = {"none", "srec", "default", NULL}; |
107 | static char *op50n_loadprotos[] = {"none", NULL}; | |
108 | ||
109 | static struct monitor_ops op50n_cmds = | |
110 | { | |
27e889bf | 111 | 1, /* 1 for ASCII, 0 for binary */ |
44b95869 | 112 | "\003.\n", /* monitor init string */ |
4e149f91 RS |
113 | "g %x\n", /* execute or usually GO command */ |
114 | "g\n", /* continue command */ | |
115 | "t\n", /* single step */ | |
7804e5bc | 116 | "b %x\n", /* set a breakpoint */ |
e6fa5bd6 RS |
117 | "bx %x\n", /* clear a breakpoint */ |
118 | 0, /* 0 for number, 1 for address */ | |
51d6a954 RS |
119 | { |
120 | "sx %x %x;.\n", /* set memory */ | |
e6fa5bd6 | 121 | "", /* delimiter */ |
51d6a954 RS |
122 | "", /* the result */ |
123 | }, | |
124 | { | |
125 | "sx %x\n", /* get memory */ | |
126 | ": ", /* delimiter */ | |
127 | " ", /* the result */ | |
128 | }, | |
129 | { | |
4e149f91 RS |
130 | "x %s %x\n", /* set a register */ |
131 | "", /* delimiter between registers */ | |
27e889bf RS |
132 | "", /* the result */ |
133 | }, | |
134 | { | |
135 | "x %s\n", /* get a register */ | |
136 | "=", /* delimiter between registers */ | |
f1ca4cbc | 137 | "", /* the result */ |
27e889bf | 138 | }, |
51d6a954 | 139 | "r 0\n", /* download command */ |
27e889bf RS |
140 | "#", /* monitor command prompt */ |
141 | " ", /* end-of-command delimitor */ | |
142 | ".\n", /* optional command terminator */ | |
143 | &op50n_ops, /* target operations */ | |
1265e2d8 SG |
144 | op50n_loadtypes, /* loadtypes */ |
145 | op50n_loadprotos, /* loadprotos */ | |
cf51c601 | 146 | "2400,4800,9600,19200,exta,38400,extb", /* supported baud rates */ |
1265e2d8 | 147 | SERIAL_1_STOPBITS, /* number of stop bits */ |
27e889bf | 148 | op50n_regnames |
e8b73ba7 RS |
149 | }; |
150 | ||
151 | void | |
152 | op50n_open(args, from_tty) | |
153 | char *args; | |
154 | int from_tty; | |
155 | { | |
1265e2d8 | 156 | monitor_open (args, &op50n_cmds, from_tty); |
e8b73ba7 RS |
157 | } |
158 | ||
159 | void | |
160 | _initialize_op50n () | |
161 | { | |
162 | add_target (&op50n_ops); | |
27e889bf RS |
163 | |
164 | /* this is the default, since it's that's how the board comes up after | |
165 | power cycle. It can then be changed using set remotebaud | |
166 | */ | |
167 | baud_rate = 9600; | |
e8b73ba7 | 168 | } |