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

Details

Provenance
mgorny_gentoo.orgAuthored on Jan 10 2022, 3:03 AM
emasteCommitted on Jan 22 2022, 7:46 PM
Reviewer
cem
Differential Revision
D33686: gdb(4): Do not use run length encoding for 3-symbol repetitions
Parents
rG6f6fbfa3a835: Remove quotes around Makefile .error/.warn/.info strings
Branches
Unknown
Tags
Unknown