fdeazeve created this revision. Herald added a subscriber: arphaman. Herald added a project: All. fdeazeve requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
In order to recognize namespace aliases as a namespace, the DW_TAG_imported_declaration has to be taken into account. The name of these DIEs is already included in all accelerator tables as of D143397 <https://reviews.llvm.org/D143397>. Two of the three Index classes already handle this correctly: 1. ManualDWARFIndex (as of D143398 <https://reviews.llvm.org/D143398>) 2. AppleDWARFIndex works by default with D143397 <https://reviews.llvm.org/D143397>, since apple has a table dedicated to namespaces. This commit updates the third index class, DWARF 5's DebugNamesDWARFIndex. As a result, it fixes the following test with DWARF 5: commands/expression/namespace-alias/TestInlineNamespaceAlias.py Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D154730 Files: lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp @@ -227,7 +227,9 @@ ConstString name, llvm::function_ref<bool(DWARFDIE die)> callback) { for (const DebugNames::Entry &entry : m_debug_names_up->equal_range(name.GetStringRef())) { - if (entry.tag() == DW_TAG_namespace) { + dwarf::Tag entry_tag = entry.tag(); + if (entry_tag == DW_TAG_namespace || + entry_tag == DW_TAG_imported_declaration) { if (!ProcessEntry(entry, callback)) return; }
Index: lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp @@ -227,7 +227,9 @@ ConstString name, llvm::function_ref<bool(DWARFDIE die)> callback) { for (const DebugNames::Entry &entry : m_debug_names_up->equal_range(name.GetStringRef())) { - if (entry.tag() == DW_TAG_namespace) { + dwarf::Tag entry_tag = entry.tag(); + if (entry_tag == DW_TAG_namespace || + entry_tag == DW_TAG_imported_declaration) { if (!ProcessEntry(entry, callback)) return; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits