From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69972 invoked by alias); 30 Nov 2016 12:54:47 -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 69953 invoked by uid 89); 30 Nov 2016 12:54:46 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=packets, Sending X-HELO: mail-wj0-f179.google.com Received: from mail-wj0-f179.google.com (HELO mail-wj0-f179.google.com) (209.85.210.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Nov 2016 12:54:45 +0000 Received: by mail-wj0-f179.google.com with SMTP id mp19so173303834wjc.1 for ; Wed, 30 Nov 2016 04:54:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sSLJdq1XLSVQDgXMRtUOs/Rh4812ikcZM9AXj4LWfYo=; b=RCxKkeHRxoCRqv72ms+ynDitYyUOKSWU550QQZ/nzILmQo5xoDkTUjCIBRRRrWfwDU nWIPrZvpmfD9rGjsrD5qOYz9afWtsBPWA4OrgE9hL0bYkzUxviU/SjVw6pgY2clJ7mgL qZmIOJE4xBQaPOaLDG+deMvW06LjwGQBBfXz/PnU48xt6f/RLaunN2dR7tr0aWlxHuVT RDtmuOvlFys81kR9XuGEYyotNxp6z7bYUVuCSBW4IMReLq0KnF1vZMgqR/Ez1R6RJboL +2e/rpFF+24OaBUbSWDkMOuzD1YMBKnB/9IedjIY2tvr9veE6M1QGxgzmwPXjsUS8Y/y PsFw== X-Gm-Message-State: AKaTC01z+UAbmR2/C3gSVSZ/rOpGUn8kyMjGMImWdBoQ1qrLtvbHGE9Z6zOYQLopgYQ81g== X-Received: by 10.194.119.68 with SMTP id ks4mr26926600wjb.171.1480510483300; Wed, 30 Nov 2016 04:54:43 -0800 (PST) Received: from E107787-LIN (power8-aix.osuosl.org. [140.211.9.96]) by smtp.gmail.com with ESMTPSA id i132sm7856326wmf.14.2016.11.30.04.54.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 30 Nov 2016 04:54:42 -0800 (PST) Date: Wed, 30 Nov 2016 12:54:00 -0000 From: Yao Qi To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Don't print too much if remote_debug is on Message-ID: <20161130125433.GH22209@E107787-LIN> References: <1480433898-19584-1-git-send-email-yao.qi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00982.txt.bz2 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. 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? -- Yao (齐尧)