|
From: <ge...@op...> - 2018-04-30 12:15:20
|
This is an automated email from Gerrit. Antonio Borneo (bor...@gm...) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4513 -- gerrit commit cde60d4285565be061a2080d2cade7767d8cd7c6 Author: Antonio Borneo <bor...@gm...> Date: Thu Jan 22 23:30:27 2015 +0800 breakpoints: exit if error while removing target breakpoint target_remove_breakpoint() can fail, e.g. in case the target is Cortex-M and is not halted. Current code does not check the return value, ending up with a misalignment between target device and OpenOCD: the breakpoint is still set in the target, while it is considered removed by OpenOCD. In this case OpenOCD would not be anymore able to remove it. Fixed by checking the return value and failing before removing the breakpoint from OpenOCD internal memory. Change-Id: Ia0c204ff59d8afa6203ede956dcd78b4b9400e59 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 58bcc86..0750d46 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -303,6 +303,8 @@ static void breakpoint_free(struct target *target, struct breakpoint *breakpoint return; retval = target_remove_breakpoint(target, breakpoint); + if (retval != ERROR_OK) + return; LOG_DEBUG("free BPID: %" PRIu32 " --> %d", breakpoint->unique_id, retval); (*breakpoint_p) = breakpoint->next; -- |