diff options
author | Jim Ingham <jingham@apple.com> | 2014-07-08 01:07:32 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-07-08 01:07:32 +0000 |
commit | 30fadafefe67e531c809496c0f4e40593f6964db (patch) | |
tree | ff00cddd2a8dabab018500c17fbeb45fb9eb745f /lldb/source/Target/ThreadPlanCallUserExpression.cpp | |
parent | c94285a1a02f8432f74d6c63ab7357a96497f177 (diff) | |
download | bcm5719-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/Target/ThreadPlanCallUserExpression.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanCallUserExpression.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/lldb/source/Target/ThreadPlanCallUserExpression.cpp b/lldb/source/Target/ThreadPlanCallUserExpression.cpp index 55aa26f4dd9..a7d627f2579 100644 --- a/lldb/source/Target/ThreadPlanCallUserExpression.cpp +++ b/lldb/source/Target/ThreadPlanCallUserExpression.cpp @@ -56,7 +56,54 @@ ThreadPlanCallUserExpression::~ThreadPlanCallUserExpression () void ThreadPlanCallUserExpression::GetDescription (Stream *s, lldb::DescriptionLevel level) { - ThreadPlanCallFunction::GetDescription (s, level); + if (level == eDescriptionLevelBrief) + s->Printf("User Expression thread plan"); + else + ThreadPlanCallFunction::GetDescription (s, level); +} + +void +ThreadPlanCallUserExpression::WillPop () +{ + ThreadPlanCallFunction::WillPop(); + if (m_user_expression_sp) + m_user_expression_sp.reset(); +} + +bool +ThreadPlanCallUserExpression::MischiefManaged () +{ + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + + if (IsPlanComplete()) + { + if (log) + log->Printf("ThreadPlanCallFunction(%p): Completed call function plan.", + static_cast<void*>(this)); + + if (m_manage_materialization && PlanSucceeded() && m_user_expression_sp) + { + lldb::addr_t function_stack_top; + lldb::addr_t function_stack_bottom; + lldb::addr_t function_stack_pointer = GetFunctionStackPointer(); + + function_stack_bottom = function_stack_pointer - Host::GetPageSize(); + function_stack_top = function_stack_pointer; + + StreamString error_stream; + + ExecutionContext exe_ctx(GetThread()); + + m_user_expression_sp->FinalizeJITExecution(error_stream, exe_ctx, m_result_var_sp, function_stack_bottom, function_stack_top); + } + + ThreadPlan::MischiefManaged (); + return true; + } + else + { + return false; + } } StopInfoSP |