This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/4] Improve "'g' reply is is to long" error message
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Sun, 27 Aug 2017 12:15:31 +0200
- Subject: [PATCH 1/4] Improve "'g' reply is is to long" error message
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <ca635448df367f79b0b833d751169c59@polymtl.ca> <1503828934-26404-1-git-send-email-simon.marchi@ericsson.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
... 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/remote.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/remote.c b/gdb/remote.c
index 2249533..ea8474d 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7581,7 +7581,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
--
2.7.4