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 31 of file Expression.h.
Enumerator | |
---|---|
eResultTypeAny | |
eResultTypeId |
Definition at line 33 of file Expression.h.
Expression::Expression | ( | Target & | target | ) |
Definition at line 15 of file Expression.cpp.
References m_target_wp.
Expression::Expression | ( | ExecutionContextScope & | exe_scope | ) |
Definition at line 23 of file Expression.cpp.
References 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 59 of file Expression.h.
References eResultTypeAny.
Referenced by SetupLangOpts().
|
inlinevirtual |
Called to notify the expression that its execution has finished.
Definition at line 79 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.
Referenced by lldb_private::ClangExpressionParser::DoPrepareForExecution().
|
inlinevirtual |
Return the Materializer that the parser should use when registering external values.
Reimplemented in lldb_private::LLVMUserExpression.
Definition at line 55 of file Expression.h.
|
inlinevirtual |
Reimplemented in lldb_private::UserExpression.
Definition at line 69 of file Expression.h.
|
inlinevirtual |
Reimplemented in lldb_private::ClangFunctionCaller, lldb_private::ClangUserExpression, and lldb_private::ClangUtilityFunction.
Definition at line 81 of file Expression.h.
Referenced by lldb_private::ClangExpressionParser::DoPrepareForExecution(), and lldb_private::ClangExpressionParser::ParseInternal().
|
pure virtual |
Implemented in lldb_private::FunctionCaller, lldb_private::LLVMUserExpression, lldb_private::UserExpression, lldb_private::UtilityFunction, lldb_private::ClangFunctionCaller, lldb_private::ClangUserExpression, and lldb_private::ClangUtilityFunction.
Referenced by lldb_private::FunctionCaller::classof(), lldb_private::LLVMUserExpression::classof(), lldb_private::UserExpression::classof(), lldb_private::UtilityFunction::classof(), lldb_private::ClangFunctionCaller::classof(), lldb_private::ClangUserExpression::classof(), and lldb_private::ClangUtilityFunction::classof().
|
inlinevirtual |
Return the language that should be used when parsing.
Reimplemented in lldb_private::UserExpression.
Definition at line 51 of file Expression.h.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser(), lldb_private::ClangExpressionParser::DoPrepareForExecution(), 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.
Referenced by lldb_private::ClangExpressionParser::DoPrepareForExecution().
|
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.
Referenced by lldb_private::ClangExpressionParser::DoPrepareForExecution().
|
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 73 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.
Referenced by lldb_private::ClangExpressionParser::ParseInternal().
|
inlinevirtual |
Called to notify the expression that it is about to be executed.
Definition at line 76 of file Expression.h.
|
protected |
The address of the JITted function within the JIT allocation.
LLDB_INVALID_ADDRESS if invalid.
Definition at line 94 of file Expression.h.
Referenced by lldb_private::UtilityFunction::ContainsAddress(), 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 88 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 91 of file Expression.h.
Referenced by lldb_private::UtilityFunction::ContainsAddress(), lldb_private::LLVMUserExpression::DoExecute(), 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 87 of file Expression.h.
Referenced by Expression().