hanchenye-llvm-project/lldb/unittests
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
..
Breakpoint Rename Error -> Status. 2017-05-12 04:51:55 +00:00
Core Scalar: Use llvm integer conversion functions 2018-06-19 17:24:03 +00:00
Editline Move PseudoTerminal to the lldb_private namespace 2017-12-11 10:09:14 +00:00
Expression Really fix ClangParserTest 2018-06-05 10:29:48 +00:00
Host [FileSpec] Make style argument mandatory for SetFile. NFC 2018-06-13 22:54:52 +00:00
Interpreter Move Args.cpp from Interpreter to Utility 2018-04-17 18:53:35 +00:00
Language CPlusPlusLanguage: Add unit tests for the FindAlternateFunctionManglings method 2018-05-10 08:59:17 +00:00
ObjectFile [FileSpec] Make style argument mandatory for SetFile. NFC 2018-06-13 22:54:52 +00:00
Platform Use llvm::VersionTuple instead of manual version marshalling 2018-06-18 15:02:23 +00:00
Process Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
ScriptInterpreter Added new API to SBStructuredData class 2017-05-29 08:25:46 +00:00
Signals Make LLDB skip server-client roundtrip for signals that don't require any actions 2017-03-07 21:34:40 +00:00
Symbol Refactor ExecuteAndWait to take StringRefs. 2018-06-12 17:43:52 +00:00
SymbolFile Revert "PDB support of function-level linking and splitted functions" 2018-06-06 09:16:00 +00:00
Target Remove UUID::SetFromCString 2018-06-21 15:24:39 +00:00
TestingSupport cmake + xcode: prevent gtests from using includes from project root 2017-10-03 21:20:18 +00:00
UnwindAssembly [LLDB] Initial version of PPC64 InstEmulation 2018-02-27 18:42:46 +00:00
Utility Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
debugserver [CMake] Need to set WITH_LOCKDOWN on debugserver target 2017-09-06 20:15:43 +00:00
tools Reapply "Remove Process references from the Host module" 2018-05-15 13:42:26 +00:00
CMakeLists.txt [cmake, unittests] Fix the CMake file for the LLDB unittests to support multiple configurations 2018-05-09 19:58:51 +00:00
gtest_common.h [Windows] Remove the #include <eh.h> hack. 2017-03-03 20:21:59 +00:00