diff options
author | dim <dim@FreeBSD.org> | 2015-09-06 15:21:47 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-06 15:21:47 +0000 |
commit | eaea1142467bd061be671b7775195ea69422a53f (patch) | |
tree | 6dbe733cbb748d293bbaa2b7616e76faff7118d5 /contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp | |
parent | ee8d011a70fa14b1e123f58d0139125f5e36173e (diff) | |
parent | 80b639cd40df427b9e325318efeec2d885a65f62 (diff) | |
download | FreeBSD-src-eaea1142467bd061be671b7775195ea69422a53f.zip FreeBSD-src-eaea1142467bd061be671b7775195ea69422a53f.tar.gz |
Update lldb to upstream trunk r242221.
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp b/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp index e742ece..e7b3abd 100644 --- a/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -147,15 +147,16 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, m_trap_exceptions (options.GetTrapExceptions()), m_function_addr (function), m_function_sp (0), - m_return_type (return_type), m_takedown_done (false), m_should_clear_objc_exception_bp(false), m_should_clear_cxx_exception_bp (false), - m_stop_address (LLDB_INVALID_ADDRESS) + m_stop_address (LLDB_INVALID_ADDRESS), + m_return_type (return_type) { - lldb::addr_t start_load_addr; - ABI *abi; - lldb::addr_t function_load_addr; + lldb::addr_t start_load_addr = LLDB_INVALID_ADDRESS; + lldb::addr_t function_load_addr = LLDB_INVALID_ADDRESS; + ABI *abi = nullptr; + if (!ConstructorSetup (thread, abi, start_load_addr, function_load_addr)) return; @@ -171,6 +172,27 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, m_valid = true; } +ThreadPlanCallFunction::ThreadPlanCallFunction(Thread &thread, + const Address &function, + const EvaluateExpressionOptions &options) : + ThreadPlan(ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion), + m_valid(false), + m_stop_other_threads(options.GetStopOthers()), + m_unwind_on_error(options.DoesUnwindOnError()), + m_ignore_breakpoints(options.DoesIgnoreBreakpoints()), + m_debug_execution(options.GetDebug()), + m_trap_exceptions(options.GetTrapExceptions()), + m_function_addr(function), + m_function_sp(0), + m_takedown_done(false), + m_should_clear_objc_exception_bp(false), + m_should_clear_cxx_exception_bp(false), + m_stop_address(LLDB_INVALID_ADDRESS), + m_return_type(ClangASTType()) +{ + +} + ThreadPlanCallFunction::~ThreadPlanCallFunction () { DoTakedown(PlanSucceeded()); @@ -222,13 +244,7 @@ ThreadPlanCallFunction::DoTakedown (bool success) { if (success) { - ProcessSP process_sp (m_thread.GetProcess()); - const ABI *abi = process_sp ? process_sp->GetABI().get() : NULL; - if (abi && m_return_type.IsValid()) - { - const bool persistent = false; - m_return_valobj_sp = abi->GetReturnValueObject (m_thread, m_return_type, persistent); - } + SetReturnValue(); } if (log) log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n", @@ -574,3 +590,15 @@ ThreadPlanCallFunction::RestoreThreadState() return GetThread().RestoreThreadStateFromCheckpoint(m_stored_thread_state); } + +void +ThreadPlanCallFunction::SetReturnValue() +{ + ProcessSP process_sp(m_thread.GetProcess()); + const ABI *abi = process_sp ? process_sp->GetABI().get() : NULL; + if (abi && m_return_type.IsValid()) + { + const bool persistent = false; + m_return_valobj_sp = abi->GetReturnValueObject(m_thread, m_return_type, persistent); + } +} |