From 54ef790149918df40e6bc2220ffd52ade1b9669b Mon Sep 17 00:00:00 2001 From: Peter Mamonov Date: Mon, 12 Oct 2020 15:02:44 +0300 Subject: [PATCH] target: use proper macro for parsing watchpoint address Currently wp/rwp commands fail on 64-bit targets: > wp 0xffffffff80001400 4 addr option value ('0xffffffff80001400') is not valid Change-Id: I94d4af906b02b7bd463c8d79a6235a3646dfc434 Signed-off-by: Peter Mamonov Reviewed-on: http://openocd.zylin.com/6058 Tested-by: jenkins Reviewed-by: Andreas Fritiofson Reviewed-by: Antonio Borneo --- src/target/target.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/target/target.c b/src/target/target.c index fa98c884b..033fc0714 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4056,7 +4056,7 @@ COMMAND_HANDLER(handle_wp_command) } enum watchpoint_rw type = WPT_ACCESS; - uint32_t addr = 0; + target_addr_t addr = 0; uint32_t length = 0; uint32_t data_value = 0x0; uint32_t data_mask = 0xffffffff; @@ -4086,7 +4086,7 @@ COMMAND_HANDLER(handle_wp_command) /* fall through */ case 2: COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], length); - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr); + COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr); break; default: @@ -4106,8 +4106,8 @@ COMMAND_HANDLER(handle_rwp_command) if (CMD_ARGC != 1) return ERROR_COMMAND_SYNTAX_ERROR; - uint32_t addr; - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr); + target_addr_t addr; + COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr); struct target *target = get_current_target(CMD_CTX); watchpoint_remove(target, addr);