Don't cache the public stop reason, since it can change as plan completion gets processed. That means GetStopReason needs to return a shared pointer, not a pointer to the thread's cached version. Also allow the thread plans to get and set the thread private stop reason - that is usually more appropriate for the logic the thread plans need to do.
llvm-svn: 116892
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp
index afc9773..2b0c0c7 100644
--- a/lldb/source/Target/ThreadPlanStepRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepRange.cpp
@@ -62,10 +62,10 @@
{
// We don't explain signals or breakpoints (breakpoints that handle stepping in or
// out will be handled by a child plan.
- StopInfo *stop_info = m_thread.GetStopInfo();
- if (stop_info)
+ StopInfoSP stop_info_sp = GetPrivateStopReason();
+ if (stop_info_sp)
{
- StopReason reason = stop_info->GetStopReason();
+ StopReason reason = stop_info_sp->GetStopReason();
switch (reason)
{