Add the ability to capture the return value in a thread's stop info, and print it
as part of the thread format output.
Currently this is only done for the ThreadPlanStepOut.
Add a convenience API ABI::GetReturnValueObject.
Change the ValueObject::EvaluationPoint to BE an ExecutionContextScope, rather than
trying to hand out one of its subsidiary object's pointers. That way this will always
be good.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146806 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index e4415b7..6fe6ec7 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -95,7 +95,7 @@
{
ThreadPlanSP plan_sp (GetCompletedPlan());
if (plan_sp)
- return StopInfo::CreateStopReasonWithPlan (plan_sp);
+ return StopInfo::CreateStopReasonWithPlan (plan_sp, GetReturnValueObject());
else
{
if (m_actual_stop_info_sp
@@ -551,6 +551,22 @@
return empty_plan_sp;
}
+ValueObjectSP
+Thread::GetReturnValueObject ()
+{
+ if (!m_completed_plan_stack.empty())
+ {
+ for (int i = m_completed_plan_stack.size() - 1; i >= 0; i--)
+ {
+ ValueObjectSP return_valobj_sp;
+ return_valobj_sp = m_completed_plan_stack[i]->GetReturnValueObject();
+ if (return_valobj_sp)
+ return return_valobj_sp;
+ }
+ }
+ return ValueObjectSP();
+}
+
bool
Thread::IsThreadPlanDone (ThreadPlan *plan)
{