Skip to content

Commit

Permalink
target: Fix an issue with rwp/rbp command in smp targets
Browse files Browse the repository at this point in the history
If wp/bp is missing at address rwp/rbp won't return zero code (on smp).
Now it fixed.

Fixes: 022e438 ("target: Change policy of removing watchpoints/breakpoints.")

Change-Id: I3a3c245f7088fc23227b286d2191fc7f3edba702
Signed-off-by: Kirill Radkin <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/7910
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
kr-sc authored and borneoa committed Oct 14, 2023
1 parent d27a3a0 commit bcaac69
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/target/breakpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
Expand Down

0 comments on commit bcaac69

Please sign in to comment.