summaryrefslogtreecommitdiffstats
path: root/source/Expression/ClangUserExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Expression/ClangUserExpression.cpp')
-rw-r--r--source/Expression/ClangUserExpression.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/source/Expression/ClangUserExpression.cpp b/source/Expression/ClangUserExpression.cpp
index 52ef4d3..5514846 100644
--- a/source/Expression/ClangUserExpression.cpp
+++ b/source/Expression/ClangUserExpression.cpp
@@ -619,15 +619,14 @@ GetObjectPointer (lldb::StackFrameSP frame_sp,
valobj_sp = frame_sp->GetValueForVariableExpressionPath(object_name.AsCString(),
lldb::eNoDynamicValues,
- StackFrame::eExpressionPathOptionCheckPtrVsMember ||
- StackFrame::eExpressionPathOptionsAllowDirectIVarAccess ||
- StackFrame::eExpressionPathOptionsNoFragileObjcIvar ||
- StackFrame::eExpressionPathOptionsNoSyntheticChildren ||
+ StackFrame::eExpressionPathOptionCheckPtrVsMember |
+ StackFrame::eExpressionPathOptionsNoFragileObjcIvar |
+ StackFrame::eExpressionPathOptionsNoSyntheticChildren |
StackFrame::eExpressionPathOptionsNoSyntheticArrayRange,
var_sp,
err);
- if (!err.Success())
+ if (!err.Success() || !valobj_sp.get())
return LLDB_INVALID_ADDRESS;
lldb::addr_t ret = valobj_sp->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
@@ -885,17 +884,17 @@ ClangUserExpression::Execute (Stream &error_stream,
args.push_back(struct_address);
- ThreadPlanCallUserExpression *user_expression_plan =
- new ThreadPlanCallUserExpression (exe_ctx.GetThreadRef(),
- wrapper_address,
- args,
- options,
- shared_ptr_to_me);
- lldb::ThreadPlanSP call_plan_sp(user_expression_plan);
+ lldb::ThreadPlanSP call_plan_sp(new ThreadPlanCallUserExpression (exe_ctx.GetThreadRef(),
+ wrapper_address,
+ args,
+ options,
+ shared_ptr_to_me));
if (!call_plan_sp || !call_plan_sp->ValidatePlan (&error_stream))
return lldb::eExpressionSetupError;
+ ThreadPlanCallUserExpression *user_expression_plan = static_cast<ThreadPlanCallUserExpression *>(call_plan_sp.get());
+
lldb::addr_t function_stack_pointer = user_expression_plan->GetFunctionStackPointer();
function_stack_bottom = function_stack_pointer - HostInfo::GetPageSize();
@@ -1070,7 +1069,7 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx,
user_expression_sp,
expr_result);
- if (options.GetResultIsInternal())
+ if (options.GetResultIsInternal() && expr_result && process)
{
process->GetTarget().GetPersistentVariables().RemovePersistentVariable (expr_result);
}
OpenPOWER on IntegriCloud