Author: jingham Date: Wed Nov 4 18:24:18 2015 New Revision: 252108 URL: http://llvm.org/viewvc/llvm-project?rev=252108&view=rev Log: AddInitialArguments -> AddArguments, and we pass in the struct_address and push it too. All the callers had to do this by hand and we ended up never actually adding initial arguments and then reusing them by passing in the struct address separately, so the distinction wasn't needed.
Modified: lldb/trunk/include/lldb/Expression/LLVMUserExpression.h lldb/trunk/source/Expression/LLVMUserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h Modified: lldb/trunk/include/lldb/Expression/LLVMUserExpression.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/LLVMUserExpression.h?rev=252108&r1=252107&r2=252108&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/LLVMUserExpression.h (original) +++ lldb/trunk/include/lldb/Expression/LLVMUserExpression.h Wed Nov 4 18:24:18 2015 @@ -77,11 +77,13 @@ class LLVMUserExpression : public UserEx virtual void ScanContext(ExecutionContext &exe_ctx, lldb_private::Error &err) = 0; bool PrepareToExecuteJITExpression(Stream &error_stream, ExecutionContext &exe_ctx, lldb::addr_t &struct_address); + virtual bool - AddInitialArguments(ExecutionContext &exe_ctx, std::vector<lldb::addr_t> &args, Stream &error_stream) - { - return true; - } + AddArguments (ExecutionContext &exe_ctx, + std::vector<lldb::addr_t> &args, + lldb::addr_t struct_address, + Stream &error_stream) = 0; + lldb::addr_t m_stack_frame_bottom; ///< The bottom of the allocated stack frame. lldb::addr_t m_stack_frame_top; ///< The top of the allocated stack frame. Modified: lldb/trunk/source/Expression/LLVMUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/LLVMUserExpression.cpp?rev=252108&r1=252107&r2=252108&view=diff ============================================================================== --- lldb/trunk/source/Expression/LLVMUserExpression.cpp (original) +++ lldb/trunk/source/Expression/LLVMUserExpression.cpp Wed Nov 4 18:24:18 2015 @@ -111,14 +111,12 @@ LLVMUserExpression::Execute(Stream &erro std::vector<lldb::addr_t> args; - if (!AddInitialArguments(exe_ctx, args, error_stream)) + if (!AddArguments(exe_ctx, args, struct_address, error_stream)) { - error_stream.Printf("Errored out in %s, couldn't AddInitialArguments", __FUNCTION__); + error_stream.Printf("Errored out in %s, couldn't AddArguments", __FUNCTION__); return lldb::eExpressionSetupError; } - args.push_back(struct_address); - function_stack_bottom = m_stack_frame_bottom; function_stack_top = m_stack_frame_top; @@ -143,14 +141,12 @@ LLVMUserExpression::Execute(Stream &erro std::vector<lldb::addr_t> args; - if (!AddInitialArguments(exe_ctx, args, error_stream)) + if (!AddArguments(exe_ctx, args, struct_address, error_stream)) { - error_stream.Printf("Errored out in %s, couldn't AddInitialArguments", __FUNCTION__); + error_stream.Printf("Errored out in %s, couldn't AddArguments", __FUNCTION__); return lldb::eExpressionSetupError; } - args.push_back(struct_address); - lldb::ThreadPlanSP call_plan_sp(new ThreadPlanCallUserExpression(exe_ctx.GetThreadRef(), wrapper_address, args, options, shared_ptr_to_me)); Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp?rev=252108&r1=252107&r2=252108&view=diff ============================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp Wed Nov 4 18:24:18 2015 @@ -555,9 +555,10 @@ ClangUserExpression::Parse (Stream &erro } bool -ClangUserExpression::AddInitialArguments (ExecutionContext &exe_ctx, - std::vector<lldb::addr_t> &args, - Stream &error_stream) +ClangUserExpression::AddArguments (ExecutionContext &exe_ctx, + std::vector<lldb::addr_t> &args, + lldb::addr_t struct_address, + Stream &error_stream) { lldb::addr_t object_ptr = LLDB_INVALID_ADDRESS; lldb::addr_t cmd_ptr = LLDB_INVALID_ADDRESS; @@ -612,7 +613,11 @@ ClangUserExpression::AddInitialArguments if (m_in_objectivec_method) args.push_back(cmd_ptr); - + args.push_back(struct_address); + } + else + { + args.push_back(struct_address); } return true; } Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h?rev=252108&r1=252107&r2=252108&view=diff ============================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h Wed Nov 4 18:24:18 2015 @@ -188,9 +188,10 @@ private: lldb_private::Error &err) override; bool - AddInitialArguments (ExecutionContext &exe_ctx, - std::vector<lldb::addr_t> &args, - Stream &error_stream) override; + AddArguments (ExecutionContext &exe_ctx, + std::vector<lldb::addr_t> &args, + lldb::addr_t struct_address, + Stream &error_stream) override; ClangUserExpressionHelper m_type_system_helper; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits