From 85ba7d867af39fe1408accd1f9ea4ca3dcb84b99 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Mon, 25 Apr 2016 09:46:36 +0100 Subject: [PATCH] [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 * linux-low.c (reinsert_raw_breakpoint): If bp->inserted is true return instead of error. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/mem-break.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index a7ffbf87f3..323d582595 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2016-04-25 Yao Qi + + * linux-low.c (reinsert_raw_breakpoint): If bp->inserted is true + return instead of error. + 2016-04-22 Yao Qi * linux-aarch32-low.c (arm_store_gregset): Clear CPSR bits 20 diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c index 419db9eb63..363d7ca562 100644 --- a/gdb/gdbserver/mem-break.c +++ b/gdb/gdbserver/mem-break.c @@ -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) -- 2.34.1