diff options
author | John Metzler <jmetzler@cygnus> | 1998-11-13 01:23:07 +0000 |
---|---|---|
committer | John Metzler <jmetzler@cygnus> | 1998-11-13 01:23:07 +0000 |
commit | 9ee5984468eca955f7fa9d27394c6939e3d1abb1 (patch) | |
tree | 6a9830d5e75cca69816c84b2f47a3f67a47fe5a9 /gdb/thread.c | |
parent | b91e1ec1e4c0c87fd144c013b9c1c44287ef0c45 (diff) | |
download | gdb-9ee5984468eca955f7fa9d27394c6939e3d1abb1.zip gdb-9ee5984468eca955f7fa9d27394c6939e3d1abb1.tar.gz gdb-9ee5984468eca955f7fa9d27394c6939e3d1abb1.tar.bz2 |
* remote.c (remote_get_threadinfo) : Support for remote
multithread debugging.
(remote_get_threadlist) : get a partial list of threads
(remote_threadlist_iterator) : Step through all the threads
(init_remote_threadtests) : Optional builtin unit test commands.
* thread.c (bind_target_thread_vector) : Implementa a more dynamic
way of accessing target specific thread info functions than
FIND_NEW_THREADS.
(target_thread_info) : Function to get extended thread information.
* gdbthread.h : Export internal data structures corresponding to
external detailed thread info response. This is more like a 'ps'
command than what might be expected of host based threads. This
is for embedded systems.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r-- | gdb/thread.c | 94 |
1 files changed, 88 insertions, 6 deletions
diff --git a/gdb/thread.c b/gdb/thread.c index 149109d..a2d052a 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -55,22 +55,104 @@ struct thread_info int another_trap; }; -static struct thread_info *thread_list = NULL; -static int highest_thread_num; + +static struct target_thread_vector *target_thread_functions; + +int +target_find_new_threads () +{ + int retval = 0; + if (target_thread_functions && + target_thread_functions->find_new_threads) + retval = (*(target_thread_functions->find_new_threads)) (); + return retval; /* no support */ +} + + +int +target_get_thread_info PARAMS (( + gdb_threadref * ref, + int selection, /* FIXME: Selection */ + struct gdb_ext_thread_info * info)); + +int +target_get_thread_info (ref, selection, info) + + gdb_threadref *ref; + int selection; + /* FIXME: Selection */ + struct gdb_ext_thread_info *info; + +{ + int retval = 0; + if (target_thread_functions + && target_thread_functions->get_thread_info) + retval = (*(target_thread_functions->get_thread_info)) (ref, selection, info); + return retval; +} + + +/* It is possible that these bind and unbinf functions implement a + stack the interface allows it, but its not implemented that way + */ + + +void +bind_target_thread_vector (vec) + struct target_thread_vector *vec; +{ + target_thread_functions = vec; +} /* Prototypes for exported functions. */ +struct target_thread_vector * +unbind_target_thread_vector () +{ + struct target_thread_vector *retval; + retval = target_thread_functions; + target_thread_functions = 0; + return retval; +} /* unbind_target_thread-vector */ + void _initialize_thread PARAMS ((void)); + /* Prototypes for local functions. */ +/* If the host has threads, the host machine definition may + set this macro. But, for remote thread debugging, it gets more + complex and setting macros does not bind to the various target + dependent methods well. So, we use the vector target_thread_functions + */ +#if !defined(FIND_NEW_THREADS) +#define FIND_NEW_THREADS target_find_new_threads +#endif + +static struct thread_info *thread_list = NULL; +static int highest_thread_num; -static void thread_command PARAMS ((char * tidstr, int from_tty)); +static void +thread_command PARAMS ((char * tidstr, int from_tty)); +static void +prune_threads PARAMS ((void)); -static void prune_threads PARAMS ((void)); +static void +switch_to_thread PARAMS ((int pid)); -static void switch_to_thread PARAMS ((int pid)); +static struct thread_info * +find_thread_id PARAMS ((int num)); -static struct thread_info *find_thread_id PARAMS ((int num)); +static void +info_threads_command PARAMS ((char *, int)); + +static void +restore_current_thread PARAMS ((int)); + +static void +thread_apply_all_command PARAMS ((char *, int)); + +static void +thread_apply_command PARAMS ((char *, int)); static void info_threads_command PARAMS ((char *, int)); |