From c49c55aa6bef62956d48f3b9eae32587190218ec Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 16 Jan 2020 14:43:58 -0800 Subject: [PATCH 1/4] lldb: xfail TestCrossDSOTailCalls.py and TestCrossObjectTailCalls.py on arm/aarch64 This effectively reverts commit 8d2f252bb8e4d199be8498c4ee2245117ef08fd2, which went a bit too far and disabled these on all non-Darwin systems. (cherry picked from commit 6c4d37733403bf3fda260f1b05fc899427a61cdc) --- .../tail_call_frames/cross_dso/TestCrossDSOTailCalls.py | 1 + .../tail_call_frames/cross_object/TestCrossObjectTailCalls.py | 1 + 2 files changed, 2 insertions(+) diff --git a/lldb/test/API/functionalities/tail_call_frames/cross_dso/TestCrossDSOTailCalls.py b/lldb/test/API/functionalities/tail_call_frames/cross_dso/TestCrossDSOTailCalls.py index 0ca2f9e52c582..6d0f1c96fcdb4 100644 --- a/lldb/test/API/functionalities/tail_call_frames/cross_dso/TestCrossDSOTailCalls.py +++ b/lldb/test/API/functionalities/tail_call_frames/cross_dso/TestCrossDSOTailCalls.py @@ -11,6 +11,7 @@ class TestCrossDSOTailCalls(TestBase): @skipIf(compiler="clang", compiler_version=["<", "10.0"]) @skipIf(dwarf_version=["<", "4"]) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr26265") + @expectedFailureAll(archs=['arm', 'aarch64'], bugnumber="llvm.org/PR44561") def test_cross_dso_tail_calls(self): self.build() exe = self.getBuildArtifact("a.out") diff --git a/lldb/test/API/functionalities/tail_call_frames/cross_object/TestCrossObjectTailCalls.py b/lldb/test/API/functionalities/tail_call_frames/cross_object/TestCrossObjectTailCalls.py index b5de75e30e495..62e12f116f0f1 100644 --- a/lldb/test/API/functionalities/tail_call_frames/cross_object/TestCrossObjectTailCalls.py +++ b/lldb/test/API/functionalities/tail_call_frames/cross_object/TestCrossObjectTailCalls.py @@ -11,6 +11,7 @@ class TestCrossObjectTailCalls(TestBase): @skipIf(compiler="clang", compiler_version=["<", "10.0"]) @skipIf(dwarf_version=["<", "4"]) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr26265") + @expectedFailureAll(archs=['arm', 'aarch64'], bugnumber="llvm.org/PR44561") def test_cross_object_tail_calls(self): self.build() exe = self.getBuildArtifact("a.out") From 1bbfa174d695448895227f07bb8a90cd5ec2030a Mon Sep 17 00:00:00 2001 From: Augusto Noronha Date: Thu, 2 Oct 2025 14:46:00 -0700 Subject: [PATCH 2/4] [lldb] Fix NameMatchesLookupInfo not considering m_name being mangled --- lldb/source/Core/Module.cpp | 46 +++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 731aa6688d275..c36630beba092 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -729,27 +729,33 @@ bool Module::LookupInfo::NameMatchesLookupInfo( if (m_name == function_name) return true; - // If function_name is mangled, we'll need to demangle it. - // In the pathologial case where the function name "looks" mangled but is - // actually demangled (e.g. a method named _Zonk), this operation should be - // relatively inexpensive since no demangling is actually occuring. See - // Mangled::SetValue for more context. - const bool function_name_may_be_mangled = - Mangled::GetManglingScheme(function_name) != Mangled::eManglingSchemeNone; - ConstString demangled_function_name = function_name; - if (function_name_may_be_mangled) { - Mangled mangled_function_name(function_name); - demangled_function_name = mangled_function_name.GetDemangledName(); - } - - // If the symbol has a language, then let the language make the match. - // Otherwise just check that the demangled function name contains the - // demangled user-provided name. - if (Language *language = Language::FindPlugin(language_type)) - return language->DemangledNameContainsPath(m_name, demangled_function_name); + // If function_name or m_name is mangled, we'll need to demangle it and + // compare with its counterpart. In the pathological case where the function + // name "looks" mangled but is actually demangled (e.g. a method named _Zonk), + // this operation should be relatively inexpensive since no demangling is + // actually occuring. See Mangled::SetValue for more context. + auto match_maybe_mangled_name = [&](ConstString maybe_mangled_name, ConstString function_name) { + const bool function_name_may_be_mangled = + Mangled::GetManglingScheme(maybe_mangled_name) != + Mangled::eManglingSchemeNone; + ConstString demangled_function_name = maybe_mangled_name; + if (function_name_may_be_mangled) { + Mangled mangled_function_name(maybe_mangled_name); + demangled_function_name = mangled_function_name.GetDemangledName(); + } - llvm::StringRef function_name_ref = demangled_function_name; - return function_name_ref.contains(m_name); + // If the symbol has a language, then let the language make the match. + // Otherwise just check that the demangled function name contains the + // demangled user-provided name. + if (Language *language = Language::FindPlugin(language_type)) + return language->DemangledNameContainsPath(function_name, + demangled_function_name); + llvm::StringRef function_name_ref = demangled_function_name; + return function_name_ref.contains(m_name); + }; + + return match_maybe_mangled_name(function_name, m_name) || + match_maybe_mangled_name(m_name, function_name); } void Module::LookupInfo::Prune(SymbolContextList &sc_list, From a4763a7ee5d85cac69d14a1409a38aa3c2ec12c9 Mon Sep 17 00:00:00 2001 From: Augusto Noronha Date: Thu, 2 Oct 2025 14:47:11 -0700 Subject: [PATCH 3/4] Reapply "[lldb] look up function names in the swift language plugin (#11477)" This reverts commit 7520b5751a72a2e577f39874c693e570086271a0. --- lldb/source/Core/Module.cpp | 6 +++++- .../break_by_partial_name/TestSwiftBreakByPartialName.py | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index c36630beba092..3f6e763f76184 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -661,7 +661,11 @@ Module::LookupInfo::LookupInfo(ConstString name, if (language != eLanguageTypeUnknown) lang_types.push_back(language); else - lang_types = {eLanguageTypeObjC, eLanguageTypeC_plus_plus}; + lang_types = {eLanguageTypeObjC, eLanguageTypeC_plus_plus, +#ifdef LLDB_ENABLE_SWIFT + eLanguageTypeSwift +#endif + }; for (LanguageType lang_type : lang_types) { if (Language *lang = Language::FindPlugin(lang_type)) diff --git a/lldb/test/API/lang/swift/break_by_partial_name/TestSwiftBreakByPartialName.py b/lldb/test/API/lang/swift/break_by_partial_name/TestSwiftBreakByPartialName.py index de901b6222f25..3387454914887 100644 --- a/lldb/test/API/lang/swift/break_by_partial_name/TestSwiftBreakByPartialName.py +++ b/lldb/test/API/lang/swift/break_by_partial_name/TestSwiftBreakByPartialName.py @@ -13,12 +13,10 @@ Tests that we can break on a partial name of a Swift function Effectively tests our chopper of Swift demangled names """ -import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil -@skipIf(bugnumber = "rdar://159531198") class SwiftPartialBreakTest(TestBase): @swiftTest def test_swift_partial_break(self): From 63b16c919246ab52daeb29c63f77881f8e4ddfde Mon Sep 17 00:00:00 2001 From: Augusto Noronha Date: Thu, 2 Oct 2025 14:48:09 -0700 Subject: [PATCH 4/4] [lldb] Reenable TestEqualityOperators rdar://159531216 --- .../swift/expression/equality_operators/TestEqualityOperators.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lldb/test/API/lang/swift/expression/equality_operators/TestEqualityOperators.py b/lldb/test/API/lang/swift/expression/equality_operators/TestEqualityOperators.py index 3f77b61333f60..9c579dfb202fb 100644 --- a/lldb/test/API/lang/swift/expression/equality_operators/TestEqualityOperators.py +++ b/lldb/test/API/lang/swift/expression/equality_operators/TestEqualityOperators.py @@ -30,7 +30,6 @@ def execute_command(command): (exit_status, output) = subprocess.getstatusoutput(command) return exit_status -@skipIf(bugnumber = "rdar://159531216") class TestUnitTests(TestBase): @swiftTest @skipIf(debug_info=no_match(["dsym"]), bugnumber="This test is building a dSYM")