diff options
| author | Ashok Thirumurthi <ashok.thirumurthi@intel.com> | 2013-09-20 19:05:10 +0000 |
|---|---|---|
| committer | Ashok Thirumurthi <ashok.thirumurthi@intel.com> | 2013-09-20 19:05:10 +0000 |
| commit | 2568f459391a98c0967c2eb6b56ab296cc6c3609 (patch) | |
| tree | 213b129c11f8480e590712e40edac7ff164b647b | |
| parent | b742879c35eb685b8d299ba52f6c9779f7142210 (diff) | |
| download | bcm5719-llvm-2568f459391a98c0967c2eb6b56ab296cc6c3609.tar.gz bcm5719-llvm-2568f459391a98c0967c2eb6b56ab296cc6c3609.zip | |
Fix lldb regressions due to r190812 in the case where debug info is present.
Specifically, allows the unwinder to handle the case where sc.function
gets resolved with a pc that is one past the address range of the function
(consistent with a tail call). However, there is no matching symbol.
Adds eSymbolContextTailCall to provide callers with control over the scope
of symbol resolution and to allow ResolveSymbolContextForAddress to handle
tail calls since this routine is common to unwind and disassembly.
llvm-svn: 191102
| -rw-r--r-- | lldb/include/lldb/lldb-enumerations.h | 1 | ||||
| -rw-r--r-- | lldb/source/Core/Module.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | 3 | ||||
| -rw-r--r-- | lldb/test/functionalities/inferior-assert/TestInferiorAssert.py | 9 |
4 files changed, 7 insertions, 10 deletions
diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 9ef342e3e98..d84827999e0 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 a0f423cbb14..f899693cb3f 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 694a143df4e..4940dbe18df 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 2dc557bb2b5..437453a90c2 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() |

