summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2016-07-14 07:43:14 +0000
committerIlia K <ki.stfu@gmail.com>2016-07-14 07:43:14 +0000
commitbeb1aa907d6ff298c860c3ab571017c81321766e (patch)
tree30e60c107937c189bc1261d62deb9eef3532a370 /lldb/packages/Python/lldbsuite/test
parent666aa945a540931451f82cd5e471bc969b1f87bc (diff)
downloadbcm5719-llvm-beb1aa907d6ff298c860c3ab571017c81321766e.tar.gz
bcm5719-llvm-beb1aa907d6ff298c860c3ab571017c81321766e.zip
Fix -break-enable/-break-disable commands (MI)
* Previously -break-enable mistakenly set BP's enabled flag to false. * These commands print fake =breakpoint-modified messages, what's not needed anymore because that events are come in normal way. * Add tests for -break-enable/-break-disable commands Initial patch from xuefangliang@hotmail.com. The test case was improved by me. Differential Revision: http://reviews.llvm.org/D21757 llvm-svn: 275381
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
index f5a221e4b86..c4a801c991a 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
@@ -246,3 +246,48 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):
self.runCmd("-exec-continue")
self.expect("\^running")
self.expect("\*stopped,reason=\"exited-normally\"")
+
+ @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ def test_lldbmi_break_enable_disable(self):
+ """Test that 'lldb-mi --interpreter' works for enabling / disabling breakpoints."""
+
+ self.spawnLldbMi(args = None)
+
+ self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+ self.expect("\^done")
+
+ self.runCmd("-break-insert main")
+ self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\"")
+ self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"main\"}")
+
+ self.runCmd("-exec-run")
+ self.expect("\^running")
+ self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"main\"}")
+ self.expect("\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"1\"")
+
+ self.runCmd("-break-insert ns::foo1")
+ self.expect("\^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo1\(\)\"")
+ self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo1\(\)\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"ns::foo1\"}")
+
+ self.runCmd("-break-insert ns::foo2")
+ self.expect("\^done,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo2\(\)\"")
+ self.expect("=breakpoint-modified,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo2\(\)\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"ns::foo2\"}")
+
+ # disable the 2nd breakpoint
+ self.runCmd("-break-disable 2")
+ self.expect("\^done")
+ self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo1\(\)\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"ns::foo1\"}")
+
+ # disable the 3rd breakpoint and re-enable
+ self.runCmd("-break-disable 3")
+ self.expect("\^done")
+ self.expect("=breakpoint-modified,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo2\(\)\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"ns::foo2\"}")
+
+ self.runCmd("-break-enable 3")
+ self.expect("\^done")
+ self.expect("=breakpoint-modified,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"ns::foo2\(\)\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\",times=\"0\",original-location=\"ns::foo2\"}")
+
+ self.runCmd("-exec-continue")
+ self.expect("\^running")
+ self.expect("\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"3\"")
OpenPOWER on IntegriCloud