* command.h command.c top.c: Add var_enum command type. It's
[deliverable/binutils-gdb.git] / gdb / monitor.h
CommitLineData
51d6a954 1/* Remote debugging interface ROM monitors.
054240ec
RS
2 * Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
3 * Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
4 *
5 * Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
6 * Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
7 *
8 * This file is part of GDB.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
51d6a954
RS
25struct rom_cmd_data {
26 char *cmd; /* command to send */
27 char *delim; /* the delimiter */
28 char *result; /* the result */
29};
30
054240ec 31struct monitor_ops {
0b0669fe 32 int type; /* 1 is ascii, 0 is GDB remote protocol */
51d6a954 33 char *init; /* initialize to the monitor */
054240ec
RS
34 char *execute; /* execute or usually GO command */
35 char *resume; /* continue command */
36 char *step; /* single step */
37 char *set_break; /* set a breakpoint */
38 char *clr_break; /* clear a breakpoint */
7804e5bc 39 int clr_type; /* number or address for clearing */
51d6a954
RS
40 struct rom_cmd_data setmem; /* set memory to a value */
41 struct rom_cmd_data getmem; /* display memory */
42 struct rom_cmd_data regset; /* set a register */
43 struct rom_cmd_data regget; /* read a register */
44 char *load; /* load command */
054240ec
RS
45 char *prompt; /* monitor command prompt */
46 char *cmd_delim; /* end-of-command delimitor */
47 char *cmd_end; /* optional command terminator */
51d6a954
RS
48 struct target_ops *target; /* target operations */
49 char *loadtypes; /* the load types that are supported */
b3b8d9bf 50 char *loadprotos; /* the load protocols that are supported */
cf51c601
RS
51 char *baudrates; /* supported baud rates */
52 int stopbits; /* number of stop bits */
51d6a954 53 char **regnames; /* array of register names in ascii */
054240ec
RS
54};
55
56extern struct monitor_ops *current_monitor;
57
51d6a954
RS
58#define PROTO_TYPE (current_monitor->type)
59#define LOADTYPES (current_monitor->loadtypes)
b3b8d9bf 60#define LOADPROTOS (current_monitor->loadprotos)
51d6a954 61#define INIT_CMD (current_monitor->init)
054240ec
RS
62#define GO_CMD (current_monitor->execute)
63#define CONT_CMD (current_monitor->resume)
64#define STEP_CMD (current_monitor->step)
65#define SET_BREAK_CMD (current_monitor->set_break)
66#define CLR_BREAK_CMD (current_monitor->clr_break)
7804e5bc 67#define CLR_BREAK_ADDR (current_monitor->clr_type)
51d6a954
RS
68#define SET_MEM (current_monitor->setmem)
69#define GET_MEM (current_monitor->getmem)
054240ec 70#define LOAD_CMD (current_monitor->load)
51d6a954
RS
71#define GET_REG (current_monitor->regget)
72#define SET_REG (current_monitor->regset)
054240ec
RS
73#define CMD_END (current_monitor->cmd_end)
74#define CMD_DELIM (current_monitor->cmd_delim)
75#define PROMPT (current_monitor->prompt)
51d6a954
RS
76#define TARGET_OPS (current_monitor->target)
77#define TARGET_NAME (current_monitor->target->to_shortname)
cf51c601
RS
78#define BAUDRATES (current_monitor->baudrates)
79#define STOPBITS (current_monitor->stopbits)
51d6a954
RS
80#define REGNAMES(x) (current_monitor->regnames[x])
81#define ROMCMD(x) (x.cmd)
82#define ROMDELIM(x) (x.delim)
83#define ROMRES(x) (x.result)
054240ec
RS
84
85#define push_monitor(x) current_monitor = x;
51d6a954 86
df3cf84a 87#define SREC_SIZE 160
0b0669fe 88#define GDBPROTO ((current_monitor->type) ? 0: 1)
df3cf84a 89
e6fa5bd6 90extern void debuglogs();
51d6a954
RS
91extern void monitor_open();
92extern void monitor_close();
93extern void monitor_detach();
7804e5bc 94extern void monitor_attach();
51d6a954
RS
95extern void monitor_resume();
96extern int monitor_wait();
97extern void monitor_fetch_register();
98extern void monitor_store_register();
0b0669fe
RS
99extern void monitor_fetch_registers();
100extern void monitor_store_registers();
51d6a954
RS
101extern void monitor_prepare_to_store();
102extern int monitor_xfer_inferior_memory();
103extern void monitor_files_info();
104extern int monitor_insert_breakpoint();
105extern int monitor_remove_breakpoint();
106extern void monitor_kill();
107extern void monitor_load();
108extern void monitor_create_inferior();
109extern void monitor_mourn_inferior();
df3cf84a
RS
110
111/*
112 * FIXME: These are to temporarily maintain compatability with the
113 * old monitor structure till remote-mon.c is fixed to work
114 * like the *-rom.c files.
115 */
116#define MEM_PROMPT (current_monitor->loadtypes)
117#define MEM_SET_CMD (current_monitor->setmem)
118#define MEM_DIS_CMD (current_monitor->getmem)
119#define REG_DELIM (current_monitor->regset.delim)
This page took 0.17025 seconds and 4 git commands to generate.