summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/StringExtractorGDBRemote.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-09-18 00:20:51 +0000
committerGreg Clayton <gclayton@apple.com>2014-09-18 00:20:51 +0000
commit109534cb596ea15c08137329c5b8760e078fa780 (patch)
treeefce3368efa8b73a50b1f55489ace21b6b2bf0d8 /lldb/source/Utility/StringExtractorGDBRemote.cpp
parent44272a40dc569d8b6e28eb34adfe0cdd4a0bfdec (diff)
downloadbcm5719-llvm-109534cb596ea15c08137329c5b8760e078fa780.tar.gz
bcm5719-llvm-109534cb596ea15c08137329c5b8760e078fa780.zip
Fix the ability of "lldb-platform" to upload files.
The issue was GDBRemoteCommunication::CheckForPacket() already fixes up any prefixed bytes (0x7d followed by value that is XOR'ed with 0x20). If we do this again, we cause binary packets to lose bytes. This allows lldb-platform to be able to upload binaries and debug them remotely. llvm-svn: 218002
Diffstat (limited to 'lldb/source/Utility/StringExtractorGDBRemote.cpp')
-rw-r--r--lldb/source/Utility/StringExtractorGDBRemote.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lldb/source/Utility/StringExtractorGDBRemote.cpp b/lldb/source/Utility/StringExtractorGDBRemote.cpp
index 17717dbe6e2..161ac6a026f 100644
--- a/lldb/source/Utility/StringExtractorGDBRemote.cpp
+++ b/lldb/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();
}
OpenPOWER on IntegriCloud