diff options
11 files changed, 72 insertions, 71 deletions
diff --git a/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py b/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py index 8c62854c3cb..35c6d27df7e 100644 --- a/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py +++ b/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py @@ -80,7 +80,7 @@ class MiGdbSetShowTestCase(lldbmi_testcase.MiTestCaseBase): it = self.expect(unexpected + [ "~\"argc=1\\\\r\\\\n" ]) if it < len(unexpected): # generate error if it's not "~\"argc=1\\\\r\\\\n" - self.expect("$UNEXPECTED FOUND: %s.^" % unexpected[it], timeout = 0) + self.expect("$UNEXPECTED FOUND: %s\.^" % unexpected[it], timeout = 0) @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") diff --git a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py index c7518e42d77..f54a945ff1f 100644 --- a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py +++ b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py @@ -31,7 +31,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase): 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=\"\?\?\",file=\".+\",fullname=\".+\",line=\"(-1|\d+)\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}") + self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"(?!0xffffffffffffffff)0x[0-9a-f]+\",func=\"\?\?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\",pending=\[\"printf\"\],times=\"0\",original-location=\"printf\"}") self.expect("\*stopped,reason=\"breakpoint-hit\"") @lldbmi_test @@ -47,26 +47,27 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-break-insert -f main") #FIXME main wasn't resolved - #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=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") - self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"main\",file=\"main.cpp\",fullname=\".+main.cpp\",line=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") + #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=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") + self.expect("\^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") #FIXME main wasn't resolved, =breakpoint-created is treated as =breakpoint-modified - #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=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") - self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"main\",file=\"main.cpp\",fullname=\".+main.cpp\",line=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") + #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=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") + self.expect("=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0xffffffffffffffff\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"15\",pending=\[\"main\"\],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=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"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=\"15\",pending=\[\"main\"\],times=\"0\",original-location=\"main\"}") self.expect("\*stopped,reason=\"breakpoint-hit\"") 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\"}") - self.expect("\^done,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\"}") + #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\"}") + self.expect("\^done,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\"}") #FIXME function name is unknown on Darwin, =breakpoint-created is treated as =breakpoint-modified - #self.expect("=breakpoint-created,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\"}") - # FIXME function name is unknown on Darwin, duplicated messages are skipped in pexpect - #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-created,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\"}") + # FIXME function name is unknown on Darwin + #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\"}") self.runCmd("-exec-continue") self.expect("\^running") diff --git a/lldb/test/tools/lldb-mi/control/TestMiExec.py b/lldb/test/tools/lldb-mi/control/TestMiExec.py index 6c8108d32b4..c0016b2d32b 100644 --- a/lldb/test/tools/lldb-mi/control/TestMiExec.py +++ b/lldb/test/tools/lldb-mi/control/TestMiExec.py @@ -20,7 +20,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -exec-abort fails on invalid process self.runCmd("-exec-abort") - self.expect("\^error,msg=\"Command 'exec-abort'. Invalid process during debug session\"") + self.expect("\^error,msg=\"Command 'exec-abort'\. Invalid process during debug session\"") # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -156,22 +156,22 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test -exec-next self.runCmd("-exec-next --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"29\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") # Test that --thread is optional self.runCmd("-exec-next --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"30\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"") # Test that --frame is optional self.runCmd("-exec-next --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"31\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"31\"") # Test that both --thread and --frame are optional self.runCmd("-exec-next") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"32\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"32\"") # Test that an invalid --thread is handled self.runCmd("-exec-next --thread 0") @@ -210,23 +210,23 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test -exec-next-instruction self.runCmd("-exec-next-instruction --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"28\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"28\"") # Test that --thread is optional self.runCmd("-exec-next-instruction --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"28\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"28\"") # Test that --frame is optional self.runCmd("-exec-next-instruction --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"29\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") # Test that both --thread and --frame are optional self.runCmd("-exec-next-instruction") self.expect("\^running") # Depending on compiler, it can stop at different line - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"(29|30)\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(29|30)\"") # Test that an invalid --thread is handled self.runCmd("-exec-next-instruction --thread 0") @@ -266,36 +266,36 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Linux: "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\" self.runCmd("-exec-step --thread 1 --frame 0") self.expect("\^running") - it = self.expect([ "\*stopped,reason=\"end-stepping-range\".+func=\"main\"", - "\*stopped,reason=\"end-stepping-range\".+func=\"((?!main).)+\"" ]) + it = self.expect([ "\*stopped,reason=\"end-stepping-range\".+?func=\"main\"", + "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\"" ]) # Exit from printf if needed if it == 1: self.runCmd("-exec-finish") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+func=\"main\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") # Test that -exec-step steps into g_MyFunction and back out # (and that --thread is optional) self.runCmd("-exec-step --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Use -exec-finish here to make sure that control reaches the caller. # -exec-step can keep us in the g_MyFunction for gcc self.runCmd("-exec-finish --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"30\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"") # Test that -exec-step steps into s_MyFunction # (and that --frame is optional) self.runCmd("-exec-step --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\".*s_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"") # Test that -exec-step steps into g_MyFunction from inside # s_MyFunction (and that both --thread and --frame are optional) self.runCmd("-exec-step") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that an invalid --thread is handled self.runCmd("-exec-step --thread 0") @@ -333,31 +333,31 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -exec-next steps over printf self.runCmd("-exec-next --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\",line=\"29\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") # Test that -exec-step-instruction steps over non branching # instruction self.runCmd("-exec-step-instruction --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*main.cpp\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\"") # Test that -exec-step-instruction steps into g_MyFunction # instruction (and that --thread is optional) self.runCmd("-exec-step-instruction --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that -exec-step-instruction steps over non branching # (and that --frame is optional) self.runCmd("-exec-step-instruction --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that -exec-step-instruction steps into g_MyFunction # (and that both --thread and --frame are optional) self.runCmd("-exec-step-instruction") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"g_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that an invalid --thread is handled self.runCmd("-exec-step-instruction --thread 0") @@ -392,7 +392,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -exec-finish returns from g_MyFunction self.runCmd("-exec-finish --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"main\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") # Run to BP inside s_MyFunction call self.runCmd("-break-insert s_MyFunction") @@ -411,13 +411,13 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # s_MyFunction (and that --frame is optional) self.runCmd("-exec-finish --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\".*s_MyFunction.*\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"") # Test that -exec-finish returns from s_MyFunction # (and that both --thread and --frame are optional) self.runCmd("-exec-finish") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"main\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") # Test that an invalid --thread is handled self.runCmd("-exec-finish --thread 0") @@ -440,7 +440,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): ## Test that -exec-finish returns from printf self.runCmd("-exec-finish --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"main\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") if __name__ == '__main__': unittest2.main() diff --git a/lldb/test/tools/lldb-mi/data/TestMiData.py b/lldb/test/tools/lldb-mi/data/TestMiData.py index dffa33633c6..5751b0a7a56 100644 --- a/lldb/test/tools/lldb-mi/data/TestMiData.py +++ b/lldb/test/tools/lldb-mi/data/TestMiData.py @@ -36,7 +36,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): # Test -data-disassemble: try to disassemble some address self.runCmd("-data-disassemble -s %#x -e %#x -- 0" % (addr, addr + 0x10)) - self.expect("\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+\"}," % addr) + self.expect("\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+?\"}," % addr) @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @@ -99,11 +99,11 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): # Test -data-list-register-names: try to get all registers self.runCmd("-data-list-register-names") - self.expect("\^done,register-names=\[\".+\",") + self.expect("\^done,register-names=\[\".+?\",") # Test -data-list-register-names: try to get specified registers self.runCmd("-data-list-register-names 0") - self.expect("\^done,register-names=\[\".+\"\]") + self.expect("\^done,register-names=\[\".+?\"\]") @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") diff --git a/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py b/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py index ef9b37461ac..8f421c330f5 100644 --- a/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py +++ b/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py @@ -151,9 +151,9 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("thread step-in") self.expect("\^done") it = self.expect([ "~\"argc=1\\\\r\\\\n\"", - "\*stopped,reason=\"end-stepping-range\".+func=\"((?!main).)+\"" ]) + "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\"" ]) if it == 0: - self.expect("\*stopped,reason=\"end-stepping-range\".+func=\"main\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") diff --git a/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py b/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py index 45758c8ea12..9157a17860c 100644 --- a/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py +++ b/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py @@ -147,9 +147,9 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-interpreter-exec console \"thread step-in\"") self.expect("\^done") it = self.expect([ "~\"argc=1\\\\r\\\\n\"", - "\*stopped,reason=\"end-stepping-range\".+func=\"((?!main).)+\"" ]) + "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\"" ]) if it == 0: - self.expect("\*stopped,reason=\"end-stepping-range\".+func=\"main\"") + self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") diff --git a/lldb/test/tools/lldb-mi/signal/TestMiSignal.py b/lldb/test/tools/lldb-mi/signal/TestMiSignal.py index 9bea5c56de6..0b1e0519468 100644 --- a/lldb/test/tools/lldb-mi/signal/TestMiSignal.py +++ b/lldb/test/tools/lldb-mi/signal/TestMiSignal.py @@ -37,7 +37,7 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -exec-interrupt can interrupt an execution self.runCmd("-exec-interrupt") - self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.*thread-id=\"1\",stopped-threads=\"all\"") + self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.+?thread-id=\"1\",stopped-threads=\"all\"") # Continue (to loop forever) self.runCmd("-exec-continue") @@ -111,7 +111,7 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^done") # Test that *stopped is printed - self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.*thread-id=\"1\",stopped-threads=\"all\"") + self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.+?thread-id=\"1\",stopped-threads=\"all\"") # Exit self.runCmd("-gdb-exit") diff --git a/lldb/test/tools/lldb-mi/stack/TestMiStack.py b/lldb/test/tools/lldb-mi/stack/TestMiStack.py index 074d8569fb5..ec0502d4897 100644 --- a/lldb/test/tools/lldb-mi/stack/TestMiStack.py +++ b/lldb/test/tools/lldb-mi/stack/TestMiStack.py @@ -59,7 +59,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-stack-list-arguments 0 -1 0") #self.expect("\^error") self.runCmd("-stack-list-arguments 0 0") - self.expect("\^error,msg=\"Command 'stack-list-arguments'. Thread frame range invalid\"") + self.expect("\^error,msg=\"Command 'stack-list-arguments'\. Thread frame range invalid\"") # Test that an invalid high-frame is handled # FIXME: -1 is treated as unsigned int @@ -68,11 +68,11 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that a missing low-frame or high-frame is handled self.runCmd("-stack-list-arguments 0 0") - self.expect("\^error,msg=\"Command 'stack-list-arguments'. Thread frame range invalid\"") + self.expect("\^error,msg=\"Command 'stack-list-arguments'\. Thread frame range invalid\"") # Test that an invalid low-frame is handled self.runCmd("-stack-list-arguments 0 0") - self.expect("\^error,msg=\"Command 'stack-list-arguments'. Thread frame range invalid\"") + self.expect("\^error,msg=\"Command 'stack-list-arguments'\. Thread frame range invalid\"") @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @@ -191,15 +191,15 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test -stack-list-locals: use 1 or --all-values self.runCmd("-stack-list-locals 1") - self.expect("\^done,locals=\[{name=\"test_str\",value=\".*Rakaposhi.*\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*\"}\]") + self.expect("\^done,locals=\[{name=\"test_str\",value=\".*?Rakaposhi.*?\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*?\"}\]") self.runCmd("-stack-list-locals --all-values") - self.expect("\^done,locals=\[{name=\"test_str\",value=\".*Rakaposhi.*\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*\"}\]") + self.expect("\^done,locals=\[{name=\"test_str\",value=\".*?Rakaposhi.*?\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*?\"}\]") # Test -stack-list-locals: use 2 or --simple-values self.runCmd("-stack-list-locals 2") - self.expect("\^done,locals=\[{name=\"test_str\",value=\".*Rakaposhi.*\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*\"}\]") + self.expect("\^done,locals=\[{name=\"test_str\",value=\".*?Rakaposhi.*?\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*?\"}\]") self.runCmd("-stack-list-locals --simple-values") - self.expect("\^done,locals=\[{name=\"test_str\",value=\".*Rakaposhi.*\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*\"}\]") + self.expect("\^done,locals=\[{name=\"test_str\",value=\".*?Rakaposhi.*?\"},{name=\"var_e\",value=\"24\"},{name=\"ptr\",value=\".*?\"}\]") @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @@ -246,7 +246,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -stack-info-frame fails when program isn't running self.runCmd("-stack-info-frame") - self.expect("\^error,msg=\"Command 'stack-info-frame'. Invalid process during debug session\"") + self.expect("\^error,msg=\"Command 'stack-info-frame'\. Invalid process during debug session\"") # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -261,7 +261,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -stack-info-frame works when program was stopped on BP self.runCmd("-stack-info-frame") - self.expect("\^done,frame=\{level=\"0\",addr=\".+\",func=\"main\",file=\"main\.cpp\",fullname=\".*main\.cpp\",line=\"\d+\"\}") + self.expect("\^done,frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\"\}") # Select frame #1 self.runCmd("-stack-select-frame 1") @@ -269,7 +269,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -stack-info-frame works when specified frame was selected self.runCmd("-stack-info-frame") - self.expect("\^done,frame=\{level=\"1\",addr=\".+\",func=\".+\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"\}") + self.expect("\^done,frame=\{level=\"1\",addr=\"0x[0-9a-f]+\",func=\".+?\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"\}") # Test that -stack-info-frame fails when an argument is specified #FIXME: unknown argument is ignored @@ -297,7 +297,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test stack frame: get frame #0 info self.runCmd("-stack-list-frames 0 0") - self.expect("\^done,stack=\[frame=\{level=\"0\",addr=\".+\",func=\"main\",file=\"main\.cpp\",fullname=\".*main\.cpp\",line=\".+\"\}\]") + self.expect("\^done,stack=\[frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\"\}\]") @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @@ -320,15 +320,15 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -stack-select-frame requires 1 mandatory argument self.runCmd("-stack-select-frame") - self.expect("\^error,msg=\"Command 'stack-select-frame'. Command Args. Missing options, 1 or more required\"") + self.expect("\^error,msg=\"Command 'stack-select-frame'\. Command Args\. Missing options, 1 or more required\"") # Test that -stack-select-frame fails on invalid frame number self.runCmd("-stack-select-frame 99") - self.expect("\^error,msg=\"Command 'stack-select-frame'. Frame ID invalid\"") + self.expect("\^error,msg=\"Command 'stack-select-frame'\. Frame ID invalid\"") # Test that current frame is #0 self.runCmd("-stack-info-frame") - self.expect("\^done,frame=\{level=\"0\",addr=\".+\",func=\"main\",file=\"main\.cpp\",fullname=\".*main\.cpp\",line=\"\d+\"\}") + self.expect("\^done,frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\"\}") # Test that -stack-select-frame can select the selected frame self.runCmd("-stack-select-frame 0") @@ -336,7 +336,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that current frame is still #0 self.runCmd("-stack-info-frame") - self.expect("\^done,frame=\{level=\"0\",addr=\".+\",func=\"main\",file=\"main\.cpp\",fullname=\".*main\.cpp\",line=\"\d+\"\}") + self.expect("\^done,frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\"\}") # Test that -stack-select-frame can select frame #1 (parent frame) self.runCmd("-stack-select-frame 1") @@ -347,7 +347,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Darwin: "^done,frame={level=\"1\",addr=\"0x[0-9a-f]+\",func=\"start\",file=\"??\",fullname=\"??\",line=\"-1\"}" # Linux: "^done,frame={level=\"1\",addr=\"0x[0-9a-f]+\",func=\".+\",file=\".+\",fullname=\".+\",line=\"\d+\"}" self.runCmd("-stack-info-frame") - self.expect("\^done,frame=\{level=\"1\",addr=\".+\",func=\".+\",file=\".+\",fullname=\".+\",line=\"(-1|\d+)\"\}") + self.expect("\^done,frame=\{level=\"1\",addr=\"0x[0-9a-f]+\",func=\".+?\",file=\".+?\",fullname=\".+?\",line=\"(-1|\d+)\"\}") # Test that -stack-select-frame can select frame #0 (child frame) self.runCmd("-stack-select-frame 0") @@ -355,7 +355,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): # Test that current frame is #0 and it has the same information self.runCmd("-stack-info-frame") - self.expect("\^done,frame=\{level=\"0\",addr=\".+\",func=\"main\",file=\"main\.cpp\",fullname=\".*main\.cpp\",line=\"\d+\"\}") + self.expect("\^done,frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"main\",file=\"main\.cpp\",fullname=\".+?main\.cpp\",line=\"\d+\"\}") if __name__ == '__main__': unittest2.main() diff --git a/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py index a4d8fed3e88..ec28c59b942 100644 --- a/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py +++ b/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py @@ -49,7 +49,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase): # Test that the executable isn't loaded when unknown file was specified self.expect("-file-exec-and-symbols \"%s\"" % path) - self.expect("\^error,msg=\"Command 'file-exec-and-symbols'. Target binary '%s' is invalid. error: unable to find executable for '%s'\"" % (path, path)) + self.expect("\^error,msg=\"Command 'file-exec-and-symbols'\. Target binary '%s' is invalid\. error: unable to find executable for '%s'\"" % (path, path)) # Test that lldb-mi is ready when executable was loaded self.expect(self.child_prompt, exactly = True) @@ -123,7 +123,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase): # Test that the executable isn't loaded when file was specified using unknown path self.expect("-file-exec-and-symbols \"%s\"" % path) - self.expect("\^error,msg=\"Command 'file-exec-and-symbols'. Target binary '%s' is invalid. error: unable to find executable for '%s'\"" % (path, path)) + self.expect("\^error,msg=\"Command 'file-exec-and-symbols'\. Target binary '%s' is invalid\. error: unable to find executable for '%s'\"" % (path, path)) # Test that lldb-mi is ready when executable was loaded self.expect(self.child_prompt, exactly = True) diff --git a/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py b/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py index 7cfceccbe84..eb81be597ef 100644 --- a/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py +++ b/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py @@ -41,11 +41,11 @@ class MiSymbolTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -symbol-list-lines fails when file doesn't exist self.runCmd("-symbol-list-lines unknown_file") - self.expect("\^error,message=\"warning: No source filenames matched 'unknown_file'. error: no source filenames matched any command arguments \"") + self.expect("\^error,message=\"warning: No source filenames matched 'unknown_file'\. error: no source filenames matched any command arguments \"") # Test that -symbol-list-lines fails when file is specified using relative path self.runCmd("-symbol-list-lines ./main.cpp") - self.expect("\^error,message=\"warning: No source filenames matched './main.cpp'. error: no source filenames matched any command arguments \"") + self.expect("\^error,message=\"warning: No source filenames matched '\./main\.cpp'\. error: no source filenames matched any command arguments \"") # Test that -symbol-list-lines works when file is specified using absolute path import os @@ -55,7 +55,7 @@ class MiSymbolTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -symbol-list-lines fails when file doesn't exist self.runCmd("-symbol-list-lines unknown_dir/main.cpp") - self.expect("\^error,message=\"warning: No source filenames matched 'unknown_dir/main.cpp'. error: no source filenames matched any command arguments \"") + self.expect("\^error,message=\"warning: No source filenames matched 'unknown_dir/main\.cpp'\. error: no source filenames matched any command arguments \"") if __name__ == '__main__': unittest2.main() diff --git a/lldb/test/tools/lldb-mi/variable/TestMiVar.py b/lldb/test/tools/lldb-mi/variable/TestMiVar.py index e8168d11cb1..06adaceb638 100644 --- a/lldb/test/tools/lldb-mi/variable/TestMiVar.py +++ b/lldb/test/tools/lldb-mi/variable/TestMiVar.py @@ -113,9 +113,9 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-data-evaluate-expression \"argv[0]\"") self.expect("\^done,value=\"0x[0-9a-f]+\"") self.runCmd("-var-create var6 * \"argv[0]\"") - self.expect("\^done,name=\"var6\",numchild=\"1\",value=\"0x[0-9a-f]+ \\\\\\\".*%s\\\\\\\"\",type=\"const char \*\",thread-id=\"1\",has_more=\"0\"" % self.myexe) + self.expect("\^done,name=\"var6\",numchild=\"1\",value=\"0x[0-9a-f]+ \\\\\\\".*?%s\\\\\\\"\",type=\"const char \*\",thread-id=\"1\",has_more=\"0\"" % self.myexe) self.runCmd("-var-evaluate-expression var6") - self.expect("\^done,value=\"0x[0-9a-f]+ \\\\\\\".*%s\\\\\\\"\"" % self.myexe) + self.expect("\^done,value=\"0x[0-9a-f]+ \\\\\\\".*?%s\\\\\\\"\"" % self.myexe) self.runCmd("-var-show-attributes var6") self.expect("\^done,status=\"editable\"") self.runCmd("-var-list-children --all-values var6") |