From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 807 invoked by alias); 2 Mar 2018 17:14:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 128069 invoked by uid 89); 2 Mar 2018 17:14:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*x:Release, H*UA:Release X-HELO: PHX2.ddci.com Received: from phx2.ddci.com (HELO PHX2.ddci.com) (184.183.10.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Mar 2018 17:14:49 +0000 To: gdb-patches@sourceware.org MIME-Version: 1.0 Subject: PATCH for minor buglet in remote.c misreporting REMOTE_DEBUG_MAX_CHAR messages X-KeepSent: 7B034DAF:5A6D3B6A-06258244:005E4499; type=4; name=$KeepSent From: alarson@ddci.com Message-ID: Date: Fri, 02 Mar 2018 17:14:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2018-03/txt/msg00064.txt.bz2 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");