diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp | 2 | ||||
-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 |
8 files changed, 38 insertions, 14 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 3c04eb35c9f..4fecc6b46b3 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -305,7 +305,8 @@ CommandObjectExpression::EvaluateExpression m_command_options.unwind_on_error, keep_in_memory, use_dynamic, - result_valobj_sp); + result_valobj_sp, + 0 /* no timeout */); if (exe_results == eExecutionInterrupted && !m_command_options.unwind_on_error) { diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index bb7ce45eeaf..973b9d4a385 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -1206,7 +1206,8 @@ protected: unwind_on_error, keep_in_memory, eNoDynamicValues, - valobj_sp); + valobj_sp, + 0 /* no timeout */); if (expr_result != eExecutionCompleted) { result.GetErrorStream().Printf("error: expression evaluation of address to watch failed\n"); result.GetErrorStream().Printf("expression evaluated: %s\n", expr_str.c_str()); diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 4fed8413b56..029b1539529 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -542,7 +542,8 @@ ClangUserExpression::Execute (Stream &error_stream, ExecutionContext &exe_ctx, bool discard_on_error, ClangUserExpression::ClangUserExpressionSP &shared_ptr_to_me, - lldb::ClangExpressionVariableSP &result) + lldb::ClangExpressionVariableSP &result, + uint32_t single_thread_timeout_usec) { // The expression log is quite verbose, and if you're just tracking the execution of the // expression, it's quite convenient to have these logs come out with the STEP log as well. @@ -578,8 +579,6 @@ ClangUserExpression::Execute (Stream &error_stream, call_plan_sp->SetPrivate(true); - uint32_t single_thread_timeout_usec = 500000; - if (log) log->Printf("-- [ClangUserExpression::Execute] Execution of expression begins --"); @@ -648,10 +647,11 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, bool discard_on_error, const char *expr_cstr, const char *expr_prefix, - lldb::ValueObjectSP &result_valobj_sp) + lldb::ValueObjectSP &result_valobj_sp, + uint32_t single_thread_timeout_usec) { Error error; - return EvaluateWithError (exe_ctx, execution_policy, language, desired_type, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error); + return EvaluateWithError (exe_ctx, execution_policy, language, desired_type, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error, single_thread_timeout_usec); } ExecutionResults @@ -663,7 +663,8 @@ ClangUserExpression::EvaluateWithError (ExecutionContext &exe_ctx, const char *expr_cstr, const char *expr_prefix, lldb::ValueObjectSP &result_valobj_sp, - Error &error) + Error &error, + uint32_t single_thread_timeout_usec) { lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP)); @@ -738,7 +739,8 @@ ClangUserExpression::EvaluateWithError (ExecutionContext &exe_ctx, exe_ctx, discard_on_error, user_expression_sp, - expr_result); + expr_result, + single_thread_timeout_usec); if (execution_results != eExecutionCompleted) { diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 2879ec45f8f..b807e61bc18 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1162,7 +1162,8 @@ CommandInterpreter::PreprocessCommand (std::string &command) unwind_on_error, keep_in_memory, eNoDynamicValues, - expr_result_valobj_sp); + expr_result_valobj_sp, + 0 /* no timeout */); if (expr_result == eExecutionCompleted) { Scalar scalar; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index a2bc88872c1..4d001d857dc 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -142,7 +142,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon &wrapper_struct_addr, error_stream, stop_others, - 100000, + 0 /* no timeout */, try_all_threads, unwind_on_error, ret); 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); } } |