aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2022-08-18 17:20:55 -0700
committerJim Ingham <jingham@apple.com>2022-08-30 10:17:58 -0700
commit5ad6ed0e5519ed26442cd0a21cdb07f5c53b854e (patch)
tree9dd764d04cdd32d7fd17c6aca377f95801bd16cf /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parent52556c3c0f942cdb644e8548d9956b24bd9bba59 (diff)
downloadllvm-5ad6ed0e5519ed26442cd0a21cdb07f5c53b854e.zip
llvm-5ad6ed0e5519ed26442cd0a21cdb07f5c53b854e.tar.gz
llvm-5ad6ed0e5519ed26442cd0a21cdb07f5c53b854e.tar.bz2
Change the meaning of a UUID with all zeros for data.
Previously, depending on how you constructed a UUID from data or a StringRef, an input value of all zeros was valid (e.g. setFromData) or not (e.g. setFromOptionalData). Since there was no way to tell which interpretation to use, it was done somewhat inconsistently. This standardizes the meaning of a UUID of all zeros to Not Valid, and removes all the Optional methods and their uses, as well as the static factories that supported them. Differential Revision: https://reviews.llvm.org/D132191
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index bc488a7..ba4a1f6 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -627,13 +627,13 @@ size_t ObjectFileELF::GetModuleSpecifications(
if (gnu_debuglink_crc) {
// Use 4 bytes of crc from the .gnu_debuglink section.
u32le data(gnu_debuglink_crc);
- uuid = UUID::fromData(&data, sizeof(data));
+ uuid = UUID(&data, sizeof(data));
} 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.
u32le data[] = {u32le(g_core_uuid_magic), u32le(core_notes_crc)};
- uuid = UUID::fromData(data, sizeof(data));
+ uuid = UUID(data, sizeof(data));
}
}
@@ -788,7 +788,7 @@ UUID ObjectFileELF::GetUUID() {
// look different form .gnu_debuglink crc - followed by 4 bytes of note
// segments crc.
u32le data[] = {u32le(g_core_uuid_magic), u32le(core_notes_crc)};
- m_uuid = UUID::fromData(data, sizeof(data));
+ m_uuid = UUID(data, sizeof(data));
}
} else {
if (!m_gnu_debuglink_crc)
@@ -796,7 +796,7 @@ UUID ObjectFileELF::GetUUID() {
if (m_gnu_debuglink_crc) {
// Use 4 bytes of crc from the .gnu_debuglink section.
u32le data(m_gnu_debuglink_crc);
- m_uuid = UUID::fromData(&data, sizeof(data));
+ m_uuid = UUID(&data, sizeof(data));
}
}
}
@@ -1134,7 +1134,7 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
if (note.n_descsz >= 4) {
if (const uint8_t *buf = data.PeekData(offset, note.n_descsz)) {
// Save the build id as the UUID for the module.
- uuid = UUID::fromData(buf, note.n_descsz);
+ uuid = UUID(buf, note.n_descsz);
} else {
error.SetErrorString("failed to read GNU_BUILD_ID note payload");
return error;