summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanCallFunction.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-12 02:14:56 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-12 02:14:56 +0000
commitfdeb15635b5974fd1d286448d25346297403a9e9 (patch)
tree8d5a7fd4efdd923f027023c9f49c37824df30db1 /lldb/source/Target/ThreadPlanCallFunction.cpp
parent622e4fcac6da8a68bdf30ebe0d94bdc334923866 (diff)
downloadbcm5719-llvm-fdeb15635b5974fd1d286448d25346297403a9e9.tar.gz
bcm5719-llvm-fdeb15635b5974fd1d286448d25346297403a9e9.zip
Cleaned up the ABI::PrepareTrivialCall() function to take three argument
pointers: virtual bool PrepareTrivialCall (Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, lldb::addr_t *arg1_ptr, lldb::addr_t *arg2_ptr, lldb::addr_t *arg3_ptr) const = 0; Prior to this it was: virtual bool PrepareTrivialCall (Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, lldb::addr_t arg, lldb::addr_t *this_arg, lldb::addr_t *cmd_arg) const = 0; This was because the function that called this slowly added more features to be able to call a C++ member function that might have a "this" pointer, and then later added "self + cmd" support for objective C. Cleaning this code up and the code that calls it makes it easier to implement the functions for new targets. The MacOSX_arm::PrepareTrivialCall() is now filled in and ready for testing. llvm-svn: 131221
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanCallFunction.cpp41
1 files changed, 33 insertions, 8 deletions
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp
index 934ac00df56..1da0e7b7945 100644
--- a/lldb/source/Target/ThreadPlanCallFunction.cpp
+++ b/lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -110,14 +110,39 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
m_function_addr = function;
lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target);
- if (!abi->PrepareTrivialCall(thread,
- m_function_sp,
- FunctionLoadAddr,
- StartLoadAddr,
- m_arg_addr,
- this_arg,
- cmd_arg))
- return;
+ if (this_arg && cmd_arg)
+ {
+ if (!abi->PrepareTrivialCall (thread,
+ m_function_sp,
+ FunctionLoadAddr,
+ StartLoadAddr,
+ this_arg,
+ cmd_arg,
+ &m_arg_addr))
+ return;
+ }
+ else if (this_arg)
+ {
+ if (!abi->PrepareTrivialCall (thread,
+ m_function_sp,
+ FunctionLoadAddr,
+ StartLoadAddr,
+ this_arg,
+ &m_arg_addr,
+ NULL))
+ return;
+ }
+ else
+ {
+ if (!abi->PrepareTrivialCall (thread,
+ m_function_sp,
+ FunctionLoadAddr,
+ StartLoadAddr,
+ &m_arg_addr,
+ NULL,
+ NULL))
+ return;
+ }
ReportRegisterState ("Function call was set up. Register state was:");
OpenPOWER on IntegriCloud