diff options
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 931baf5..097c91b 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -826,6 +826,24 @@ bool ObjectFileELF::ParseHeader() { } UUID ObjectFileELF::GetUUID() { + if (m_uuid) + return m_uuid; + + // Try loading note info from any PT_NOTE program headers. This is more + // friendly to ELF files that have no section headers, like ELF files that + // are loaded from memory. + for (const ELFProgramHeader &H : ProgramHeaders()) { + if (H.p_type == llvm::ELF::PT_NOTE) { + DataExtractor note_data = GetSegmentData(H); + if (note_data.GetByteSize()) { + lldb_private::ArchSpec arch_spec; + RefineModuleDetailsFromNote(note_data, arch_spec, m_uuid); + if (m_uuid) + return m_uuid; + } + } + } + // Need to parse the section list to get the UUIDs, so make sure that's been // done. if (!ParseSectionHeaders() && GetType() != ObjectFile::eTypeCoreFile) |