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,
262 std::string *fixed_expression =
nullptr,
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);
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
"lldb/Utility/ArgCompletionRequest.h"
A uniqued constant string class.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Encapsulates a single expression for use in lldb.
virtual bool isA(const void *ClassID) const =0
Encapsulates a one-time expression for use in lldb.
Address m_address
The address the process is stopped in.
~UserExpression() override
Destructor.
virtual lldb::ExpressionVariableSP GetResultAfterDematerialization(ExecutionContextScope *exe_scope)
virtual bool CanInterpret()=0
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...
virtual lldb::ExpressionResults DoExecute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)=0
const char * GetUserText()
Return the string that the user typed.
std::string m_fixed_text
The text of the expression with fix-its applied.
ResultType m_desired_type
The type to coerce the expression's result to.
bool NeedsVariableResolution() override
Return true if external variables in the expression should be resolved.
bool NeedsValidation() override
Return true if validation code should be inserted into the expression.
bool isA(const void *ClassID) const override
const char * Text() override
Return the string that the parser should parse.
void InstallContext(ExecutionContext &exe_ctx)
Populate m_in_cplusplus_method and m_in_objectivec_method based on the environment.
lldb::LanguageType Language() const override
Return the language that should be used when parsing.
std::string m_expr_prefix
The text of the translation-level definitions, as provided by the user.
ResultType DesiredResultType() override
Return the desired result type of the function, or eResultTypeAny if indifferent.
static const Status::ValueType kNoResult
ValueObject::GetError() returns this if there is no result from the expression.
const char * FunctionName() override
Return the function name that should be used for executing the expression.
std::string m_expr_text
The text of the expression, as typed by the user.
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...
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.
EvaluateExpressionOptions m_options
Additional options provided by the user.
bool LockAndCheckContext(ExecutionContext &exe_ctx, lldb::TargetSP &target_sp, lldb::ProcessSP &process_sp, lldb::StackFrameSP &frame_sp)
bool MatchesContext(ExecutionContext &exe_ctx)
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 lldb::addr_t GetObjectPointer(lldb::StackFrameSP frame_sp, ConstString &object_name, Status &err)
llvm::StringRef GetFixedText()
lldb::LanguageType m_language
The language to use when parsing (eLanguageTypeUnknown means use defaults)
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.
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 bool classof(const Expression *obj)
EvaluateExpressionOptions * GetOptions() override
static char ID
LLVM RTTI support.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
ExecutionPolicy
Expression execution policies.
LanguageType
Programming language type.
ExpressionResults
The results of expression evaluation.