summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2018-02-07 01:28:29 +0000
committerJason Molenda <jmolenda@apple.com>2018-02-07 01:28:29 +0000
commitfd443e9b6cd0559f2dd6e51ae40eb54542fccbf0 (patch)
treecfc78a9c8d178d55cbce2a07fb35e03a3ccd7431 /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
parent6d9e090a64b0326a203b5ad99758652c23fa301b (diff)
downloadbcm5719-llvm-fd443e9b6cd0559f2dd6e51ae40eb54542fccbf0.tar.gz
bcm5719-llvm-fd443e9b6cd0559f2dd6e51ae40eb54542fccbf0.zip
lldb running on an ios device is using the _dyld_get_all_image_infos()
SPI call to to find its own shared cache's UUID. On newer sytems we need to use the a new SPI which will return the UUID directly. <rdar://problem/36625871> llvm-svn: 324437
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 1f03f7b64a9..6a729e97b39 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -2113,6 +2113,11 @@ UUID ObjectFileMachO::GetSharedCacheUUID(FileSpec dyld_shared_cache,
sizeof(uuid_t));
dsc_uuid.SetBytes(uuid_bytes);
}
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS));
+ if (log && dsc_uuid.IsValid()) {
+ log->Printf("Shared cache %s has UUID %s", dyld_shared_cache.GetPath().c_str(),
+ dsc_uuid.GetAsString().c_str());
+ }
return dsc_uuid;
}
@@ -5684,6 +5689,9 @@ UUID ObjectFileMachO::GetProcessSharedCacheUUID(Process *process) {
dl->GetSharedCacheInformation(load_address, uuid, using_shared_cache,
private_shared_cache);
}
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS | LIBLLDB_LOG_PROCESS));
+ if (log)
+ log->Printf("inferior process shared cache has a UUID of %s", uuid.GetAsString().c_str());
return uuid;
}
@@ -5714,7 +5722,20 @@ UUID ObjectFileMachO::GetLLDBSharedCacheUUID() {
uuid.SetBytes(sharedCacheUUID_address);
}
}
+ } else {
+ // Exists in macOS 10.12 and later, iOS 10.0 and later - dyld SPI
+ bool *(*dyld_get_shared_cache_uuid)(uuid_t);
+ dyld_get_shared_cache_uuid = (bool *(*)(uuid_t))
+ dlsym(RTLD_DEFAULT, "_dyld_get_shared_cache_uuid");
+ if (dyld_get_shared_cache_uuid) {
+ uuid_t tmp_uuid;
+ if (dyld_get_shared_cache_uuid(tmp_uuid))
+ uuid.SetBytes(tmp_uuid);
+ }
}
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS | LIBLLDB_LOG_PROCESS));
+ if (log && uuid.IsValid())
+ log->Printf("lldb's in-memory shared cache has a UUID of %s", uuid.GetAsString().c_str());
#endif
return uuid;
}
OpenPOWER on IntegriCloud