diff --git a/src/target/xscale.c b/src/target/xscale.c index 022204705..ef476027a 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -2262,10 +2262,6 @@ int xscale_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint) LOG_INFO("no breakpoint unit available for hardware breakpoint"); return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; } - else - { - xscale->ibcr_available--; - } if ((breakpoint->length != 2) && (breakpoint->length != 4)) { @@ -2273,6 +2269,11 @@ int xscale_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint) return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; } + if (breakpoint->type == BKPT_HARD) + { + xscale->ibcr_available--; + } + return ERROR_OK; }