Author: jingham Date: Mon Nov 7 16:47:01 2016 New Revision: 286170 URL: http://llvm.org/viewvc/llvm-project?rev=286170&view=rev Log: UserExpression::Evaluate only returns a non-empty ValueObjectSP if it returns eExpressionCompleted. Don't try to get the error from the ValueObjectSP if that's not true.
I just have a report of this from the field, I don't know how to make it fail yet. <rdar://problem/29113004> Modified: lldb/trunk/source/Expression/UserExpression.cpp lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Modified: lldb/trunk/source/Expression/UserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/UserExpression.cpp?rev=286170&r1=286169&r2=286170&view=diff ============================================================================== --- lldb/trunk/source/Expression/UserExpression.cpp (original) +++ lldb/trunk/source/Expression/UserExpression.cpp Mon Nov 7 16:47:01 2016 @@ -158,6 +158,7 @@ lldb::ExpressionResults UserExpression:: if (log) log->Printf("== [UserExpression::Evaluate] Passed a NULL target, can't " "run expressions."); + error.SetErrorString("expression passed a null target"); return lldb::eExpressionSetupError; } Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp?rev=286170&r1=286169&r2=286170&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (original) +++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Mon Nov 7 16:47:01 2016 @@ -737,8 +737,12 @@ Error PlatformPOSIX::EvaluateLibdlExpres expr_options.SetTimeoutUsec(2000000); // 2 seconds Error expr_error; - UserExpression::Evaluate(exe_ctx, expr_options, expr_cstr, expr_prefix, - result_valobj_sp, expr_error); + ExpressionResults result = + UserExpression::Evaluate(exe_ctx, expr_options, expr_cstr, expr_prefix, + result_valobj_sp, expr_error); + if (result != eExpressionCompleted) + return expr_error; + if (result_valobj_sp->GetError().Fail()) return result_valobj_sp->GetError(); return Error(); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits