llvm-project/lldb
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
..
cmake Fix up Info.plist when building LLDB.framework with CMake 2018-06-19 02:59:30 +00:00
docs Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
examples Update cmdtemplate.py to use best pratices. 2018-06-22 23:34:24 +00:00
include/lldb Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
lit DebugNamesDWARFIndex: fix handling of compressed sections 2018-06-14 14:41:30 +00:00
lldb.xcodeproj Sort the files in the PBXBuildFile and PBXFileReference 2018-06-15 23:29:32 +00:00
lldb.xcworkspace Fix a typo in the gtest build target for Debug configuration. 2018-04-10 17:49:56 +00:00
packages/Python/lldbsuite Fix TestThreadExit for gcc&libc++ combo 2018-06-25 14:28:38 +00:00
resources Fix up Info.plist when building LLDB.framework with CMake 2018-06-19 02:59:30 +00:00
scripts Improve SBThread's stepping API using SBError parameter. 2018-06-20 21:43:16 +00:00
source Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
test [test] Fix --framework argument passed to dotest. 2018-05-29 12:30:27 +00:00
third_party/Python/module *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
tools Fix windows build for r335541. 2018-06-25 23:29:52 +00:00
unittests Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
utils [CMake] Unify and relayer testing 2018-05-03 16:54:10 +00:00
www Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format Updated .clang-format rules so bring LLDB in line with LLVM standards. 2016-09-06 17:19:00 +00:00
.gitignore [dotest] Remove crashinfo hook 2018-01-10 10:18:47 +00:00
CMakeLists.txt Attempt to fix windows build broken by r334968 2018-06-19 14:23:31 +00:00
CODE_OWNERS.txt Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
INSTALL.txt Changed builld-llvm.py to use .json files 2017-02-23 02:21:34 +00:00
LICENSE.TXT
use_lldb_suite_root.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00