* utils.c (floatformat_from_doublest): Handle infinity properly.
[deliverable/binutils-gdb.git] / gdb / remote-est.c
CommitLineData
93584146 1/* Remote debugging interface for EST-300 ICE, for GDB
5de0c648 2 Copyright 1995 Free Software Foundation, Inc.
93584146
SC
3 Contributed by Cygnus Support.
4
5 Written by Steve Chamberlain for Cygnus Support.
a25a9f49 6 Re-written by Stu Grossman of Cygnus Support
93584146 7
5de0c648 8This file is part of GDB.
93584146 9
5de0c648
SG
10This program is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2 of the License, or
13(at your option) any later version.
93584146 14
5de0c648
SG
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
93584146 19
5de0c648
SG
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
6c9638b4 22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
93584146 23
93584146 24#include "defs.h"
93584146
SC
25#include "gdbcore.h"
26#include "target.h"
a25a9f49 27#include "monitor.h"
93584146 28#include "serial.h"
93584146 29
a25a9f49 30static void est_open PARAMS ((char *args, int from_tty));
93584146 31
93584146 32static void
a25a9f49
SG
33est_supply_register (regname, regnamelen, val, vallen)
34 char *regname;
35 int regnamelen;
36 char *val;
37 int vallen;
93584146
SC
38{
39 int regno;
40
a25a9f49 41 if (regnamelen != 2)
93584146 42 return;
93584146 43
a25a9f49 44 switch (regname[0])
93584146 45 {
a25a9f49
SG
46 case 'S':
47 if (regname[1] != 'R')
48 return;
49 regno = PS_REGNUM;
93584146 50 break;
a25a9f49
SG
51 case 'P':
52 if (regname[1] != 'C')
53 return;
54 regno = PC_REGNUM;
93584146 55 break;
a25a9f49
SG
56 case 'D':
57 if (regname[1] < '0' || regname[1] > '7')
58 return;
59 regno = regname[1] - '0' + D0_REGNUM;
93584146 60 break;
a25a9f49
SG
61 case 'A':
62 if (regname[1] < '0' || regname[1] > '7')
63 return;
64 regno = regname[1] - '0' + A0_REGNUM;
65 break;
66 default:
67 return;
93584146 68 }
a25a9f49
SG
69
70 monitor_supply_register (regno, val);
93584146
SC
71}
72
a25a9f49
SG
73/*
74 * This array of registers needs to match the indexes used by GDB. The
75 * whole reason this exists is because the various ROM monitors use
76 * different names than GDB does, and don't support all the
77 * registers either. So, typing "info reg sp" becomes a "r30".
78 */
79
80static char *est_regnames[NUM_REGS] =
93584146 81{
a25a9f49
SG
82 "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
83 "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
84 "SR", "PC",
85};
93584146 86
a25a9f49
SG
87/*
88 * Define the monitor command strings. Since these are passed directly
89 * through to a printf style function, we need can include formatting
90 * strings. We also need a CR or LF on the end.
91 */
92
93static struct target_ops est_ops;
94
a25a9f49
SG
95static char *est_inits[] = {"he\r", /* Resets the prompt, and clears repeated cmds */
96 NULL};
97
98static struct monitor_ops est_cmds =
99{
c92f31c6
MA
100 MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_NEED_REGDUMP_AFTER_CONT |
101 MO_SREC_ACK,
a25a9f49
SG
102 est_inits, /* Init strings */
103 "go\r", /* continue command */
104 "sidr\r", /* single step */
a706069f 105 "\003", /* ^C interrupts the program */
a25a9f49
SG
106 "sb %x\r", /* set a breakpoint */
107 "rb %x\r", /* clear a breakpoint */
108 "rb\r", /* clear all breakpoints */
109 "bfb %x %x %x\r", /* fill (start end val) */
110 {
111 "smb %x %x\r", /* setmem.cmdb (addr, value) */
112 "smw %x %x\r", /* setmem.cmdw (addr, value) */
113 "sml %x %x\r", /* setmem.cmdl (addr, value) */
114 NULL, /* setmem.cmdll (addr, value) */
115 NULL, /* setreg.resp_delim */
116 NULL, /* setreg.term */
117 NULL, /* setreg.term_cmd */
118 },
119 {
120 "dmb %x %x\r", /* getmem.cmdb (addr, len) */
121 "dmw %x %x\r", /* getmem.cmdw (addr, len) */
122 "dml %x %x\r", /* getmem.cmdl (addr, len) */
123 NULL, /* getmem.cmdll (addr, len) */
124 ": ", /* getmem.resp_delim */
125 NULL, /* getmem.term */
126 NULL, /* getmem.term_cmd */
127 },
128 {
129 "sr %s %x\r", /* setreg.cmd (name, value) */
130 NULL, /* setreg.resp_delim */
131 NULL, /* setreg.term */
132 NULL /* setreg.term_cmd */
133 },
134 {
135 "dr %s\r", /* getreg.cmd (name) */
136 " = ", /* getreg.resp_delim */
137 NULL, /* getreg.term */
138 NULL /* getreg.term_cmd */
139 },
140 "dr\r", /* dump_registers */
141 "\\(\\w+\\) = \\([0-9a-fA-F]+\\)", /* register_pattern */
142 est_supply_register, /* supply_register */
5de0c648 143 NULL, /* load_routine (defaults to SRECs) */
a25a9f49
SG
144 "dl\r", /* download command */
145 "+", /* load response */
146 ">BKM>", /* monitor command prompt */
511ffbf2 147 "\r", /* end-of-line terminator */
a25a9f49
SG
148 NULL, /* optional command terminator */
149 &est_ops, /* target operations */
a25a9f49
SG
150 SERIAL_1_STOPBITS, /* number of stop bits */
151 est_regnames, /* registers names */
152 MONITOR_OPS_MAGIC /* magic */
153 };
93584146 154
bec6c6db 155static void
a25a9f49 156est_open(args, from_tty)
93584146
SC
157 char *args;
158 int from_tty;
159{
a25a9f49 160 monitor_open (args, &est_cmds, from_tty);
93584146
SC
161}
162
a25a9f49
SG
163void
164_initialize_est ()
93584146 165{
a25a9f49 166 init_monitor_ops (&est_ops);
93584146 167
a25a9f49
SG
168 est_ops.to_shortname = "est";
169 est_ops.to_longname = "EST background debug monitor";
170 est_ops.to_doc = "Debug via the EST BDM.\n\
171Specify the serial device it is connected to (e.g. /dev/ttya).";
172 est_ops.to_open = est_open;
93584146 173
93584146
SC
174 add_target (&est_ops);
175}
This page took 0.130477 seconds and 4 git commands to generate.