]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
gdb(4): Do not use run length encoding for 3-symbol repetitions
authorMichał Górny <mgorny@gentoo.org>
Mon, 10 Jan 2022 03:03:46 +0000 (22:03 -0500)
committerEd Maste <emaste@FreeBSD.org>
Sat, 5 Feb 2022 01:58:34 +0000 (20:58 -0500)
commit93627e0a18d40370b64c9da558adfd8a59a5cfb6
treebf2f892ce1bd867093c4f8999f29442bbf2476f2
parent57b0fc30676f98dcb2c2dec2dcc21b1c93a69b73
gdb(4): Do not use run length encoding for 3-symbol repetitions

Disable the gdb packet run length encoding for 3-symbol repetitions.
While it is technically possible to encode them, they have no advantage
over sending the characters verbatim (the resulting length is the same)
and they result in sending non-printable \x1f character.  The protocol
has been designed with the intent of avoiding non-printable characters
and therefore the run length encoding is biased to emit \x20 (a space)
with the minimal intended run length of 4.

While at it, simplify the logic by merging the different 'if' blocks
into a single while loop, and moving 'runlen == 0' check lower.

Reviewed by: cem, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33686

(cherry picked from commit 028a372fe2658ccf72ed481b9e942b28a59cb178)
sys/gdb/gdb_packet.c