From: Ashok Thirumurthi Date: Tue, 23 Jul 2013 17:20:17 +0000 (+0000) Subject: Adds a test for "disassemble -a" after an assert, which can fail with ELF X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd20ee8369bbe04d2b8e677ca5fa6a3104b6f8bd;p=platform%2Fupstream%2Fllvm.git Adds a test for "disassemble -a" after an assert, which can fail with ELF because a synthetic symbol hasn't been provided for stripped function symbols. llvm-svn: 186959 --- diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py index 86130f6..1e3ddc4 100644 --- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py +++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py @@ -31,6 +31,13 @@ class AssertingInferiorTestCase(TestBase): self.buildDwarf() self.inferior_asserting_registers() + @skipIfGcc # Avoid xpasses as the verion of libc used on the gcc buildbot has the required function symbols. + @expectedFailureLinux # ResolveSymbolContextForAddress can fail using ELF with stripped function symbols. + def test_inferior_asserting_disassemble(self): + """Test that lldb reliably disassemblers frames after asserting (command).""" + 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).""" @@ -130,6 +137,33 @@ class AssertingInferiorTestCase(TestBase): self.expect("register read eax", substrs = ['eax = 0x']) + def inferior_asserting_disassemble(self): + """Test that lldb can disassemble frames after asserting.""" + exe = os.path.join(os.getcwd(), "a.out") + + # Create a target by the debugger. + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + # Launch the process, and do not stop at the entry point. + target.LaunchSimple(None, None, os.getcwd()) + self.check_stop_reason() + + process = target.GetProcess() + self.assertTrue(process.IsValid(), "current process is valid") + + thread = process.GetThreadAtIndex(0) + self.assertTrue(thread.IsValid(), "current thread is valid") + + # lldb should be able to disassemble frames from the inferior after asserting. + for frame in thread: + self.assertTrue(frame.IsValid(), "current frame is valid") + + self.runCmd("frame select " + str(frame.GetFrameID()), RUN_SUCCEEDED) + + self.expect("disassemble -a %s" % frame.GetPC(), + substrs = ['->', frame.GetFunctionName()]) + def check_expr_in_main(self, thread): depth = thread.GetNumFrames() for i in range(depth):