LLDB mainline
|
Encapsulates a single expression for use in lldb. More...
#include "lldb/Expression/Expression.h"
Public Types | |
enum | ResultType { eResultTypeAny , eResultTypeId } |
Public Member Functions | |
Expression (Target &target) | |
Expression (ExecutionContextScope &exe_scope) | |
virtual | ~Expression ()=default |
Destructor. | |
virtual const char * | Text ()=0 |
Return the string that the parser should parse. | |
virtual const char * | FunctionName ()=0 |
Return the function name that should be used for executing the expression. | |
virtual SourceLanguage | Language () const |
Return the language that should be used when parsing. | |
virtual Materializer * | GetMaterializer () |
Return the Materializer that the parser should use when registering external values. | |
virtual ResultType | DesiredResultType () const |
Return the desired result type of the function, or eResultTypeAny if indifferent. | |
virtual bool | NeedsValidation ()=0 |
Flags. | |
virtual bool | NeedsVariableResolution ()=0 |
Return true if external variables in the expression should be resolved. | |
virtual EvaluateExpressionOptions * | GetOptions () |
lldb::addr_t | StartAddress () |
Return the address of the function's JIT-compiled code, or LLDB_INVALID_ADDRESS if the function is not JIT compiled. | |
virtual void | WillStartExecuting () |
Called to notify the expression that it is about to be executed. | |
virtual void | DidFinishExecuting () |
Called to notify the expression that its execution has finished. | |
virtual ExpressionTypeSystemHelper * | GetTypeSystemHelper () |
virtual bool | isA (const void *ClassID) const =0 |
Protected Attributes | |
lldb::TargetWP | m_target_wp |
lldb::ProcessWP | m_jit_process_wp |
Expression's always have to have a target... | |
lldb::addr_t | m_jit_start_addr |
An expression might have a process, but it doesn't need to (e.g. | |
lldb::addr_t | m_jit_end_addr |
The address of the JITted function within the JIT allocation. |
Encapsulates a single expression for use in lldb.
LLDB uses expressions for various purposes, notably to call functions and as a backend for the expr command. Expression encapsulates the objects needed to parse and interpret or JIT an expression. It uses the expression parser appropriate to the language of the expression to produce LLVM IR from the expression.
Definition at line 32 of file Expression.h.
Enumerator | |
---|---|
eResultTypeAny | |
eResultTypeId |
Definition at line 34 of file Expression.h.
Expression::Expression | ( | Target & | target | ) |
Definition at line 20 of file Expression.cpp.
References LLDB_INVALID_ADDRESS, m_jit_end_addr, m_jit_start_addr, and m_target_wp.
Referenced by lldb_private::FunctionCaller::classof(), lldb_private::UserExpression::classof(), lldb_private::UtilityFunction::classof(), lldb_private::FunctionCaller::FunctionCaller(), lldb_private::UserExpression::UserExpression(), and lldb_private::UtilityFunction::UtilityFunction().
Expression::Expression | ( | ExecutionContextScope & | exe_scope | ) |
Definition at line 28 of file Expression.cpp.
References LLDB_INVALID_ADDRESS, m_jit_end_addr, m_jit_start_addr, and m_target_wp.
|
virtualdefault |
Destructor.
|
inlinevirtual |
Return the desired result type of the function, or eResultTypeAny if indifferent.
Reimplemented in lldb_private::UserExpression.
Definition at line 60 of file Expression.h.
References eResultTypeAny.
Referenced by SetupLangOpts().
|
inlinevirtual |
Called to notify the expression that its execution has finished.
Definition at line 80 of file Expression.h.
|
pure virtual |
Return the function name that should be used for executing the expression.
Text() should contain the definition of this function.
Implemented in lldb_private::FunctionCaller, lldb_private::UserExpression, and lldb_private::UtilityFunction.
|
inlinevirtual |
Return the Materializer that the parser should use when registering external values.
Reimplemented in lldb_private::LLVMUserExpression.
Definition at line 56 of file Expression.h.
|
inlinevirtual |
Reimplemented in lldb_private::UserExpression.
Definition at line 70 of file Expression.h.
|
inlinevirtual |
Reimplemented in lldb_private::ClangFunctionCaller, lldb_private::ClangUserExpression, and lldb_private::ClangUtilityFunction.
Definition at line 82 of file Expression.h.
|
pure virtual |
Implemented in lldb_private::ClangFunctionCaller, lldb_private::ClangUserExpression, lldb_private::ClangUtilityFunction, lldb_private::FunctionCaller, lldb_private::LLVMUserExpression, lldb_private::UserExpression, and lldb_private::UtilityFunction.
Referenced by lldb_private::ClangFunctionCaller::classof(), lldb_private::ClangUserExpression::classof(), lldb_private::ClangUtilityFunction::classof(), lldb_private::FunctionCaller::classof(), lldb_private::LLVMUserExpression::classof(), lldb_private::UserExpression::classof(), and lldb_private::UtilityFunction::classof().
|
inlinevirtual |
Return the language that should be used when parsing.
Reimplemented in lldb_private::UserExpression.
Definition at line 52 of file Expression.h.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser(), lldb_private::UtilityFunction::MakeFunctionCaller(), and SetupLangOpts().
|
pure virtual |
Return true if validation code should be inserted into the expression.
Implemented in lldb_private::FunctionCaller, lldb_private::UserExpression, and lldb_private::UtilityFunction.
|
pure virtual |
Return true if external variables in the expression should be resolved.
Implemented in lldb_private::FunctionCaller, lldb_private::UserExpression, and lldb_private::UtilityFunction.
|
inline |
Return the address of the function's JIT-compiled code, or LLDB_INVALID_ADDRESS if the function is not JIT compiled.
Definition at line 74 of file Expression.h.
References m_jit_start_addr.
Referenced by lldb_private::UtilityFunction::MakeFunctionCaller().
|
pure virtual |
Return the string that the parser should parse.
Must be a full translation unit.
Implemented in lldb_private::FunctionCaller, lldb_private::LLVMUserExpression, lldb_private::UserExpression, and lldb_private::UtilityFunction.
|
inlinevirtual |
Called to notify the expression that it is about to be executed.
Definition at line 77 of file Expression.h.
|
protected |
The address of the JITted function within the JIT allocation.
LLDB_INVALID_ADDRESS if invalid.
Definition at line 95 of file Expression.h.
Referenced by lldb_private::UtilityFunction::ContainsAddress(), Expression(), Expression(), lldb_private::ClangUtilityFunction::Install(), lldb_private::ClangUserExpression::TryParse(), and lldb_private::FunctionCaller::WriteFunctionWrapper().
|
protected |
Expression's always have to have a target...
Definition at line 89 of file Expression.h.
Referenced by lldb_private::ClangFunctionCaller::ClangFunctionCaller(), lldb_private::ClangFunctionCaller::CompileFunction(), lldb_private::FunctionCaller::FetchFunctionResults(), lldb_private::FunctionCaller::FunctionCaller(), lldb_private::ClangUtilityFunction::Install(), lldb_private::UserExpression::InstallContext(), lldb_private::UserExpression::LockAndCheckContext(), lldb_private::UtilityFunction::MakeFunctionCaller(), lldb_private::ClangUserExpression::Parse(), lldb_private::FunctionCaller::WriteFunctionArguments(), lldb_private::FunctionCaller::WriteFunctionWrapper(), lldb_private::FunctionCaller::~FunctionCaller(), and lldb_private::UtilityFunction::~UtilityFunction().
|
protected |
An expression might have a process, but it doesn't need to (e.g.
calculator mode.) The address of the JITted function within the JIT allocation. LLDB_INVALID_ADDRESS if invalid.
Definition at line 92 of file Expression.h.
Referenced by lldb_private::UtilityFunction::ContainsAddress(), lldb_private::LLVMUserExpression::DoExecute(), Expression(), Expression(), lldb_private::FunctionCaller::GetThreadPlanToCallFunction(), lldb_private::FunctionCaller::InsertFunction(), lldb_private::ClangUtilityFunction::Install(), lldb_private::ClangUserExpression::Parse(), lldb_private::LLVMUserExpression::PrepareToExecuteJITExpression(), StartAddress(), lldb_private::ClangUserExpression::TryParse(), and lldb_private::FunctionCaller::WriteFunctionWrapper().
|
protected |
Definition at line 88 of file Expression.h.
Referenced by lldb_private::ClangUserExpression::ClangUserExpression(), Expression(), and Expression().