[Lldb-commits] [lldb] r228582 - Fix TestFdLeak.py on Mac.

Pavel Labath labath at google.com
Mon Feb 9 09:42:47 PST 2015


Author: labath
Date: Mon Feb  9 11:42:47 2015
New Revision: 228582

URL: http://llvm.org/viewvc/llvm-project?rev=228582&view=rev
Log:
Fix TestFdLeak.py on Mac.

bug introduced in D7466. For some reason target.Launch behaves differently on linux and mac.

Modified:
    lldb/trunk/test/functionalities/avoids-fd-leak/TestFdLeak.py
    lldb/trunk/test/functionalities/avoids-fd-leak/main.c

Modified: lldb/trunk/test/functionalities/avoids-fd-leak/TestFdLeak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/avoids-fd-leak/TestFdLeak.py?rev=228582&r1=228581&r2=228582&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/avoids-fd-leak/TestFdLeak.py (original)
+++ lldb/trunk/test/functionalities/avoids-fd-leak/TestFdLeak.py Mon Feb  9 11:42:47 2015
@@ -42,12 +42,10 @@ class AvoidsFdLeakTestCase(TestBase):
         exe = os.path.join (os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
+	breakpoint = target.BreakpointCreateBySourceRegex ('Set breakpoint here', lldb.SBFileSpec ("main.c", False))
+	self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
-        listener = lldb.SBListener()
-        error = lldb.SBError()
-        process1 = target.Launch (listener, None, None, None, None, None,
-                self.get_process_working_directory(), 0, True, # stop at entry
-                error)
+        process1 = target.LaunchSimple (None, None, self.get_process_working_directory())
         self.assertTrue(process1, PROCESS_IS_VALID)
         self.assertTrue(process1.GetState() == lldb.eStateStopped, "Process should have been stopped.")
 

Modified: lldb/trunk/test/functionalities/avoids-fd-leak/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/avoids-fd-leak/main.c?rev=228582&r1=228581&r2=228582&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/avoids-fd-leak/main.c (original)
+++ lldb/trunk/test/functionalities/avoids-fd-leak/main.c Mon Feb  9 11:42:47 2015
@@ -8,7 +8,7 @@ int
 main (int argc, char const **argv)
 {
     struct stat buf;
-    int i, rv = 0;
+    int i, rv = 0; // Set breakpoint here.
 
     // Make sure stdin/stdout/stderr exist.
     for (i = 0; i <= 2; ++i) {





More information about the lldb-commits mailing list