aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r--gdb/gdbserver/linux-low.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index ff4f81e..2ea54c3 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -293,6 +293,19 @@ linux_detach (void)
for_each_inferior (&all_threads, linux_detach_one_process);
}
+static void
+linux_join (void)
+{
+ extern unsigned long signal_pid;
+ int status, ret;
+
+ do {
+ ret = waitpid (signal_pid, &status, 0);
+ if (WIFEXITED (status) || WIFSIGNALED (status))
+ break;
+ } while (ret != -1 || errno != ECHILD);
+}
+
/* Return nonzero if the given thread is still alive. */
static int
linux_thread_alive (unsigned long tid)
@@ -1656,6 +1669,7 @@ static struct target_ops linux_target_ops = {
linux_attach,
linux_kill,
linux_detach,
+ linux_join,
linux_thread_alive,
linux_resume,
linux_wait,