diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Expression/FunctionCaller.cpp | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) | |
download | src-5f29bb8a675e8f96452b632e7129113f7dec850e.tar.gz src-5f29bb8a675e8f96452b632e7129113f7dec850e.zip |
Vendor import of stripped lldb trunk r366426 (just before the release_90
branch point):
https://llvm.org/svn/llvm-project/lldb/trunk@366426
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=351290
Diffstat (limited to 'source/Expression/FunctionCaller.cpp')
-rw-r--r-- | source/Expression/FunctionCaller.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/source/Expression/FunctionCaller.cpp b/source/Expression/FunctionCaller.cpp index 97f4f51e1ff6..618c1a13212c 100644 --- a/source/Expression/FunctionCaller.cpp +++ b/source/Expression/FunctionCaller.cpp @@ -1,9 +1,8 @@ //===-- FunctionCaller.cpp ---------------------------------------*- C++-*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -30,17 +29,15 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // FunctionCaller constructor -//---------------------------------------------------------------------- FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &functionAddress, const ValueList &arg_value_list, const char *name) - : Expression(exe_scope), m_execution_unit_sp(), m_parser(), - m_jit_module_wp(), m_name(name ? name : "<unknown>"), - m_function_ptr(NULL), m_function_addr(functionAddress), + : Expression(exe_scope, eKindFunctionCaller), m_execution_unit_sp(), + m_parser(), m_jit_module_wp(), m_name(name ? name : "<unknown>"), + m_function_ptr(nullptr), 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(), @@ -51,9 +48,7 @@ FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope, assert(m_jit_process_wp.lock()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- FunctionCaller::~FunctionCaller() { lldb::ProcessSP process_sp(m_jit_process_wp.lock()); if (process_sp) { @@ -103,7 +98,8 @@ bool FunctionCaller::WriteFunctionWrapper( jit_file.GetFilename() = const_func_name; jit_module_sp->SetFileSpecAndObjectName(jit_file, ConstString()); m_jit_module_wp = jit_module_sp; - process->GetTarget().GetImages().Append(jit_module_sp); + process->GetTarget().GetImages().Append(jit_module_sp, + true /* notify */); } } if (process && m_jit_start_addr) @@ -141,7 +137,7 @@ bool FunctionCaller::WriteFunctionArguments( Process *process = exe_ctx.GetProcessPtr(); - if (process == NULL) + if (process == nullptr) return return_value; lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock()); @@ -242,11 +238,11 @@ lldb::ThreadPlanSP FunctionCaller::GetThreadPlanToCallFunction( // FIXME: Use the errors Stream for better error reporting. Thread *thread = exe_ctx.GetThreadPtr(); - if (thread == NULL) { + if (thread == nullptr) { diagnostic_manager.PutString( eDiagnosticSeverityError, "Can't call a function without a valid thread."); - return NULL; + return nullptr; } // Okay, now run the function: @@ -282,7 +278,7 @@ bool FunctionCaller::FetchFunctionResults(ExecutionContext &exe_ctx, Process *process = exe_ctx.GetProcessPtr(); - if (process == NULL) + if (process == nullptr) return false; lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock()); @@ -329,7 +325,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction( lldb::addr_t args_addr; - if (args_addr_ptr != NULL) + if (args_addr_ptr != nullptr) args_addr = *args_addr_ptr; else args_addr = LLDB_INVALID_ADDRESS; @@ -379,7 +375,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction( if (exe_ctx.GetProcessPtr()) exe_ctx.GetProcessPtr()->SetRunningUserExpression(false); - if (args_addr_ptr != NULL) + if (args_addr_ptr != nullptr) *args_addr_ptr = args_addr; if (return_value != lldb::eExpressionCompleted) @@ -387,7 +383,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction( FetchFunctionResults(exe_ctx, args_addr, results); - if (args_addr_ptr == NULL) + if (args_addr_ptr == nullptr) DeallocateFunctionResults(exe_ctx, args_addr); return lldb::eExpressionCompleted; |