/* Interface between GDB and target environments, including files and processes
- Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by John Gilmore.
This file is part of GDB.
process_stratum /* Executing processes */
};
+enum thread_control_capabilities {
+ tc_none = 0, /* Default: can't control thread execution. */
+ tc_schedlock = 1, /* Can lock the thread scheduler. */
+ tc_switch = 2 /* Can switch the running thread on demand. */
+};
+
/* Stuff for target_wait. */
/* Generally, what has the program done? */
signals (insofar as various unices use the same numbers, anyway).
It is also the numbering of the GDB remote protocol. Other remote
protocols, if they use a different numbering, should make sure to
- translate appropriately. */
+ translate appropriately.
-/* This is based strongly on Unix/POSIX signals for several reasons:
+ Since these numbers have actually made it out into other software
+ (stubs, etc.), you mustn't disturb the assigned numbering. If you
+ need to add new signals here, add them to the end of the explicitly
+ numbered signals.
+
+ This is based strongly on Unix/POSIX signals for several reasons:
(1) This set of signals represents a widely-accepted attempt to
represent events of this sort in a portable fashion, (2) we want a
signal to make it from wait to child_wait to the user intact, (3) many
TARGET_SIGNAL_REALTIME_61 = 73,
TARGET_SIGNAL_REALTIME_62 = 74,
TARGET_SIGNAL_REALTIME_63 = 75,
+
+ /* Used internally by Solaris threads. See signal(5) on Solaris. */
+ TARGET_SIGNAL_CANCEL = 76,
+
#if defined(MACH) || defined(__MACH__)
/* 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,
+ TARGET_EXC_BAD_ACCESS,
+ TARGET_EXC_BAD_INSTRUCTION,
+ TARGET_EXC_ARITHMETIC,
+ TARGET_EXC_EMULATION,
+ TARGET_EXC_SOFTWARE,
+ TARGET_EXC_BREAKPOINT,
#endif
+ TARGET_SIGNAL_INFO,
+
/* Some signal we don't know about. */
TARGET_SIGNAL_UNKNOWN,
int (*to_can_run) PARAMS ((void));
void (*to_notice_signals) PARAMS ((int pid));
int (*to_thread_alive) PARAMS ((int pid));
+ void (*to_find_new_threads) PARAMS ((void));
void (*to_stop) PARAMS ((void));
+ int (*to_query) PARAMS ((int/*char*/, char *, char *, int *));
struct symtab_and_line * (*to_enable_exception_callback) PARAMS ((enum exception_event_kind, int));
struct exception_event_record * (*to_get_current_exception_event) PARAMS ((void));
char * (*to_pid_to_exec_file) PARAMS ((int pid));
int to_has_stack;
int to_has_registers;
int to_has_execution;
+ int to_has_thread_control; /* control thread execution */
struct section_table
*to_sections;
struct section_table
extern char *
child_core_file_to_sym_file PARAMS ((char *));
+#if defined(CHILD_POST_ATTACH)
extern void
child_post_attach PARAMS ((int));
+#endif
extern void
child_post_wait PARAMS ((int, int));
#define target_thread_alive(pid) \
(*current_target.to_thread_alive) (pid)
+/* Query for new threads and add them to the thread list. */
+
+#define target_find_new_threads() \
+ do { \
+ if (current_target.to_find_new_threads) \
+ (*current_target.to_find_new_threads) (); \
+ } while (0);
+
/* 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. */
#define target_stop current_target.to_stop
+/* Queries the target side for some information. The first argument is a
+ letter specifying the type of the query, which is used to determine who
+ should process it. The second argument is a string that specifies which
+ information is desired and the third is a buffer that carries back the
+ response from the target side. The fourth parameter is the size of the
+ output buffer supplied. */
+
+#define target_query(query_type, query, resp_buffer, bufffer_size) \
+ (*current_target.to_query) (query_type, query, resp_buffer, bufffer_size)
+
/* Get the symbol information for a breakpointable routine called when
an exception event occurs.
Intended mainly for C++, and for those
#define target_has_execution \
(current_target.to_has_execution)
+/* Can the target support the debugger control of thread execution?
+ a) Can it lock the thread scheduler?
+ b) Can it switch the currently running thread? */
+
+#define target_can_lock_scheduler \
+ (current_target.to_has_thread_control & tc_schedlock)
+
+#define target_can_switch_threads \
+ (current_target.to_has_thread_control & tc_switch)
+
extern void target_link PARAMS ((char *, CORE_ADDR *));
/* Converts a process id to a string. Usually, the string just contains
void
find_default_clone_and_follow_inferior PARAMS ((int, int *));
+extern struct target_ops *find_run_target PARAMS ((void));
+
extern struct target_ops *
find_core_target PARAMS ((void));
\f