From: Luis Machado <lgustavo@codesourcery.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Don't print too much if remote_debug is on
Date: Wed, 30 Nov 2016 14:01:00 -0000 [thread overview]
Message-ID: <dedfd938-3ae3-609b-88b9-28b29082e772@codesourcery.com> (raw)
In-Reply-To: <20161130125433.GH22209@E107787-LIN>
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.
next prev parent reply other threads:[~2016-11-30 14:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 15:38 Yao Qi
2016-11-29 15:46 ` Luis Machado
2016-11-30 12:54 ` Yao Qi
2016-11-30 14:01 ` Luis Machado [this message]
2016-12-01 20:05 ` Gary Benson
2016-11-30 19:28 ` Pedro Alves
2016-12-06 14:22 ` [PATCH V2] " Yao Qi
2017-01-13 15:46 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dedfd938-3ae3-609b-88b9-28b29082e772@codesourcery.com \
--to=lgustavo@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox