[Lldb-commits] [lldb] r228576 - Fix test case failure on Linux.

Hafiz Abid Qadeer hafiz_abid at mentor.com
Mon Feb 9 05:54:51 PST 2015


Author: abidh
Date: Mon Feb  9 07:54:51 2015
New Revision: 228576

URL: http://llvm.org/viewvc/llvm-project?rev=228576&view=rev
Log:
Fix test case failure on Linux.
The test case were failing becuase my test compiler was gcc. The generated
code behaved a bit differently to the how the test expected. Adjusted a few
lines so that it works on both gcc and clang.


Modified:
    lldb/trunk/test/tools/lldb-mi/TestMiExec.py

Modified: lldb/trunk/test/tools/lldb-mi/TestMiExec.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiExec.py?rev=228576&r1=228575&r2=228576&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiExec.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiExec.py Mon Feb  9 07:54:51 2015
@@ -183,7 +183,6 @@ class MiExecTestCase(lldbmi_testcase.MiT
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @expectedFailureLinux("TODO: Figures why it is failing on Linux")
     def test_lldbmi_exec_next_instruction(self):
         """Test that 'lldb-mi --interpreter' works for instruction stepping."""
 
@@ -221,7 +220,8 @@ class MiExecTestCase(lldbmi_testcase.MiT
         # Test that both --thread and --frame are optional
         self.runCmd("-exec-next-instruction --thread 1")
         self.expect("\^running")
-        self.expect("\*stopped,reason=\"end-stepping-range\".*main.c\",line=\"22\"")
+        # Depending on compiler, it can stop at different line.
+        self.expect("\*stopped,reason=\"end-stepping-range\".*main.c\",line=\"2[0-2]\"")
 
         # Test that an invalid --thread is handled
         self.runCmd("-exec-next-instruction --thread 0")
@@ -236,7 +236,6 @@ class MiExecTestCase(lldbmi_testcase.MiT
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @expectedFailureLinux("TODO: Figures why it is failing on Linux")
     def test_lldbmi_exec_step(self):
         """Test that 'lldb-mi --interpreter' works for stepping into."""
 
@@ -272,7 +271,9 @@ class MiExecTestCase(lldbmi_testcase.MiT
         self.runCmd("-exec-step --frame 0")
         self.expect("\^running")
         self.expect("\*stopped,reason=\"end-stepping-range\".*func=\"a_MyFunction\"")
-        self.runCmd("-exec-step --frame 0")
+        # Use -exec-finish here to make sure that control reaches the caller.
+        # -exec-step can keep us in the a_MyFunction for gcc
+        self.runCmd("-exec-finish --frame 0")
         self.expect("\^running")
         self.expect("\*stopped,reason=\"end-stepping-range\".*main.c\",line=\"22\"")
         self.runCmd("-exec-step --frame 0")





More information about the lldb-commits mailing list