[Lldb-commits] [lldb] [lldb] Ignore notification packets (PR #204788)

Tim Hutt via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 23 04:29:40 PDT 2026


================
@@ -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


More information about the lldb-commits mailing list