1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / target.h
index ccf047f7f9dc8a66df99796534f7f65e7671ef56..f44d3e4754ad101625bce601530c073997b5c101 100644 (file)
@@ -51,6 +51,12 @@ enum strata {
        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?  */
@@ -349,6 +355,7 @@ struct target_ops
   void       (*to_notice_signals) PARAMS ((int pid));
   int        (*to_thread_alive) PARAMS ((int pid));
   void       (*to_stop) PARAMS ((void));
+  int        (*to_query) PARAMS ((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));
@@ -361,6 +368,7 @@ struct target_ops
   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
@@ -551,8 +559,10 @@ child_pid_to_exec_file PARAMS ((int));
 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));
@@ -881,6 +891,16 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
 
 #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
@@ -934,6 +954,16 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
 #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
This page took 0.022998 seconds and 4 git commands to generate.