llvm-project/lldb/unittests/Process/gdb-remote
Pavel Labath 2f93fd1f50 Represent invalid UUIDs as UUIDs with length zero
Summary:
During the previous attempt to generalize the UUID class, it was
suggested that we represent invalid UUIDs as length zero (previously, we
used an all-zero UUID for that). This meant that some valid build-ids
could not be represented (it's possible however unlikely that a checksum of
some file would be zero) and complicated adding support for variable
length build-ids (should a 16-byte empty UUID compare equal to a 20-byte
empty UUID?).

This patch resolves these issues by introducing a canonical
representation for an invalid UUID. The slight complication here is that
some clients (MachO) actually use the all-zero notation to mean "no UUID
has been set". To keep this use case working (while making it very
explicit about which construction semantices are wanted), replaced the
UUID constructors and the SetBytes functions with named factory methods.
- "fromData" creates a UUID from the given data, and it treats all bytes
  equally.
- "fromOptionalData" first checks the data contents - if all bytes are
  zero, it treats this as an invalid/empty UUID.

Reviewers: clayborg, sas, lemo, davide, espindola

Subscribers: emaste, lldb-commits, arichardson

Differential Revision: https://reviews.llvm.org/D48479

llvm-svn: 335612
2018-06-26 15:12:20 +00:00
..
CMakeLists.txt gdb-remote: Fix checksum verification for messages with escape chars 2018-03-28 10:19:10 +00:00
GDBRemoteClientBaseTest.cpp Handle O reply packets during qRcmd 2018-01-10 14:39:08 +00:00
GDBRemoteCommunicationClientTest.cpp Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
GDBRemoteCommunicationTest.cpp gdb-remote: Fix checksum verification for messages with escape chars 2018-03-28 10:19:10 +00:00
GDBRemoteTestUtils.cpp Simplify the gdb-remote unit tests 2017-06-22 15:54:21 +00:00
GDBRemoteTestUtils.h Simplify the gdb-remote unit tests 2017-06-22 15:54:21 +00:00