diff options
author | Pedro Alves <palves@redhat.com> | 2008-07-09 10:58:41 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-07-09 10:58:41 +0000 |
commit | 5e0b29c16aca01c2a9a8ae251ee7998d96a32124 (patch) | |
tree | e9a87376385f76ac3104fce63e1bd7b9964ed712 /gdb/thread.c | |
parent | a4a9b1c4f23dbe0165cce217f253c38e845b0030 (diff) | |
download | gdb-5e0b29c16aca01c2a9a8ae251ee7998d96a32124.zip gdb-5e0b29c16aca01c2a9a8ae251ee7998d96a32124.tar.gz gdb-5e0b29c16aca01c2a9a8ae251ee7998d96a32124.tar.bz2 |
* monitor (monitor_ptid): New global.
(monitor_open): Silently add the main task to GDB's thread list.
(monitor_close, monitor_mourn_inferior): Silently delete the main
task from GDB's thread list.
(monitor_thread_alive, monitor_pid_to_str): New.
(init_base_monitor_ops): Register monitor_thread_alive and
monitor_pid_to_str.
(_initialize_remote_monitors): Initialize monitor_ptid.
* gdbthread.h (delete_thread_silent): Declare.
* thread.c (delete_thread): Rename to ...
(delete_thread_1): ... this. Add "silent" parameter. If silent,
don't do exit notifications.
(delete_thread, delete_thread_silent): New, as wrappers to
delete_thread_1.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r-- | gdb/thread.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gdb/thread.c b/gdb/thread.c index 5b1b563..aa18228 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -153,8 +153,10 @@ add_thread (ptid_t ptid) return add_thread_with_info (ptid, NULL); } -void -delete_thread (ptid_t ptid) +/* Delete thread PTID. If SILENT, don't notify the observer of this + exit. */ +static void +delete_thread_1 (ptid_t ptid, int silent) { struct thread_info *tp, *tpprev; @@ -172,11 +174,24 @@ delete_thread (ptid_t ptid) else thread_list = tp->next; - observer_notify_thread_exit (tp); + if (!silent) + observer_notify_thread_exit (tp); free_thread (tp); } +void +delete_thread (ptid_t ptid) +{ + delete_thread_1 (ptid, 0 /* not silent */); +} + +void +delete_thread_silent (ptid_t ptid) +{ + delete_thread_1 (ptid, 1 /* silent */); +} + static struct thread_info * find_thread_id (int num) { |