diff options
author | Jim Ingham <jingham@apple.com> | 2017-08-03 18:13:24 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2017-08-03 18:13:24 +0000 |
commit | f08f5c99262ff9eaa08956334accbb2614b0f7a2 (patch) | |
tree | 7627308ccb3fc7ce52a6ea0ea45c0d948fcd66af /lldb/packages/Python/lldbsuite/test | |
parent | f0cadcd9f385d36dc751cdb32476b32ec43306b5 (diff) | |
download | bcm5719-llvm-f08f5c99262ff9eaa08956334accbb2614b0f7a2.tar.gz bcm5719-llvm-f08f5c99262ff9eaa08956334accbb2614b0f7a2.zip |
Add an auto-continue flag to breakpoints & locations.
You can get a breakpoint to auto-continue by adding "continue"
as a command, but that has the disadvantage that if you hit two
breakpoints simultaneously, the continue will force the process
to continue, and maybe even forstalling the commands on the other.
The auto-continue flag means the breakpoints can negotiate about
whether to stop.
Writing tests, I wanted to supply some commands when I made the
breakpoints, so I also added that ability.
llvm-svn: 309969
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py index e67a6332d9d..cb4aeadbf93 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -24,12 +24,21 @@ class BreakpointCommandTestCase(TestBase): cls.RemoveTempFile("output2.txt") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") - def test(self): + def test_breakpoint_command_sequence(self): """Test a sequence of breakpoint command add, list, and delete.""" self.build() self.breakpoint_command_sequence() + + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") + def test_script_parameters(self): + """Test a sequence of breakpoint command add, list, and delete.""" + self.build() self.breakpoint_command_script_parameters() + def test_commands_on_creation(self): + self.build() + self.breakpoint_commands_on_creation() + def setUp(self): # Call super's setUp(). TestBase.setUp(self) @@ -268,3 +277,23 @@ class BreakpointCommandTestCase(TestBase): # Now remove 'output-2.txt' os.remove('output-2.txt') + + def breakpoint_commands_on_creation(self): + """Test that setting breakpoint commands when creating the breakpoint works""" + exe = os.path.join(os.getcwd(), "a.out") + target = self.dbg.CreateTarget(exe) + self.assertTrue(target.IsValid(), "Created an invalid target.") + + # Add a breakpoint. + lldbutil.run_break_set_by_file_and_line( + self, "main.c", self.line, num_expected_locations=1, loc_exact=True, + extra_options='-d bt -d "thread list" -d continue') + + bkpt = target.FindBreakpointByID(1) + self.assertTrue(bkpt.IsValid(), "Couldn't find breakpoint 1") + com_list = lldb.SBStringList() + bkpt.GetCommandLineCommands(com_list) + self.assertEqual(com_list.GetSize(), 3, "Got the wrong number of commands") + self.assertEqual(com_list.GetStringAtIndex(0), "bt", "First bt") + self.assertEqual(com_list.GetStringAtIndex(1), "thread list", "Next thread list") + self.assertEqual(com_list.GetStringAtIndex(2), "continue", "Last continue") |