Change Target::EvaluateExpression to take an ExecutionContextScope * rather than a

StackFrame * (StackFrame is an ExecutionContextScope.)  That allows you to call an
expression on a particular Thread, but not using the context of any particular frame.
That in turn is useful for injecting utility functions that don't actually depend on
locals/self/etc of the current frame.

I also had to include StackFrame.h in a couple of places so the compiler knew
how to downcast StackFrame to ExecutionContextScope.

<rdar://problem/22852953>

llvm-svn: 251564
This commit is contained in:
Jim Ingham 2015-10-28 22:23:17 +00:00
parent b25fe95afe
commit a309efef39
4 changed files with 6 additions and 4 deletions

View File

@ -1381,7 +1381,7 @@ public:
// in in th execution context.
lldb::ExpressionResults
EvaluateExpression (const char *expression,
StackFrame *frame,
ExecutionContextScope *exe_scope,
lldb::ValueObjectSP &result_valobj_sp,
const EvaluateExpressionOptions& options = EvaluateExpressionOptions());

View File

@ -19,6 +19,7 @@
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
using namespace lldb;

View File

@ -27,6 +27,7 @@
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
using namespace lldb;

View File

@ -2165,7 +2165,7 @@ Target::GetTargetFromContexts (const ExecutionContext *exe_ctx_ptr, const Symbol
ExpressionResults
Target::EvaluateExpression(const char *expr_cstr,
StackFrame *frame,
ExecutionContextScope *exe_scope,
lldb::ValueObjectSP &result_valobj_sp,
const EvaluateExpressionOptions& options)
{
@ -2183,9 +2183,9 @@ Target::EvaluateExpression(const char *expr_cstr,
ExecutionContext exe_ctx;
if (frame)
if (exe_scope)
{
frame->CalculateExecutionContext(exe_ctx);
exe_scope->CalculateExecutionContext(exe_ctx);
}
else if (m_process_sp)
{