]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Improve "'g' reply is is to long" error message
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 5 Sep 2017 14:43:07 +0000 (16:43 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 5 Sep 2017 15:45:55 +0000 (17:45 +0200)
... by adding the expected size, and the received size.  I found this
useful when debugging gdbarch/remote issues, since it gives a hint of
what gdb expects and what the remote sent.

gdb/ChangeLog:

* remote.c (process_g_packet): Update error message.

gdb/ChangeLog
gdb/remote.c

index 5eef1c9394463be54dd918bad7f48d0675e1d866..25310e7d1b6c928fe5e8258d654201ef4ef82344 100644 (file)
@@ -1,3 +1,7 @@
+2017-09-05  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * remote.c (process_g_packet): Update error message.
+
 2017-09-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        PR gdb/22046
index 694897df1d6c39e3fb061d14cf0555bd71554dad..a667b0c75e6c08d17bf179aea53ab3b4f29a8ecb 100644 (file)
@@ -7583,7 +7583,8 @@ process_g_packet (struct regcache *regcache)
 
   /* Further sanity checks, with knowledge of the architecture.  */
   if (buf_len > 2 * rsa->sizeof_g_packet)
-    error (_("Remote 'g' packet reply is too long: %s"), rs->buf);
+    error (_("Remote 'g' packet reply is too long (expected %ld bytes, got %d "
+            "bytes): %s"), rsa->sizeof_g_packet, buf_len / 2, rs->buf);
 
   /* Save the size of the packet sent to us by the target.  It is used
      as a heuristic when determining the max size of packets that the