diff options
author | Pedro Alves <palves@redhat.com> | 2008-09-08 21:30:23 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-09-08 21:30:23 +0000 |
commit | 62a93fa9cbc7a5db0db8919f1a0b76ff401f7af5 (patch) | |
tree | 44c70276097475a8ea6abfe9036853fec1068ded | |
parent | 438ac09b47f7fbd1cf7b8dff0c2275546100c2a4 (diff) | |
download | gdb-62a93fa9cbc7a5db0db8919f1a0b76ff401f7af5.zip gdb-62a93fa9cbc7a5db0db8919f1a0b76ff401f7af5.tar.gz gdb-62a93fa9cbc7a5db0db8919f1a0b76ff401f7af5.tar.bz2 |
* inf-ttrace.c (inf_ttrace_wait): On TTEVT_LWP_CREATE and
LWP_TERMINATE, resume the caller thread. On TTEVT_LWP_CREATE,
TTEVT_LWP_EXIT and TTEVT_LWP_TERMINATE, don't stop the whole
process, and return TARGET_WAITKIND_IGNORE.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/inf-ttrace.c | 26 |
2 files changed, 27 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cbb3050..aafe0a0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2008-09-08 Pedro Alves <pedro@codesourcery.com> + * inf-ttrace.c (inf_ttrace_wait): On TTEVT_LWP_CREATE and + LWP_TERMINATE, resume the caller thread. On TTEVT_LWP_CREATE, + TTEVT_LWP_EXIT and TTEVT_LWP_TERMINATE, don't stop the whole + process, and return TARGET_WAITKIND_IGNORE. + +2008-09-08 Pedro Alves <pedro@codesourcery.com> + * inf-ttrace.c: Include <signal.h> (inf_ttrace_delete_dead_threads_callback): New. (inf_ttrace_resume_lwp): New. diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index 8284561..0ad9157 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -1040,7 +1040,12 @@ inf_ttrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus) sizeof (struct inf_ttrace_private_thread_info)); inf_ttrace_num_lwps++; ptid = ptid_build (tts.tts_pid, tts.tts_lwpid, 0); - break; + /* Let the lwp_create-caller thread continue. */ + ttrace (TT_LWP_CONTINUE, ptid_get_pid (ptid), + ptid_get_lwp (ptid), TT_NOPC, 0, 0); + /* Return without stopping the whole process. */ + ourstatus->kind = TARGET_WAITKIND_IGNORE; + return ptid; case TTEVT_LWP_EXIT: if (print_thread_events) @@ -1049,22 +1054,31 @@ inf_ttrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus) gdb_assert (ti != NULL); ((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1; inf_ttrace_num_lwps--; + /* Let the thread really exit. */ ttrace (TT_LWP_CONTINUE, ptid_get_pid (ptid), ptid_get_lwp (ptid), TT_NOPC, 0, 0); - /* If we don't return -1 here, core GDB will re-add the thread. */ - ptid = minus_one_ptid; - break; + /* Return without stopping the whole process. */ + ourstatus->kind = TARGET_WAITKIND_IGNORE; + return ptid; case TTEVT_LWP_TERMINATE: lwpid = tts.tts_u.tts_thread.tts_target_lwpid; ptid = ptid_build (tts.tts_pid, lwpid, 0); - printf_filtered(_("[%s has been terminated]\n"), target_pid_to_str (ptid)); + if (print_thread_events) + printf_unfiltered(_("[%s has been terminated]\n") + target_pid_to_str (ptid)); ti = find_thread_pid (ptid); gdb_assert (ti != NULL); ((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1; inf_ttrace_num_lwps--; + + /* Resume the lwp_terminate-caller thread. */ ptid = ptid_build (tts.tts_pid, tts.tts_lwpid, 0); - break; + ttrace (TT_LWP_CONTINUE, ptid_get_pid (ptid), + ptid_get_lwp (ptid), TT_NOPC, 0, 0); + /* Return without stopping the whole process. */ + ourstatus->kind = TARGET_WAITKIND_IGNORE; + return ptid; case TTEVT_SIGNAL: ourstatus->kind = TARGET_WAITKIND_STOPPED; |