diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint')
| -rw-r--r-- | packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py | 44 | ||||
| -rw-r--r-- | packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp | 13 | 
2 files changed, 38 insertions, 19 deletions
| diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py index 38c6b1f0b179..16f71fe8130c 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py @@ -19,6 +19,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races      @expectedFlakeyLinux("llvm.org/pr24717") +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_insert_function_pending(self):          """Test that 'lldb-mi --interpreter' works for pending function breakpoints.""" @@ -45,6 +46,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_insert_function(self):          """Test that 'lldb-mi --interpreter' works for function breakpoints.""" @@ -113,6 +115,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_insert_file_line_pending(self):          """Test that 'lldb-mi --interpreter' works for pending file:line breakpoints.""" @@ -142,6 +145,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_insert_file_line(self):          """Test that 'lldb-mi --interpreter' works for file:line breakpoints.""" @@ -179,6 +183,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_insert_file_line_absolute_path(self):          """Test that 'lldb-mi --interpreter' works for file:line breakpoints.""" @@ -206,6 +211,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_insert_settings(self):          """Test that 'lldb-mi --interpreter' can set breakpoints accoridng to global options.""" @@ -220,38 +226,47 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):          self.runCmd(              "-interpreter-exec console \"settings set target.move-to-nearest-code off\"")          self.expect("\^done") -        line = line_number('main.cpp', '// BP_before_main') -        self.runCmd("-break-insert -f main.cpp:%d" % line) +        line_decl = line_number('main.cpp', '// BP_main_decl') +        line_in = line_number('main.cpp', '// BP_in_main') +        self.runCmd("-break-insert -f main.cpp:%d" % line_in)          self.expect("\^done,bkpt={number=\"1\"")          # Test that non-pending BP will not be set on non-existing line if target.move-to-nearest-code=off          # Note: this increases the BP number by 1 even though BP #2 is invalid. -        self.runCmd("-break-insert main.cpp:%d" % line) +        self.runCmd("-break-insert main.cpp:%d" % line_in)          self.expect(              "\^error,msg=\"Command 'break-insert'. Breakpoint location 'main.cpp:%d' not found\"" % -            line) +            line_in)          # Set target.move-to-nearest-code=on and target.skip-prologue=on and -        # set BP #3 +        # set BP #3 & #4          self.runCmd(              "-interpreter-exec console \"settings set target.move-to-nearest-code on\"")          self.runCmd(              "-interpreter-exec console \"settings set target.skip-prologue on\"")          self.expect("\^done") -        self.runCmd("-break-insert main.cpp:%d" % line) +        self.runCmd("-break-insert main.cpp:%d" % line_in)          self.expect("\^done,bkpt={number=\"3\"") +        self.runCmd("-break-insert main.cpp:%d" % line_decl) +        self.expect("\^done,bkpt={number=\"4\"") -        # Set target.skip-prologue=off and set BP #4 +        # Set target.skip-prologue=off and set BP #5          self.runCmd(              "-interpreter-exec console \"settings set target.skip-prologue off\"")          self.expect("\^done") -        self.runCmd("-break-insert main.cpp:%d" % line) -        self.expect("\^done,bkpt={number=\"4\"") +        self.runCmd("-break-insert main.cpp:%d" % line_decl) +        self.expect("\^done,bkpt={number=\"5\"") -        # Test that BP #4 is located before BP #3 +        # Test that BP #5 is located before BP #4          self.runCmd("-exec-run")          self.expect("\^running")          self.expect( +            "\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"5\"") + +        # Test that BP #4 is hit +        self.runCmd("-exec-continue") +        self.expect("\^running") +        self.expect(              "\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"4\"")          # Test that BP #3 is hit @@ -260,7 +275,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):          self.expect(              "\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"3\"") -        # Test that the target.language=pascal setting works and that BP #5 is +        # Test that the target.language=pascal setting works and that BP #6 is          # NOT set          self.runCmd(              "-interpreter-exec console \"settings set target.language c\"") @@ -268,16 +283,16 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):          self.runCmd("-break-insert ns.foo1")          self.expect("\^error") -        # Test that the target.language=c++ setting works and that BP #6 is hit +        # Test that the target.language=c++ setting works and that BP #7 is hit          self.runCmd(              "-interpreter-exec console \"settings set target.language c++\"")          self.expect("\^done")          self.runCmd("-break-insert ns::foo1") -        self.expect("\^done,bkpt={number=\"6\"") +        self.expect("\^done,bkpt={number=\"7\"")          self.runCmd("-exec-continue")          self.expect("\^running")          self.expect( -            "\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"6\"") +            "\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"7\"")          # Test that BP #1 and #2 weren't set by running to program exit          self.runCmd("-exec-continue") @@ -286,6 +301,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):      @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races +    @skipIfRemote   # We do not currently support remote debugging via the MI.      def test_lldbmi_break_enable_disable(self):          """Test that 'lldb-mi --interpreter' works for enabling / disabling breakpoints.""" diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp b/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp index 9416a0d01c7d..366c53c3143f 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp @@ -15,13 +15,16 @@ namespace ns      int foo2(void) { printf("In foo2\n"); return 2; }  } -// BP_before_main -  int x; -int -main(int argc, char const *argv[]) -{ +int main(int argc, char const *argv[]) { // BP_main_decl      printf("Print a formatted string so that GCC does not optimize this printf call: %s\n", argv[0]); +  // This is a long comment with no code inside +  // This is a long comment with no code inside +  // This is a long comment with no code inside +  // BP_in_main +  // This is a long comment with no code inside +  // This is a long comment with no code inside +  // This is a long comment with no code inside      x = ns::foo1() + ns::foo2();      return 0; // BP_return  } | 
