39 std::string text, std::string name,
40 bool enable_debugging)
41 :
Expression(exe_scope), m_execution_unit_sp(), m_jit_module_wp(),
42 m_function_text(std::move(text)), m_function_name(std::move(name)) {}
49 process_sp->GetTarget().GetImages().Remove(jit_module_sp);
65 "Can't make a function caller without a process.");
72 "Can't make a function caller while the process is {0}: the process "
73 "must be stopped to allocate memory.",
81 name.append(
"-caller");
83 m_caller_up.reset(process_sp->GetTarget().GetFunctionCallerForLanguage(
84 Language().AsLanguageType(), return_type, impl_code_address,
85 arg_value_list, name.c_str(),
error));
93 m_caller_up->CompileFunction(thread_to_use_sp, diagnostics);
106 if (!
m_caller_up->WriteFunctionWrapper(exe_ctx, diagnostics)) {
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Generic representation of a type in a programming language.
llvm::Error GetAsError(lldb::ExpressionResults result, llvm::Twine message={}) const
Returns an ExpressionError with arg as error code.
"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.
lldb::ProcessWP m_jit_process_wp
Expression's always have to have a target...
lldb::addr_t StartAddress()
Return the address of the function's JIT-compiled code, or LLDB_INVALID_ADDRESS if the function is no...
Encapsulates a function that can be called.
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
UtilityFunction(ExecutionContextScope &exe_scope, std::string text, std::string name, bool enable_debugging)
Constructor.
FunctionCaller * MakeFunctionCaller(const CompilerType &return_type, const ValueList &arg_value_list, lldb::ThreadSP compilation_thread, Status &error)
std::string m_function_name
The name of the function.
~UtilityFunction() override
lldb::ModuleWP m_jit_module_wp
std::unique_ptr< FunctionCaller > m_caller_up
A class that represents a running process on the host machine.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
std::shared_ptr< lldb_private::Thread > ThreadSP
@ eStateStopped
Process or thread is stopped and can be examined.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Module > ModuleSP