* Makefile.in: Add rules for monitor.o and rom68k-rom.o to make
[deliverable/binutils-gdb.git] / gdb / rom68k-rom.c
1 /* Remote target glue for the rom68k ROM monitor. This was running on a
2 Motorola IDP board.
3
4 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
5
6 This file is part of GDB.
7
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.
12
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.
17
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. */
21
22 #include "defs.h"
23 #include "gdbcore.h"
24 #include "target.h"
25 #include "monitor.h"
26 #include "serial.h"
27
28 void rom68k_open();
29
30 /*
31 * this array of registers need to match the indexes used by GDB. The
32 * whole reason this exists is cause the various ROM monitors use
33 * different strings than GDB does, and doesn't support all the
34 * registers either. So, typing "info reg sp" becomes a "r30".
35 */
36 static char *rom68k_regnames[NUM_REGS] = {
37 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
38 "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
39 "SR", "PC" };
40
41 /*
42 * Define the monitor command strings. Since these are passed directly
43 * through to a printf style function, we need can include formatting
44 * strings. We also need a CR or LF on the end.
45 */
46
47 static struct target_ops rom68k_ops =
48 {
49 "rom68k",
50 "Rom68k debug monitor for the IDP Eval board",
51 "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\
52 Specify the serial device it is connected to (e.g. /dev/ttya).",
53 rom68k_open,
54 monitor_close,
55 NULL,
56 monitor_detach,
57 monitor_resume,
58 monitor_wait,
59 monitor_fetch_registers,
60 monitor_store_registers,
61 monitor_prepare_to_store,
62 monitor_xfer_memory,
63 monitor_files_info,
64 monitor_insert_breakpoint,
65 monitor_remove_breakpoint, /* Breakpoints */
66 0,
67 0,
68 0,
69 0,
70 0, /* Terminal handling */
71 monitor_kill,
72 monitor_load, /* load */
73 0, /* lookup_symbol */
74 monitor_create_inferior,
75 monitor_mourn_inferior,
76 0, /* can_run */
77 0, /* notice_signals */
78 0, /* to_stop */
79 process_stratum,
80 0, /* next */
81 1,
82 1,
83 1,
84 1,
85 1, /* all mem, mem, stack, regs, exec */
86 0,
87 0, /* Section pointers */
88 OPS_MAGIC /* Always the last thing */
89 };
90
91 static char *rom68k_loadtypes[] = {"none", "srec", "default", NULL};
92 static char *rom68k_loadprotos[] = {"none", NULL};
93
94 static struct monitor_ops rom68k_cmds =
95 {
96 1, /* 1 for ASCII, 0 for binary */
97 ".\r\r", /* monitor init string */
98 "go \r", /* execute or usually GO command */
99 "go \r", /* continue command */
100 "st \r", /* single step */
101 "db %x\r", /* set a breakpoint */
102 "cb %x\r", /* clear a breakpoint */
103 0, /* 0 for number, 1 for address */
104 {
105 "pm %x %x\r", /* setmem.cmd (addr, value) */
106 NULL, /* setreg.resp_delim */
107 NULL, /* setreg.term */
108 NULL, /* setreg.term_cmd */
109 },
110 {
111 "dm %x 1\r", /* getmem.cmd (addr) */
112 " ", /* getmem.resp_delim */
113 NULL, /* getmem.term */
114 NULL, /* getmem.term_cmd */
115 },
116 {
117 "pr %s %x\r", /* setreg.cmd (name, value) */
118 NULL, /* setreg.resp_delim */
119 NULL, /* setreg.term */
120 NULL /* setreg.term_cmd */
121 },
122 {
123 "pr %s\r", /* getreg.cmd (name) */
124 ": ", /* getreg.resp_delim */
125 "= ", /* getreg.term */
126 ".\r" /* getreg.term_cmd */
127 },
128 "dc\r", /* download command */
129 "ROM68K :->", /* monitor command prompt */
130 "=", /* end-of-command delimitor */
131 ".\r", /* optional command terminator */
132 &rom68k_ops, /* target operations */
133 rom68k_loadtypes, /* loadtypes */
134 rom68k_loadprotos, /* loadprotos */
135 "9600", /* supported baud rates */
136 SERIAL_1_STOPBITS, /* number of stop bits */
137 rom68k_regnames /* registers names */
138 };
139
140 void
141 rom68k_open(args, from_tty)
142 char *args;
143 int from_tty;
144 {
145 monitor_open (args, &rom68k_cmds, from_tty);
146 }
147
148 void
149 _initialize_rom68k ()
150 {
151 add_target (&rom68k_ops);
152
153 /* this is the default, since it's the only baud rate supported by the hardware */
154 baud_rate = 9600;
155 }
This page took 0.036239 seconds and 5 git commands to generate.