HomeFreeBSD

gdb(4): Do not use run length encoding for 3-symbol repetitions

Description

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)

Details

Provenance
mgorny_gentoo.orgAuthored on Jan 10 2022, 3:03 AM
emasteCommitted on Feb 5 2022, 1:58 AM
Reviewer
cem
Differential Revision
D33686: gdb(4): Do not use run length encoding for 3-symbol repetitions
Parents
rG57b0fc30676f: Avoid unnecessary setting of UFS flag requesting fsck(8) be run.
Branches
Unknown
Tags
Unknown