本文整理汇总了C++中UUID::SetBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ UUID::SetBytes方法的具体用法?C++ UUID::SetBytes怎么用?C++ UUID::SetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::SetBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSharedCacheInformation
bool DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(
lldb::addr_t &base_address, UUID &uuid, LazyBool &using_shared_cache,
LazyBool &private_shared_cache) {
base_address = LLDB_INVALID_ADDRESS;
uuid.Clear();
using_shared_cache = eLazyBoolCalculate;
private_shared_cache = eLazyBoolCalculate;
if (m_process) {
addr_t all_image_infos = m_process->GetImageInfoAddress();
// The address returned by GetImageInfoAddress may be the address of dyld
// (don't want)
// or it may be the address of the dyld_all_image_infos structure (want).
// The first four
// bytes will be either the version field (all_image_infos) or a Mach-O file
// magic constant.
// Version 13 and higher of dyld_all_image_infos is required to get the
// sharedCacheUUID field.
Error err;
uint32_t version_or_magic =
m_process->ReadUnsignedIntegerFromMemory(all_image_infos, 4, -1, err);
if (version_or_magic != static_cast<uint32_t>(-1) &&
version_or_magic != llvm::MachO::MH_MAGIC &&
version_or_magic != llvm::MachO::MH_CIGAM &&
version_or_magic != llvm::MachO::MH_MAGIC_64 &&
version_or_magic != llvm::MachO::MH_CIGAM_64 &&
version_or_magic >= 13) {
addr_t sharedCacheUUID_address = LLDB_INVALID_ADDRESS;
int wordsize = m_process->GetAddressByteSize();
if (wordsize == 8) {
sharedCacheUUID_address =
all_image_infos + 160; // sharedCacheUUID <mach-o/dyld_images.h>
}
if (wordsize == 4) {
sharedCacheUUID_address =
all_image_infos + 84; // sharedCacheUUID <mach-o/dyld_images.h>
}
if (sharedCacheUUID_address != LLDB_INVALID_ADDRESS) {
uuid_t shared_cache_uuid;
if (m_process->ReadMemory(sharedCacheUUID_address, shared_cache_uuid,
sizeof(uuid_t), err) == sizeof(uuid_t)) {
uuid.SetBytes(shared_cache_uuid);
if (uuid.IsValid()) {
using_shared_cache = eLazyBoolYes;
}
}
if (version_or_magic >= 15) {
// The sharedCacheBaseAddress field is the next one in the
// dyld_all_image_infos struct.
addr_t sharedCacheBaseAddr_address = sharedCacheUUID_address + 16;
Error error;
base_address = m_process->ReadUnsignedIntegerFromMemory(
sharedCacheBaseAddr_address, wordsize, LLDB_INVALID_ADDRESS,
error);
if (error.Fail())
base_address = LLDB_INVALID_ADDRESS;
}
return true;
}
//
// add
// NB: sharedCacheBaseAddress is the next field in dyld_all_image_infos
// after
// sharedCacheUUID -- that is, 16 bytes after it, if we wanted to fetch
// it.
}
}
return false;
}