Author: nitesh.jain Date: Wed Feb 8 01:42:56 2017 New Revision: 294418 URL: http://llvm.org/viewvc/llvm-project?rev=294418&view=rev Log: [LLDB][MIPS] Fix TestMiExec and TestMiData failures
Subscribers: jaydeep, bhushan, lldb-commits, slthakur Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=294418&r1=294417&r2=294418&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Wed Feb 8 01:42:56 2017 @@ -1227,6 +1227,13 @@ class Base(unittest2.TestCase): # (enables reading of the current test configuration) # ==================================================== + def isMIPS(self): + """Returns true if the architecture is MIPS.""" + arch = self.getArchitecture() + if re.match("mips", arch): + return True + return False + def getArchitecture(self): """Returns the architecture in effect the test suite is running with.""" module = builder_module() Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py?rev=294418&r1=294417&r2=294418&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py Wed Feb 8 01:42:56 2017 @@ -260,7 +260,7 @@ class MiExecTestCase(lldbmi_testcase.MiT self.expect("\^running") # Depending on compiler, it can stop at different line self.expect( - "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(29|30|31)\"") + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(28|29|30|31)\"") # Test that an invalid --thread is handled self.runCmd("-exec-next-instruction --thread 0") @@ -382,7 +382,17 @@ class MiExecTestCase(lldbmi_testcase.MiT # Test that -exec-step-instruction steps into g_MyFunction # instruction (and that --thread is optional) - self.runCmd("-exec-step-instruction --frame 0") + + # In case of MIPS, there might be more than one instruction + # before actual call instruction (like load, move and call instructions). + # The -exec-step-instruction would step one assembly instruction. + # Thus we may not enter into g_MyFunction function. The -exec-step would definitely + # step into the function. + + if self.isMIPS(): + self.runCmd("-exec-step --frame 0") + else: + self.runCmd("-exec-step-instruction --frame 0") self.expect("\^running") self.expect( "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py?rev=294418&r1=294417&r2=294418&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py Wed Feb 8 01:42:56 2017 @@ -77,7 +77,13 @@ class MiDataTestCase(lldbmi_testcase.MiT # Linux: {address="0x0000000000400642",func-name="hello_world()",offset="18",size="5",inst="callq 0x4004d0; symbol stub for: printf"} # To match the escaped characters in the ouptut, we must use four backslashes per matches backslash # See https://docs.python.org/2/howto/regex.html#the-backslash-plague - self.expect(["{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; \\\\\"Hello, World!\\\\\\\\n\\\\\"\"}", + + # The MIPS disassembler never prints stub name + if self.isMIPS(): + self.expect(["{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; \\\\\"Hello, World!\\\\\\\\n\\\\\"\"}", + "{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?\"}"]) + else: + self.expect(["{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; \\\\\"Hello, World!\\\\\\\\n\\\\\"\"}", "{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; symbol stub for: printf\"}"]) @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits