Go to the documentation of this file.
9 #ifndef LLDB_EXPRESSION_USEREXPRESSION_H
10 #define LLDB_EXPRESSION_USEREXPRESSION_H
40 bool isA(
const void *ClassID)
const override {
return ClassID == &
ID; }
88 bool keep_result_in_memory,
bool generate_debug_info) = 0;
112 unsigned complete_pos) {
149 lldb::UserExpressionSP &shared_ptr_to_me,
150 lldb::ExpressionVariableSP &result);
181 lldb::ExpressionVariableSP &result,
211 virtual lldb::ExpressionVariableSP
213 return lldb::ExpressionVariableSP();
260 llvm::StringRef expr_cstr, llvm::StringRef expr_prefix,
261 lldb::ValueObjectSP &result_valobj_sp,
Status &
error,
277 lldb::UserExpressionSP &shared_ptr_to_me,
278 lldb::ExpressionVariableSP &result) = 0;
296 static lldb::ValueObjectSP
306 lldb::ProcessSP &process_sp,
307 lldb::StackFrameSP &frame_sp);
326 #endif // LLDB_EXPRESSION_USEREXPRESSION_H
void InstallContext(ExecutionContext &exe_ctx)
Populate m_in_cplusplus_method and m_in_objectivec_method based on the environment.
Address m_address
The address the process is stopped in.
ResultType m_desired_type
The type to coerce the expression's result to.
~UserExpression() override
Destructor.
const char * GetUserText()
Return the string that the user typed.
virtual bool CanInterpret()=0
ExecutionPolicy
Expression execution policies.
ExpressionResults
The results of expression evaluation.
const char * FunctionName() override
Return the function name that should be used for executing the expression.
bool isA(const void *ClassID) const override
const char * Text() override
Return the string that the parser should parse.
LanguageType
Programming language type.
static lldb::ValueObjectSP GetObjectPointerValueObject(lldb::StackFrameSP frame, ConstString const &object_name, Status &err)
Return ValueObject for a given variable name in the current stack frame.
static lldb::ExpressionResults Evaluate(ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, llvm::StringRef expr_cstr, llvm::StringRef expr_prefix, lldb::ValueObjectSP &result_valobj_sp, Status &error, std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
Evaluate one expression in the scratch context of the target passed in the exe_ctx and return its res...
EvaluateExpressionOptions * GetOptions() override
std::string m_fixed_text
The text of the expression with fix-its applied.
virtual lldb::ExpressionVariableSP GetResultAfterDematerialization(ExecutionContextScope *exe_scope)
virtual bool isA(const void *ClassID) const =0
EvaluateExpressionOptions m_options
Additional options provided by the user.
virtual bool FinalizeJITExecution(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb::ExpressionVariableSP &result, lldb::addr_t function_stack_bottom=LLDB_INVALID_ADDRESS, lldb::addr_t function_stack_top=LLDB_INVALID_ADDRESS)=0
Apply the side effects of the function to program state.
static llvm::raw_ostream & error(Stream &strm)
ResultType DesiredResultType() override
Return the desired result type of the function, or eResultTypeAny if indifferent.
lldb::LanguageType Language() const override
Return the language that should be used when parsing.
static lldb::addr_t GetObjectPointer(lldb::StackFrameSP frame_sp, ConstString &object_name, Status &err)
bool NeedsValidation() override
Return true if validation code should be inserted into the expression.
string(SUBSTRING ${p} 10 -1 pStripped) if($
llvm::StringRef GetFixedText()
virtual bool Parse(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info)=0
Parse the expression.
lldb::LanguageType m_language
The language to use when parsing (eLanguageTypeUnknown means use defaults)
virtual bool Complete(ExecutionContext &exe_ctx, CompletionRequest &request, unsigned complete_pos)
Attempts to find possible command line completions for the given (possible incomplete) user expressio...
lldb::ExpressionResults Execute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)
Execute the parsed expression by callinng the derived class's DoExecute method.
#define LLDB_INVALID_ADDRESS
static const Status::ValueType kNoResult
ValueObject::GetError() returns this if there is no result from the expression.
UserExpression(ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options)
Constructor.
A class that represents a running process on the host machine.
static char ID
LLVM RTTI support.
std::string m_expr_prefix
The text of the translation-level definitions, as provided by the user.
std::string m_expr_text
The text of the expression, as typed by the user.
static bool classof(const Expression *obj)
bool LockAndCheckContext(ExecutionContext &exe_ctx, lldb::TargetSP &target_sp, lldb::ProcessSP &process_sp, lldb::StackFrameSP &frame_sp)
virtual lldb::ExpressionResults DoExecute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)=0
bool NeedsVariableResolution() override
Return true if external variables in the expression should be resolved.
bool MatchesContext(ExecutionContext &exe_ctx)