You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (TARGET_H)
#define TARGET_H
TARGET_SIGNAL_REALTIME_62 = 74,
TARGET_SIGNAL_REALTIME_63 = 75,
+ /* Mach exceptions */
+ TARGET_EXC_BAD_ACCESS = 76,
+ TARGET_EXC_BAD_INSTRUCTION = 77,
+ TARGET_EXC_ARITHMETIC = 78,
+ TARGET_EXC_EMULATION = 79,
+ TARGET_EXC_SOFTWARE = 80,
+ TARGET_EXC_BREAKPOINT = 81,
+
/* Some signal we don't know about. */
TARGET_SIGNAL_UNKNOWN,
void (*to_mourn_inferior) PARAMS ((void));
int (*to_can_run) PARAMS ((void));
void (*to_notice_signals) PARAMS ((int pid));
+ int (*to_thread_alive) PARAMS ((int pid));
void (*to_stop) PARAMS ((void));
enum strata to_stratum;
struct target_ops
extern int target_read_string PARAMS ((CORE_ADDR, char **, int, int *));
extern int
-target_read_memory PARAMS ((CORE_ADDR, char *, int));
+target_read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
+
+extern int
+target_read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr, int len,
+ asection *bfd_section));
extern int
target_read_memory_partial PARAMS ((CORE_ADDR, char *, int, int *));
extern int
child_xfer_memory PARAMS ((CORE_ADDR, char *, int, int, struct target_ops *));
-/* Transfer LEN bytes between target address MEMADDR and GDB address MYADDR.
- Returns 0 for success, errno code for failure (which includes partial
- transfers--if you want a more useful response to partial transfers, try
- target_read_memory_partial). */
-
-extern int target_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
- int len, int write));
-
/* From exec.c */
extern void
#define target_notice_signals(pid) \
(*current_target.to_notice_signals) (pid)
+/* Check to see if a thread is still alive. */
+
+#define target_thread_alive(pid) \
+ (*current_target.to_thread_alive) (pid)
+
/* Make target stop in a continuable fashion. (For instance, under Unix, this
should act like SIGSTOP). This function is normally used by GUIs to
implement a stop button. */
extern char *normal_pid_to_str PARAMS ((int pid));
#endif
+#ifndef target_new_objfile
+#define target_new_objfile(OBJFILE)
+#endif
+
+/* Hook to call target-dependant code after reading in a new symbol table. */
+
+#ifndef TARGET_SYMFILE_POSTREAD
+#define TARGET_SYMFILE_POSTREAD(OBJFILE)
+#endif
+
+/* Hook to call target dependant code just after inferior target process has
+ started. */
+
+#ifndef TARGET_CREATE_INFERIOR_HOOK
+#define TARGET_CREATE_INFERIOR_HOOK(PID)
+#endif
+
/* Hardware watchpoint interfaces. */
/* Returns non-zero if we were stopped by a hardware watchpoint (memory read or
#define STOPPED_BY_WATCHPOINT(w) 0
#endif
+/* Provide defaults for systems that don't support hardware watchpoints. */
+
+#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS
+
+/* Returns non-zero if we can set a hardware watchpoint of type TYPE. TYPE is
+ one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint, or
+ bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
+ (including this one?). OTHERTYPE is who knows what... */
+
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) 0
+
+/* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes. TYPE is 0
+ for write, 1 for read, and 2 for read/write accesses. Returns 0 for
+ success, non-zero for failure. */
+
+#define target_remove_watchpoint(ADDR,LEN,TYPE) -1
+#define target_insert_watchpoint(ADDR,LEN,TYPE) -1
+
+#endif /* TARGET_HAS_HARDWARE_WATCHPOINTS */
+
+#ifndef target_insert_hw_breakpoint
+#define target_remove_hw_breakpoint(ADDR,SHADOW) -1
+#define target_insert_hw_breakpoint(ADDR,SHADOW) -1
+#endif
+
+#ifndef target_stopped_data_address
+#define target_stopped_data_address() 0
+#endif
+
+/* If defined, then we need to decr pc by this much after a hardware break-
+ point. Presumably this overrides DECR_PC_AFTER_BREAK... */
+
+#ifndef DECR_PC_AFTER_HW_BREAK
+#define DECR_PC_AFTER_HW_BREAK 0
+#endif
+
/* Routines for maintenance of the target structures...
add_target: Add a target to the list of all possible targets.
extern int
memory_insert_breakpoint PARAMS ((CORE_ADDR, char *));
+unsigned char *
+memory_breakpoint_from_pc PARAMS ((CORE_ADDR *pcptr, int *lenptr));
+
/* From target.c */
-void
+extern void
+initialize_targets PARAMS ((void));
+
+extern void
noprocess PARAMS ((void));
-void
+extern void
find_default_attach PARAMS ((char *, int));
-void
+extern void
find_default_create_inferior PARAMS ((char *, char *, char **));
-struct target_ops *
+extern struct target_ops *
find_core_target PARAMS ((void));
\f
/* Stuff that should be shared among the various remote targets. */
/* Speed in bits per second, or -1 which means don't mess with the speed. */
extern int baud_rate;
+/* Timeout limit for response from target. */
+extern int remote_timeout;
+
+extern asection *target_memory_bfd_section;
\f
/* Functions for helping to write a native target. */
/* Convert from a number used in a GDB command to an enum target_signal. */
extern enum target_signal target_signal_from_command PARAMS ((int));
+/* Any target can call this to switch to remote protocol (in remote.c). */
+extern void push_remote_target PARAMS ((char *name, int from_tty));
+\f
+/* Imported from machine dependent code */
+
+#ifdef NO_SINGLE_STEP
+extern int one_stepped;
+extern void single_step PARAMS ((enum target_signal));
+#endif /* NO_SINGLE_STEP */
+
#endif /* !defined (TARGET_H) */