[Lldb-commits] [lldb] r236840 - Improve MiBreakTestCase.test_lldbmi_break_insert_{function*, file_line*} tests (MI)

Ilia K ki.stfu at gmail.com
Fri May 8 05:35:50 PDT 2015


Author: ki.stfu
Date: Fri May  8 07:35:49 2015
New Revision: 236840

URL: http://llvm.org/viewvc/llvm-project?rev=236840&view=rev
Log:
Improve MiBreakTestCase.test_lldbmi_break_insert_{function*,file_line*} tests (MI)


Modified:
    lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py

Modified: lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=236840&r1=236839&r2=236840&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py (original)
+++ lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py Fri May  8 07:35:49 2015
@@ -54,6 +54,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         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+\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}")
         self.expect("\*stopped,reason=\"breakpoint-hit\"")
 
+        # Test that -break-insert can set non-pending BP
         self.runCmd("-break-insert printf")
         #FIXME function name is unknown on Darwin
         #self.expect("\^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"printf\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
@@ -65,6 +66,11 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         #self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"printf\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
         self.expect("=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\".+?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",times=\"0\",original-location=\"printf\"}")
 
+        # Test that -break-insert fails if non-pending BP can't be resolved
+        self.runCmd("-break-insert unknown_func")
+        self.expect("\^error,msg=\"Command 'break-insert'. Breakpoint location 'unknown_func' not found\"")
+
+        # Test that non-pending BP was set correctly
         self.runCmd("-exec-continue")
         self.expect("\^running")
         self.expect("\*stopped,reason=\"breakpoint-hit\"")
@@ -84,7 +90,8 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         # pending BP
         line = line_number('main.cpp', '// BP_return')
         self.runCmd("-break-insert -f main.cpp:%d" % line)
-        self.expect("\^done,bkpt={number=\"1\"")
+        self.expect("\^done,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\",pending=\[\"main.cpp:%d\"\],times=\"0\",original-location=\"main.cpp:%d\"}" % (line, line, line))
+        self.expect("=breakpoint-created,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\",pending=\[\"main.cpp:%d\"\],times=\"0\",original-location=\"main.cpp:%d\"}" % (line, line, line))
 
         self.runCmd("-exec-run")
         self.expect("\^running")
@@ -108,10 +115,17 @@ class MiBreakTestCase(lldbmi_testcase.Mi
         self.expect("\^running")
         self.expect("\*stopped,reason=\"breakpoint-hit\"")
 
+        # Test that -break-insert can set non-pending BP
         line = line_number('main.cpp', '// BP_return')
         self.runCmd("-break-insert main.cpp:%d" % line)
-        self.expect("\^done,bkpt={number=\"2\"")
+        self.expect("\^done,bkpt={number=\"2\",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.cpp:%d\"}" % (line, line))
+        self.expect("=breakpoint-created,bkpt={number=\"2\",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.cpp:%d\"}" % (line, line))
+
+        # Test that -break-insert fails if non-pending BP can't be resolved
+        self.runCmd("-break-insert unknown_file:1")
+        self.expect("\^error,msg=\"Command 'break-insert'. Breakpoint location 'unknown_file:1' not found\"")
 
+        # Test that non-pending BP was set correctly
         self.runCmd("-exec-continue")
         self.expect("\^running")
         self.expect("\*stopped,reason=\"breakpoint-hit\"")





More information about the lldb-commits mailing list