Delete reinsert breakpoints from forked child
authorYao Qi <yao.qi@linaro.org>
Fri, 17 Jun 2016 09:25:13 +0000 (10:25 +0100)
committerYao Qi <yao.qi@linaro.org>
Fri, 17 Jun 2016 09:38:55 +0000 (10:38 +0100)
commit8a81c5d7a7cc3ec4d60032d2a911d2f6c3eb8328
treec6849aedb5beed40808eed179f4d75eb620bc2e2
parentf50bf8e5153e3cdddd1ad5d3f7d16f2b4e5adb3c
Delete reinsert breakpoints from forked child

When a thread is stepping over a syscall instruction with software
single step, GDBserver inserts reinsert breakpoints at the next pcs.
If the syscall call is fork, the forked child has reinsert breakpoint
in its space, and GDBserver clones parent's breakpoint list to child's.
When GDBserver resumes the child, its bp_reinsert is zero, but has
reinsert breakpoints, so the following assert is triggered if I apply
the patch extending step-over-syscall.exp.

gdb/gdbserver/linux-low.c:4292: A problem internal to GDBserver has been detected.^M
void linux_resume_one_lwp_throw(lwp_info*, int, int, siginfo_t*): Assertion `!has_reinsert_breakpoints (proc)' failed.

gdb/gdbserver:

2016-06-17  Yao Qi  <yao.qi@linaro.org>

* linux-low.c (handle_extended_wait): If the parent is doing
step-over, remove the reinsert breakpoints from the forked child.
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c