================
@@ -839,6 +853,31 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, 
size_t src_len,
   return GDBRemoteCommunication::PacketType::Invalid;
 }
 
+GDBRemoteCommunication::PacketType
+GDBRemoteCommunication::CheckForPacketIgnoreNotifications(
+    const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet) {
+  for (;;) {
+    switch (CheckForPacket(src, src_len, packet)) {
+    case PacketType::Standard:
+      return PacketType::Standard;
+    case PacketType::Invalid:
+      // Either an incomplete packet or an invalid one that was removed.
+      // There may be more data in the buffer that contains valid
+      // packets but we can't easily tell because CheckForPacket
+      // does not distinguish these cases.
+      return PacketType::Invalid;
+    case PacketType::Notify:
+      // No notifications are currently supported so they should be ignored.
+      // There may be more packets in the buffer so go back to check.
+
+      // Also we need to set src_len=0 so that it doesn't add the
+      // data we read to the internal buffer again.
----------------
Timmmm wrote:

Updated

https://github.com/llvm/llvm-project/pull/204788
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to