diff options
| author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-05-13 23:47:25 +0000 |
|---|---|---|
| committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-05-13 23:47:25 +0000 |
| commit | d4dc57930418dc32258f14503dd8b5ea1e2055d5 (patch) | |
| tree | 66743d1ccfb70f1aefe62f6f480b681ad48a57c2 | |
| parent | 201284a8d3096078e74c14cc6352e2dfda27cbad (diff) | |
| download | bcm5719-llvm-d4dc57930418dc32258f14503dd8b5ea1e2055d5.tar.gz bcm5719-llvm-d4dc57930418dc32258f14503dd8b5ea1e2055d5.zip | |
Adding new test cases for inferior crashing.
llvm-svn: 181742
| -rw-r--r-- | lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py | 82 |
1 files changed, 75 insertions, 7 deletions
diff --git a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py index 92f71476d38..01fe6b2e2b8 100644 --- a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -38,29 +38,51 @@ class CrashingInferiorTestCase(TestBase): self.inferior_crashing_python() @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_inferior_crashing_expr(self): + def test_inferior_crashing_expr_dsym(self): """Test that the lldb expression interpreter can read from the inferior after crashing (command).""" self.buildDsym() self.inferior_crashing_expr() - # bugzilla 15784 - the same commands fail when run on Linux from the lldb command line - def test_inferior_crashing_expr(self): + def test_inferior_crashing_expr_dwarf(self): """Test that the lldb expression interpreter can read from the inferior after crashing (command).""" self.buildDwarf() self.inferior_crashing_expr() @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_inferior_crashing_step(self): + def test_inferior_crashing_step_dsym(self): """Test that lldb functions correctly after stepping through a crash.""" self.buildDsym() self.inferior_crashing_step() - # bugzilla 15784 - the same commands fail when run on Linux from the lldb command line - def test_inferior_crashing_step(self): - """Test that lldb functions correctly after stepping through a crash.""" + def test_inferior_crashing_step_dwarf(self): + """Test that stepping after a crash behaves correctly.""" self.buildDwarf() self.inferior_crashing_step() + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_inferior_crashing_step_after_break_dsym(self): + """Test that stepping after a crash behaves correctly.""" + self.buildDsym() + self.inferior_crashing_step_after_break() + + @expectedFailureLinux # due to bugzilla 15988 -- step over misbehaves after crash + def test_inferior_crashing_step_after_break_dwarf(self): + """Test that lldb functions correctly after stepping through a crash.""" + self.buildDwarf() + self.inferior_crashing_step_after_break() + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_inferior_crashing_expr_step_and_expr_dsym(self): + """Test that lldb expressions work before and after stepping after a crash.""" + self.buildDsym() + self.inferior_crashing_expr_step_expr() + + @expectedFailureLinux # due to bugzilla 15989 -- expression fails after crash and step + def test_inferior_crashing_expr_step_and_expr_dwarf(self): + """Test that lldb expressions work before and after stepping after a crash.""" + self.buildDwarf() + self.inferior_crashing_expr_step_expr() + def set_breakpoint(self, line): lldbutil.run_break_set_by_file_and_line (self, "main.c", line, num_expected_locations=1, loc_exact=True) @@ -193,6 +215,52 @@ class CrashingInferiorTestCase(TestBase): substrs = [stop_reason, 'main.c:%d' % self.line]) + def inferior_crashing_step_after_break(self): + """Test that lldb behaves correctly when stepping after a crash.""" + exe = os.path.join(os.getcwd(), "a.out") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + + self.runCmd("run", RUN_SUCCEEDED) + + if sys.platform.startswith("darwin"): + stop_reason = 'stop reason = EXC_BAD_ACCESS' + else: + stop_reason = 'stop reason = invalid address' + + self.runCmd("next") + + # The stop reason of the thread should still be a bad access exception. + self.expect("thread list", STOPPED_DUE_TO_EXC_BAD_ACCESS, + substrs = ['stopped', stop_reason]) + + def inferior_crashing_expr_step_expr(self): + """Test that lldb expressions work before and after stepping after a crash.""" + exe = os.path.join(os.getcwd(), "a.out") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + + self.runCmd("run", RUN_SUCCEEDED) + + if sys.platform.startswith("darwin"): + stop_reason = 'stop reason = EXC_BAD_ACCESS' + else: + stop_reason = 'stop reason = invalid address' + + # The lldb expression interpreter should be able to read from addresses of the inferior after a crash. + self.expect("p argv[0]", + substrs = ['a.out']) + + self.runCmd("next") + + if sys.platform.startswith("darwin"): + stop_reason = 'stop reason = EXC_BAD_ACCESS' + else: + stop_reason = 'stop reason = invalid address' + + # The lldb expression interpreter should be able to read from addresses of the inferior after a crash. + self.expect("p argv[0]", + substrs = ['a.out']) + + if __name__ == '__main__': import atexit lldb.SBDebugger.Initialize() |

