llvm-project/lldb/source/Utility
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
..
ARM64_DWARF_Registers.h Break some dependencies in lldbUtility. 2017-02-01 19:45:14 +00:00
ARM64_ehframe_Registers.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ARM_DWARF_Registers.h Break some dependencies in lldbUtility. 2017-02-01 19:45:14 +00:00
ARM_ehframe_Registers.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ArchSpec.cpp Log to the process channel, not target twice. 2018-05-01 00:42:17 +00:00
Args.cpp Use llvm::VersionTuple instead of manual version marshalling 2018-06-18 15:02:23 +00:00
Baton.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
CMakeLists.txt Move Args.cpp from Interpreter to Utility 2018-04-17 18:53:35 +00:00
Connection.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
ConstString.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataBufferHeap.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataBufferLLVM.cpp Make sure DataBufferLLVM contents are writable 2017-12-21 10:54:30 +00:00
DataEncoder.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataExtractor.cpp Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
Environment.cpp Add Utility/Environment class for handling... environments 2018-01-10 11:57:31 +00:00
FastDemangle.cpp Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
FileSpec.cpp Revert "[FileSpec] Always normalize" 2018-06-25 10:11:53 +00:00
History.cpp Move many other files from Core -> Utility. 2017-03-06 18:34:25 +00:00
IOObject.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
JSON.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
LLDBAssert.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
Log.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Logging.cpp Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
NameMatches.cpp Fix a couple of corner cases in NameMatches 2017-02-20 11:35:33 +00:00
PPC64LE_DWARF_Registers.h Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
PPC64LE_ehframe_Registers.h Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
PPC64_DWARF_Registers.h Add SysV Abi for PPC64le 2018-01-22 11:27:43 +00:00
Range.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
RegularExpression.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
SelectHelper.cpp [LLDB] Select helper sign comparison fix 2018-06-25 16:10:20 +00:00
SharingPtr.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Status.cpp Typo fixes. 2018-05-29 09:10:46 +00:00
Stream.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StreamCallback.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StreamGDBRemote.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StreamString.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StringExtractor.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StringExtractorGDBRemote.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StringLexer.cpp [Utility/StringLexer] Remove dead code. 2017-04-19 18:18:25 +00:00
StringList.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StructuredData.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
TildeExpressionResolver.cpp s/LLVM_ON_WIN32/_WIN32/, lldb 2018-04-10 13:33:45 +00:00
Timer.cpp Move Timer and TraceOptions from Core to Utility 2017-06-29 14:32:17 +00:00
UUID.cpp Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
UriParser.cpp Fix some warnings found by ToT clang 2017-11-02 21:35:26 +00:00
UserID.cpp Move many other files from Core -> Utility. 2017-03-06 18:34:25 +00:00
UuidCompatibility.h
VASprintf.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
VMRange.cpp [VMRange] Remove unused FindRangeIndexThatContainsValue(). 2017-06-09 21:01:55 +00:00