]> 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, 22 Jan 2022 19:46:06 +0000 (14:46 -0500)
commit028a372fe2658ccf72ed481b9e942b28a59cb178
tree518ec10ae9b0bb21f56f898b69a21d966507d928
parent6f6fbfa3a83578332f5605a97108ef28d6726c29
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
sys/gdb/gdb_packet.c