fe58e71373ef5176536fc35617b515835efdad9c
[deliverable/binutils-gdb.git] / gdb / op50-rom.c
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
21 #include "defs.h"
22 #include "gdbcore.h"
23 #include "target.h"
24 #include "monitor.h"
25
26 void op50n_open();
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[] = {
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",
40 "r28", "r29", "r30", "r31", "", "p", "",
41 "", "", "", "", "", "", "",
42 "", "", "", "", "", "", "",
43 "", "", "", "", "", "", "", "",
44 "", "", "", "", "", "", "",
45 "", "", "", "", "", "", "", "",
46 "", "", "", "", "", "", "", "",
47 "", "", "", "", "", "", "", "",
48 "", "", "", "", "", "", "", "",
49 "", "", "", "", "", "", "", "",
50 "", "", "", "", "", "", "", "",
51 "", "", "", "", "", "", "", "",
52 "", "", "", "", "", "", "", ""
53 };
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
61 struct target_ops op50n_ops = {
62 "op50n",
63 "Oki's debug monitor for the Op50n Eval board",
64
65 "Debug on a Oki OP50N eval board.\n\
66 Specify the serial device it is connected to (e.g. /dev/ttya).",
67 op50n_open,
68
69 monitor_close,
70 0,
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 */
93 0, /* to_stop */
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
106 struct monitor_ops op50n_cmds = {
107 1, /* 1 for ASCII, 0 for binary */
108 "\003.\n", /* monitor init string */
109 "g %x\n", /* execute or usually GO command */
110 "g\n", /* continue command */
111 "t\n", /* single step */
112 "b %x\n", /* set a breakpoint */
113 "bx %x\n", /* clear a breakpoint */
114 0, /* 0 for number, 1 for address */
115 {
116 "sx %x %x;.\n", /* set memory */
117 "", /* delimiter */
118 "", /* the result */
119 },
120 {
121 "sx %x\n", /* get memory */
122 ": ", /* delimiter */
123 " ", /* the result */
124 },
125 {
126 "x %s %x\n", /* set a register */
127 "", /* delimiter between registers */
128 "", /* the result */
129 },
130 {
131 "x %s\n", /* get a register */
132 "=", /* delimiter between registers */
133 "", /* the result */
134 },
135 "r 0\n", /* download command */
136 "#", /* monitor command prompt */
137 " ", /* end-of-command delimitor */
138 ".\n", /* optional command terminator */
139 &op50n_ops, /* target operations */
140 "srec,ascii-srec,default", /* load types */
141 op50n_regnames
142 };
143
144 void
145 op50n_open(args, from_tty)
146 char *args;
147 int from_tty;
148 {
149 target_preopen(from_tty);
150 push_target(&op50n_ops);
151 push_monitor (&op50n_cmds);
152 monitor_open (args, "op50n", from_tty);
153 }
154
155 void
156 _initialize_op50n ()
157 {
158 add_target (&op50n_ops);
159
160 /* this is the default, since it's that's how the board comes up after
161 power cycle. It can then be changed using set remotebaud
162 */
163 baud_rate = 9600;
164 }
This page took 0.044681 seconds and 3 git commands to generate.