1 /* Remote target glue for the ROM68K ROM monitor.
2 Copyright 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 static void rom68k_open
PARAMS ((char *args
, int from_tty
));
29 rom68k_supply_register (regname
, regnamelen
, val
, vallen
)
45 if (regname
[1] == 'R')
49 if (regname
[1] == 'C')
53 if (regname
[1] != 'R')
59 if (regname
[1] != 'R')
65 else if (regnamelen
== 3)
69 if (regname
[1] == 'S' && regname
[2] == 'P')
75 val
= monitor_supply_register (regno
++, val
);
78 /* This array of registers need to match the indexes used by GDB.
79 This exists because the various ROM monitors use different strings
80 than does GDB, and don't necessarily support all the registers
81 either. So, typing "info reg sp" becomes a "r30". */
83 static char *rom68k_regnames
[NUM_REGS
] = {
84 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
85 "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
88 /* Define the monitor command strings. Since these are passed directly
89 through to a printf style function, we may include formatting
90 strings. We also need a CR or LF on the end. */
92 static struct target_ops rom68k_ops
;
94 static char *rom68k_inits
[] = {".\r\r", NULL
}; /* Exits pm/pr & download cmds */
96 static struct monitor_ops rom68k_cmds
;
97 static void init_rom68k_cmds(void)
99 rom68k_cmds
.flags
= 0;
100 rom68k_cmds
.init
= rom68k_inits
; /* monitor init string */
101 rom68k_cmds
.cont
= "go\r";
102 rom68k_cmds
.step
= "st\r";
103 rom68k_cmds
.stop
= NULL
;
104 rom68k_cmds
.set_break
= "db %x\r";
105 rom68k_cmds
.clr_break
= "cb %x\r";
106 rom68k_cmds
.clr_all_break
= "cb *\r";
107 rom68k_cmds
.fill
= "fm %x %x %x\r";
108 rom68k_cmds
.setmem
.cmdb
= "pm %x %x\r";
109 rom68k_cmds
.setmem
.cmdw
= "pm;w %x %x\r";
110 rom68k_cmds
.setmem
.cmdl
= "pm;l %x %x\r";
111 rom68k_cmds
.setmem
.cmdll
= NULL
;
112 rom68k_cmds
.setmem
.resp_delim
= NULL
;
113 rom68k_cmds
.setmem
.term
= NULL
;
114 rom68k_cmds
.setmem
.term_cmd
= NULL
;
115 rom68k_cmds
.getmem
.cmdb
= "dm %x %x\r";
116 rom68k_cmds
.getmem
.cmdw
= "dm;w %x %x\r";
117 rom68k_cmds
.getmem
.cmdl
= "dm;l %x %x\r";
118 rom68k_cmds
.getmem
.cmdll
= NULL
;
119 rom68k_cmds
.getmem
.resp_delim
= " ";
120 rom68k_cmds
.getmem
.term
= NULL
;
121 rom68k_cmds
.getmem
.term_cmd
= NULL
;
122 rom68k_cmds
.setreg
.cmd
= "pr %s %x\r";
123 rom68k_cmds
.setreg
.resp_delim
= NULL
;
124 rom68k_cmds
.setreg
.term
= NULL
;
125 rom68k_cmds
.setreg
.term_cmd
= NULL
;
126 rom68k_cmds
.getreg
.cmd
= "pr %s\r" ;
127 rom68k_cmds
.getreg
.resp_delim
= ": " ;
128 rom68k_cmds
.getreg
.term
= "= " ;
129 rom68k_cmds
.getreg
.term_cmd
= ";\r" ;
130 rom68k_cmds
.dump_registers
= "dr\r" ;
131 rom68k_cmds
.register_pattern
=
132 "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)" ;
133 rom68k_cmds
.supply_register
= rom68k_supply_register
;
134 rom68k_cmds
.load_routine
= NULL
;
135 rom68k_cmds
.load
= "dc\r";
136 rom68k_cmds
.loadresp
= "Waiting for S-records from host;.. ";
137 rom68k_cmds
.prompt
= "ROM68K :-> ";
138 rom68k_cmds
.line_term
= "\r";
139 rom68k_cmds
.cmd_end
= ";\r";
140 rom68k_cmds
.target
= &rom68k_ops
;
141 rom68k_cmds
.stopbits
= SERIAL_1_STOPBITS
;
142 rom68k_cmds
.regnames
= rom68k_regnames
;
143 rom68k_cmds
.magic
= MONITOR_OPS_MAGIC
;
144 } /* init_rom68k_cmds */
147 rom68k_open (args
, from_tty
)
151 monitor_open (args
, &rom68k_cmds
, from_tty
);
155 _initialize_rom68k ()
158 init_monitor_ops (&rom68k_ops
);
160 rom68k_ops
.to_shortname
= "rom68k";
161 rom68k_ops
.to_longname
= "Rom68k debug monitor for the IDP Eval board";
162 rom68k_ops
.to_doc
= "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\
163 Specify the serial device it is connected to (e.g. /dev/ttya).";
164 rom68k_ops
.to_open
= rom68k_open
;
166 add_target (&rom68k_ops
);
This page took 0.032445 seconds and 4 git commands to generate.