This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] advance packet ptr after hex2bin call.


Checked in this portion of John Kallal's patch: it clearly fixes a bug.
2001-05-15  John S Kallal  <jskallal@home.com>

        * remote.c (remote_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.52
diff -c -3 -p -r1.52 remote.c
*** remote.c	2001/05/14 19:02:00	1.52
--- remote.c	2001/05/16 20:10:15
*************** remote_wait (ptid_t ptid, struct target_
*** 2841,2846 ****
--- 2841,2847 ----
  	      {
  		unsigned char *p1;
  		char *p_temp;
+ 		int fieldsize;
  
  		/* Read the register number */
  		regno = strtol ((const char *) p, &p_temp, 16);
*************** Packet: '%s'\n",
*** 2874,2881 ****
  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);
  		  }
--- 2875,2883 ----
  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);
  		  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]