[Lldb-commits] [lldb] r240651 - Fix TestThreadAPI on Linux

Tamas Berghammer tberghammer at google.com
Thu Jun 25 08:19:22 PDT 2015


Author: tberghammer
Date: Thu Jun 25 10:19:22 2015
New Revision: 240651

URL: http://llvm.org/viewvc/llvm-project?rev=240651&view=rev
Log:
Fix TestThreadAPI on Linux

On Linux malloc calls itself in some case. Change the test case to
handle this scenario.

Modified:
    lldb/trunk/test/python_api/thread/TestThreadAPI.py

Modified: lldb/trunk/test/python_api/thread/TestThreadAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/thread/TestThreadAPI.py?rev=240651&r1=240650&r2=240651&view=diff
==============================================================================
--- lldb/trunk/test/python_api/thread/TestThreadAPI.py (original)
+++ lldb/trunk/test/python_api/thread/TestThreadAPI.py Thu Jun 25 10:19:22 2015
@@ -75,7 +75,6 @@ class ThreadAPITestCase(TestBase):
         self.step_out_of_malloc_into_function_b(self.exe_name)
 
     @expectedFailureFreeBSD # llvm.org/pr20476
-    @expectedFailureLinux # need to 'thread step-out' twice to get out of malloc
     @python_api_test
     @dwarf_test
     def test_step_out_of_malloc_into_function_b_with_dwarf(self):
@@ -175,7 +174,6 @@ class ThreadAPITestCase(TestBase):
 
         breakpoint = target.BreakpointCreateByName('malloc')
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
-        self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
         process = target.LaunchSimple (None, None, self.get_process_working_directory())
@@ -184,7 +182,6 @@ class ThreadAPITestCase(TestBase):
             thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
             self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
             caller_symbol = get_caller_symbol(thread)
-            #print "caller symbol of malloc:", caller_symbol
             if not caller_symbol:
                 self.fail("Test failed: could not locate the caller symbol of malloc")
 
@@ -198,13 +195,14 @@ class ThreadAPITestCase(TestBase):
 
             if caller_symbol == "b(int)":
                 break
-            #self.runCmd("thread backtrace")
-            #self.runCmd("process status")           
             process.Continue()
 
+        # On Linux malloc calls itself in some case. Remove the breakpoint because we don't want
+        # to hit it during step-out.
+        target.BreakpointDelete(breakpoint.GetID())
+
         thread.StepOut()
         self.runCmd("thread backtrace")
-        #self.runCmd("process status")           
         self.assertTrue(thread.GetFrameAtIndex(0).GetLineEntry().GetLine() == self.step_out_of_malloc,
                         "step out of malloc into function b is successful")
 





More information about the lldb-commits mailing list