Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH for minor buglet in remote.c misreporting REMOTE_DEBUG_MAX_CHAR messages
@ 2018-03-02 17:14 alarson
  2018-03-08 23:34 ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: alarson @ 2018-03-02 17:14 UTC (permalink / raw)
  To: gdb-patches

In remote.c, when the output of "set debug remote" is truncated, the 
number of characters reported is incorrect.  What is reported is the 
number of characters added by the quoting, not the number of characters 
that were truncated.  I'm not up to speed on the GDB patch process , but 
here are the necessary changes if someone is willing to be a proxy:

--- gdb/remote.c        2017-09-07 08:28:11.000000000 -0600
+++ ../../gdb-8.0.1/gdb/remote.c        2018-03-02 11:07:33.465414200 
-0600
@@ -8768,10 +8768,10 @@
 
          fprintf_unfiltered (gdb_stdlog, "Sending packet: %s", str.c_str 
());
 
-         if (str.length () > REMOTE_DEBUG_MAX_CHAR)
+         if (len > REMOTE_DEBUG_MAX_CHAR)
            {
              fprintf_unfiltered (gdb_stdlog, "[%zu bytes omitted]",
-                                 str.length () - REMOTE_DEBUG_MAX_CHAR);
+                                 len - REMOTE_DEBUG_MAX_CHAR);
            }
 
          fprintf_unfiltered (gdb_stdlog, "...");
@@ -9210,10 +9210,10 @@
              fprintf_unfiltered (gdb_stdlog, "Packet received: %s",
                                  str.c_str ());
 
-             if (str.length () >  REMOTE_DEBUG_MAX_CHAR)
+             if (val >  REMOTE_DEBUG_MAX_CHAR)
                {
                  fprintf_unfiltered (gdb_stdlog, "[%zu bytes omitted]",
-                                     str.length () - 
REMOTE_DEBUG_MAX_CHAR);
+                                     val - REMOTE_DEBUG_MAX_CHAR);
                }
 
              fprintf_unfiltered (gdb_stdlog, "\n");


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-09  0:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 17:14 PATCH for minor buglet in remote.c misreporting REMOTE_DEBUG_MAX_CHAR messages alarson
2018-03-08 23:34 ` Simon Marchi
2018-03-08 23:51   ` alarson
2018-03-09  0:01     ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox