This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Don't print too much if remote_debug is on
- From: Gary Benson <gbenson at redhat dot com>
- To: Luis Machado <lgustavo at codesourcery dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 1 Dec 2016 20:05:25 +0000
- Subject: Re: [PATCH] Don't print too much if remote_debug is on
- Authentication-results: sourceware.org; auth=none
- References: <1480433898-19584-1-git-send-email-yao.qi@linaro.org> <a52d54c4-1b27-4877-c40d-2846e3149272@codesourcery.com> <20161130125433.GH22209@E107787-LIN> <dedfd938-3ae3-609b-88b9-28b29082e772@codesourcery.com>
Luis Machado wrote:
> On 11/30/2016 06:54 AM, Yao Qi wrote:
> > 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.
I haven't checked, but it might be trivial to spot and not strip XML
by looking for "<?xml" in the first few bytes if the packet.
However this happens, removing the huge binary packets gets my +1.
(I know I'm responsible for a large increase in those recently,
sorry!)
Cheers,
Gary
--
http://gbenson.net/