Compilation can end up calling functions (e.g. to resolve indirect functions) so I added

a way for compilation to take a "thread to use for compilation".  If it isn't set then the
compilation will use the currently selected thread.  This should help keep function execution
to the one thread intended.

llvm-svn: 263972
This commit is contained in:
Jim Ingham
2016-03-21 19:21:13 +00:00
parent cdaf644c48
commit 6896b35585
14 changed files with 52 additions and 14 deletions

View File

@@ -194,6 +194,11 @@ UserExpression::Evaluate (ExecutionContext &exe_ctx,
if (process == NULL || !process->CanJIT())
execution_policy = eExecutionPolicyNever;
// We need to set the expression execution thread here, turns out parse can call functions in the process of
// looking up symbols, which will escape the context set by exe_ctx passed to Execute.
lldb::ThreadSP thread_sp = exe_ctx.GetThreadSP();
ThreadList::ExpressionExecutionThreadPusher execution_thread_pusher(thread_sp);
const char *full_prefix = NULL;
const char *option_prefix = options.GetPrefix();