* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / lynx-nat.c
index 0a62229987083f06c64066b62605c6888bc2e6ec..1ab9cc7cc678934703198962e27f82df4c7af48c 100644 (file)
@@ -649,13 +649,16 @@ child_wait (pid, ourstatus)
 
          if (realsig == SIGNEWTHREAD)
            {
-             /* Simply ignore new thread notification, as we can't do anything
-                useful with such threads.  All ptrace calls at this point just
-                fail for no apparent reason.  The thread will eventually get a
-                real signal when it becomes real.  */
-             child_resume (pid, 0, TARGET_SIGNAL_0);
-             continue;
+             /* It's a new thread notification.  Nothing to do here since
+                the machine independent code in wait_for_inferior will
+                add the thread to the thread list and restart the thread
+                when pid != inferior_pid and pid is not in the thread
+                list.   We don't even want to much with realsig -- the
+                code in wait_for_inferior expects SIGTRAP.  */
+             ;
            }
+         else
+           error ("Signal for unknown thread was not SIGNEWTHREAD");
        }
 
 #ifdef SPARC
@@ -702,14 +705,16 @@ child_resume (pid, step, signal)
 
   errno = 0;
 
+  /* If pid == -1, then we want to step/continue all threads, else
+     we only want to step/continue a single thread.  */
   if (pid == -1)
     {
-      /* Resume all threads.  */
-
       pid = inferior_pid;
+      func = step ? PTRACE_SINGLESTEP : PTRACE_CONT;
     }
+  else
+    func = step ? PTRACE_SINGLESTEP_ONE : PTRACE_CONT_ONE;
 
-  func = step ? PTRACE_SINGLESTEP_ONE : PTRACE_CONT;
 
   /* An address of (PTRACE_ARG3_TYPE)1 tells ptrace to continue from where
      it was.  (If GDB wanted it to start some other way, we have already
This page took 0.023805 seconds and 4 git commands to generate.