Fix handling of gdbserver binary packets with escape characters.

We were not properly handling the escape character 0x7d ('}') in responses
from gdbserver which used the binary protocol.

llvm-svn: 202062
This commit is contained in:
Steve Pucci 2014-02-24 19:07:29 +00:00
parent 039697513e
commit 3c5d3339be
1 changed files with 7 additions and 0 deletions

View File

@ -497,6 +497,13 @@ GDBRemoteCommunication::CheckForPacket (const uint8_t *src, size_t src_len, Stri
for (int i = 0; i < repeat_count; ++i)
packet_str.push_back(char_to_repeat);
}
else if (*c == 0x7d)
{
// 0x7d is the escape character. The next character is to
// be XOR'd with 0x20.
char escapee = *++c ^ 0x20;
packet_str.push_back(escapee);
}
else
{
packet_str.push_back(*c);