This is an automated email from Gerrit.

"Alan-19950616 <wangyan...@nucleisys.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8095

-- gerrit

commit 4910de738945580ecb7db326776e0f569682807d
Author: wangyanwen <wangyan...@nucleisys.com>
Date:   Mon Oct 9 14:08:59 2023 +0800

    server/gdb-server:fix type error.
    
    Fix flash operation error when addr-width > 32bit on windows.
    
    Change-Id: I199f1cc5128c45bd0bb155e37acb2fb6325dff88
    Signed-off-by: wangyanwen <wangyan...@nucleisys.com>

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index d1bcfb5406..896ed5cc1b 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -3286,8 +3286,8 @@ static int gdb_v_packet(struct connection *connection,
        }
 
        if (strncmp(packet, "vFlashErase:", 12) == 0) {
-               unsigned long addr;
-               unsigned long length;
+               target_addr_t addr;
+               target_addr_t length;
 
                char const *parse = packet + 12;
                if (*parse == '\0') {
@@ -3295,14 +3295,14 @@ 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");
                        return ERROR_SERVER_REMOTE_CLOSED;
                }
 
-               length = strtoul(parse, (char **)&parse, 16);
+               length = strtoull(parse, (char **)&parse, 16);
 
                if (*parse != '\0') {
                        LOG_ERROR("incomplete vFlashErase packet received, 
dropping connection");
@@ -3343,15 +3343,16 @@ static int gdb_v_packet(struct connection *connection,
 
        if (strncmp(packet, "vFlashWrite:", 12) == 0) {
                int retval;
-               unsigned long addr;
-               unsigned long length;
+               target_addr_t addr;
+               target_addr_t length;
                char const *parse = packet + 12;
 
                if (*parse == '\0') {
                        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;

-- 

Reply via email to