Author: davidxu
Date: Wed Sep  8 01:55:03 2010
New Revision: 212311
URL: http://svn.freebsd.org/changeset/base/212311

Log:
  MFC: r212047
    If a process is being debugged, skips job control caused by SIGSTOP/SIGCONT
    signals, because it is managed by debugger, however a normal signal sent to
    a interruptibly sleeping thread wakes up the thread so it will handle the
    signal when the process leaves the stopped state.

Modified:
  stable/8/sys/kern/kern_sig.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/kern_sig.c
==============================================================================
--- stable/8/sys/kern/kern_sig.c        Wed Sep  8 01:41:22 2010        
(r212310)
+++ stable/8/sys/kern/kern_sig.c        Wed Sep  8 01:55:03 2010        
(r212311)
@@ -2129,20 +2129,13 @@ tdsignal(struct proc *p, struct thread *
         * We try do the per-process part here.
         */
        if (P_SHOULDSTOP(p)) {
-               /*
-                * The process is in stopped mode. All the threads should be
-                * either winding down or already on the suspended queue.
-                */
-               if (p->p_flag & P_TRACED) {
+               if (sig == SIGKILL) {
                        /*
-                        * The traced process is already stopped,
-                        * so no further action is necessary.
-                        * No signal can restart us.
+                        * If traced process is already stopped,
+                        * then no further action is necessary.
                         */
-                       goto out;
-               }
-
-               if (sig == SIGKILL) {
+                       if (p->p_flag & P_TRACED)
+                               goto out;
                        /*
                         * SIGKILL sets process running.
                         * It will die elsewhere.
@@ -2154,6 +2147,12 @@ tdsignal(struct proc *p, struct thread *
 
                if (prop & SA_CONT) {
                        /*
+                        * If traced process is already stopped,
+                        * then no further action is necessary.
+                        */
+                       if (p->p_flag & P_TRACED)
+                               goto out;
+                       /*
                         * If SIGCONT is default (or ignored), we continue the
                         * process but don't leave the signal in sigqueue as
                         * it has no further action.  If SIGCONT is held, we
@@ -2198,6 +2197,12 @@ tdsignal(struct proc *p, struct thread *
 
                if (prop & SA_STOP) {
                        /*
+                        * If traced process is already stopped,
+                        * then no further action is necessary.
+                        */
+                       if (p->p_flag & P_TRACED)
+                               goto out;
+                       /*
                         * Already stopped, don't need to stop again
                         * (If we did the shell could get confused).
                         * Just make sure the signal STOP bit set.
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to