summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanCallFunction.cpp
diff options
context:
space:
mode:
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