diff options
author | Kirill Radkin <kirill.radkin@syntacore.com> | 2023-09-26 16:49:09 +0300 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-10-14 11:59:34 +0000 |
commit | bcaac692d0fce45189279a4c80cbd6852e4bbf4e (patch) | |
tree | 0c48b646e47899662d8e1e5e4293158bb11c9701 | |
parent | d27a3a00b8582cf2750cbc86c6194f5796ccca06 (diff) | |
download | riscv-openocd-bcaac692d0fce45189279a4c80cbd6852e4bbf4e.zip riscv-openocd-bcaac692d0fce45189279a4c80cbd6852e4bbf4e.tar.gz riscv-openocd-bcaac692d0fce45189279a4c80cbd6852e4bbf4e.tar.bz2 |
target: Fix an issue with rwp/rbp command in smp targets
If wp/bp is missing at address rwp/rbp won't return zero code (on smp).
Now it fixed.
Fixes: 022e438292de ("target: Change policy of removing watchpoints/breakpoints.")
Change-Id: I3a3c245f7088fc23227b286d2191fc7f3edba702
Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7910
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r-- | src/target/breakpoints.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 5ce0346..4a613cc 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -367,8 +367,10 @@ int breakpoint_remove(struct target *target, target_addr_t address) } } - if (num_found_breakpoints == 0) + if (num_found_breakpoints == 0) { LOG_TARGET_ERROR(target, "no breakpoint at address " TARGET_ADDR_FMT " found", address); + return ERROR_BREAKPOINT_NOT_FOUND; + } return retval; } @@ -591,7 +593,7 @@ int watchpoint_remove(struct target *target, target_addr_t address) num_found_watchpoints++; if (status != ERROR_OK) { - LOG_TARGET_ERROR(curr, "failed to remove watchpoint at address" TARGET_ADDR_FMT, address); + LOG_TARGET_ERROR(curr, "failed to remove watchpoint at address " TARGET_ADDR_FMT, address); retval = status; } } @@ -603,12 +605,14 @@ int watchpoint_remove(struct target *target, target_addr_t address) num_found_watchpoints++; if (retval != ERROR_OK) - LOG_TARGET_ERROR(target, "failed to remove watchpoint at address" TARGET_ADDR_FMT, address); + LOG_TARGET_ERROR(target, "failed to remove watchpoint at address " TARGET_ADDR_FMT, address); } } - if (num_found_watchpoints == 0) + if (num_found_watchpoints == 0) { LOG_TARGET_ERROR(target, "no watchpoint at address " TARGET_ADDR_FMT " found", address); + return ERROR_WATCHPOINT_NOT_FOUND; + } return retval; } |