]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix PR gdb/19187 (process record over a fork causes internal error)
authorPedro Alves <palves@redhat.com>
Wed, 10 Aug 2016 22:06:02 +0000 (23:06 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 10 Aug 2016 22:06:02 +0000 (23:06 +0100)
commit4dfacf706adacbefbc38d7ba59212566f77bd051
treef0e6db88828700cae6cdd8f0ca585ece1b2bf1f7
parentaac9c6220f36cea74d13cd02cce6c64d49f41f34
Fix PR gdb/19187 (process record over a fork causes internal error)

Right after a fork is detected, we detach breakpoints from the child
(detach_breakpoints), which calls into target_remove_breakpoint with
inferior_ptid pointing at the child process, but leaves the breakpoint
marked inserted (in the parent).

The problem is that record-full.c always deletes all knowledge of the
breakpoint.  Then when we later really delete the breakpoint from the
parent, we fail the assertion, since the breakpoint is unexpectedly
not found in the record-full.c breakpoint table.

The fix is simply to not forget about the breakpoint if we're
detaching it from a fork child.

gdb/ChangeLog:
2016-08-10  Pedro Alves  <palves@redhat.com>

PR gdb/19187
* record-full.c (record_full_remove_breakpoint): Don't remove the
breakpoint from the record_full_breakpoints VEC if we're detaching
the breakpoint from a fork child.

gdb/testsuite/ChangeLog:
2016-08-10  Pedro Alves  <palves@redhat.com>

PR gdb/19187
* gdb.reverse/waitpid-reverse.exp: Add comment and remove
setup_kfails.
gdb/ChangeLog
gdb/record-full.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.reverse/waitpid-reverse.exp