From 3ab2abae9ac2dc0ab96fc2d1a678b463485b90a0 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Wed, 13 Jan 1999 23:53:30 +0000 Subject: Wed Jan 13 14:59:02 1999 Michael Snyder * infrun.c (set/show scheduler-locking) New command. Set a mode bit that will control how GDB attempts to control thread scheduling for step, continue, etc. (resume): make use of the schedule-locking mode. * target.h (struct target_ops): new field to_has_thread_control. * sol-thread.c: initialize target_ops to_has_thread_control. * procfs.c: ditto. * target.c: ditto. * m3-nat.c: ditto. * remote.c: ditto. * hpux-thread.c: ditto. --- gdb/target.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gdb/target.h') diff --git a/gdb/target.h b/gdb/target.h index ccf047f..c9d6b6e 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -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? */ @@ -361,6 +367,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 @@ -934,6 +941,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 -- cgit v1.1