Skip to content

Commit fd62626

Browse files
en-scborneoa
authored andcommitted
target/breakpoints: fix types in watchpoint_add_internal()
There was a conflict: 1. commit 2cd8ebf ("breakpoints: use 64-bit type for watchpoint mask and value") 2. commit 0bf3373 ("target/breakpoints: Use 'unsigned int' for length") The second commit was created erlier, but merged later so the types of `mask` and `value` became `uint32_t` in `watchpoint_add_internal()`. This created a bug: `WATCHPOINT_IGNORE_DATA_VALUE_MASK` is defined as `(~(uint64_t)0)`. Truncation to uint32_t makes it so the comparisons with the constant don't work. Change-Id: I19c414c351f52aff72a60330d83c29db7bbca375 Signed-off-by: Evgeniy Naydanov <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8500 Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Jan Matyas <[email protected]> Tested-by: jenkins Reviewed-by: zapb <[email protected]> Reviewed-by: Karl Palsson <[email protected]>
1 parent b68d23d commit fd62626

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/target/breakpoints.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ struct breakpoint *breakpoint_find(struct target *target, target_addr_t address)
500500
}
501501

502502
static int watchpoint_add_internal(struct target *target, target_addr_t address,
503-
unsigned int length, enum watchpoint_rw rw, uint32_t value, uint32_t mask)
503+
unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask)
504504
{
505505
struct watchpoint *watchpoint = target->watchpoints;
506506
struct watchpoint **watchpoint_p = &target->watchpoints;

0 commit comments

Comments
 (0)