diff options
author | Jim Ingham <jingham@apple.com> | 2011-12-22 19:12:40 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-12-22 19:12:40 +0000 |
commit | ef651600167a47060e4b19bdb788a0d1649671b8 (patch) | |
tree | aabe5d4cfbeb06df5596ec5731c1d5e5f1485760 /lldb/source/Target/ThreadPlanCallFunction.cpp | |
parent | 6901c0de675f3c264d496cdd75ac08fd21109305 (diff) | |
download | bcm5719-llvm-ef651600167a47060e4b19bdb788a0d1649671b8.tar.gz bcm5719-llvm-ef651600167a47060e4b19bdb788a0d1649671b8.zip |
Improve the x86_64 return value decoder to handle most structure returns.
Switch from GetReturnValue, which was hardly ever used, to GetReturnValueObject
which is much more convenient.
Return the "return value object" as a persistent variable if requested.
llvm-svn: 147157
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanCallFunction.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 2494c7cacfd..a5180613f9e 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -37,6 +37,7 @@ using namespace lldb_private; ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, Address &function, + const ClangASTType &return_type, addr_t arg, bool stop_other_threads, bool discard_on_error, @@ -47,6 +48,7 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, m_stop_other_threads (stop_other_threads), m_function_addr (function), m_function_sp (NULL), + m_return_type (return_type), m_takedown_done (false), m_stop_address (LLDB_INVALID_ADDRESS) { @@ -149,6 +151,7 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, Address &function, + const ClangASTType &return_type, bool stop_other_threads, bool discard_on_error, addr_t *arg1_ptr, @@ -162,6 +165,7 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, m_stop_other_threads (stop_other_threads), m_function_addr (function), m_function_sp(NULL), + m_return_type (return_type), m_takedown_done (false) { SetOkayToDiscard (discard_on_error); @@ -281,13 +285,12 @@ ThreadPlanCallFunction::DoTakedown () LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (!m_takedown_done) { - // TODO: how do we tell if all went well? - if (m_return_value_sp) + const ABI *abi = m_thread.GetProcess().GetABI().get(); + if (abi && m_return_type.IsValid()) { - const ABI *abi = m_thread.GetProcess().GetABI().get(); - if (abi) - abi->GetReturnValue(m_thread, *m_return_value_sp); + m_return_valobj_sp = abi->GetReturnValueObject (m_thread, m_return_type); } + if (log) log->Printf ("DoTakedown called for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); m_takedown_done = true; |