From: <ge...@op...> - 2025-10-21 13:18:02
|
This is an automated email from Gerrit. "Evgeniy Naydanov <evg...@sy...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9175 -- gerrit commit 45f7337d3a804141253f021de817d8faae9ed306 Author: Tim Newsome <ti...@si...> Date: Wed Apr 27 12:41:13 2022 -0700 Make `watchpoint.unique_id` a `uint32_t` Now it matches `breakpoint.unique_id`. Cherry-picked from Link: https://github.com/riscv-collab/riscv-openocd/commit/e8b05455e21079d0e0698235bf4b85bda6023875 Change-Id: I06f24b2cede2ee56bdeac8666b5235f923b18659 Signed-off-by: Tim Newsome <ti...@si...> diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 7254eac7dc..ba550a7039 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -403,7 +403,7 @@ static int watchpoint_free(struct target *target, struct watchpoint *watchpoint_ return retval; } - LOG_TARGET_DEBUG(target, "free WPID: %d --> %d", watchpoint->unique_id, retval); + LOG_TARGET_DEBUG(target, "free WPID: %" PRIu32 " --> %d", watchpoint->unique_id, retval); (*watchpoint_p) = watchpoint->next; free(watchpoint); @@ -495,7 +495,7 @@ static int watchpoint_add_internal(struct target *target, target_addr_t address, || watchpoint->mask != mask || watchpoint->rw != rw) { LOG_TARGET_ERROR(target, "address " TARGET_ADDR_FMT - " already has watchpoint %d", + " already has watchpoint %" PRIu32, address, watchpoint->unique_id); return ERROR_FAIL; } @@ -635,7 +635,7 @@ int watchpoint_hit(struct target *target, enum watchpoint_rw *rw, *rw = hit_watchpoint->rw; *address = hit_watchpoint->address; - LOG_TARGET_DEBUG(target, "Found hit watchpoint at " TARGET_ADDR_FMT " (WPID: %d)", + LOG_TARGET_DEBUG(target, "Found hit watchpoint at " TARGET_ADDR_FMT " (WPID: %" PRIu32 ")", hit_watchpoint->address, hit_watchpoint->unique_id); diff --git a/src/target/breakpoints.h b/src/target/breakpoints.h index d547a687fd..89572ffc5d 100644 --- a/src/target/breakpoints.h +++ b/src/target/breakpoints.h @@ -47,7 +47,7 @@ struct watchpoint { bool is_set; unsigned int number; struct watchpoint *next; - int unique_id; + uint32_t unique_id; }; int breakpoint_add(struct target *target, diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 42e9572602..a9285c5237 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2147,7 +2147,7 @@ static int cortex_m_set_watchpoint(struct target *target, struct watchpoint *wat target_write_u32(target, comparator->dwt_comparator_address + 8, comparator->function); - LOG_TARGET_DEBUG(target, "Watchpoint (ID %d) DWT%d 0x%08" PRIx32 " 0x%" PRIx32 " 0x%05" PRIx32, + LOG_TARGET_DEBUG(target, "Watchpoint (ID %" PRIu32 ") DWT%d 0x%08" PRIx32 " 0x%" PRIx32 " 0x%05" PRIx32, watchpoint->unique_id, dwt_num, comparator->comp, comparator->mask, comparator->function); return ERROR_OK; @@ -2159,14 +2159,14 @@ static int cortex_m_unset_watchpoint(struct target *target, struct watchpoint *w struct cortex_m_dwt_comparator *comparator; if (!watchpoint->is_set) { - LOG_TARGET_WARNING(target, "watchpoint (wpid: %d) not set", + LOG_TARGET_WARNING(target, "watchpoint (wpid: %" PRIu32 ") not set", watchpoint->unique_id); return ERROR_OK; } unsigned int dwt_num = watchpoint->number; - LOG_TARGET_DEBUG(target, "Watchpoint (ID %d) DWT%u address: " TARGET_ADDR_FMT " clear", + LOG_TARGET_DEBUG(target, "Watchpoint (ID %" PRIu32 ") DWT%u address: " TARGET_ADDR_FMT " clear", watchpoint->unique_id, dwt_num, watchpoint->address); diff --git a/src/target/x86_32_common.c b/src/target/x86_32_common.c index 8ad9d00fec..e7add095b4 100644 --- a/src/target/x86_32_common.c +++ b/src/target/x86_32_common.c @@ -1223,7 +1223,7 @@ static int set_watchpoint(struct target *t, struct watchpoint *wp) watchpoint_set(wp, wp_num); debug_reg_list[wp_num].used = 1; debug_reg_list[wp_num].bp_value = wp->address; - LOG_USER("'%s' watchpoint %d set at " TARGET_ADDR_FMT " with length %" PRIu32 " (hwreg=%d)", + LOG_USER("'%s' watchpoint %" PRIu32 " set at " TARGET_ADDR_FMT " with length %" PRIu32 " (hwreg=%d)", wp->rw == WPT_READ ? "read" : wp->rw == WPT_WRITE ? "write" : wp->rw == WPT_ACCESS ? "access" : "?", wp->unique_id, wp->address, wp->length, wp_num); @@ -1252,7 +1252,7 @@ static int unset_watchpoint(struct target *t, struct watchpoint *wp) debug_reg_list[wp_num].bp_value = 0; wp->is_set = false; - LOG_USER("'%s' watchpoint %d removed from " TARGET_ADDR_FMT " with length %" PRIu32 " (hwreg=%d)", + LOG_USER("'%s' watchpoint %" PRIu32 " removed from " TARGET_ADDR_FMT " with length %" PRIu32 " (hwreg=%d)", wp->rw == WPT_READ ? "read" : wp->rw == WPT_WRITE ? "write" : wp->rw == WPT_ACCESS ? "access" : "?", wp->unique_id, wp->address, wp->length, wp_num); -- |