aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-12-18 21:35:23 +0000
committerPedro Alves <palves@redhat.com>2008-12-18 21:35:23 +0000
commit0d14fc63276224196874dc5593e521d2142bdc05 (patch)
treea362195e75b31c9347e01dcf926ef20e4c8cceae /gdb/linux-nat.c
parent4e59450ef0333b385bb575153d00942dcd2112fd (diff)
downloadgdb-0d14fc63276224196874dc5593e521d2142bdc05.zip
gdb-0d14fc63276224196874dc5593e521d2142bdc05.tar.gz
gdb-0d14fc63276224196874dc5593e521d2142bdc05.tar.bz2
* 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.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c6
1 files changed, 6 insertions, 0 deletions
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);