From 9b294d1e905ab49c941333c81840afac9f6fe238 Mon Sep 17 00:00:00 2001 From: Eugene Zemtsov Date: Mon, 16 Apr 2018 22:26:21 +0000 Subject: Make sure deleting all breakpoints clears their sites first Bug: https://bugs.llvm.org/show_bug.cgi?id=36430 Differential Revision: https://reviews.llvm.org/D45554 llvm-svn: 330163 --- .../breakpoint_command/TestBreakpointCommand.py | 19 +++++++++++++++++++ .../breakpoint/breakpoint_command/main.c | 4 ++++ 2 files changed, 23 insertions(+) (limited to 'lldb/packages/Python/lldbsuite') 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 8b56e6f9d27..7a2dc61b1b6 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 @@ -45,6 +45,25 @@ class BreakpointCommandTestCase(TestBase): self.addTearDownHook( lambda: self.runCmd("settings clear auto-confirm")) + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") + def test_delete_all_breakpoints(self): + """Test that deleting all breakpoints works.""" + self.build() + exe = self.getBuildArtifact("a.out") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_symbol(self, "main") + lldbutil.run_break_set_by_file_and_line( + self, "main.c", self.line, num_expected_locations=1, loc_exact=True) + + self.runCmd("run", RUN_SUCCEEDED) + + self.runCmd("breakpoint delete") + self.runCmd("process continue") + self.expect("process status", PROCESS_STOPPED, + patterns=['Process .* exited with status = 0']) + + def breakpoint_command_sequence(self): """Test a sequence of breakpoint command add, list, and delete.""" exe = self.getBuildArtifact("a.out") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c index 62ec97f4328..702644b692d 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c @@ -9,5 +9,9 @@ int main (int argc, char const *argv[]) { + // Add a body to the function, so we can set more than one + // breakpoint in it. + static volatile int var = 0; + var++; return 0; // Set break point at this line. } -- cgit v1.2.3