Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibraryPathDiagnostics prints UUIDs with bytes in the reverse order #3391

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions Source/WTF/wtf/darwin/LibraryPathDiagnostics.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
#endif
static char const * const bundleListEnvironmentVariableName = "LIBRARY_PATH_DIAGNOSTICS_BUNDLES";

static String uuidToString(const uuid_t& uuid)
{
uuid_string_t uuid_string = { };
uuid_unparse(uuid, uuid_string);
return String::fromUTF8(uuid_string);
}

class LibraryPathDiagnosticsLogger final {
public:
LibraryPathDiagnosticsLogger();
Expand Down Expand Up @@ -147,7 +154,7 @@

auto sharedCacheInfo = JSON::Object::create();
sharedCacheInfo->setString("Path"_s, FileSystem::realPath(String::fromUTF8(dyld_shared_cache_file_path())));
sharedCacheInfo->setString("UUID"_s, UUID(Span<const uint8_t, 16> { uuid }).toString());
sharedCacheInfo->setString("UUID"_s, uuidToString(uuid));

logObject({ "SharedCache"_s }, WTFMove(sharedCacheInfo));
}
Expand Down Expand Up @@ -188,7 +195,7 @@ static bool isAddressInSharedRegion(const void* addr)
auto libraryObject = JSON::Object::create();

libraryObject->setString("Path"_s, FileSystem::realPath(String::fromUTF8(info.dli_fname)));
libraryObject->setString("UUID"_s, UUID(Span<const uint8_t, 16> { uuid }).toString());
libraryObject->setString("UUID"_s, uuidToString(uuid));

#if HAVE(SHARED_REGION_SPI)
libraryObject->setBoolean("InSharedCache"_s, isAddressInSharedRegion(header));
Expand Down