1 |
/* This file defines the interface between the simulator and gdb. |
/* This file defines the interface between the simulator and gdb. |
2 |
Copyright 1993, 1994, 1996, 1997, 1998, 2000 |
|
3 |
Free Software Foundation, Inc. |
Copyright 1993, 1994, 1996, 1997, 1998, 2000, 2002 Free Software |
4 |
|
Foundation, Inc. |
5 |
|
|
6 |
This file is part of GDB. |
This file is part of GDB. |
7 |
|
|
58 |
|
|
59 |
typedef enum { |
typedef enum { |
60 |
SIM_RC_FAIL = 0, |
SIM_RC_FAIL = 0, |
61 |
SIM_RC_OK = 1, |
SIM_RC_OK = 1 |
|
SIM_RC_UNKNOWN_BREAKPOINT = 2, |
|
|
SIM_RC_INSUFFICIENT_RESOURCES = 3, |
|
|
SIM_RC_DUPLICATE_BREAKPOINT = 4 |
|
62 |
} SIM_RC; |
} SIM_RC; |
63 |
|
|
64 |
|
|
65 |
/* The bfd struct, as an opaque type. */ |
/* The bfd struct, as an opaque type. */ |
66 |
|
|
67 |
struct _bfd; |
struct bfd; |
68 |
|
|
69 |
|
|
70 |
/* Main simulator entry points. */ |
/* Main simulator entry points. */ |
105 |
sim_create_inferior. FIXME: What should the state of the simulator |
sim_create_inferior. FIXME: What should the state of the simulator |
106 |
be? */ |
be? */ |
107 |
|
|
108 |
SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct _bfd *abfd, char **argv)); |
SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, char **argv)); |
109 |
|
|
110 |
|
|
111 |
/* Destory a simulator instance. |
/* Destory a simulator instance. |
142 |
Such manipulation should probably (?) occure in |
Such manipulation should probably (?) occure in |
143 |
sim_create_inferior. */ |
sim_create_inferior. */ |
144 |
|
|
145 |
SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tty)); |
SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty)); |
146 |
|
|
147 |
|
|
148 |
/* Prepare to run the simulated program. |
/* Prepare to run the simulated program. |
162 |
address space (according to the applicable ABI) and the program |
address space (according to the applicable ABI) and the program |
163 |
counter and stack pointer set accordingly. */ |
counter and stack pointer set accordingly. */ |
164 |
|
|
165 |
SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct _bfd *abfd, char **argv, char **env)); |
SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct bfd *abfd, char **argv, char **env)); |
166 |
|
|
167 |
|
|
168 |
/* Fetch LENGTH bytes of the simulated program's memory. Start fetch |
/* Fetch LENGTH bytes of the simulated program's memory. Start fetch |
275 |
|
|
276 |
void sim_do_command PARAMS ((SIM_DESC sd, char *cmd)); |
void sim_do_command PARAMS ((SIM_DESC sd, char *cmd)); |
277 |
|
|
|
/* Call these functions to set and clear breakpoints at ADDR. */ |
|
|
|
|
|
SIM_RC sim_set_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); |
|
|
SIM_RC sim_clear_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); |
|
|
SIM_RC sim_clear_all_breakpoints PARAMS ((SIM_DESC sd)); |
|
|
|
|
|
/* These functions are used to enable and disable breakpoints. */ |
|
|
|
|
|
SIM_RC sim_enable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); |
|
|
SIM_RC sim_disable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); |
|
|
SIM_RC sim_enable_all_breakpoints PARAMS ((SIM_DESC sd)); |
|
|
SIM_RC sim_disable_all_breakpoints PARAMS ((SIM_DESC sd)); |
|
|
|
|
|
|
|
|
/* Provide simulator with a default (global) host_callback_struct. |
|
|
THIS PROCEDURE IS DEPRECIATED. |
|
|
GDB and NRUN do not use this interface. |
|
|
This procedure does not take a SIM_DESC argument as it is |
|
|
used before sim_open. */ |
|
|
|
|
|
void sim_set_callbacks PARAMS ((struct host_callback_struct *)); |
|
|
|
|
|
|
|
|
/* Set the size of the simulator memory array. |
|
|
THIS PROCEDURE IS DEPRECIATED. |
|
|
GDB and NRUN do not use this interface. |
|
|
This procedure does not take a SIM_DESC argument as it is |
|
|
used before sim_open. */ |
|
|
|
|
|
void sim_size PARAMS ((int i)); |
|
|
|
|
|
|
|
|
/* Single-step simulator with tracing enabled. |
|
|
THIS PROCEDURE IS DEPRECIATED. |
|
|
THIS PROCEDURE IS EVEN MORE DEPRECATED THAN SIM_SET_TRACE |
|
|
GDB and NRUN do not use this interface. |
|
|
This procedure returns: ``0'' indicating that the simulator should |
|
|
be continued using sim_trace() calls; ``1'' indicating that the |
|
|
simulation has finished. */ |
|
|
|
|
|
int sim_trace PARAMS ((SIM_DESC sd)); |
|
|
|
|
|
|
|
|
/* Enable tracing. |
|
|
THIS PROCEDURE IS DEPRECIATED. |
|
|
GDB and NRUN do not use this interface. |
|
|
This procedure returns: ``0'' indicating that the simulator should |
|
|
be continued using sim_trace() calls; ``1'' indicating that the |
|
|
simulation has finished. */ |
|
|
|
|
|
void sim_set_trace PARAMS ((void)); |
|
|
|
|
|
|
|
|
/* Configure the size of the profile buffer. |
|
|
THIS PROCEDURE IS DEPRECIATED. |
|
|
GDB and NRUN do not use this interface. |
|
|
This procedure does not take a SIM_DESC argument as it is |
|
|
used before sim_open. */ |
|
|
|
|
|
void sim_set_profile_size PARAMS ((int n)); |
|
|
|
|
|
|
|
|
/* Kill the running program. |
|
|
THIS PROCEDURE IS DEPRECIATED. |
|
|
GDB and NRUN do not use this interface. |
|
|
This procedure will be replaced as part of the introduction of |
|
|
multi-cpu simulators. */ |
|
|
|
|
|
void sim_kill PARAMS ((SIM_DESC sd)); |
|
|
|
|
278 |
#ifdef __cplusplus |
#ifdef __cplusplus |
279 |
} |
} |
280 |
#endif |
#endif |