diff options
author | Greg Clayton <gclayton@apple.com> | 2011-06-22 01:42:17 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-06-22 01:42:17 +0000 |
commit | 1a38ea763a7cd21e743e7c655641046395c0efa0 (patch) | |
tree | 187e71aa86c031b621ca832e213755faab091676 /lldb/source/Target/Process.cpp | |
parent | 1da6f9d7f1a62119cf83edc75cfe50461131d1b5 (diff) | |
download | bcm5719-llvm-1a38ea763a7cd21e743e7c655641046395c0efa0.tar.gz bcm5719-llvm-1a38ea763a7cd21e743e7c655641046395c0efa0.zip |
Add a 10 second timeout to ensure that we don't lock up if we never get to the
process entry point.
llvm-svn: 133598
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 79310dd11ad..178d3c39856 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2060,9 +2060,19 @@ Process::Launch 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 (); |