diff options
author | Martin Svensson <poya@me.com> | 2019-11-22 11:18:47 +0100 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-11-22 11:20:09 +0100 |
commit | 0b0dca9f6fe34333abdb437bd1d3d92c8362a2e6 (patch) | |
tree | 1daf27f50e36f5445a47f207b77875376034d8e6 /lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception | |
parent | b9a26a80c81c29b7ddf6f84dd75f1918de468c5a (diff) | |
download | bcm5719-llvm-0b0dca9f6fe34333abdb437bd1d3d92c8362a2e6.tar.gz bcm5719-llvm-0b0dca9f6fe34333abdb437bd1d3d92c8362a2e6.zip |
[lldb] Fix exception breakpoint not being resolved when set on dummy target
Summary: Ensure that breakpoint ivar is properly set in exception breakpoint resolver so that exception breakpoints set on dummy targets are resolved once real targets are created and run.
Reviewers: jingham
Reviewed By: jingham
Subscribers: teemperor, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69880
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py index e8a1b81a839..839a47041ae 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py @@ -24,6 +24,14 @@ class TestCPPExceptionBreakpoint (TestBase): self.build() self.do_cpp_exception_bkpt() + @add_test_categories(['pyapi']) + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24538") + @expectedFailureNetBSD + def test_dummy_target_cpp_exception_breakpoint(self): + """Test setting and hitting the C++ exception breakpoint from dummy target.""" + self.build() + self.do_dummy_target_cpp_exception_bkpt() + def setUp(self): TestBase.setUp(self) self.main_source = "main.c" @@ -50,3 +58,30 @@ class TestCPPExceptionBreakpoint (TestBase): process, exception_bkpt) self.assertTrue(len(thread_list) == 1, "One thread stopped at the exception breakpoint.") + + def do_dummy_target_cpp_exception_bkpt(self): + exe = self.getBuildArtifact("a.out") + error = lldb.SBError() + + dummy_exception_bkpt = self.dbg.GetDummyTarget().BreakpointCreateForException( + lldb.eLanguageTypeC_plus_plus, False, True) + self.assertTrue( + dummy_exception_bkpt.IsValid(), + "Created exception breakpoint in dummy target.") + + self.target = self.dbg.CreateTarget(exe) + self.assertTrue(self.target, VALID_TARGET) + + exception_bkpt = self.target.GetBreakpointAtIndex(0) + self.assertTrue( + exception_bkpt.IsValid(), + "Target primed with exception breakpoint from dummy target.") + + process = self.target.LaunchSimple( + None, None, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) + + thread_list = lldbutil.get_threads_stopped_at_breakpoint( + process, exception_bkpt) + self.assertTrue(len(thread_list) == 1, + "One thread stopped at the exception breakpoint.") |