This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Improve "'g' reply is is to long" error message
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 5 Sep 2017 15:43:02 -0000
- Subject: [binutils-gdb] Improve "'g' reply is is to long" error message
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fc8098275751f48404a547fd027b2671c5350302
commit fc8098275751f48404a547fd027b2671c5350302
Author: Simon Marchi <simon.marchi@ericsson.com>
Date: Tue Sep 5 16:43:07 2017 +0200
Improve "'g' reply is is to long" error message
... 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.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/remote.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3ba07ce..2792208 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2017-09-05 Simon Marchi <simon.marchi@ericsson.com>
+
+ * remote.c (process_g_packet): Update error message.
+
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.tgt (gdb_target_obs): Add i386.o for x86_64-*
diff --git a/gdb/remote.c b/gdb/remote.c
index 3347dd8..abeef0d 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7591,7 +7591,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