[PATCH] Don't print too much if remote_debug is on
Thu Dec 1 20:05:00 GMT 2016
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,
More information about the Gdb-patches