diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h @@ -44,6 +44,16 @@ dw_offset_t die_offset() const { return m_die_offset; } + bool operator<(DIERef other) const { + if (m_dwo_num_valid != other.m_dwo_num_valid) + return m_dwo_num_valid < other.m_dwo_num_valid; + if (m_dwo_num_valid && (m_dwo_num != other.m_dwo_num)) + return m_dwo_num < other.m_dwo_num; + if (m_section != other.m_section) + return m_section < other.m_section; + return m_die_offset < other.m_die_offset; + } + private: uint32_t m_dwo_num : 30; uint32_t m_dwo_num_valid : 1; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -498,7 +498,7 @@ bool m_fetched_external_modules : 1; lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type; - typedef std::set DIERefSet; + typedef std::set DIERefSet; typedef llvm::StringMap NameToOffsetMap; NameToOffsetMap m_function_scope_qualified_name_map; std::unique_ptr m_ranges; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2385,9 +2385,9 @@ dwo->GetMangledNamesForFunction(scope_qualified_name, mangled_names); } - for (lldb::user_id_t uid : + for (DIERef die_ref : m_function_scope_qualified_name_map.lookup(scope_qualified_name)) { - DWARFDIE die = GetDIE(uid); + DWARFDIE die = GetDIE(die_ref); mangled_names.push_back(ConstString(die.GetMangledName())); } } @@ -3035,7 +3035,7 @@ .AsCString("")); if (scope_qualified_name.size()) { m_function_scope_qualified_name_map[scope_qualified_name].insert( - die.GetID()); + *die.GetDIERef()); } } }