summaryrefslogtreecommitdiff
path: root/gdb/inf-ptrace.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-05-17 19:20:32 +0000
committerPedro Alves <pedro@codesourcery.com>2009-05-17 19:20:32 +0000
commit44bb4ddfffe0e0ad534fbf191b19cd48f62bf8e0 (patch)
tree5074dffe542249ab849fd79b6d0e796db1361d2a /gdb/inf-ptrace.c
parentb5353480aca29c22d57227998e7639acccc462cf (diff)
downloadgdb-44bb4ddfffe0e0ad534fbf191b19cd48f62bf8e0.tar.gz
gdb/
2009-05-17 Pedro Alves <pedro@codesourcery.com> * infrun.c (handle_inferior_event): When handling a TARGET_WAITKIND_FORKED, detach breakpoints from the fork child immediatelly. * linux-nat.c (linux_child_follow_fork): Only detach breakpoint from the child if vforking. * inf-ptrace.c (inf_ptrace_follow_fork): No need to detach breakpoints from the child here. gdb/testsuite/ 2009-05-17 Pedro Alves <pedro@codesourcery.com> * gdb.base/foll-fork.c: Include stdlib.h. Add markers for `gdb_get_line_number'. Call `callee' in both parent and child. * gdb.base/foll-fork.exp (catch_fork_child_follow): Use `gdb_get_line_number' instead of hardcoding line numbers. (catch_fork_unpatch_child): New procedure to test detaching breakpoints from child fork. (tcatch_fork_parent_follow): Use `gdb_get_line_number' instead of hardcoding line numbers. (do_fork_tests): Run `catch_fork_unpatch_child'.
Diffstat (limited to 'gdb/inf-ptrace.c')
-rw-r--r--gdb/inf-ptrace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index f088ffdc6e7..7849f2436f1 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -111,7 +111,9 @@ inf_ptrace_follow_fork (struct target_ops *ops, int follow_child)
else
{
inferior_ptid = pid_to_ptid (pid);
- detach_breakpoints (fpid);
+
+ /* Breakpoints have already been detached from the child by
+ infrun.c. */
if (ptrace (PT_DETACH, fpid, (PTRACE_TYPE_ARG3)1, 0) == -1)
perror_with_name (("ptrace"));