diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index be99ece..feca722 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -2644,13 +2644,14 @@ linux_nat_filter_event (int lwpid, int status, int options) "LLW: %s exited.\n", target_pid_to_str (lp->ptid)); - exit_lwp (lp); - - /* If there is at least one more LWP, then the exit signal was - not the end of the debugged application and should be - ignored. */ - if (num_lwps > 0) - return NULL; + if (num_lwps > 1) + { + /* If there is at least one more LWP, then the exit signal + was not the end of the debugged application and should be + ignored. */ + exit_lwp (lp); + return NULL; + } } /* Check if the current LWP has previously exited. In the nptl