* remote.c (remote_wait): Include beginning of malformed packet
authorDoug Evans <dje@google.com>
Mon, 9 Jun 2008 20:43:48 +0000 (20:43 +0000)
committerDoug Evans <dje@google.com>
Mon, 9 Jun 2008 20:43:48 +0000 (20:43 +0000)
in error output.

gdb/ChangeLog
gdb/remote.c

index 475d952349b18aa388a123e3d397fb6b189d9169..71e9df5f9e1e082f3b4a94e9f07ac8ddc325dce2 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-09  Doug Evans  <dje@google.com>
+
+       * remote.c (remote_wait): Include beginning of malformed packet
+       in error output.
+
 2008-06-09  Tom Tromey  <tromey@redhat.com>
 
        * completer.c (complete_line): Don't special-case
index e2e63ce2b0fd82e6b896d682b1f5f324b2b6fbfe..3f7d07b831d5dc2aff136a1431b178ce5eb52f72 100644 (file)
@@ -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 */