This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: remote.c, catch return value of hex2bin
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH]: remote.c, catch return value of hex2bin
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Mon, 21 May 2001 11:49:24 -0700
- Organization: Red Hat
As suggested by John Kallal, remote_async_wait also requires this fix:
2001-05-21 Michael Snyder <msnyder@redhat.com>
* remote.c (remote_async_wait): Added new variable fieldsize.
Add fieldsize (return value of hex2bin) to string pointer p.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.53
diff -c -3 -p -r1.53 remote.c
*** remote.c 2001/05/16 20:10:52 1.53
--- remote.c 2001/05/21 18:47:28
*************** remote_async_wait (ptid_t ptid, struct t
*** 3060,3065 ****
--- 3060,3066 ----
{
unsigned char *p1;
char *p_temp;
+ int fieldsize;
/* Read the register number */
regno = strtol ((const char *) p, &p_temp, 16);
*************** Packet: '%s'\n",
*** 3093,3100 ****
Packet: '%s'\n",
regno, p, buf);
! if (hex2bin (p, regs, REGISTER_RAW_SIZE (regno))
! < REGISTER_RAW_SIZE (regno))
warning ("Remote reply is too short: %s", buf);
supply_register (regno, regs);
}
--- 3094,3102 ----
Packet: '%s'\n",
regno, p, buf);
! fieldsize = hex2bin (p, regs, REGISTER_RAW_SIZE (regno));
! p += 2 * fieldsize;
! if (fieldsize < REGISTER_RAW_SIZE (regno))
warning ("Remote reply is too short: %s", buf);
supply_register (regno, regs);
}