diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 9ef342e3e989..d84827999e0e 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -263,6 +263,7 @@ namespace lldb { eSymbolContextBlock = (1u << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results eSymbolContextLineEntry = (1u << 5), ///< Set when \a line_entry is requested from a query, or was located in query results eSymbolContextSymbol = (1u << 6), ///< Set when \a symbol is requested from a query, or was located in query results + eSymbolContextTailCall = (1u << 7), ///< Set when a function symbol with a tail call is requested from a query, or was located in query results eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1u) ///< Indicates to try and lookup everything up during a query. } SymbolContextItem; diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index a0f423cbb142..f899693cb3f6 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -498,13 +498,13 @@ Module::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve // with FDE row indices in eh_frame sections, but requires extra logic here to permit // symbol lookup for disassembly and unwind. if (resolve_scope & eSymbolContextSymbol && !(resolved_flags & eSymbolContextSymbol) && - resolve_scope & eSymbolContextFunction && !(resolved_flags & eSymbolContextFunction) && + resolve_scope & eSymbolContextTailCall && so_addr.IsSectionOffset()) { Address previous_addr = so_addr; previous_addr.Slide(-1); - const uint32_t flags = sym_vendor->ResolveSymbolContext (previous_addr, resolve_scope, sc); + const uint32_t flags = ResolveSymbolContextForAddress(previous_addr, resolve_scope & ~eSymbolContextTailCall, sc); if (flags & eSymbolContextSymbol) { AddressRange addr_range; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index 694a143df4ea..4940dbe18dfb 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -370,7 +370,8 @@ RegisterContextLLDB::InitializeNonZerothFrame() } // We require that eSymbolContextSymbol be successfully filled in or this context is of no use to us. - if ((pc_module_sp->ResolveSymbolContextForAddress (m_current_pc, eSymbolContextFunction| eSymbolContextSymbol, m_sym_ctx) & eSymbolContextSymbol) == eSymbolContextSymbol) + uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol | eSymbolContextTailCall; + if ((pc_module_sp->ResolveSymbolContextForAddress (m_current_pc, resolve_scope, m_sym_ctx) & eSymbolContextSymbol) == eSymbolContextSymbol) { m_sym_ctx_valid = true; } diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py index 2dc557bb2b5b..437453a90c2a 100644 --- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py +++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py @@ -17,7 +17,6 @@ class AssertingInferiorTestCase(TestBase): def test_inferior_asserting_dwarf(self): """Test that lldb reliably catches the inferior asserting (command).""" - self.skipTest("llvm.org/pr17276 -- backtrace is truncated") self.buildDwarf() self.inferior_asserting() @@ -30,21 +29,20 @@ class AssertingInferiorTestCase(TestBase): @expectedFailureFreeBSD('llvm.org/pr17184') def test_inferior_asserting_register_dwarf(self): """Test that lldb reliably reads registers from the inferior after asserting (command).""" - self.skipTest("llvm.org/pr17276 -- backtrace is truncated") self.buildDwarf() self.inferior_asserting_registers() @skipIfGcc # Avoid xpasses as the verion of libc used on the gcc buildbot has the required function symbols. + @expectedFailureFreeBSD # ResolveSymbolContextForAddress can fail using ELF with stripped function symbols. + @expectedFailureLinux # ResolveSymbolContextForAddress can fail using ELF with stripped function symbols. def test_inferior_asserting_disassemble(self): """Test that lldb reliably disassembles frames after asserting (command).""" - self.skipTest("llvm.org/pr17276 -- ResolveSymbolContextForAddress can fail using ELF with stripped function symbols.") self.buildDefault() self.inferior_asserting_disassemble() @python_api_test def test_inferior_asserting_python(self): """Test that lldb reliably catches the inferior asserting (Python API).""" - self.skipTest("llvm.org/pr17276 -- backtrace is truncated") self.buildDefault() self.inferior_asserting_python() @@ -56,20 +54,17 @@ class AssertingInferiorTestCase(TestBase): def test_inferior_asserting_expr(self): """Test that the lldb expression interpreter can read from the inferior after asserting (command).""" - self.skipTest("llvm.org/pr17276 -- backtrace is truncated") self.buildDwarf() self.inferior_asserting_expr() @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_inferior_asserting_step(self): """Test that lldb functions correctly after stepping through a call to assert().""" - self.skipTest("llvm.org/pr17276 -- backtrace is truncated") self.buildDsym() self.inferior_asserting_step() def test_inferior_asserting_step(self): """Test that lldb functions correctly after stepping through a call to assert().""" - self.skipTest("llvm.org/pr17276 -- backtrace is truncated") self.buildDwarf() self.inferior_asserting_step()