This is an automated email from Gerrit.

"Tomas Vanek <[email protected]>" just uploaded a new patch set to Gerrit, which 
you can find at https://review.openocd.org/c/openocd/+/9131

-- gerrit

commit 37f2d05be42561abc3fa085b9473f4a1625c96d4
Author: Tomas Vanek <[email protected]>
Date:   Mon Sep 15 16:50:58 2025 +0200

    target: drop halted check from target_add_breakpoint() [RFC]
    
    Request for comments / for testing only.
    
    Removed check is too restrictive for some targets:
    - Cortex-M can add/remove any breakpoint while running
    - RISC-V needs to return specific error in unavailable state
    
    Many targets are probably able to add a breakpoint in halted state only
    and would need to add the check to the target specific code.
    
    Change-Id: Idb2d11572e8a985c9abf3c7623ce02b11fcd4a08
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/target/target.c b/src/target/target.c
index 1428fac913..b10bc5690a 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1303,10 +1303,6 @@ int target_write_phys_memory(struct target *target,
 int target_add_breakpoint(struct target *target,
                struct breakpoint *breakpoint)
 {
-       if ((target->state != TARGET_HALTED) && (breakpoint->type != 
BKPT_HARD)) {
-               LOG_TARGET_ERROR(target, "not halted (add breakpoint)");
-               return ERROR_TARGET_NOT_HALTED;
-       }
        return target->type->add_breakpoint(target, breakpoint);
 }
 

-- 

Reply via email to