* monitor.c array-rom.c monitor.h rom68k-rom.c: Move target_ops
[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 static char *rom68k_loadtypes[] = {"none", "srec", "default", NULL};
50 static char *rom68k_loadprotos[] = {"none", NULL};
51
52 static struct monitor_ops rom68k_cmds =
53 {
54 1, /* 1 for ASCII, 0 for binary */
55 ".\r\r", /* monitor init string */
56 "go \r", /* execute or usually GO command */
57 "go \r", /* continue command */
58 "st \r", /* single step */
59 "db %x\r", /* set a breakpoint */
60 "cb %x\r", /* clear a breakpoint */
61 0, /* 0 for number, 1 for address */
62 {
63 "pm %x %x\r", /* setmem.cmd (addr, value) */
64 NULL, /* setreg.resp_delim */
65 NULL, /* setreg.term */
66 NULL, /* setreg.term_cmd */
67 },
68 {
69 "dm %x 1\r", /* getmem.cmd (addr) */
70 " ", /* getmem.resp_delim */
71 NULL, /* getmem.term */
72 NULL, /* getmem.term_cmd */
73 },
74 {
75 "pr %s %x\r", /* setreg.cmd (name, value) */
76 NULL, /* setreg.resp_delim */
77 NULL, /* setreg.term */
78 NULL /* setreg.term_cmd */
79 },
80 {
81 "pr %s\r", /* getreg.cmd (name) */
82 ": ", /* getreg.resp_delim */
83 "= ", /* getreg.term */
84 ".\r" /* getreg.term_cmd */
85 },
86 "dc\r", /* download command */
87 "ROM68K :->", /* monitor command prompt */
88 "=", /* end-of-command delimitor */
89 ".\r", /* optional command terminator */
90 &rom68k_ops, /* target operations */
91 rom68k_loadtypes, /* loadtypes */
92 rom68k_loadprotos, /* loadprotos */
93 "9600", /* supported baud rates */
94 SERIAL_1_STOPBITS, /* number of stop bits */
95 rom68k_regnames /* registers names */
96 };
97
98 void
99 rom68k_open(args, from_tty)
100 char *args;
101 int from_tty;
102 {
103 monitor_open (args, &rom68k_cmds, from_tty);
104 }
105
106 void
107 _initialize_rom68k ()
108 {
109 init_monitor_ops (&rom68k_ops);
110
111 rom68k_ops.to_shortname = "rom68k";
112 rom68k_ops.to_longname = "Rom68k debug monitor for the IDP Eval board";
113 rom68k_ops.to_doc = "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\
114 Specify the serial device it is connected to (e.g. /dev/ttya).";
115 rom68k_ops.to_open = rom68k_open;
116
117 add_target (&rom68k_ops);
118
119 /* this is the default, since it's the only baud rate supported by the hardware */
120 baud_rate = 9600;
121 }
This page took 0.033632 seconds and 5 git commands to generate.