1 /* This file defines the interface between the simulator and gdb.
2 Copyright (C) 1993 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #if !defined (REMOTE_SIM_H)
21 #define REMOTE_SIM_H 1
23 /* This file is used when building stand-alone simulators, so isolate this
26 /* Pick up CORE_ADDR_TYPE if defined (from gdb), otherwise use same value as
27 gdb does (unsigned int - from defs.h). */
29 #ifndef CORE_ADDR_TYPE
30 typedef unsigned int SIM_ADDR
;
32 typedef CORE_ADDR_TYPE SIM_ADDR
;
35 /* Main simulator globals ... */
37 extern int sim_verbose
;
39 /* Main simulator entry points ...
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
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.
48 ARGS is the raw character string and must be parsed by the simulator.
50 Returns 0 for success, non-zero for failure (FIXME: how do we say what
51 kind of failure it was?). */
53 int sim_open
PARAMS ((char *name
));
55 /* Load program PROG into the simulator.
56 We use "void *" instead of "bfd *" to isolate this file from BFD. */
58 int sim_load
PARAMS ((void *bfd_handle
, char *args
));
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. */
65 int sim_set_args
PARAMS ((char **argv
, char **env
));
67 /* Fetch register REGNO and store the raw value in BUF. */
69 int sim_fetch_register
PARAMS ((int regno
, unsigned char *buf
));
71 /* Store register REGNO from BUF (in raw format). */
73 int sim_store_register
PARAMS ((int regno
, unsigned char *buf
));
75 /* Kill the running program.
76 This may involve closing any open files and deleting any mmap'd areas. */
78 int sim_kill
PARAMS ((void));
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. */
83 int sim_read
PARAMS ((SIM_ADDR mem
, unsigned char *buf
, int length
));
85 /* Store LENGTH bytes from BUF in the simulated program's memory.
86 Result is number of bytes write, or zero if error. */
88 int sim_write
PARAMS ((SIM_ADDR mem
, unsigned char *buf
, int length
));
90 /* Print some interesting information about the simulator.
91 VERBOSE is non-zero for the wordy version. */
93 int sim_info
PARAMS ((void (*printf_fn
)(), int verbose
));
95 /* Set the simulated cpu's program counter to PC. */
97 int sim_set_pc
PARAMS ((SIM_ADDR pc
));
99 /* Fetch why the program stopped.
100 SIGRC will contain either the argument to exit() or the signal number. */
102 enum sim_stop
{ sim_exited
, sim_stopped
, sim_signalled
};
104 int sim_stop_reason
PARAMS ((enum sim_stop
*reason
, int *sigrc
));
106 /* Run (or resume) the program. */
108 int sim_resume
PARAMS ((int step
, int siggnal
));
110 #endif /* !defined (REMOTE_SIM_H) */
This page took 0.032238 seconds and 4 git commands to generate.