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 <pmamonov@gmail.com>
Reviewed-on: http://openocd.zylin.com/6058
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Peter Mamonov 2020-10-12 15:02:44 +03:00 committed by Antonio Borneo
parent 84a2302af7
commit 54ef790149
1 changed files with 4 additions and 4 deletions

View File

@ -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);