From 0d14fc63276224196874dc5593e521d2142bdc05 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 18 Dec 2008 21:35:23 +0000 Subject: * linux-nat.c (linux_child_follow_fork): If following the child, and not detaching the parent, also add the child fork to the fork list. * linux-fork.c (linux_fork_context): Remove dead error call. Assert that the incoming newfp argument is not null. Do not add a new fork for inferior_ptid. Assert that there is one already. --- gdb/linux-nat.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/linux-nat.c') diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index a2cb39d..d90fb07 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -857,6 +857,12 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child) if (!fp) fp = add_fork (parent_pid); fork_save_infrun_state (fp, 0); + + /* Also add an entry for the child fork. */ + fp = find_fork_pid (child_pid); + if (!fp) + fp = add_fork (child_pid); + fork_save_infrun_state (fp, 0); } else target_detach (NULL, 0); -- cgit v1.1