[lldb/Utility] YAML validation should be orthogonal to packet semantics.
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 3 Jan 2020 22:17:25 +0000 (14:17 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 3 Jan 2020 22:23:42 +0000 (14:23 -0800)
It's not up to YAML to validate the semantics of the GDB remote packet
struct. This is especially wrong here as there's nothing that says that
the amount of bytes transmitted  matches the packet payload size.

lldb/source/Utility/GDBRemote.cpp

index 54f3a3c..f267d00 100644 (file)
@@ -93,9 +93,6 @@ void yaml::MappingTraits<GDBRemotePacket>::mapping(IO &io,
 StringRef
 yaml::MappingTraits<GDBRemotePacket>::validate(IO &io,
                                                GDBRemotePacket &Packet) {
-  if (Packet.bytes_transmitted != Packet.packet.data.size())
-    return "BinaryData size doesn't match bytes transmitted";
-
   return {};
 }