This is an automated email from Gerrit.

"Marek Vrbka <marek.vr...@codasip.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7903

-- gerrit

commit 0e47b36aab48ccba1e7003c80c819d8d285408de
Author: Marek Vrbka <marek.vr...@codasip.com>
Date:   Thu Sep 21 12:54:10 2023 +0200

    breakpoints: Make duplicate watchpoints error in all cases
    
    This patch makes watchpoints set at the same address an error,
    same as with breakpoints.
    Furthermore, it changes the error format to make sure it is the
    same as with breakpoints.
    
    Change-Id: I879431a0013c7679c2523010eeefd23dffb90892
    Signed-off-by: Marek Vrbka <marek.vr...@codasip.com>

diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c
index 5ce0346bb4..50a20ee347 100644
--- a/src/target/breakpoints.c
+++ b/src/target/breakpoints.c
@@ -453,19 +453,11 @@ static int watchpoint_add_internal(struct target *target, 
target_addr_t address,
 
        while (watchpoint) {
                if (watchpoint->address == address) {
-                       if (watchpoint->length != length
-                               || watchpoint->value != value
-                               || watchpoint->mask != mask
-                               || watchpoint->rw != rw) {
-                               LOG_ERROR("address " TARGET_ADDR_FMT
-                                       " already has watchpoint %d",
-                                       address, watchpoint->unique_id);
-                               return ERROR_FAIL;
-                       }
-
-                       /* ignore duplicate watchpoint */
-                       return ERROR_OK;
+                       LOG_TARGET_ERROR(target, "Duplicate Watchpoint address: 
" TARGET_ADDR_FMT " (WP %d)",
+                                         address, watchpoint->unique_id);
+                       return ERROR_TARGET_DUPLICATE_WATCHPOINT;
                }
+
                watchpoint_p = &watchpoint->next;
                watchpoint = watchpoint->next;
        }
diff --git a/src/target/target.h b/src/target/target.h
index abeb8ed511..4adbc6e387 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -798,6 +798,7 @@ int target_profiling_default(struct target *target, 
uint32_t *samples, uint32_t
 #define ERROR_TARGET_NOT_EXAMINED (-311)
 #define ERROR_TARGET_DUPLICATE_BREAKPOINT (-312)
 #define ERROR_TARGET_ALGO_EXIT  (-313)
+#define ERROR_TARGET_DUPLICATE_WATCHPOINT (-314)
 
 extern bool get_target_reset_nag(void);
 

-- 

Reply via email to