summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2018-02-01 21:35:50 +0000
committerJim Ingham <jingham@apple.com>2018-02-01 21:35:50 +0000
commit0423fcac394f4ec3bdae4ccf8eca5276f9585fc6 (patch)
tree11a9ff6235bfd682bf1bc537649832d5b55ccb2a /lldb/packages/Python/lldbsuite/test/functionalities
parent1765028d3c967d05b4e2ce7c60b76df096e43260 (diff)
downloadbcm5719-llvm-0423fcac394f4ec3bdae4ccf8eca5276f9585fc6.tar.gz
bcm5719-llvm-0423fcac394f4ec3bdae4ccf8eca5276f9585fc6.zip
Added lldbutil.run_to_name_breakpoint and use it in one test.
Using the "run_to_{source,name}_breakpoint will allow us to remove a lot of boiler-plate from the testsuite. We mostly use source breakpoints, but some tests use by name ones so this was needed. llvm-svn: 324010
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py28
1 files changed, 4 insertions, 24 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py b/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
index 69c15f46e95..b7d0d8170b3 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
@@ -41,27 +41,9 @@ class ReturnValueTestCase(TestBase):
"""Test getting return values from stepping out."""
self.build()
exe = self.getBuildArtifact("a.out")
- error = lldb.SBError()
-
- self.target = self.dbg.CreateTarget(exe)
- self.assertTrue(self.target, VALID_TARGET)
-
- inner_sint_bkpt = self.target.BreakpointCreateByName("inner_sint", exe)
- self.assertTrue(inner_sint_bkpt, VALID_BREAKPOINT)
-
- # Now launch the process, and do not stop at entry point.
- self.process = self.target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(self.process, PROCESS_IS_VALID)
+ (self.target, self.process, thread, inner_sint_bkpt) = lldbutil.run_to_name_breakpoint(self, "inner_sint", exe_name = exe)
- # The stop reason of the thread should be breakpoint.
- self.assertTrue(self.process.GetState() == lldb.eStateStopped,
- STOPPED_DUE_TO_BREAKPOINT)
-
- # Now finish, and make sure the return value is correct.
- thread = lldbutil.get_stopped_thread(
- self.process, lldb.eStopReasonBreakpoint)
+ error = lldb.SBError()
# inner_sint returns the variable value, so capture that here:
in_int = thread.GetFrameAtIndex(0).FindVariable(
@@ -86,10 +68,8 @@ class ReturnValueTestCase(TestBase):
# Run again and we will stop in inner_sint the second time outer_sint is called.
# Then test stepping out two frames at once:
-
- self.process.Continue()
- thread_list = lldbutil.get_threads_stopped_at_breakpoint(
- self.process, inner_sint_bkpt)
+
+ thread_list = lldbutil.continue_to_breakpoint(self.process, inner_sint_bkpt)
self.assertTrue(len(thread_list) == 1)
thread = thread_list[0]
OpenPOWER on IntegriCloud