This revision was automatically updated to reflect the committed changes. Closed by commit rGaed965d55d46: [lldb] Don't construct the demangled strings while indexing the symbol table (authored by JDevlieghere). Herald added a project: LLDB.
Changed prior to commit: https://reviews.llvm.org/D118814?vs=405698&id=406032#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118814/new/ https://reviews.llvm.org/D118814 Files: lldb/source/Core/Mangled.cpp lldb/source/Symbol/Symtab.cpp lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py Index: lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py =================================================================== --- lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py +++ lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py @@ -43,8 +43,6 @@ self.assertEqual(unstripped_Z3pat_symbols.GetSize(), 1) unstripped_pat_symbols = unstripped_target.FindSymbols("pat") self.assertEqual(unstripped_pat_symbols.GetSize(), 1) - unstripped_patint_symbols = unstripped_target.FindSymbols("pat(int)") - self.assertEqual(unstripped_patint_symbols.GetSize(), 1) unstripped_bar_symbols = unstripped_target.FindSymbols("bar") self.assertEqual(unstripped_bar_symbols.GetSize(), 1) @@ -77,8 +75,6 @@ self.assertEqual(stripped_Z3pat_symbols.GetSize(), 1) stripped_pat_symbols = stripped_target.FindSymbols("pat") self.assertEqual(stripped_pat_symbols.GetSize(), 1) - stripped_patint_symbols = stripped_target.FindSymbols("pat(int)") - self.assertEqual(stripped_patint_symbols.GetSize(), 1) # bar should have been strippped. We should not find it, or the # stripping went wrong. Index: lldb/source/Symbol/Symtab.cpp =================================================================== --- lldb/source/Symbol/Symtab.cpp +++ lldb/source/Symbol/Symtab.cpp @@ -328,8 +328,10 @@ const SymbolType type = symbol->GetType(); if (type == eSymbolTypeCode || type == eSymbolTypeResolver) { - if (mangled.DemangleWithRichManglingInfo(rmc, lldb_skip_name)) + if (mangled.DemangleWithRichManglingInfo(rmc, lldb_skip_name)) { RegisterMangledNameEntry(value, class_contexts, backlog, rmc); + continue; + } } } Index: lldb/source/Core/Mangled.cpp =================================================================== --- lldb/source/Core/Mangled.cpp +++ lldb/source/Core/Mangled.cpp @@ -214,24 +214,16 @@ case eManglingSchemeItanium: // We want the rich mangling info here, so we don't care whether or not // there is a demangled string in the pool already. - if (context.FromItaniumName(m_mangled)) { - // If we got an info, we have a name. Copy to string pool and connect the - // counterparts to accelerate later access in GetDemangledName(). - m_demangled.SetStringWithMangledCounterpart(context.ParseFullName(), - m_mangled); - return true; - } else { - m_demangled.SetCString(""); - return false; - } + return context.FromItaniumName(m_mangled); case eManglingSchemeMSVC: { // We have no rich mangling for MSVC-mangled names yet, so first try to // demangle it if necessary. if (!m_demangled && !m_mangled.GetMangledCounterpart(m_demangled)) { if (char *d = GetMSVCDemangledStr(m_mangled.GetCString())) { - // If we got an info, we have a name. Copy to string pool and connect - // the counterparts to accelerate later access in GetDemangledName(). + // Without the rich mangling info we have to demangle the full name. + // Copy it to string pool and connect the counterparts to accelerate + // later access in GetDemangledName(). m_demangled.SetStringWithMangledCounterpart(llvm::StringRef(d), m_mangled); ::free(d);
Index: lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py =================================================================== --- lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py +++ lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py @@ -43,8 +43,6 @@ self.assertEqual(unstripped_Z3pat_symbols.GetSize(), 1) unstripped_pat_symbols = unstripped_target.FindSymbols("pat") self.assertEqual(unstripped_pat_symbols.GetSize(), 1) - unstripped_patint_symbols = unstripped_target.FindSymbols("pat(int)") - self.assertEqual(unstripped_patint_symbols.GetSize(), 1) unstripped_bar_symbols = unstripped_target.FindSymbols("bar") self.assertEqual(unstripped_bar_symbols.GetSize(), 1) @@ -77,8 +75,6 @@ self.assertEqual(stripped_Z3pat_symbols.GetSize(), 1) stripped_pat_symbols = stripped_target.FindSymbols("pat") self.assertEqual(stripped_pat_symbols.GetSize(), 1) - stripped_patint_symbols = stripped_target.FindSymbols("pat(int)") - self.assertEqual(stripped_patint_symbols.GetSize(), 1) # bar should have been strippped. We should not find it, or the # stripping went wrong. Index: lldb/source/Symbol/Symtab.cpp =================================================================== --- lldb/source/Symbol/Symtab.cpp +++ lldb/source/Symbol/Symtab.cpp @@ -328,8 +328,10 @@ const SymbolType type = symbol->GetType(); if (type == eSymbolTypeCode || type == eSymbolTypeResolver) { - if (mangled.DemangleWithRichManglingInfo(rmc, lldb_skip_name)) + if (mangled.DemangleWithRichManglingInfo(rmc, lldb_skip_name)) { RegisterMangledNameEntry(value, class_contexts, backlog, rmc); + continue; + } } } Index: lldb/source/Core/Mangled.cpp =================================================================== --- lldb/source/Core/Mangled.cpp +++ lldb/source/Core/Mangled.cpp @@ -214,24 +214,16 @@ case eManglingSchemeItanium: // We want the rich mangling info here, so we don't care whether or not // there is a demangled string in the pool already. - if (context.FromItaniumName(m_mangled)) { - // If we got an info, we have a name. Copy to string pool and connect the - // counterparts to accelerate later access in GetDemangledName(). - m_demangled.SetStringWithMangledCounterpart(context.ParseFullName(), - m_mangled); - return true; - } else { - m_demangled.SetCString(""); - return false; - } + return context.FromItaniumName(m_mangled); case eManglingSchemeMSVC: { // We have no rich mangling for MSVC-mangled names yet, so first try to // demangle it if necessary. if (!m_demangled && !m_mangled.GetMangledCounterpart(m_demangled)) { if (char *d = GetMSVCDemangledStr(m_mangled.GetCString())) { - // If we got an info, we have a name. Copy to string pool and connect - // the counterparts to accelerate later access in GetDemangledName(). + // Without the rich mangling info we have to demangle the full name. + // Copy it to string pool and connect the counterparts to accelerate + // later access in GetDemangledName(). m_demangled.SetStringWithMangledCounterpart(llvm::StringRef(d), m_mangled); ::free(d);
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits