diff options
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 23 |
2 files changed, 15 insertions, 18 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 1b70f8a933e..de7b391a3b4 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -733,13 +733,13 @@ size_t ObjectFileELF::GetModuleSpecifications( if (gnu_debuglink_crc) { // Use 4 bytes of crc from the .gnu_debuglink section. uint32_t uuidt[4] = {gnu_debuglink_crc, 0, 0, 0}; - uuid.SetBytes(uuidt, sizeof(uuidt)); + uuid = UUID::fromData(uuidt, sizeof(uuidt)); } else if (core_notes_crc) { // Use 8 bytes - first 4 bytes for *magic* prefix, mainly to make // it look different form .gnu_debuglink crc followed by 4 bytes // of note segments crc. uint32_t uuidt[4] = {g_core_uuid_magic, core_notes_crc, 0, 0}; - uuid.SetBytes(uuidt, sizeof(uuidt)); + uuid = UUID::fromData(uuidt, sizeof(uuidt)); } } @@ -926,7 +926,7 @@ bool ObjectFileELF::GetUUID(lldb_private::UUID *uuid) { // different form .gnu_debuglink crc - followed by 4 bytes of note // segments crc. uint32_t uuidt[4] = {g_core_uuid_magic, core_notes_crc, 0, 0}; - m_uuid.SetBytes(uuidt, sizeof(uuidt)); + m_uuid = UUID::fromData(uuidt, sizeof(uuidt)); } } else { if (!m_gnu_debuglink_crc) @@ -935,7 +935,7 @@ bool ObjectFileELF::GetUUID(lldb_private::UUID *uuid) { if (m_gnu_debuglink_crc) { // Use 4 bytes of crc from the .gnu_debuglink section. uint32_t uuidt[4] = {m_gnu_debuglink_crc, 0, 0, 0}; - m_uuid.SetBytes(uuidt, sizeof(uuidt)); + m_uuid = UUID::fromData(uuidt, sizeof(uuidt)); } } @@ -1284,7 +1284,7 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data, } // Save the build id as the UUID for the module. - uuid.SetBytes(uuidbuf, note.n_descsz); + uuid = UUID::fromData(uuidbuf, note.n_descsz); } } break; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index b2cb6bd23f9..91e7f335327 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -2087,10 +2087,8 @@ UUID ObjectFileMachO::GetSharedCacheUUID(FileSpec dyld_shared_cache, version_str[6] = '\0'; if (strcmp(version_str, "dyld_v") == 0) { offset = offsetof(struct lldb_copy_dyld_cache_header_v1, uuid); - uint8_t uuid_bytes[sizeof(uuid_t)]; - memcpy(uuid_bytes, dsc_header_data.GetData(&offset, sizeof(uuid_t)), - sizeof(uuid_t)); - dsc_uuid.SetBytes(uuid_bytes); + dsc_uuid = UUID::fromOptionalData( + dsc_header_data.GetData(&offset, sizeof(uuid_t)), sizeof(uuid_t)); } Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS)); if (log && dsc_uuid.IsValid()) { @@ -4861,7 +4859,7 @@ bool ObjectFileMachO::GetUUID(const llvm::MachO::mach_header &header, if (!memcmp(uuid_bytes, opencl_uuid, 16)) return false; - uuid.SetBytes(uuid_bytes); + uuid = UUID::fromOptionalData(uuid_bytes, 16); return true; } return false; @@ -5392,12 +5390,11 @@ bool ObjectFileMachO::GetCorefileMainBinaryInfo (addr_t &address, UUID &uuid) { uuid_t raw_uuid; memset (raw_uuid, 0, sizeof (uuid_t)); - if (m_data.GetU32 (&offset, &type, 1) - && m_data.GetU64 (&offset, &address, 1) - && m_data.CopyData (offset, sizeof (uuid_t), raw_uuid) != 0 - && uuid.SetBytes (raw_uuid, sizeof (uuid_t))) - { - return true; + if (m_data.GetU32(&offset, &type, 1) && + m_data.GetU64(&offset, &address, 1) && + m_data.CopyData(offset, sizeof(uuid_t), raw_uuid) != 0) { + uuid = UUID::fromOptionalData(raw_uuid, sizeof(uuid_t)); + return true; } } } @@ -5660,7 +5657,7 @@ void ObjectFileMachO::GetLLDBSharedCacheUUID(addr_t &base_addr, UUID &uuid) { + 100); // sharedCacheBaseAddress <mach-o/dyld_images.h> } } - uuid.SetBytes(sharedCacheUUID_address); + uuid = UUID::fromOptionalData(sharedCacheUUID_address, sizeof(uuid_t)); } } } else { @@ -5685,7 +5682,7 @@ void ObjectFileMachO::GetLLDBSharedCacheUUID(addr_t &base_addr, UUID &uuid) { dyld_process_info_get_cache (process_info, &sc_info); if (sc_info.cacheBaseAddress != 0) { base_addr = sc_info.cacheBaseAddress; - uuid.SetBytes (sc_info.cacheUUID); + uuid = UUID::fromOptionalData(sc_info.cacheUUID, sizeof(uuid_t)); } dyld_process_info_release (process_info); } |