[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)
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

index a7ffbf87f38c7c7131449e691c7917f98ac1c87b..323d58259521ff7766d93338e3117cf3bc3dc25f 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-25  Yao Qi  <yao.qi@linaro.org>
+
+       * linux-low.c (reinsert_raw_breakpoint): If bp->inserted is true
+       return instead of error.
+
 2016-04-22  Yao Qi  <yao.qi@linaro.org>
 
        * linux-aarch32-low.c (arm_store_gregset): Clear CPSR bits 20
index 419db9eb6316806c7a4bfb3d1ee71cacc1f91007..363d7ca56289aac7eebc7ae7fd16fb5e8c6992bb 100644 (file)
@@ -1515,7 +1515,7 @@ reinsert_raw_breakpoint (struct raw_breakpoint *bp)
   int err;
 
   if (bp->inserted)
-    error ("Breakpoint already inserted at reinsert time.");
+    return;
 
   err = the_target->insert_point (bp->raw_type, bp->pc, bp->kind, bp);
   if (err == 0)
This page took 0.032408 seconds and 4 git commands to generate.