Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [RFA] fix minor bug in malformed packet error message
Date: Mon, 09 Jun 2008 18:46:00 -0000	[thread overview]
Message-ID: <20080609183337.91FDE1C7640@localhost> (raw)

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 */


             reply	other threads:[~2008-06-09 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 18:46 Doug Evans [this message]
2008-06-09 19:12 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080609183337.91FDE1C7640@localhost \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox