2003-01-06 Michael Snyder * lin-lwp.c (lin_lwp_wait): Allow the event thread to receive kill (SIGSTOP) along with everyone else, and do a corresponding waitpid on the event thread. This will help us adapt gdb to work with the new kernel and its different thread model. Index: lin-lwp.c =================================================================== RCS file: /cvs/src/src/gdb/lin-lwp.c,v retrieving revision 1.40 diff -p -r1.40 lin-lwp.c *** lin-lwp.c 6 Jan 2003 23:12:29 -0000 1.40 --- lin-lwp.c 6 Jan 2003 23:14:44 -0000 *************** lin_lwp_wait (ptid_t ptid, struct target *** 1358,1377 **** } } ! /* This LWP is stopped now. */ ! lp->stopped = 1; ! if (debug_lin_lwp) ! fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n", ! status_to_str (status), ! target_pid_to_str (lp->ptid)); ! /* Now stop all other LWP's ... */ ! iterate_over_lwps (stop_callback, NULL); ! /* ... and wait until all of them have reported back that they're no ! longer running. */ ! iterate_over_lwps (stop_wait_callback, &flush_mask); /* If we're not waiting for a specific LWP, choose an event LWP from among those that have had events. Giving equal priority to all --- 1358,1388 ---- } } ! /* Stop all other LWPs, if any. */ ! if (!WIFEXITED (status)) /* Can't stop it if it's exited... */ ! { ! if (debug_lin_lwp) ! fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n", ! status_to_str (status), ! target_pid_to_str (lp->ptid)); ! /* Now stop all other LWP's ... */ ! iterate_over_lwps (stop_callback, NULL); ! /* The event thread must now be continued, before it can be ! waited again. */ ! errno = 0; ! ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); ! if (debug_lin_lwp) ! fprintf_unfiltered (gdb_stdlog, ! "LLW: PTRACE_CONT %s, 0, 0 (%s)\n", ! target_pid_to_str (lp->ptid), ! errno ? safe_strerror (errno) : "OK"); ! /* ... and wait until all of them have reported back that they're no ! longer running. */ ! iterate_over_lwps (stop_wait_callback, &flush_mask); ! } /* If we're not waiting for a specific LWP, choose an event LWP from among those that have had events. Giving equal priority to all