From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52833 invoked by alias); 30 Nov 2016 14:01:41 -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 52778 invoked by uid 89); 30 Nov 2016 14:01:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=replies, nonetheless, Personally, Sending X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Nov 2016 14:01:35 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cC5S2-00006A-21 from Luis_Gustavo@mentor.com ; Wed, 30 Nov 2016 06:01:34 -0800 Received: from [172.30.5.15] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 30 Nov 2016 06:01:31 -0800 Reply-To: Luis Machado Subject: Re: [PATCH] Don't print too much if remote_debug is on References: <1480433898-19584-1-git-send-email-yao.qi@linaro.org> <20161130125433.GH22209@E107787-LIN> To: Yao Qi CC: From: Luis Machado Message-ID: Date: Wed, 30 Nov 2016 14:01:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161130125433.GH22209@E107787-LIN> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00988.txt.bz2 On 11/30/2016 06:54 AM, Yao Qi wrote: > On Tue, Nov 29, 2016 at 09:45:59AM -0600, Luis Machado wrote: >> On 11/29/2016 09:38 AM, Yao Qi wrote: >>> If we turn "remote debug" on and GDB does some vFile operations, >>> a lot of things will be printed in the screen, which makes >>> "remote debug" useless. >>> >>> This patch changes the code that we don't print messages if >>> messages are too long, greater than 512. Instead, print >>> "Sending packet: $vFile:pread:5,3fff,e0d12#c4...Packet received: [16384 bytes omitted]". >> >> How about not printing binary data at all and instead print some >> useful information about contents being sent? Like the number of >> bytes and maybe how many still need to be read? > > In putpkt/getpkt, we don't know the data is binary or not, unless we > pass an additional parameter to indicate this. Then, we need to > go through every calls to putpkt/getpkt, check the data is plain text > or binary, so pass the right value to putpkt/getpkt. Ah, that's unfortunate. > > The binary and plain data is mixed in the buffer in some packets, like > "vFile:pwrite: fd, offset, data". If we want to print > "Sending packet: $vFile:pwrite:5,e0d12,[16384 bytes]#c4" in the debug > output, we need to move the debugging output from buffer level to > packet level. I agree it is better than > "Sending packet: [16384 bytes omitted]" which is what my patch does. > > We can omit the received packet if it is more than REMOTE_DEBUG_MAX_CHAR > chars; if the sent packet is more than REMOTE_DEBUG_MAX_CHAR chars, only > print the first 50 chars, and omit the rest of them, so the debug > output is like, > > Sending packet: $vFile:pread:5,3fff,e0d12#c4...Packet received: [16384 bytes omitted] > Sending packet: $vFile:pwrite:5,e0d12,xxxyyyzzz[384 bytes omitted] ... Packet received: 358 > > What do you think? > I think it is an improvement nonetheless. Personally i still find particular lengthy replies useful, like the XML descriptions. But all the binary data is too distracting, hence why i was suggesting only binary streams being restricted. I'm fine with your version.