[pushed 1/2] GDB: remote: Print total bytes received in debug message

Thiago Jung Bauermann thiago.bauermann@linaro.org
Fri Jan 10 17:32:36 GMT 2025


This is useful information I missed while debugging issues with
the g packet reply.

Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
---
 gdb/remote.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Change from last posted version:

- Adopted message wording suggested by Baris.

diff --git a/gdb/remote.c b/gdb/remote.c
index d9ad6974366a..8cb9050eaeda 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -10539,8 +10539,8 @@ remote_target::getpkt (gdb::char_vector *buf, bool forever, bool *is_notif)
 
 	      if (val > max_chars)
 		remote_debug_printf_nofunc
-		  ("Packet received: %s [%d bytes omitted]", str.c_str (),
-		   val - max_chars);
+		  ("Packet received: %s [%d of %d bytes omitted]", str.c_str (),
+		   val - max_chars, val);
 	      else
 		remote_debug_printf_nofunc ("Packet received: %s",
 					    str.c_str ());


More information about the Gdb-patches mailing list