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) {
268 llvm::StringRef expr_cstr, llvm::StringRef expr_prefix,
270 std::string *fixed_expression =
nullptr,
289 llvm::StringRef object_name,
307 llvm::StringRef object_name,
Status &err);
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
"lldb/Utility/ArgCompletionRequest.h"
"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
uint32_t ValueType
Every error value that this object can contain needs to be able to fit into ValueType.
Encapsulates a one-time expression for use in lldb.
Address m_address
The address the process is stopped in.
~UserExpression() override
Destructor.
static lldb::ValueObjectSP GetObjectPointerValueObject(lldb::StackFrameSP frame, llvm::StringRef object_name, Status &err)
Return ValueObject for a given variable name in the current stack frame.
virtual lldb::ExpressionVariableSP GetResultAfterDematerialization(ExecutionContextScope *exe_scope)
virtual bool CanInterpret()=0
SourceLanguage m_language
The language to use when parsing (unknown 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...
virtual lldb::ExpressionResults DoExecute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)=0
virtual bool IsParseCacheable()
Returns whether the call to Parse on this user expression is cacheable.
const char * GetUserText()
Return the string that the user typed.
std::string m_fixed_text
The text of the expression with fix-its applied this won't be set if the fixed text doesn't parse.
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.
std::string m_expr_prefix
The text of the translation-level definitions, as provided by the user.
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, llvm::StringRef object_name, Status &err)
SourceLanguage Language() const override
Return the language that should be used when parsing.
ResultType DesiredResultType() const override
Return the desired result type of the function, or eResultTypeAny if indifferent.
llvm::StringRef GetFixedText()
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 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.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ExpressionVariable > ExpressionVariableSP
std::shared_ptr< lldb_private::UserExpression > UserExpressionSP
ExpressionResults
The results of expression evaluation.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Target > TargetSP
A type-erased pair of llvm::dwarf::SourceLanguageName and version.