From a15e7f296babc33d7565dc6c224a818a9597796b Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Thu, 6 Jul 2017 02:18:16 +0000 Subject: Add a lldbutils routine that gathers up the boiler-plate to make a target, set a source regex breakpoint, run to the breakpoint and find the thread that hit the breakpoint. Start the process of replacing the boiler plate with this routine. llvm-svn: 307234 --- .../test/expression_command/char/TestExprsChar.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/char') diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py b/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py index a771e7004c9..74991999d92 100644 --- a/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py +++ b/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py @@ -17,29 +17,14 @@ class ExprCharTestCase(TestBase): self.main_source = "main.cpp" self.main_source_spec = lldb.SBFileSpec(self.main_source) - self.exe = os.path.join(os.getcwd(), "a.out") def do_test(self, dictionary=None): """These basic expression commands should work as expected.""" self.build(dictionary=dictionary) - target = self.dbg.CreateTarget(self.exe) - self.assertTrue(target) - - breakpoint = target.BreakpointCreateBySourceRegex( - '// Break here', self.main_source_spec) - self.assertTrue(breakpoint) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertTrue(process) - - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - self.assertEqual(len(threads), 1) - - frame = threads[0].GetFrameAtIndex(0) + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + '// Break here', self.main_source_spec) + frame = thread.GetFrameAtIndex(0) value = frame.EvaluateExpression("foo(c)") self.assertTrue(value.IsValid()) -- cgit v1.2.3