1 /* Remote debugging interface to dBUG ROM monitor for GDB, the GNU debugger.
2 Copyright 1996 Free Software Foundation, Inc.
4 Written by Stan Shebs of Cygnus Support.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 /* dBUG is a monitor supplied on various Motorola boards, including
23 m68k, ColdFire, and PowerPC-based designs. The code here assumes
24 the ColdFire, and (as of 9/25/96) has only been tested with a
25 ColdFire IDP board. */
33 static void dbug_open
PARAMS ((char *args
, int from_tty
));
36 dbug_supply_register (regname
, regnamelen
, val
, vallen
)
50 if (regname
[1] != 'R')
55 if (regname
[1] != 'C')
60 if (regname
[1] < '0' || regname
[1] > '7')
62 regno
= regname
[1] - '0' + D0_REGNUM
;
65 if (regname
[1] < '0' || regname
[1] > '7')
67 regno
= regname
[1] - '0' + A0_REGNUM
;
73 monitor_supply_register (regno
, val
);
76 /* This array of registers needs to match the indexes used by GDB. The
77 whole reason this exists is because the various ROM monitors use
78 different names than GDB does, and don't support all the registers
79 either. So, typing "info reg sp" becomes an "A7". */
81 static char *dbug_regnames
[NUM_REGS
] =
83 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
84 "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
86 /* no float registers */
89 static struct target_ops dbug_ops
;
91 static char *dbug_inits
[] = {"\r", NULL
};
93 static struct monitor_ops dbug_cmds
=
95 MO_CLR_BREAK_USES_ADDR
| MO_GETMEM_NEEDS_RANGE
| MO_FILL_USES_ADDR
,
96 dbug_inits
, /* Init strings */
97 "go\r", /* continue command */
98 "step\r", /* single step */
99 NULL
, /* interrupt command */
100 "br %x\r", /* set a breakpoint */
101 "br -c %x\r", /* clear a breakpoint */
102 "br -c\r", /* clear all breakpoints */
103 "bf.b %x %x %x", /* fill (start end val) */
105 "mm.b %x %x\r", /* setmem.cmdb (addr, value) */
106 "mm.w %x %x\r", /* setmem.cmdw (addr, value) */
107 "mm.l %x %x\r", /* setmem.cmdl (addr, value) */
108 NULL
, /* setmem.cmdll (addr, value) */
109 NULL
, /* setmem.resp_delim */
110 NULL
, /* setmem.term */
111 NULL
/* setmem.term_cmd */
114 "md.b %x %x\r", /* getmem.cmdb (addr, addr2) */
115 "md.w %x %x\r", /* getmem.cmdw (addr, addr2) */
116 "md.l %x %x\r", /* getmem.cmdl (addr, addr2) */
117 NULL
, /* getmem.cmdll (addr, addr2) */
118 ":", /* getmem.resp_delim */
119 NULL
, /* getmem.term */
120 NULL
/* getmem.term_cmd */
123 "rm %s %x\r", /* setreg.cmd (name, value) */
124 NULL
, /* setreg.resp_delim */
125 NULL
, /* setreg.term */
126 NULL
/* setreg.term_cmd */
129 "rd %s\r", /* getreg.cmd (name) */
130 ":", /* getreg.resp_delim */
131 NULL
, /* getreg.term */
132 NULL
/* getreg.term_cmd */
134 "rd\r", /* dump_registers */
135 "\\(\\w+\\) +:\\([0-9a-fA-F]+\\b\\)", /* register_pattern */
136 dbug_supply_register
, /* supply_register */
137 NULL
, /* load_routine (defaults to SRECs) */
138 "dl\r", /* download command */
139 "\n", /* load response */
140 "dBUG>", /* monitor command prompt */
141 "\r", /* end-of-line terminator */
142 NULL
, /* optional command terminator */
143 &dbug_ops
, /* target operations */
144 SERIAL_1_STOPBITS
, /* number of stop bits */
145 dbug_regnames
, /* registers names */
146 MONITOR_OPS_MAGIC
/* magic */
150 dbug_open(args
, from_tty
)
154 monitor_open (args
, &dbug_cmds
, from_tty
);
158 _initialize_dbug_rom ()
160 init_monitor_ops (&dbug_ops
);
162 dbug_ops
.to_shortname
= "dbug";
163 dbug_ops
.to_longname
= "dBUG monitor";
164 dbug_ops
.to_doc
= "Debug via the dBUG monitor.\n\
165 Specify the serial device it is connected to (e.g. /dev/ttya).";
166 dbug_ops
.to_open
= dbug_open
;
168 add_target (&dbug_ops
);
This page took 0.032118 seconds and 4 git commands to generate.