Add the ability to set timeout & "run all threads" options both from the "expr" command and from
the SB API's that evaluate expressions.
<rdar://problem/12457211>
llvm-svn: 166062
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index 62e4e8a..1909dc2 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -485,13 +485,13 @@
ClangFunction::ExecuteFunction(
ExecutionContext &exe_ctx,
Stream &errors,
- uint32_t single_thread_timeout_usec,
+ uint32_t timeout_usec,
bool try_all_threads,
Value &results)
{
const bool stop_others = true;
const bool discard_on_error = true;
- return ExecuteFunction (exe_ctx, NULL, errors, stop_others, single_thread_timeout_usec,
+ return ExecuteFunction (exe_ctx, NULL, errors, stop_others, timeout_usec,
try_all_threads, discard_on_error, results);
}
@@ -504,7 +504,7 @@
bool stop_others,
bool try_all_threads,
bool discard_on_error,
- uint32_t single_thread_timeout_usec,
+ uint32_t timeout_usec,
Stream &errors,
lldb::addr_t *this_arg)
{
@@ -529,7 +529,7 @@
stop_others,
try_all_threads,
discard_on_error,
- single_thread_timeout_usec,
+ timeout_usec,
errors);
if (exe_ctx.GetProcessPtr())
@@ -544,7 +544,7 @@
lldb::addr_t *args_addr_ptr,
Stream &errors,
bool stop_others,
- uint32_t single_thread_timeout_usec,
+ uint32_t timeout_usec,
bool try_all_threads,
bool discard_on_error,
Value &results)
@@ -574,7 +574,7 @@
stop_others,
try_all_threads,
discard_on_error,
- single_thread_timeout_usec,
+ timeout_usec,
errors);
if (args_addr_ptr != NULL)
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index c037d02..4507282 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -544,7 +544,8 @@
bool discard_on_error,
ClangUserExpression::ClangUserExpressionSP &shared_ptr_to_me,
lldb::ClangExpressionVariableSP &result,
- uint32_t single_thread_timeout_usec)
+ bool run_others,
+ uint32_t 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.
@@ -594,7 +595,7 @@
stop_others,
try_all_threads,
discard_on_error,
- single_thread_timeout_usec,
+ timeout_usec,
error_stream);
if (exe_ctx.GetProcessPtr())
@@ -655,10 +656,21 @@
const char *expr_cstr,
const char *expr_prefix,
lldb::ValueObjectSP &result_valobj_sp,
- uint32_t single_thread_timeout_usec)
+ bool run_others,
+ uint32_t timeout_usec)
{
Error 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);
+ return EvaluateWithError (exe_ctx,
+ execution_policy,
+ language,
+ desired_type,
+ discard_on_error,
+ expr_cstr,
+ expr_prefix,
+ result_valobj_sp,
+ error,
+ run_others,
+ timeout_usec);
}
ExecutionResults
@@ -671,7 +683,8 @@
const char *expr_prefix,
lldb::ValueObjectSP &result_valobj_sp,
Error &error,
- uint32_t single_thread_timeout_usec)
+ bool run_others,
+ uint32_t timeout_usec)
{
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
@@ -747,7 +760,8 @@
discard_on_error,
user_expression_sp,
expr_result,
- single_thread_timeout_usec);
+ run_others,
+ timeout_usec);
if (execution_results != eExecutionCompleted)
{