> These calls are unnecessary because handle_inferior_events already
> called detach_breakpoints for us before calling the target_ops'
> to_follow_fork hook.
Only in the fork case, and only from the child. vfork is more
complicated. See linux-nat.c:linux_child_follow_fork:
if (! follow_child)
struct lwp_info *child_lp = NULL;
/* We're already attached to the parent, by default. */
/* Detach new forked process? */
struct cleanup *old_chain;
/* Before detaching from the child, remove all breakpoints
from it. If we forked, then this has already been taken
care of by infrun.c. If we vforked however, any
breakpoint inserted in the parent is visible in the
child, even those added while stopped in a vfork
catchpoint. This will remove the breakpoints from the
parent also, but they'll be reinserted below. */
/* keep breakpoints list in sync. */
remove_breakpoints_pid (GET_PID (inferior_ptid));
> Without this change, we would get a warning
> when trying to remove the breakpoint the second time, because
> the ia64 code detects that the breakpoint address does not point
> to a breakpoint instruction (any more):
> warning: Cannot remove breakpoint at address 0x4000000000000d52, no break instruction at such address.
> * inf-ttrace.c (inf_ttrace_follow_fork): Remove calls to
> I am sufficiently confident in this patch that I think I can commit
> on my own, but a second pair of eyes wouldn't hurt...
> gdb/inf-ttrace.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
> diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
> index 2c620d5..ffe56e1 100644
> --- a/gdb/inf-ttrace.c
> +++ b/gdb/inf-ttrace.c
> @@ -457,7 +457,6 @@ inf_ttrace_follow_fork (struct target_ops *ops, int follow_child)
> inf->pspace = parent_inf->pspace;
> inf->aspace = parent_inf->aspace;
> copy_terminal_info (inf, parent_inf);
> - detach_breakpoints (pid);
This branch is detaching breakpoints from the parent, not the child.