llvm-project/lldb/source
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
..
API Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
Breakpoint BreakpointIDList: Use llvm::ArrayRef instead of pointer+length pair 2018-06-20 08:12:50 +00:00
Commands Remove duplicated check and shared_ptr copying. 2018-06-21 19:19:57 +00:00
Core Change AddressClass type from 'enum' to 'enum class'. 2018-06-26 13:06:54 +00:00
DataFormatters Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Expression Fix an issue where DW_OP_deref might be dereferencing a file address. Convert the file address to a load address so this works. 2018-06-21 17:58:06 +00:00
Host Fix macos build for r335244 2018-06-21 15:40:33 +00:00
Initialization Move ObjectFile initialization out of SystemInitializerCommon 2018-05-24 12:44:18 +00:00
Interpreter Remove UUID::SetFromCString 2018-06-21 15:24:39 +00:00
Plugins Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
Symbol Change AddressClass type from 'enum' to 'enum class'. 2018-06-26 13:06:54 +00:00
Target Change AddressClass type from 'enum' to 'enum class'. 2018-06-26 13:06:54 +00:00
Utility Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
CMakeLists.txt Remove Plugins/Process/POSIX from include_directories 2017-04-11 12:26:25 +00:00
lldb.cpp Run clang-format on lldb.cpp 2017-11-02 16:56:52 +00:00