[Lldb-commits] [lldb] r242184 - Add comment explaning sanity check on packet size in the packet decompression method.
Jason Molenda
jmolenda at apple.com
Tue Jul 14 12:19:07 PDT 2015
Author: jmolenda
Date: Tue Jul 14 14:19:07 2015
New Revision: 242184
URL: http://llvm.org/viewvc/llvm-project?rev=242184&view=rev
Log:
Add comment explaning sanity check on packet size in the packet decompression method.
Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=242184&r1=242183&r2=242184&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue Jul 14 14:19:07 2015
@@ -564,8 +564,12 @@ GDBRemoteCommunication::DecompressPacket
return true;
size_t pkt_size = m_bytes.size();
+
+ // Smallest possible compressed packet is $N#00 - an uncompressed empty reply, most commonly indicating
+ // an unsupported packet. Anything less than 5 characters, it's definitely not a compressed packet.
if (pkt_size < 5)
return true;
+
if (m_bytes[0] != '$' && m_bytes[0] != '%')
return true;
if (m_bytes[1] != 'C' && m_bytes[1] != 'N')
More information about the lldb-commits
mailing list