Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] fix minor bug in malformed packet error message
@ 2008-06-09 18:46 Doug Evans
  2008-06-09 19:12 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2008-06-09 18:46 UTC (permalink / raw)
  To: gdb-patches

This patch fixes a minor bug in malformed packet error messages.
The error message tries to print the start of where things go bad,
but due to the `*p++ != mumble' test the ++ causes the first character
character to be missed.

ok to check in?

2008-06-09  Doug Evans  <dje@google.com>

	* remote.c (remote_wait): Include beginning of malformed packet
	in error output.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.295
diff -u -p -u -p -r1.295 remote.c
--- remote.c	5 Jun 2008 21:35:00 -0000	1.295
+++ remote.c	9 Jun 2008 18:28:16 -0000
@@ -3487,10 +3487,11 @@ Packet: '%s'\n"),
 		    struct packet_reg *reg = packet_reg_from_pnum (rsa, pnum);
 		    p = p1;
 
-		    if (*p++ != ':')
+		    if (*p != ':')
 		      error (_("Malformed packet(b) (missing colon): %s\n\
 Packet: '%s'\n"),
 			     p, buf);
+                    ++p;
 
 		    if (reg == NULL)
 		      error (_("Remote sent bad register number %s: %s\n\
@@ -3508,9 +3509,10 @@ Packet: '%s'\n"),
 					 reg->regnum, regs);
 		  }
 
-		if (*p++ != ';')
+		if (*p != ';')
 		  error (_("Remote register badly formatted: %s\nhere: %s"),
 			 buf, p);
+                ++p;
 	      }
 	  }
 	  /* fall through */


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-09 18:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-09 18:46 [RFA] fix minor bug in malformed packet error message Doug Evans
2008-06-09 19:12 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox