[Lldb-commits] [lldb] r116892 - in /lldb/trunk: include/lldb/Target/ source/API/ source/Core/ source/Expression/ source/Target/

Jim Ingham jingham at apple.com
Tue Oct 19 17:39:53 PDT 2010


Author: jingham
Date: Tue Oct 19 19:39:53 2010
New Revision: 116892

URL: http://llvm.org/viewvc/llvm-project?rev=116892&view=rev
Log:
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.

Modified:
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/include/lldb/Target/ThreadPlan.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Expression/ClangFunction.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/Target/ThreadList.cpp
    lldb/trunk/source/Target/ThreadPlanBase.cpp
    lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
    lldb/trunk/source/Target/ThreadPlanStepOut.cpp
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
    lldb/trunk/source/Target/ThreadPlanTestCondition.cpp

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Tue Oct 19 19:39:53 2010
@@ -235,15 +235,9 @@
     virtual bool
     MatchesSpec (const ThreadSpec *spec);
 
-    StopInfo *
+    lldb::StopInfoSP
     GetStopInfo ();
 
-    void
-    SetStopInfo (lldb::StopInfoSP stop_info_sp)
-    {
-        m_public_stop_info_sp = stop_info_sp;
-    }
-
     bool
     ThreadStoppedForAReason ();
 
@@ -650,18 +644,22 @@
     StackFrameList &
     GetStackFrameList ();
 
+    void
+    SetStopInfo (lldb::StopInfoSP stop_info_sp)
+    {
+        m_actual_stop_info_sp = stop_info_sp;
+    }
+
     //------------------------------------------------------------------
     // Classes that inherit from Process can see and modify these
     //------------------------------------------------------------------
     Process &           m_process;          ///< The process that owns this thread.
-    lldb::StopInfoSP    m_public_stop_info_sp;     ///< The public stop reason for this thread
     lldb::StopInfoSP    m_actual_stop_info_sp;     ///< The private stop reason for this thread
     const uint32_t      m_index_id;         ///< A unique 1 based index assigned to each thread for easy UI/command line access.
     lldb::RegisterContextSP   m_reg_context_sp;   ///< The register context for this thread's current register state.
     lldb::StateType     m_state;            ///< The state of our process.
     mutable Mutex       m_state_mutex;      ///< Multithreaded protection for m_state.
     plan_stack          m_plan_stack;       ///< The stack of plans this thread is executing.
-    plan_stack          m_immediate_plan_stack; ///< The plans that need to get executed before any other work gets done.
     plan_stack          m_completed_plan_stack;  ///< Plans that have been completed by this stop.  They get deleted when the thread resumes.
     plan_stack          m_discarded_plan_stack;  ///< Plans that have been discarded by this stop.  They get deleted when the thread resumes.
     std::auto_ptr<StackFrameList> m_curr_frames_ap; ///< The stack frames that get lazily populated after a thread stops.

Modified: lldb/trunk/include/lldb/Target/ThreadPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlan.h?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlan.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlan.h Tue Oct 19 19:39:53 2010
@@ -18,6 +18,7 @@
 #include "lldb/lldb-private.h"
 #include "lldb/Core/UserID.h"
 #include "lldb/Host/Mutex.h"
+#include "lldb/Target/Thread.h"
 
 namespace lldb_private {
 
@@ -40,20 +41,6 @@
 //  of the running process.
 //
 //
-//  DEPRECATED: This ended up causing a real hassle, too many cases where the immediate plan
-//  got stranded.  So the better way to do this is to post any plans you need to do right before
-//  running in the PrepareToResume method.
-//f
-//  Immediate Plans:
-//
-//  One other complexity of the plan stack is that sometimes you need to do a piece of work immediately
-//  on resume, regardless of what other plans have been pushed on the stack while the process has
-//  been stopped.  The classic example is stepping over a breakpoint.  To that end the plan stack is
-//  actually two stacks, an "immediate" plan stack and the normal plan stack.  A plan can indicate that it
-//  should go on the immediate plan stack by returning "true" from the IsImmediate method.
-//
-//  END DEPRECATED...
-//
 //  Creating Plans:
 //
 //  The thread plan is generally created and added to the plan stack through the QueueThreadPlanFor... API
@@ -247,18 +234,6 @@
                     lldb::DescriptionLevel level) = 0;
 
     //------------------------------------------------------------------
-    /// Returns whether this plan needs to be executed immediatly on resume.
-    ///
-    /// @return
-    ///   \b true if the plan is immediate, \b false otherwise.
-    //------------------------------------------------------------------
-    virtual bool
-    IsImmediate() const
-    {
-        return false;
-    }
-
-    //------------------------------------------------------------------
     /// Returns whether this plan could be successfully created.
     ///
     /// @param[in] error
@@ -362,6 +337,21 @@
 
     ThreadPlan *
     GetPreviousPlan ();
+    
+    // This forwards the private Thread::GetPrivateStopReason which is generally what
+    // ThreadPlan's need to know.
+    
+    lldb::StopInfoSP 
+    GetPrivateStopReason()
+    {
+        return m_thread.GetPrivateStopReason();
+    }
+    
+    void
+    SetStopInfo (lldb::StopInfoSP stop_reason_sp)
+    {
+        m_thread.SetStopInfo (stop_reason_sp);
+    }
 
     Thread &m_thread;
     lldb::Vote m_stop_vote;

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h Tue Oct 19 19:39:53 2010
@@ -31,10 +31,6 @@
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType RunState ();
-    virtual bool IsImmediate () const
-    {
-        return false;
-    }
     virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();

Modified: lldb/trunk/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Tue Oct 19 19:39:53 2010
@@ -81,9 +81,9 @@
 {
     if (m_opaque_sp)
     {
-        lldb_private::StopInfo *stop_info = m_opaque_sp->GetStopInfo ();
-        if (stop_info)
-            return stop_info->GetStopReason();
+        StopInfoSP stop_info_sp = m_opaque_sp->GetStopInfo ();
+        if (stop_info_sp)
+            return stop_info_sp->GetStopReason();
     }
     return eStopReasonInvalid;
 }
@@ -93,10 +93,10 @@
 {
     if (m_opaque_sp)
     {
-        lldb_private::StopInfo *stop_info = m_opaque_sp->GetStopInfo ();
-        if (stop_info)
+        StopInfoSP stop_info_sp = m_opaque_sp->GetStopInfo ();
+        if (stop_info_sp)
         {
-            const char *stop_desc = stop_info->GetDescription();
+            const char *stop_desc = stop_info_sp->GetDescription();
             if (stop_desc)
             {
                 if (dst)
@@ -110,7 +110,7 @@
             else
             {
                 size_t stop_desc_len = 0;
-                switch (stop_info->GetStopReason())
+                switch (stop_info_sp->GetStopReason())
                 {
                 case eStopReasonTrace:
                 case eStopReasonPlanComplete:
@@ -139,7 +139,7 @@
 
                 case eStopReasonSignal:
                     {
-                        stop_desc = m_opaque_sp->GetProcess().GetUnixSignals ().GetSignalAsCString (stop_info->GetValue());
+                        stop_desc = m_opaque_sp->GetProcess().GetUnixSignals ().GetSignalAsCString (stop_info_sp->GetValue());
                         if (stop_desc == NULL || stop_desc[0] == '\0')
                         {
                             static char signal_desc[] = "signal";

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Tue Oct 19 19:39:53 2010
@@ -799,10 +799,10 @@
                                     }
                                     else if (::strncmp (var_name_begin, "stop-reason}", strlen("stop-reason}")) == 0)
                                     {
-                                        lldb_private::StopInfo *stop_info = exe_ctx->thread->GetStopInfo ();
-                                        if (stop_info)
+                                        StopInfoSP stop_info_sp = exe_ctx->thread->GetStopInfo ();
+                                        if (stop_info_sp)
                                         {
-                                            cstr = stop_info->GetDescription();
+                                            cstr = stop_info_sp->GetDescription();
                                             if (cstr && cstr[0])
                                             {
                                                 s.PutCString(cstr);

Modified: lldb/trunk/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangFunction.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangFunction.cpp (original)
+++ lldb/trunk/source/Expression/ClangFunction.cpp Tue Oct 19 19:39:53 2010
@@ -662,10 +662,10 @@
                         else
                             ts.Printf("[ip unknown] ");
                         
-                        StopInfo *stop_info = thread->GetStopInfo();
-                        if (stop_info)
+                        lldb::StopInfoSP stop_info_sp = thread->GetStopInfo();
+                        if (stop_info_sp)
                         {
-                            const char *stop_desc = stop_info->GetDescription();
+                            const char *stop_desc = stop_info_sp->GetDescription();
                             if (stop_desc)
                                 ts.PutCString (stop_desc);
                         }

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Oct 19 19:39:53 2010
@@ -1734,10 +1734,10 @@
         {
             lldb::ThreadSP thread_sp = m_process_sp->GetThreadList().GetThreadAtIndex(idx);
 
-            StopInfo *stop_info = thread_sp->GetStopInfo ();
-            if (stop_info)
+            StopInfoSP stop_info_sp = thread_sp->GetStopInfo ();
+            if (stop_info_sp)
             {
-                stop_info->PerformAction(event_ptr);
+                stop_info_sp->PerformAction(event_ptr);
             }
         }
         

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Tue Oct 19 19:39:53 2010
@@ -44,14 +44,12 @@
     UserID (tid),
     ThreadInstanceSettings (*(Thread::GetSettingsController().get())),
     m_process (process),
-    m_public_stop_info_sp (),
     m_actual_stop_info_sp (),
     m_index_id (process.GetNextThreadIndexID ()),
     m_reg_context_sp (),
     m_state (eStateUnloaded),
     m_state_mutex (Mutex::eMutexTypeRecursive),
     m_plan_stack (),
-    m_immediate_plan_stack(),
     m_completed_plan_stack(),
     m_curr_frames_ap (),
     m_resume_signal (LLDB_INVALID_SIGNAL_NUMBER),
@@ -99,18 +97,14 @@
     m_resume_state = state;
 }
 
-StopInfo *
+lldb::StopInfoSP
 Thread::GetStopInfo ()
 {
-    if (m_public_stop_info_sp.get() == NULL)
-    {
-        ThreadPlanSP plan_sp (GetCompletedPlan());
-        if (plan_sp)
-            m_public_stop_info_sp = StopInfo::CreateStopReasonWithPlan (plan_sp);
-        else
-            m_public_stop_info_sp = GetPrivateStopReason ();
-    }
-    return m_public_stop_info_sp.get();
+    ThreadPlanSP plan_sp (GetCompletedPlan());
+    if (plan_sp)
+        return StopInfo::CreateStopReasonWithPlan (plan_sp);
+    else
+        return GetPrivateStopReason ();
 }
 
 bool
@@ -210,7 +204,6 @@
         plan_ptr->WillResume (resume_state, false);
     }
     
-    m_public_stop_info_sp.reset();
     m_actual_stop_info_sp.reset();
     return true;
 }
@@ -353,10 +346,7 @@
 {
     if (thread_plan_sp)
     {
-        if (thread_plan_sp->IsImmediate())
-            m_immediate_plan_stack.push_back (thread_plan_sp);
-        else
-            m_plan_stack.push_back (thread_plan_sp);
+        m_plan_stack.push_back (thread_plan_sp);
 
         thread_plan_sp->DidPush();
 
@@ -365,10 +355,9 @@
         {
             StreamString s;
             thread_plan_sp->GetDescription (&s, lldb::eDescriptionLevelFull);
-            log->Printf("Pushing plan: \"%s\", tid = 0x%4.4x, immediate = %s.",
+            log->Printf("Pushing plan: \"%s\", tid = 0x%4.4x.",
                         s.GetData(),
-                        thread_plan_sp->GetThread().GetID(),
-                        thread_plan_sp->IsImmediate() ? "true" : "false");
+                        thread_plan_sp->GetThread().GetID());
         }
     }
 }
@@ -378,17 +367,7 @@
 {
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
 
-    if (!m_immediate_plan_stack.empty())
-    {
-        ThreadPlanSP &plan = m_immediate_plan_stack.back();
-        if (log)
-        {
-            log->Printf("Popping plan: \"%s\", tid = 0x%4.4x, immediate = true.", plan->GetName(), plan->GetThread().GetID());
-        }
-        plan->WillPop();
-        m_immediate_plan_stack.pop_back();
-    }
-    else if (m_plan_stack.empty())
+    if (m_plan_stack.empty())
         return;
     else
     {
@@ -418,9 +397,7 @@
 ThreadPlan *
 Thread::GetCurrentPlan ()
 {
-    if (!m_immediate_plan_stack.empty())
-        return m_immediate_plan_stack.back().get();
-    else if (m_plan_stack.empty())
+    if (m_plan_stack.empty())
         return NULL;
     else
         return m_plan_stack.back().get();
@@ -488,22 +465,6 @@
 
     if (stack_size > 0 && m_completed_plan_stack[0].get() == current_plan)
     {
-        if (m_immediate_plan_stack.size() > 0)
-            return m_immediate_plan_stack.back().get();
-        else if (m_plan_stack.size() > 0)
-            return m_plan_stack.back().get();
-        else
-            return NULL;
-    }
-
-    stack_size = m_immediate_plan_stack.size();
-    for (int i = stack_size - 1; i > 0; i--)
-    {
-        if (current_plan == m_immediate_plan_stack[i].get())
-            return m_immediate_plan_stack[i-1].get();
-    }
-    if (stack_size > 0 && m_immediate_plan_stack[0].get() == current_plan)
-    {
         if (m_plan_stack.size() > 0)
             return m_plan_stack.back().get();
         else
@@ -751,17 +712,6 @@
         s->EOL();
     }
 
-    stack_size = m_immediate_plan_stack.size();
-    s->Printf ("Immediate Plan Stack: %d elements.\n", stack_size);
-    for (i = stack_size - 1; i >= 0; i--)
-    {
-        s->Printf ("Element %d: ", i);
-        s->IndentMore();
-        m_immediate_plan_stack[i]->GetDescription (s, eDescriptionLevelFull);
-        s->IndentLess();
-        s->EOL();
-    }
-
     stack_size = m_completed_plan_stack.size();
     s->Printf ("Completed Plan Stack: %d elements.\n", stack_size);
     for (i = stack_size - 1; i >= 0; i--)

Modified: lldb/trunk/source/Target/ThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadList.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadList.cpp (original)
+++ lldb/trunk/source/Target/ThreadList.cpp Tue Oct 19 19:39:53 2010
@@ -430,15 +430,7 @@
     for (pos = m_threads.begin(); pos != end; ++pos)
     {
         ThreadSP thread_sp(*pos);
-        if (thread_sp->GetCurrentPlan()->IsImmediate())
-        {
-            // We first do all the immediate plans, so if we find one, set
-            // immediate_thread_sp and break out, and we'll pick it up first thing
-            // when we're negotiating which threads get to run.
-            immediate_thread_sp = thread_sp;
-            break;
-        }
-        else if (thread_sp->GetResumeState() != eStateSuspended &&
+        if (thread_sp->GetResumeState() != eStateSuspended &&
                  thread_sp->GetCurrentPlan()->StopOthers())
         {
             // You can't say "stop others" and also want yourself to be suspended.

Modified: lldb/trunk/source/Target/ThreadPlanBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanBase.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanBase.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanBase.cpp Tue Oct 19 19:39:53 2010
@@ -67,10 +67,10 @@
     m_stop_vote = eVoteYes;
     m_run_vote = eVoteYes;
 
-    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)
         {
         case eStopReasonInvalid:
@@ -80,7 +80,7 @@
             return false;
 
         case eStopReasonBreakpoint:
-            if (stop_info->ShouldStop(event_ptr))
+            if (stop_info_sp->ShouldStop(event_ptr))
             {
                 // If we are going to stop for a breakpoint, then unship the other plans
                 // at this point.  Don't force the discard, however, so Master plans can stay
@@ -92,7 +92,7 @@
             // don't report this stop or the subsequent running event.  
             // Otherwise we will post the stopped & running, but the stopped event will get marked
             // with "restarted" so the UI will know to wait and expect the consequent "running".
-            if (stop_info->ShouldNotify (event_ptr))
+            if (stop_info_sp->ShouldNotify (event_ptr))
             {
                 m_stop_vote = eVoteYes;
                 m_run_vote = eVoteYes;
@@ -115,7 +115,7 @@
             return true;
 
         case eStopReasonSignal:
-            if (stop_info->ShouldStop(event_ptr))
+            if (stop_info_sp->ShouldStop(event_ptr))
             {
                 m_thread.DiscardThreadPlans(false);
                 return true;
@@ -124,7 +124,7 @@
             {
                 // We're not going to stop, but while we are here, let's figure out
                 // whether to report this.
-                 if (stop_info->ShouldNotify(event_ptr))
+                 if (stop_info_sp->ShouldNotify(event_ptr))
                     m_stop_vote = eVoteYes;
                 else
                     m_stop_vote = eVoteNo;

Modified: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp Tue Oct 19 19:39:53 2010
@@ -84,10 +84,10 @@
 bool
 ThreadPlanStepInstruction::PlanExplainsStop ()
 {
-    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();
         if (reason == eStopReasonTrace || reason == eStopReasonNone)
             return true;
         else

Modified: lldb/trunk/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOut.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOut.cpp Tue Oct 19 19:39:53 2010
@@ -104,16 +104,16 @@
 {
     // 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)
         {
         case eStopReasonBreakpoint:
         {
             // If this is OUR breakpoint, we're fine, otherwise we don't know why this happened...
-            BreakpointSiteSP site_sp (m_thread.GetProcess().GetBreakpointSiteList().FindByID (stop_info->GetValue()));
+            BreakpointSiteSP site_sp (m_thread.GetProcess().GetBreakpointSiteList().FindByID (stop_info_sp->GetValue()));
             if (site_sp && site_sp->IsBreakpointAtThisSite (m_return_bp_id))
             {
                 // If there was only one owner, then we're done.  But if we also hit some

Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Tue Oct 19 19:39:53 2010
@@ -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)
         {

Modified: lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepUntil.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepUntil.cpp Tue Oct 19 19:39:53 2010
@@ -170,20 +170,20 @@
     if (m_ran_analyze)
         return;
         
-    StopInfo *stop_info = m_thread.GetStopInfo();
+    StopInfoSP stop_info_sp = GetPrivateStopReason();
     m_should_stop = true;
     m_explains_stop = false;
     
-    if (stop_info)
+    if (stop_info_sp)
     {
-        StopReason reason = stop_info->GetStopReason();
+        StopReason reason = stop_info_sp->GetStopReason();
 
         switch (reason)
         {
             case eStopReasonBreakpoint:
             {
                 // If this is OUR breakpoint, we're fine, otherwise we don't know why this happened...
-                BreakpointSiteSP this_site = m_thread.GetProcess().GetBreakpointSiteList().FindByID (stop_info->GetValue());
+                BreakpointSiteSP this_site = m_thread.GetProcess().GetBreakpointSiteList().FindByID (stop_info_sp->GetValue());
                 if (!this_site)
                 {
                     m_explains_stop = false;
@@ -275,8 +275,8 @@
     // do so here.  Otherwise, as long as this thread has stopped for a reason,
     // we will stop.
 
-    StopInfo *stop_info = m_thread.GetStopInfo ();
-    if (stop_info == NULL || stop_info->GetStopReason() == eStopReasonNone)
+    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    if (stop_info_sp == NULL || stop_info_sp->GetStopReason() == eStopReasonNone)
         return false;
 
     AnalyzeStop();

Modified: lldb/trunk/source/Target/ThreadPlanTestCondition.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTestCondition.cpp?rev=116892&r1=116891&r2=116892&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTestCondition.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTestCondition.cpp Tue Oct 19 19:39:53 2010
@@ -110,9 +110,9 @@
     Process::ProcessEventData *new_data = new Process::ProcessEventData (m_thread.GetProcess().GetSP(), eStateStopped);
     event_ptr->SetData(new_data);
     event_ptr->SetType(Process::eBroadcastBitStateChanged);
-    m_thread.SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID (m_thread, 
-                                                                         m_break_loc_sp->GetBreakpointSite()->GetID(),
-                                                                         m_did_stop));
+    SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID (m_thread, 
+                                                                m_break_loc_sp->GetBreakpointSite()->GetID(),
+                                                                m_did_stop));
     if (m_did_stop)
     {
         Process::ProcessEventData::SetRestartedInEvent (event_ptr, false);





More information about the lldb-commits mailing list