1 /* Remote target glue for the rom68k ROM monitor. This was running on a
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. */
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".
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",
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.
47 static struct target_ops rom68k_ops
=
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).",
59 monitor_fetch_registers
,
60 monitor_store_registers
,
61 monitor_prepare_to_store
,
64 monitor_insert_breakpoint
,
65 monitor_remove_breakpoint
, /* Breakpoints */
70 0, /* Terminal handling */
72 monitor_load
, /* load */
73 0, /* lookup_symbol */
74 monitor_create_inferior
,
75 monitor_mourn_inferior
,
77 0, /* notice_signals */
85 1, /* all mem, mem, stack, regs, exec */
87 0, /* Section pointers */
88 OPS_MAGIC
/* Always the last thing */
91 static char *rom68k_loadtypes
[] = {"none", "srec", "default", NULL
};
92 static char *rom68k_loadprotos
[] = {"none", NULL
};
94 static struct monitor_ops rom68k_cmds
=
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 */
105 "pm %x %x\r", /* setmem.cmd (addr, value) */
106 NULL
, /* setreg.resp_delim */
107 NULL
, /* setreg.term */
108 NULL
, /* setreg.term_cmd */
111 "dm %x 1\r", /* getmem.cmd (addr) */
112 " ", /* getmem.resp_delim */
113 NULL
, /* getmem.term */
114 NULL
, /* getmem.term_cmd */
117 "pr %s %x\r", /* setreg.cmd (name, value) */
118 NULL
, /* setreg.resp_delim */
119 NULL
, /* setreg.term */
120 NULL
/* setreg.term_cmd */
123 "pr %s\r", /* getreg.cmd (name) */
124 ": ", /* getreg.resp_delim */
125 "= ", /* getreg.term */
126 ".\r" /* getreg.term_cmd */
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 */
141 rom68k_open(args
, from_tty
)
145 monitor_open (args
, &rom68k_cmds
, from_tty
);
149 _initialize_rom68k ()
151 add_target (&rom68k_ops
);
153 /* this is the default, since it's the only baud rate supported by the hardware */