[Lldb-commits] [lldb] r133598 - /lldb/trunk/source/Target/Process.cpp

Greg Clayton gclayton at apple.com
Tue Jun 21 18:42:17 PDT 2011


Author: gclayton
Date: Tue Jun 21 20:42:17 2011
New Revision: 133598

URL: http://llvm.org/viewvc/llvm-project?rev=133598&view=rev
Log:
Add a 10 second timeout to ensure that we don't lock up if we never get to the
process entry point.


Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=133598&r1=133597&r2=133598&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Jun 21 20:42:17 2011
@@ -2060,9 +2060,19 @@
                 else
                 {
                     EventSP event_sp;
-                    StateType state = WaitForProcessStopPrivate(NULL, event_sp);
+                    TimeValue timeout_time;
+                    timeout_time = TimeValue::Now();
+                    timeout_time.OffsetWithSeconds(10);
+                    StateType state = WaitForProcessStopPrivate(&timeout_time, event_sp);
 
-                    if (state == eStateStopped || state == eStateCrashed)
+                    if (state == eStateInvalid || event_sp.get() == NULL)
+                    {
+                        // We were able to launch the process, but we failed to
+                        // catch the initial stop.
+                        SetExitStatus (0, "failed to catch stop after launch");
+                        Destroy();
+                    }
+                    else if (state == eStateStopped || state == eStateCrashed)
                     {
 
                         DidLaunch ();





More information about the lldb-commits mailing list