breakpoints: use 64-bit type for watchpoint mask and value
This patch changes data types of watchpoint value and mask to allow for 64-bit values match that some architectures (like RISCV) allow. In addition this patch fixes the behavior of watchpoint command to zero-out mask if only data value is provided. Change-Id: I3c7ec1630f03ea9534ec34c0ebe99e08ea56e7f0 Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7840 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
2ca6d25eb5
commit
2cd8ebf44d
@@ -4061,8 +4061,8 @@ COMMAND_HANDLER(handle_wp_command)
|
||||
while (watchpoint) {
|
||||
command_print(CMD, "address: " TARGET_ADDR_FMT
|
||||
", len: 0x%8.8" PRIx32
|
||||
", r/w/a: %i, value: 0x%8.8" PRIx32
|
||||
", mask: 0x%8.8" PRIx32,
|
||||
", r/w/a: %i, value: 0x%8.8" PRIx64
|
||||
", mask: 0x%8.8" PRIx64,
|
||||
watchpoint->address,
|
||||
watchpoint->length,
|
||||
(int)watchpoint->rw,
|
||||
@@ -4076,15 +4076,20 @@ COMMAND_HANDLER(handle_wp_command)
|
||||
enum watchpoint_rw type = WPT_ACCESS;
|
||||
target_addr_t addr = 0;
|
||||
uint32_t length = 0;
|
||||
uint32_t data_value = 0x0;
|
||||
uint32_t data_mask = 0xffffffff;
|
||||
uint64_t data_value = 0x0;
|
||||
uint64_t data_mask = WATCHPOINT_IGNORE_DATA_VALUE_MASK;
|
||||
bool mask_specified = false;
|
||||
|
||||
switch (CMD_ARGC) {
|
||||
case 5:
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[4], data_mask);
|
||||
COMMAND_PARSE_NUMBER(u64, CMD_ARGV[4], data_mask);
|
||||
mask_specified = true;
|
||||
/* fall through */
|
||||
case 4:
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], data_value);
|
||||
COMMAND_PARSE_NUMBER(u64, CMD_ARGV[3], data_value);
|
||||
// if user specified only data value without mask - the mask should be 0
|
||||
if (!mask_specified)
|
||||
data_mask = 0;
|
||||
/* fall through */
|
||||
case 3:
|
||||
switch (CMD_ARGV[2][0]) {
|
||||
|
||||
Reference in New Issue
Block a user