X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fcortex_m.c;fp=src%2Ftarget%2Fcortex_m.c;h=d341d457291de7fd7669cbcb75cf9240df0f8e09;hp=8c43016cbf04cdb3c11cdde13fe70d707475ce9f;hb=d73de4c07c726fb0dc86f6ee6bac53fccbd62a87;hpb=4db5299b5bd2c3e853f7383c076f9726dc588680 diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 8c43016cbf..d341d45729 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1288,16 +1288,10 @@ int cortex_m_add_breakpoint(struct target *target, struct breakpoint *breakpoint int cortex_m_remove_breakpoint(struct target *target, struct breakpoint *breakpoint) { - /* REVISIT why check? FPB can be updated with core running ... */ - if (target->state != TARGET_HALTED) { - LOG_WARNING("target not halted"); - return ERROR_TARGET_NOT_HALTED; - } - - if (breakpoint->set) - cortex_m_unset_breakpoint(target, breakpoint); + if (!breakpoint->set) + return ERROR_OK; - return ERROR_OK; + return cortex_m_unset_breakpoint(target, breakpoint); } int cortex_m_set_watchpoint(struct target *target, struct watchpoint *watchpoint)