diff options
author | Pedro Alves <palves@redhat.com> | 2009-01-26 22:34:55 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2009-01-26 22:34:55 +0000 |
commit | 77435e4c95513bfccecb90bca8a06a5a62aebdc6 (patch) | |
tree | d5b102cdd08b46ac4595637d011223b5b8d664e4 /gdb/inf-ptrace.c | |
parent | 7488432fc292f9ac6fb3e69ef7c8fa745c0fa886 (diff) | |
download | gdb-77435e4c95513bfccecb90bca8a06a5a62aebdc6.zip gdb-77435e4c95513bfccecb90bca8a06a5a62aebdc6.tar.gz gdb-77435e4c95513bfccecb90bca8a06a5a62aebdc6.tar.bz2 |
* linux-nat.c (linux_child_follow_fork): Copy attach_flag from the
parent to the child.
* inf-ttrace.c (inf_ttrace_follow_fork): Likewise.
* inf-ptrace.c (inf_ptrace_follow_fork): Likewise. Use
remove_breakpoints to remove breakpoints from the parent.
Diffstat (limited to 'gdb/inf-ptrace.c')
-rw-r--r-- | gdb/inf-ptrace.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 538816d..76cbecc 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -73,7 +73,8 @@ inf_ptrace_follow_fork (struct target_ops *ops, int follow_child) CORE_ADDR step_range_start = last_tp->step_range_start; CORE_ADDR step_range_end = last_tp->step_range_end; struct frame_id step_frame_id = last_tp->step_frame_id; - + int attach_flag = find_inferior_pid (pid)->attach_flag; + struct inferior *inf; struct thread_info *tp; /* Otherwise, deleting the parent would get rid of this @@ -82,7 +83,7 @@ inf_ptrace_follow_fork (struct target_ops *ops, int follow_child) /* Before detaching from the parent, remove all breakpoints from it. */ - detach_breakpoints (pid); + remove_breakpoints (); if (ptrace (PT_DETACH, pid, (PTRACE_TYPE_ARG3)1, 0) == -1) perror_with_name (("ptrace")); @@ -94,7 +95,8 @@ inf_ptrace_follow_fork (struct target_ops *ops, int follow_child) detach_inferior (pid); /* Add the child. */ - add_inferior (fpid); + inf = add_inferior (fpid); + inf->attach_flag = attach_flag; tp = add_thread_silent (inferior_ptid); tp->step_resume_breakpoint = step_resume_breakpoint; |