HomeFreeBSD

gdb(4): Don't escape GDB special characters at application layer

Description

gdb(4): Don't escape GDB special characters at application layer

In r351368, we introduced this XML- and GDB-encoded data. The protocol
'offset' should reflex the logical XML data offset, but unfortunately we
counted the GDB escapes as well.

In fact, we cannot safely do GDB character escaping at this layer at
all, because we don't know what will be flushed in a packet. It is
bogus to send only the first character of a two-character escape
sequence.

This patch "corrects" the problem by squashing these characters in the
transmitted XML document. It would be nice to transmit the characters
faithfully, but that is a more complicated change. Thread names are a
nice convenience feature for the GDB client, but one can always inspect
td_name or p_comm directly to find the true name.

Reported by: Ka Ho Ng <khng300 AT gmail.com>
Tested by: Ka Ho Ng
Reviewed by: emaste, markj, rlibby
Differential Revision: https://reviews.freebsd.org/D26599

Details

Provenance
cemAuthored on
Reviewer
emaste
Differential Revision
D26599: gdb(4): Don't escape GDB special characters at application layer
Parents
rS366290: MFC r366091:
Branches
Unknown
Tags
Unknown