* gdb.texinfo (Continuing and Stepping): When talking about "step"
[deliverable/binutils-gdb.git] / gdb / remote-sim.h
CommitLineData
b562a186
DE
1/* This file defines the interface between the simulator and gdb.
2 Copyright (C) 1993 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20#if !defined (REMOTE_SIM_H)
21#define REMOTE_SIM_H 1
22
c7efaa16
DE
23/* This file is used when building stand-alone simulators, so isolate this
24 file from gdb. */
25
26/* Pick up CORE_ADDR_TYPE if defined (from gdb), otherwise use same value as
27 gdb does (unsigned int - from defs.h). */
28
29#ifndef CORE_ADDR_TYPE
30typedef unsigned int SIM_ADDR;
31#else
32typedef CORE_ADDR_TYPE SIM_ADDR;
33#endif
34
b562a186
DE
35/* Main simulator globals ... */
36
37extern int sim_verbose;
38
39/* Main simulator entry points ...
40
c7efaa16
DE
41 Except where noted, all functions return 0 for success and non-zero for
42 failure. Sometimes there won't be much possibility of error, but maybe
43 in the future. */
b562a186
DE
44
45/* Initialize the simulator. This function is called when the simulator
46 is selected from the command line. ARGS is passed from the command line
47 and can be used to select whatever run time options the simulator provides.
40b92220
JK
48 ARGS is the raw character string and must be parsed by the simulator.
49
50 Returns 0 for success, non-zero for failure (FIXME: how do we say what
51 kind of failure it was?). */
b562a186
DE
52
53int sim_open PARAMS ((char *name));
54
55/* Load program PROG into the simulator.
56 We use "void *" instead of "bfd *" to isolate this file from BFD. */
57
58int sim_load PARAMS ((void *bfd_handle, char *args));
59
60/* Set the arguments and environment for the program loaded into the
61 simulator. ARGV and ENV are NULL terminated lists of pointers.
62 If the simulator doesn't support setting arguments, print an error message
63 and return non-zero. */
64
65int sim_set_args PARAMS ((char **argv, char **env));
66
67/* Fetch register REGNO and store the raw value in BUF. */
68
c7efaa16 69int sim_fetch_register PARAMS ((int regno, unsigned char *buf));
b562a186
DE
70
71/* Store register REGNO from BUF (in raw format). */
72
c7efaa16 73int sim_store_register PARAMS ((int regno, unsigned char *buf));
b562a186
DE
74
75/* Kill the running program.
76 This may involve closing any open files and deleting any mmap'd areas. */
77
78int sim_kill PARAMS ((void));
79
592f517a
DE
80/* Read LENGTH bytes of the simulated program's memory and store in BUF.
81 Result is number of bytes read, or zero if error. */
b562a186 82
c7efaa16 83int sim_read PARAMS ((SIM_ADDR mem, unsigned char *buf, int length));
b562a186 84
592f517a
DE
85/* Store LENGTH bytes from BUF in the simulated program's memory.
86 Result is number of bytes write, or zero if error. */
b562a186 87
c7efaa16 88int sim_write PARAMS ((SIM_ADDR mem, unsigned char *buf, int length));
b562a186 89
c7efaa16
DE
90/* Print some interesting information about the simulator.
91 VERBOSE is non-zero for the wordy version. */
b562a186 92
c7efaa16 93int sim_info PARAMS ((void (*printf_fn)(), int verbose));
b562a186
DE
94
95/* Set the simulated cpu's program counter to PC. */
96
c7efaa16 97int sim_set_pc PARAMS ((SIM_ADDR pc));
b562a186 98
592f517a
DE
99/* Fetch why the program stopped.
100 SIGRC will contain either the argument to exit() or the signal number. */
b562a186 101
592f517a
DE
102enum sim_stop { sim_exited, sim_stopped, sim_signalled };
103
c7efaa16 104int sim_stop_reason PARAMS ((enum sim_stop *reason, int *sigrc));
b562a186
DE
105
106/* Run (or resume) the program. */
107
108int sim_resume PARAMS ((int step, int siggnal));
109
110#endif /* !defined (REMOTE_SIM_H) */
This page took 0.063145 seconds and 4 git commands to generate.