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 <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1360
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
__archive__
Hsiangkai Wang 2013-04-23 18:42:07 +08:00 committed by Freddie Chopin
parent e12989a84b
commit 992059b898
1 changed files with 1 additions and 1 deletions

View File

@ -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); 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"); LOG_ERROR("unable to decode memory packet");
retval = target_write_buffer(target, addr, len, buffer); retval = target_write_buffer(target, addr, len, buffer);