diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index e87d7b9f95e..960b994241a 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2015-07-14 Pedro Alves + + * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails. + Instead, ignore ECHILD, and throw an error for other errnos. + 2015-07-10 Pedro Alves * event-loop.c (struct callback_event) : Change type to diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 7bb9f7f19fe..2dafb033bce 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -1103,7 +1103,10 @@ kill_wait_lwp (struct lwp_info *lwp) res = my_waitpid (lwpid, &wstat, __WCLONE); } while (res > 0 && WIFSTOPPED (wstat)); - gdb_assert (res > 0); + /* Even if it was stopped, the child may have already disappeared. + E.g., if it was killed by SIGKILL. */ + if (res < 0 && errno != ECHILD) + perror_with_name ("kill_wait_lwp"); } /* Callback for `find_inferior'. Kills an lwp of a given process,