[GDBserver] Don't error in reinsert_raw_breakpoint if bp->inserted
authorYao Qi <yao.qi@linaro.org>
Mon, 25 Apr 2016 08:46:36 +0000 (09:46 +0100)
committerYao Qi <yao.qi@linaro.org>
Mon, 25 Apr 2016 08:46:36 +0000 (09:46 +0100)
commit85ba7d867af39fe1408accd1f9ea4ca3dcb84b99
tree8e4b991463b3fe9d2c0ffa7e22a9c17bfabd064f
parent20249ae4551ae7b2193caed73d9ce8d594f38754
[GDBserver] Don't error in reinsert_raw_breakpoint if bp->inserted

GDBserver steps over a breakpoint while the single step breakpoint
is inserted at the same address, there are two breakpoint objects
using single raw breakpoint, which is inserted (for single step).
When step over is finished, GDBserver reinsert the breakpoint, but
it finds the raw breakpoint is already inserted, and error out
"Breakpoint already inserted at reinsert time."  Even if I change the
order to delete reinsert breakpoints first (which only decreases the
refcount, but leave inserted flag unchanged), the error is still
there.

The fix is to remove the error and return instead.

gdb/gdbserver:

2016-04-25  Yao Qi  <yao.qi@linaro.org>

* linux-low.c (reinsert_raw_breakpoint): If bp->inserted is true
return instead of error.
gdb/gdbserver/ChangeLog
gdb/gdbserver/mem-break.c