diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2015-02-06 21:38:51 +0000 | 
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2015-02-06 21:38:51 +0000 | 
| commit | 205afe679855a4ce8149cdaa94d3f0868ce796dc (patch) | |
| tree | 09bc83f73246ee3c7a779605cd0122093d2a8a19 /source/Utility/StringExtractorGDBRemote.cpp | |
| parent | 0cac4ca3916ac24ab6139d03cbfd18db9e715bfe (diff) | |
Notes
Diffstat (limited to 'source/Utility/StringExtractorGDBRemote.cpp')
| -rw-r--r-- | source/Utility/StringExtractorGDBRemote.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/source/Utility/StringExtractorGDBRemote.cpp b/source/Utility/StringExtractorGDBRemote.cpp index 17717dbe6e20..161ac6a026f2 100644 --- a/source/Utility/StringExtractorGDBRemote.cpp +++ b/source/Utility/StringExtractorGDBRemote.cpp @@ -346,14 +346,15 @@ StringExtractorGDBRemote::GetError ()  size_t  StringExtractorGDBRemote::GetEscapedBinaryData (std::string &str)  { +    // Just get the data bytes in the string as GDBRemoteCommunication::CheckForPacket() +    // already removes any 0x7d escaped characters. If any 0x7d characters are left in +    // the packet, then they are supposed to be there...      str.clear(); -    char ch; -    while (GetBytesLeft()) +    const size_t bytes_left = GetBytesLeft(); +    if (bytes_left > 0)      { -        ch = GetChar(); -        if (ch == 0x7d) -            ch = (GetChar() ^ 0x20); -        str.append(1,ch); +        str.assign(m_packet, m_index, bytes_left); +        m_index += bytes_left;      }      return str.size();  }  | 
