This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] minor comment cleanups, lin-lwp.c
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] minor comment cleanups, lin-lwp.c
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 26 Apr 2001 15:36:38 -0700
- Organization: Red Hat
2001-04-26 Michael Snyder <msnyder@redhat.com>
* lin-lwp.c: Minor cleanups in comments.
Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 lin-lwp.c
*** lin-lwp.c 2001/04/06 17:53:39 1.8
--- lin-lwp.c 2001/04/26 22:34:22
*************** extern const char *strsignal (int sig);
*** 63,69 ****
cannot use it since GDB must work on older systems too.
- When a traced, cloned process exits and is waited for by the
! debugger, the kernel reassigns it to the origional parent and
keeps it around as a "zombie". Somehow, the LinuxThreads library
doesn't notice this, which leads to the "zombie problem": When
debugged a multi-threaded process that spawns a lot of threads
--- 63,69 ----
cannot use it since GDB must work on older systems too.
- When a traced, cloned process exits and is waited for by the
! debugger, the kernel reassigns it to the original parent and
keeps it around as a "zombie". Somehow, the LinuxThreads library
doesn't notice this, which leads to the "zombie problem": When
debugged a multi-threaded process that spawns a lot of threads
*************** extern struct target_ops child_ops;
*** 131,146 ****
/* Since we cannot wait (in lin_lwp_wait) for the initial process and
any cloned processes with a single call to waitpid, we have to use
! use the WNOHANG flag and call waitpid in a loop. To optimize
things a bit we use `sigsuspend' to wake us up when a process has
something to report (it will send us a SIGCHLD if it has). To make
this work we have to juggle with the signal mask. We save the
! origional signal mask such that we can restore it before creating a
new process in order to avoid blocking certain signals in the
inferior. We then block SIGCHLD during the waitpid/sigsuspend
loop. */
! /* Origional signal mask. */
static sigset_t normal_mask;
/* Signal mask for use with sigsuspend in lin_lwp_wait, initialized in
--- 131,146 ----
/* Since we cannot wait (in lin_lwp_wait) for the initial process and
any cloned processes with a single call to waitpid, we have to use
! the WNOHANG flag and call waitpid in a loop. To optimize
things a bit we use `sigsuspend' to wake us up when a process has
something to report (it will send us a SIGCHLD if it has). To make
this work we have to juggle with the signal mask. We save the
! original signal mask such that we can restore it before creating a
new process in order to avoid blocking certain signals in the
inferior. We then block SIGCHLD during the waitpid/sigsuspend
loop. */
! /* Original signal mask. */
static sigset_t normal_mask;
/* Signal mask for use with sigsuspend in lin_lwp_wait, initialized in
*************** lin_lwp_mourn_inferior (void)
*** 900,906 ****
trap_pid = 0;
! /* Restore the origional signal mask. */
sigprocmask (SIG_SETMASK, &normal_mask, NULL);
sigemptyset (&blocked_mask);
--- 900,906 ----
trap_pid = 0;
! /* Restore the original signal mask. */
sigprocmask (SIG_SETMASK, &normal_mask, NULL);
sigemptyset (&blocked_mask);
*************** _initialize_lin_lwp (void)
*** 1027,1033 ****
add_target (&lin_lwp_ops);
thread_db_init (&lin_lwp_ops);
! /* Save the origional signal mask. */
sigprocmask (SIG_SETMASK, NULL, &normal_mask);
action.sa_handler = sigchld_handler;
--- 1027,1033 ----
add_target (&lin_lwp_ops);
thread_db_init (&lin_lwp_ops);
! /* Save the original signal mask. */
sigprocmask (SIG_SETMASK, NULL, &normal_mask);
action.sa_handler = sigchld_handler;