summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanCallUserExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallUserExpression.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanCallUserExpression.cpp49
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
OpenPOWER on IntegriCloud