This is an archive of the discontinued LLVM Phabricator instance.

Add UUID::SetFromOptionalStringRef, use it in DynamicLoaderDarwin
ClosedPublic

Authored by jingham on Jan 24 2019, 2:18 PM.

Details

Summary

When you build a macOS binary with -no_uuid, we get a binary blob of all 0's from the file, and we read that in with UUID::fromOptionalData, so we get an invalid UUID. When debugserver tells us about the binaries that have been loaded, it returns a UUID string of all 0's. We need these two to match. If we use SetFromStringRef in the latter case, we end up with a valid UUID of all 0's, so they don't match.

This patch adds SetFromOptionalStringRef to mirror the from...Bytes API's, and use it in the macOS Dynamic loader.

I added tests in UUIDTests.cpp to ensure this behavior.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

jingham created this revision.Jan 24 2019, 2:18 PM
labath accepted this revision.Jan 24 2019, 2:24 PM

lgtm

This revision is now accepted and ready to land.Jan 24 2019, 2:24 PM
This revision was automatically updated to reflect the committed changes.