UUID: Add support for arbitrary-sized module IDs
authorPavel Labath <labath@google.com>
Fri, 29 Jun 2018 11:20:29 +0000 (11:20 +0000)
committerPavel Labath <labath@google.com>
Fri, 29 Jun 2018 11:20:29 +0000 (11:20 +0000)
commit77c397f465f170df8f39f79fde93b724205b8009
tree83a8c635f61fca2d42ac3ac0e44c88b1d83ac2fc
parent3b599d75d508409b1ae92ba26d7fcee3c284abe7
UUID: Add support for arbitrary-sized module IDs

Summary:
The data structure is optimized for the case where the UUID size is <=
20 bytes (standard length emitted by the GNU linkers), but larger sizes
are also possible.

I've modified the string conversion function to support the new sizes as
well. For standard UUIDs it maintains the traditional formatting
(4-2-2-2-6). If a UUID is shorter, we just cut this sequence short, and
for longer UUIDs it will just repeat the last 6-byte block as long as
necessary.

I've also modified ObjectFileELF to take advantage of the new UUIDs and
avoid manually padding the UUID to 16 bytes. While there, I also made
sure the computed UUID does not depend on host endianness.

Reviewers: clayborg, lemo, sas, davide, espindola

Subscribers: emaste, arichardson, lldb-commits

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

llvm-svn: 335963
lldb/include/lldb/Utility/UUID.h
lldb/source/Interpreter/OptionValueUUID.cpp
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Utility/UUID.cpp
lldb/unittests/Utility/UUIDTest.cpp