ClangFunction::ClangFunction ( ExecutionContextScope &exe_scope, Function &function, ClangASTContext *ast_context, const ValueList &arg_value_list ) : m_function_ptr (&function), m_function_addr (), m_function_return_qual_type (), m_clang_ast_context (ast_context), m_wrapper_function_name ("__lldb_function_caller"), m_wrapper_struct_name ("__lldb_caller_struct"), m_wrapper_args_addrs (), m_arg_values (arg_value_list), m_compiled (false), m_JITted (false) { m_jit_process_sp = exe_scope.CalculateProcess(); // Can't make a ClangFunction without a process. assert (m_jit_process_sp); m_function_addr = m_function_ptr->GetAddressRange().GetBaseAddress(); m_function_return_qual_type = m_function_ptr->GetReturnClangType(); }
Expression::Expression(ExecutionContextScope &exe_scope, ExpressionKind kind) : m_kind(kind), m_target_wp(exe_scope.CalculateTarget()), m_jit_start_addr(LLDB_INVALID_ADDRESS), m_jit_end_addr(LLDB_INVALID_ADDRESS) { assert(m_target_wp.lock()); }
ClangFunction::ClangFunction ( ExecutionContextScope &exe_scope, Function &function, ClangASTContext *ast_context, const ValueList &arg_value_list, const char *name ) : m_name (name ? name : "<unknown>"), m_function_ptr (&function), m_function_addr (), m_function_return_type (), m_wrapper_function_name ("__lldb_function_caller"), m_wrapper_struct_name ("__lldb_caller_struct"), m_wrapper_args_addrs (), m_arg_values (arg_value_list), m_compiled (false), m_JITted (false) { m_jit_process_wp = exe_scope.CalculateProcess(); // Can't make a ClangFunction without a process. assert (m_jit_process_wp.lock()); m_function_addr = m_function_ptr->GetAddressRange().GetBaseAddress(); m_function_return_type = m_function_ptr->GetCompilerType().GetFunctionReturnType(); }
//---------------------------------------------------------------------- // ClangFunction constructor //---------------------------------------------------------------------- ClangFunction::ClangFunction ( ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address& functionAddress, const ValueList &arg_value_list, const char *name ) : m_execution_unit_sp(), m_parser(), m_jit_module_wp(), m_name (name ? name : "<unknown>"), m_function_ptr (NULL), m_function_addr (functionAddress), m_function_return_type(return_type), m_wrapper_function_name ("__lldb_caller_function"), m_wrapper_struct_name ("__lldb_caller_struct"), m_wrapper_args_addrs (), m_arg_values (arg_value_list), m_compiled (false), m_JITted (false) { m_jit_process_wp = lldb::ProcessWP(exe_scope.CalculateProcess()); // Can't make a ClangFunction without a process. assert (m_jit_process_wp.lock()); }
//---------------------------------------------------------------------- // ClangFunctionCaller constructor //---------------------------------------------------------------------- ClangFunctionCaller::ClangFunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &functionAddress, const ValueList &arg_value_list, const char *name) : FunctionCaller(exe_scope, return_type, functionAddress, arg_value_list, name), m_type_system_helper(*this) { m_jit_process_wp = lldb::ProcessWP(exe_scope.CalculateProcess()); // Can't make a ClangFunctionCaller without a process. assert(m_jit_process_wp.lock()); }
//---------------------------------------------------------------------- // ClangFunction constructor //---------------------------------------------------------------------- ClangFunction::ClangFunction ( ExecutionContextScope &exe_scope, ClangASTContext *ast_context, void *return_qualtype, const Address& functionAddress, const ValueList &arg_value_list ) : m_function_ptr (NULL), m_function_addr (functionAddress), m_function_return_qual_type(return_qualtype), m_clang_ast_context (ast_context), m_wrapper_function_name ("__lldb_caller_function"), m_wrapper_struct_name ("__lldb_caller_struct"), m_wrapper_args_addrs (), m_arg_values (arg_value_list), m_compiled (false), m_JITted (false) { m_jit_process_sp = exe_scope.CalculateProcess(); // Can't make a ClangFunction without a process. assert (m_jit_process_sp); }
ClangUserExpression::ClangUserExpression( ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options) : LLVMUserExpression(exe_scope, expr, prefix, language, desired_type, options), m_type_system_helper(*m_target_wp.lock().get(), options.GetExecutionPolicy() == eExecutionPolicyTopLevel), m_result_delegate(exe_scope.CalculateTarget()) { switch (m_language) { case lldb::eLanguageTypeC_plus_plus: m_allow_cxx = true; break; case lldb::eLanguageTypeObjC: m_allow_objc = true; break; case lldb::eLanguageTypeObjC_plus_plus: default: m_allow_cxx = true; m_allow_objc = true; break; } }
ExecutionContext::ExecutionContext (ExecutionContextScope &exe_scope_ref) { exe_scope_ref.CalculateExecutionContext (*this); }