diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-08-16 23:54:37 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-08-16 23:54:37 +0000 |
commit | 2dcc608618e09c68ed83560f2471a8b2ef52db79 (patch) | |
tree | 929740c7605c7fc3ab36312be401168665533244 /gdb/inf-ttrace.c | |
parent | 58f594cdb752acbd9e5b910cd39f513bcd6ba800 (diff) | |
download | gdb-2dcc608618e09c68ed83560f2471a8b2ef52db79.zip gdb-2dcc608618e09c68ed83560f2471a8b2ef52db79.tar.gz gdb-2dcc608618e09c68ed83560f2471a8b2ef52db79.tar.bz2 |
inf_ttrace_follow_fork: detach_breakpoints called twice for child.
When debugging a program that forks with follow-fork set to follow
the parent, we end up calling detach_breakpoints for the child twice.
On ia64-hpux, this leads to a warning when trying to remove the
breakpoints the second time around, because the ia64 code detects
that the address does not point to a breakpoint instruction.
gdb/ChangeLog:
* inf-ttrace.c (inf_ttrace_follow_fork): When following the
parent, only call detach_breakpoints if tts.tts_event ==
TTEVT_VFORK.
Diffstat (limited to 'gdb/inf-ttrace.c')
-rw-r--r-- | gdb/inf-ttrace.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index 2c620d5..ddcbd42 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -467,7 +467,11 @@ inf_ttrace_follow_fork (struct target_ops *ops, int follow_child) else { inferior_ptid = ptid_build (pid, lwpid, 0); - detach_breakpoints (fpid); + /* Detach any remaining breakpoints in the child. In the case + of fork events, we do not need to do this, because breakpoints + should have already been removed earlier. */ + if (tts.tts_event == TTEVT_VFORK) + detach_breakpoints (fpid); target_terminal_ours (); fprintf_unfiltered (gdb_stdlog, |