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,
19 Boston, MA 02111-1307, USA. */
27 static void rom68k_open (char *args
, int from_tty
);
30 rom68k_supply_register (char *regname
, int regnamelen
, char *val
, int vallen
)
42 if (regname
[1] == 'R')
46 if (regname
[1] == 'C')
50 if (regname
[1] != 'R')
56 if (regname
[1] != 'R')
62 else if (regnamelen
== 3)
66 if (regname
[1] == 'S' && regname
[2] == 'P')
72 val
= monitor_supply_register (regno
++, val
);
75 /* This array of registers need to match the indexes used by GDB.
76 This exists because the various ROM monitors use different strings
77 than does GDB, and don't necessarily support all the registers
78 either. So, typing "info reg sp" becomes a "r30". */
80 static char *rom68k_regnames
[NUM_REGS
] =
82 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
83 "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
86 /* Define the monitor command strings. Since these are passed directly
87 through to a printf style function, we may include formatting
88 strings. We also need a CR or LF on the end. */
90 static struct target_ops rom68k_ops
;
92 static char *rom68k_inits
[] =
93 {".\r\r", NULL
}; /* Exits pm/pr & download cmds */
95 static struct monitor_ops rom68k_cmds
;
98 init_rom68k_cmds (void)
100 rom68k_cmds
.flags
= 0;
101 rom68k_cmds
.init
= rom68k_inits
; /* monitor init string */
102 rom68k_cmds
.cont
= "go\r";
103 rom68k_cmds
.step
= "st\r";
104 rom68k_cmds
.stop
= NULL
;
105 rom68k_cmds
.set_break
= "db %x\r";
106 rom68k_cmds
.clr_break
= "cb %x\r";
107 rom68k_cmds
.clr_all_break
= "cb *\r";
108 rom68k_cmds
.fill
= "fm %x %x %x\r";
109 rom68k_cmds
.setmem
.cmdb
= "pm %x %x\r";
110 rom68k_cmds
.setmem
.cmdw
= "pm.w %x %x\r";
111 rom68k_cmds
.setmem
.cmdl
= "pm.l %x %x\r";
112 rom68k_cmds
.setmem
.cmdll
= NULL
;
113 rom68k_cmds
.setmem
.resp_delim
= NULL
;
114 rom68k_cmds
.setmem
.term
= NULL
;
115 rom68k_cmds
.setmem
.term_cmd
= NULL
;
116 rom68k_cmds
.getmem
.cmdb
= "dm %x %x\r";
117 rom68k_cmds
.getmem
.cmdw
= "dm.w %x %x\r";
118 rom68k_cmds
.getmem
.cmdl
= "dm.l %x %x\r";
119 rom68k_cmds
.getmem
.cmdll
= NULL
;
120 rom68k_cmds
.getmem
.resp_delim
= " ";
121 rom68k_cmds
.getmem
.term
= NULL
;
122 rom68k_cmds
.getmem
.term_cmd
= NULL
;
123 rom68k_cmds
.setreg
.cmd
= "pr %s %x\r";
124 rom68k_cmds
.setreg
.resp_delim
= NULL
;
125 rom68k_cmds
.setreg
.term
= NULL
;
126 rom68k_cmds
.setreg
.term_cmd
= NULL
;
127 rom68k_cmds
.getreg
.cmd
= "pr %s\r";
128 rom68k_cmds
.getreg
.resp_delim
= ": ";
129 rom68k_cmds
.getreg
.term
= "= ";
130 rom68k_cmds
.getreg
.term_cmd
= ".\r";
131 rom68k_cmds
.dump_registers
= "dr\r";
132 rom68k_cmds
.register_pattern
=
133 "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)";
134 rom68k_cmds
.supply_register
= rom68k_supply_register
;
135 rom68k_cmds
.load_routine
= NULL
;
136 rom68k_cmds
.load
= "dc\r";
137 rom68k_cmds
.loadresp
= "Waiting for S-records from host... ";
138 rom68k_cmds
.prompt
= "ROM68K :-> ";
139 rom68k_cmds
.line_term
= "\r";
140 rom68k_cmds
.cmd_end
= ".\r";
141 rom68k_cmds
.target
= &rom68k_ops
;
142 rom68k_cmds
.stopbits
= SERIAL_1_STOPBITS
;
143 rom68k_cmds
.regnames
= rom68k_regnames
;
144 rom68k_cmds
.magic
= MONITOR_OPS_MAGIC
;
145 } /* init_rom68k_cmds */
148 rom68k_open (char *args
, int from_tty
)
150 monitor_open (args
, &rom68k_cmds
, from_tty
);
154 _initialize_rom68k (void)
157 init_monitor_ops (&rom68k_ops
);
159 rom68k_ops
.to_shortname
= "rom68k";
160 rom68k_ops
.to_longname
= "Rom68k debug monitor for the IDP Eval board";
161 rom68k_ops
.to_doc
= "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\
162 Specify the serial device it is connected to (e.g. /dev/ttya).";
163 rom68k_ops
.to_open
= rom68k_open
;
165 add_target (&rom68k_ops
);
This page took 0.032217 seconds and 4 git commands to generate.