summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangUserExpression.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-07-08 01:07:32 +0000
committerJim Ingham <jingham@apple.com>2014-07-08 01:07:32 +0000
commit30fadafefe67e531c809496c0f4e40593f6964db (patch)
treeff00cddd2a8dabab018500c17fbeb45fb9eb745f /lldb/source/Expression/ClangUserExpression.cpp
parentc94285a1a02f8432f74d6c63ab7357a96497f177 (diff)
downloadbcm5719-llvm-30fadafefe67e531c809496c0f4e40593f6964db.tar.gz
bcm5719-llvm-30fadafefe67e531c809496c0f4e40593f6964db.zip
If a hand-called function is interrupted by hitting a breakpoint, then
when you continue to finish off the function call, the expression result will be included as part of the thread stop info. llvm-svn: 212506
Diffstat (limited to 'lldb/source/Expression/ClangUserExpression.cpp')
-rw-r--r--lldb/source/Expression/ClangUserExpression.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index 8f580024821..62f2869dd4b 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -884,17 +884,19 @@ ClangUserExpression::Execute (Stream &error_stream,
}
args.push_back(struct_address);
-
- lldb::ThreadPlanSP call_plan_sp(new ThreadPlanCallUserExpression (exe_ctx.GetThreadRef(),
- wrapper_address,
- args,
- options,
- shared_ptr_to_me));
+
+ 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);
if (!call_plan_sp || !call_plan_sp->ValidatePlan (&error_stream))
return lldb::eExpressionSetupError;
- lldb::addr_t function_stack_pointer = static_cast<ThreadPlanCallFunction *>(call_plan_sp.get())->GetFunctionStackPointer();
+ lldb::addr_t function_stack_pointer = user_expression_plan->GetFunctionStackPointer();
function_stack_bottom = function_stack_pointer - Host::GetPageSize();
function_stack_top = function_stack_pointer;
@@ -935,8 +937,12 @@ ClangUserExpression::Execute (Stream &error_stream,
|| (execution_result == lldb::eExpressionHitBreakpoint && options.DoesIgnoreBreakpoints()))
error_stream.PutCString ("\nThe process has been returned to the state before expression evaluation.");
else
+ {
+ if (execution_result == lldb::eExpressionHitBreakpoint)
+ user_expression_plan->TransferExpressionOwnership();
error_stream.PutCString ("\nThe process has been left at the point where it was interrupted, "
"use \"thread return -x\" to return to the state before expression evaluation.");
+ }
return execution_result;
}
OpenPOWER on IntegriCloud