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: 022e438292 ("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>
This commit is contained in:
Kirill Radkin 2023-09-26 16:49:09 +03:00 committed by Antonio Borneo
parent d27a3a00b8
commit bcaac692d0
1 changed files with 8 additions and 4 deletions

View File

@ -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;
}