mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
server/gdb-server: fix type error.
Fix flash operation error when addr-width > 32bit on any 32-bit OS and some 64-bit OS (windows). Change-Id: I199f1cc5128c45bd0bb155e37acb2fb6325dff88 Signed-off-by: wangyanwen <wangyanwen@nucleisys.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8095 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
This commit is contained in:
@@ -3286,7 +3286,7 @@ static int gdb_v_packet(struct connection *connection,
|
||||
}
|
||||
|
||||
if (strncmp(packet, "vFlashErase:", 12) == 0) {
|
||||
unsigned long addr;
|
||||
target_addr_t addr;
|
||||
unsigned long length;
|
||||
|
||||
char const *parse = packet + 12;
|
||||
@@ -3295,7 +3295,7 @@ static int gdb_v_packet(struct connection *connection,
|
||||
return ERROR_SERVER_REMOTE_CLOSED;
|
||||
}
|
||||
|
||||
addr = strtoul(parse, (char **)&parse, 16);
|
||||
addr = strtoull(parse, (char **)&parse, 16);
|
||||
|
||||
if (*(parse++) != ',' || *parse == '\0') {
|
||||
LOG_ERROR("incomplete vFlashErase packet received, dropping connection");
|
||||
@@ -3343,7 +3343,7 @@ static int gdb_v_packet(struct connection *connection,
|
||||
|
||||
if (strncmp(packet, "vFlashWrite:", 12) == 0) {
|
||||
int retval;
|
||||
unsigned long addr;
|
||||
target_addr_t addr;
|
||||
unsigned long length;
|
||||
char const *parse = packet + 12;
|
||||
|
||||
@@ -3351,7 +3351,8 @@ static int gdb_v_packet(struct connection *connection,
|
||||
LOG_ERROR("incomplete vFlashErase packet received, dropping connection");
|
||||
return ERROR_SERVER_REMOTE_CLOSED;
|
||||
}
|
||||
addr = strtoul(parse, (char **)&parse, 16);
|
||||
|
||||
addr = strtoull(parse, (char **)&parse, 16);
|
||||
if (*(parse++) != ':') {
|
||||
LOG_ERROR("incomplete vFlashErase packet received, dropping connection");
|
||||
return ERROR_SERVER_REMOTE_CLOSED;
|
||||
|
||||
Reference in New Issue
Block a user