]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
gdb(4): Don't escape GDB special characters at application layer
authorcem <cem@FreeBSD.org>
Wed, 30 Sep 2020 14:55:54 +0000 (14:55 +0000)
committercem <cem@FreeBSD.org>
Wed, 30 Sep 2020 14:55:54 +0000 (14:55 +0000)
commit7e411ad3e5cc04e4e82f60cbcd617f0d74ccf218
tree5d7697e8f6b518061520e234ca79b9f932a7ab1b
parente068f5f52883b27d7a9f2448740514595a1dc916
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
sys/gdb/gdb_main.c