From 027a0a007cabf6cb23b35c53f5cbc172904d84ba Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 28 Dec 2008 16:14:56 +0000 Subject: * linux-fork.c (linux_fork_detach): New. * linux-fork.h (linux_fork_detach): Declare. * linux-nat.c (linux_child_follow_fork): When following the fork child, add the child inferior before possibly detaching from the parent. Don't reinstall ourselves. (linux_nat_detach): Call linux_fork_detach if there are other forks to debug. * linux-thread-db.c (thread_db_detach): Don't call target_mourn_inferior. Instead inline the necessary bits. * inf-ptrace.c (inf_ptrace_detach): Don't unpush the target if there are other inferiors to debug. --- gdb/inf-ptrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/inf-ptrace.c') diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 8a34db71993..8ae1161a9d6 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -309,7 +309,9 @@ inf_ptrace_detach (struct target_ops *ops, char *args, int from_tty) inferior_ptid = null_ptid; detach_inferior (pid); - unpush_target (ops); + + if (!have_inferiors ()) + unpush_target (ops); } /* Kill the inferior. */ -- cgit v1.2.1