9#ifndef LLDB_EXPRESSION_FUNCTIONCALLER_H
10#define LLDB_EXPRESSION_FUNCTIONCALLER_H
61 bool isA(
const void *ClassID)
const override {
return ClassID == &
ID; }
82 const Address &function_address,
83 const ValueList &arg_value_list,
const char *name);
292 std::unique_ptr<ExpressionParser>
324 std::vector<uint64_t>
A section + offset based address class.
Generic representation of a type in a programming language.
"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.
"lldb/Expression/ExpressionVariable.h" A list of variable references.
Encapsulates a single expression for use in lldb.
virtual bool isA(const void *ClassID) const =0
Encapsulates a function that can be called.
std::string m_wrapper_struct_name
The name of the struct that contains the target function address, arguments, and result.
Function * m_function_ptr
The function we're going to call.
std::list< lldb::addr_t > m_wrapper_args_addrs
The addresses of the arguments to the wrapper function.
ValueList GetArgumentValues() const
~FunctionCaller() override
Destructor.
Address m_function_addr
If we don't have the FunctionSP, we at least need the address & return type.
size_t m_struct_size
These values are populated by the ASTStructExtractor.
void DeallocateFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr)
Deallocate the arguments structure.
uint64_t m_return_offset
The offset of the result variable in the struct, in bytes.
bool m_struct_valid
True if the ASTStructExtractor has populated the variables below.
bool InsertFunction(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, DiagnosticManager &diagnostic_manager)
Insert the default function wrapper and its default argument struct.
ValueList m_arg_values
The default values of the arguments.
std::string m_wrapper_function_name
The name of the wrapper function.
bool NeedsValidation() override
Return true if validation code should be inserted into the expression.
lldb::ExpressionResults ExecuteFunction(ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager, Value &results)
Run the function this FunctionCaller was created with.
lldb::ThreadPlanSP GetThreadPlanToCallFunction(ExecutionContext &exe_ctx, lldb::addr_t args_addr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
Get a thread plan to run the function this FunctionCaller was created with.
virtual unsigned CompileFunction(lldb::ThreadSP thread_to_use_sp, DiagnosticManager &diagnostic_manager)=0
Compile the wrapper function.
std::string m_wrapper_function_text
The contents of the wrapper function.
ExpressionVariableList * LocalVariables()
Return the object that the parser should use when registering local variables.
bool isA(const void *ClassID) const override
bool FetchFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr, Value &ret_value)
Get the result of the function from its struct.
CompilerType m_function_return_type
The opaque clang qual type for the function return type.
bool WriteFunctionArguments(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, DiagnosticManager &diagnostic_manager)
Insert the default function argument struct.
uint64_t m_return_size
The size of the result variable, in bytes.
bool m_compiled
True if the wrapper function has already been parsed.
std::string m_name
The name of this clang function - for debugging purposes.
const char * Text() override
Interface for ClangExpression.
bool m_JITted
True if the wrapper function has already been JIT-compiled.
std::shared_ptr< IRExecutionUnit > m_execution_unit_sp
bool NeedsVariableResolution() override
Return true if external variables in the expression should be resolved.
lldb::ModuleWP m_jit_module_wp
static bool classof(const Expression *obj)
std::unique_ptr< ExpressionParser > m_parser
The parser responsible for compiling the function.
const char * FunctionName() override
Return the function name that should be used for executing the expression.
std::vector< uint64_t > m_member_offsets
The offset of each member in the struct, in bytes.
bool WriteFunctionWrapper(ExecutionContext &exe_ctx, DiagnosticManager &diagnostic_manager)
Insert the default function wrapper (using the JIT)
A class that describes a function.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::weak_ptr< lldb_private::Module > ModuleWP
std::shared_ptr< lldb_private::Thread > ThreadSP
ExpressionResults
The results of expression evaluation.