Go to the documentation of this file.
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>
339 #endif // LLDB_EXPRESSION_FUNCTIONCALLER_H
std::string m_wrapper_function_name
The name of the wrapper function.
Function * m_function_ptr
The function we're going to call.
uint64_t m_return_offset
The offset of the result variable in the struct, in bytes.
ExpressionResults
The results of expression evaluation.
bool WriteFunctionWrapper(ExecutionContext &exe_ctx, DiagnosticManager &diagnostic_manager)
Insert the default function wrapper (using the JIT)
std::string m_name
The name of this clang function - for debugging purposes.
lldb::ModuleWP m_jit_module_wp
bool NeedsVariableResolution() override
Return true if external variables in the expression should be resolved.
virtual bool isA(const void *ClassID) const =0
std::string m_wrapper_function_text
The contents of the wrapper function.
void DeallocateFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr)
Deallocate the arguments structure.
bool WriteFunctionArguments(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, DiagnosticManager &diagnostic_manager)
Insert the default function argument struct.
std::string m_wrapper_struct_name
The name of the struct that contains the target function address, arguments, and result.
bool InsertFunction(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, DiagnosticManager &diagnostic_manager)
Insert the default function wrapper and its default argument struct.
size_t m_struct_size
These values are populated by the ASTStructExtractor.
uint64_t m_return_size
The size of the result variable, in bytes.
std::shared_ptr< IRExecutionUnit > m_execution_unit_sp
ValueList GetArgumentValues() const
ValueList m_arg_values
The default values of the arguments.
string(SUBSTRING ${p} 10 -1 pStripped) if($
bool FetchFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr, Value &ret_value)
Get the result of the function from its struct.
virtual unsigned CompileFunction(lldb::ThreadSP thread_to_use_sp, DiagnosticManager &diagnostic_manager)=0
Compile the wrapper function.
static bool classof(const Expression *obj)
FunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name)
Constructor.
bool NeedsValidation() override
Return true if validation code should be inserted into the expression.
~FunctionCaller() override
Destructor.
std::list< lldb::addr_t > m_wrapper_args_addrs
The addresses of the arguments to the wrapper function.
std::unique_ptr< ExpressionParser > m_parser
The parser responsible for compiling the function.
std::vector< uint64_t > m_member_offsets
The offset of each member in the struct, in bytes.
ExpressionVariableList * LocalVariables()
Return the object that the parser should use when registering local variables.
Generic representation of a type in a programming language.
CompilerType m_function_return_type
The opaque clang qual type for the function return type.
Address m_function_addr
If we don't have the FunctionSP, we at least need the address & return type.
A class that represents a running process on the host machine.
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.
bool m_JITted
True if the wrapper function has already been JIT-compiled.
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.
bool m_compiled
True if the wrapper function has already been parsed.
bool isA(const void *ClassID) const override
const char * Text() override
Interface for ClangExpression.
const char * FunctionName() override
Return the function name that should be used for executing the expression.
bool m_struct_valid
True if the ASTStructExtractor has populated the variables below.