From: Hsiangkai Wang Date: Tue, 23 Apr 2013 10:42:07 +0000 (+0800) Subject: gdb server: Fix bug. Parse 'M' packet error. X-Git-Tag: v0.7.0-rc2~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=992059b8985cccfa19e0579ba5835f343b1179e5;p=openocd gdb server: Fix bug. Parse 'M' packet error. The format of 'M' packet is 'M addr,length:XX...'. The data follows ':' immediately. No need to '+2' to SEPARATOR in unhexify(), because SEPARATOR points to data correctly. Change-Id: I15b5758b540816cc727752e7bf68cd45e623f603 Signed-off-by: Hsiangkai Wang Reviewed-on: http://openocd.zylin.com/1360 Tested-by: jenkins Reviewed-by: Spencer Oliver Reviewed-by: Freddie Chopin --- diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index cb96bf29..e7f54281 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1259,7 +1259,7 @@ static int gdb_write_memory_packet(struct connection *connection, LOG_DEBUG("addr: 0x%8.8" PRIx32 ", len: 0x%8.8" PRIx32 "", addr, len); - if (unhexify((char *)buffer, separator + 2, len) != (int)len) + if (unhexify((char *)buffer, separator, len) != (int)len) LOG_ERROR("unable to decode memory packet"); retval = target_write_buffer(target, addr, len, buffer);