diff options
Diffstat (limited to 'lldb/source/Target')
| -rw-r--r-- | lldb/source/Target/Process.cpp | 16 | ||||
| -rw-r--r-- | lldb/source/Target/StopInfo.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Target/Target.cpp | 6 |
3 files changed, 22 insertions, 3 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 531b56c503e..61da768995e 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4228,11 +4228,27 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, if (single_thread_timeout_usec != 0) { + // we have a > 0 timeout, let us set it so that we stop after the deadline real_timeout = TimeValue::Now(); real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec); timeout_ptr = &real_timeout; } + else if (first_timeout) + { + // if we are willing to wait "forever" we still need to have an initial timeout + // this timeout is going to induce all threads to run when hit. we do this so that + // we can avoid ending locked up because of multithreaded contention issues + real_timeout = TimeValue::Now(); + real_timeout.OffsetWithNanoSeconds(500000000UL); + timeout_ptr = &real_timeout; + } + else + { + timeout_ptr = NULL; // if we are in a no-timeout scenario, then we only need a fake timeout the first time through + // at this point in the code, all threads will be running so we are willing to wait forever, and do not + // need a timeout + } } else { diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp index 5b782beb4bd..fe4f7952b54 100644 --- a/lldb/source/Target/StopInfo.cpp +++ b/lldb/source/Target/StopInfo.cpp @@ -520,7 +520,8 @@ public: wp_sp->GetConditionText(), NULL, result_value_sp, - error); + error, + 500000); if (result_code == eExecutionCompleted) { if (result_value_sp) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index c5c0a187990..5b568278e0d 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1652,7 +1652,8 @@ Target::EvaluateExpression bool unwind_on_error, bool keep_in_memory, lldb::DynamicValueType use_dynamic, - lldb::ValueObjectSP &result_valobj_sp + lldb::ValueObjectSP &result_valobj_sp, + uint32_t single_thread_timeout_usec ) { ExecutionResults execution_results = eExecutionSetupError; @@ -1781,7 +1782,8 @@ Target::EvaluateExpression unwind_on_error, expr_cstr, prefix, - result_valobj_sp); + result_valobj_sp, + single_thread_timeout_usec); } } |

