* lynx-nat.c (child_wait): Don't restart new threads and loop
authorJeff Law <law@redhat.com>
Sun, 25 Jun 1995 02:33:33 +0000 (02:33 +0000)
committerJeff Law <law@redhat.com>
Sun, 25 Jun 1995 02:33:33 +0000 (02:33 +0000)
        to the top of child_wait; let the machine independent code in
        wait_for_inferior deal with new thread notifications.

lynx-6100 (partial)
Fixes SEGV when multi-threaded program hits a breakpoint in a new
thread.

gdb/ChangeLog
gdb/lynx-nat.c

index c65bcee9e046377348904f42176201c6c97f4505..2254328a1067fce6f61124a16e78af0d4840ada9 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jun 24 19:27:37 1995  Jeffrey A. Law  <law@rtl.cygnus.com>
+
+       * lynx-nat.c (child_wait): Don't restart new threads and loop
+       to the top of child_wait; let the machine independent code in
+       wait_for_inferior deal with new thread notifications.
+
 Fri Jun 23 11:51:58 1995  Kung Hsu  <kung@mexican.cygnus.com>
 
        * remote-nindy (nindy_load): Put in target specific load, it's 
index 0a62229987083f06c64066b62605c6888bc2e6ec..f0e817e5653267b504134b6774e343bb44f7a693 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