[Lldb-commits] [lldb] r183177 - If ThreadPlanCallFunction hasn't set its notion of the "real stop info" yet, just return the current PrivateStopInfo.

Jim Ingham jingham at apple.com
Mon Jun 3 18:40:51 PDT 2013


Author: jingham
Date: Mon Jun  3 20:40:51 2013
New Revision: 183177

URL: http://llvm.org/viewvc/llvm-project?rev=183177&view=rev
Log:
If ThreadPlanCallFunction hasn't set its notion of the "real stop info" yet, just return the current PrivateStopInfo.

Also renamed a few more places where we were using StopReason in functions that were returning StopInfo's.

<rdar://problem/14042692>

Modified:
    lldb/trunk/include/lldb/Target/ThreadPlan.h
    lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h
    lldb/trunk/source/Target/ThreadPlanBase.cpp
    lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
    lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
    lldb/trunk/source/Target/ThreadPlanStepOut.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepUntil.cpp

Modified: lldb/trunk/include/lldb/Target/ThreadPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlan.h?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlan.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlan.h Mon Jun  3 20:40:51 2013
@@ -544,11 +544,11 @@ protected:
         return m_thread.GetPreviousPlan (this);
     }
     
-    // This forwards the private Thread::GetPrivateStopReason which is generally what
+    // This forwards the private Thread::GetPrivateStopInfo which is generally what
     // ThreadPlan's need to know.
     
     lldb::StopInfoSP 
-    GetPrivateStopReason()
+    GetPrivateStopInfo()
     {
         return m_thread.GetPrivateStopInfo ();
     }

Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h Mon Jun  3 20:40:51 2013
@@ -115,12 +115,17 @@ public:
     
     // If the thread plan stops mid-course, this will be the stop reason that interrupted us.
     // Once DoTakedown is called, this will be the real stop reason at the end of the function call.
+    // If it hasn't been set for one or the other of these reasons, we'll return the PrivateStopReason.
     // This is needed because we want the CallFunction thread plans not to show up as the stop reason.
     // But if something bad goes wrong, it is nice to be able to tell the user what really happened.
+
     virtual lldb::StopInfoSP
     GetRealStopInfo()
     {
-        return m_real_stop_info_sp;
+        if (m_real_stop_info_sp)
+            return m_real_stop_info_sp;
+        else
+            return GetPrivateStopInfo ();
     }
     
     lldb::addr_t

Modified: lldb/trunk/source/Target/ThreadPlanBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanBase.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanBase.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanBase.cpp Mon Jun  3 20:40:51 2013
@@ -102,10 +102,10 @@ ThreadPlanBase::ShouldStop (Event *event
 
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
 
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     if (stop_info_sp)
     {
-        StopReason reason = stop_info_sp->GetStopReason();
+        StopReason reason = stop_info_sp->GetStopReason ();
         switch (reason)
         {
         case eStopReasonInvalid:

Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Mon Jun  3 20:40:51 2013
@@ -298,7 +298,7 @@ ThreadPlanCallFunction::DoTakedown (bool
             log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n", this, m_thread.GetID(), m_valid, IsPlanComplete());
         m_takedown_done = true;
         m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
-        m_real_stop_info_sp = GetPrivateStopReason();
+        m_real_stop_info_sp = GetPrivateStopInfo ();
         m_thread.RestoreRegisterStateFromCheckpoint(m_stored_thread_state);
         SetPlanComplete(success);
         ClearBreakpoints();
@@ -365,7 +365,7 @@ bool
 ThreadPlanCallFunction::DoPlanExplainsStop (Event *event_ptr)
 {    
     Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP|LIBLLDB_LOG_PROCESS));
-    m_real_stop_info_sp = GetPrivateStopReason();
+    m_real_stop_info_sp = GetPrivateStopInfo ();
     
     // If our subplan knows why we stopped, even if it's done (which would forward the question to us)
     // we answer yes.
@@ -584,7 +584,7 @@ ThreadPlanCallFunction::ClearBreakpoints
 bool
 ThreadPlanCallFunction::BreakpointsExplainStop()
 {
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     
     if ((m_cxx_language_runtime &&
             m_cxx_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp))

Modified: lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp Mon Jun  3 20:40:51 2013
@@ -67,12 +67,16 @@ StopInfoSP
 ThreadPlanCallUserExpression::GetRealStopInfo()
 {
     StopInfoSP stop_info_sp = ThreadPlanCallFunction::GetRealStopInfo();
-    lldb::addr_t addr = GetStopAddress();
-    DynamicCheckerFunctions *checkers = m_thread.GetProcess()->GetDynamicCheckers();
-    StreamString s;
     
-    if (checkers && checkers->DoCheckersExplainStop(addr, s))
-        stop_info_sp->SetDescription(s.GetData());
+    if (stop_info_sp)
+    {
+        lldb::addr_t addr = GetStopAddress();
+        DynamicCheckerFunctions *checkers = m_thread.GetProcess()->GetDynamicCheckers();
+        StreamString s;
+        
+        if (checkers && checkers->DoCheckersExplainStop(addr, s))
+            stop_info_sp->SetDescription(s.GetData());
+    }
 
     return stop_info_sp;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Mon Jun  3 20:40:51 2013
@@ -403,7 +403,7 @@ ThreadPlanStepInRange::DoPlanExplainsSto
     }
     else
     {
-        StopInfoSP stop_info_sp = GetPrivateStopReason();
+        StopInfoSP stop_info_sp = GetPrivateStopInfo ();
         if (stop_info_sp)
         {
             StopReason reason = stop_info_sp->GetStopReason();

Modified: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp Mon Jun  3 20:40:51 2013
@@ -83,7 +83,7 @@ ThreadPlanStepInstruction::ValidatePlan
 bool
 ThreadPlanStepInstruction::DoPlanExplainsStop (Event *event_ptr)
 {
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     if (stop_info_sp)
     {
         StopReason reason = stop_info_sp->GetStopReason();

Modified: lldb/trunk/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOut.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOut.cpp Mon Jun  3 20:40:51 2013
@@ -200,7 +200,7 @@ ThreadPlanStepOut::DoPlanExplainsStop (E
     // We don't explain signals or breakpoints (breakpoints that handle stepping in or
     // out will be handled by a child plan.
     
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     if (stop_info_sp)
     {
         StopReason reason = stop_info_sp->GetStopReason();

Modified: lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp Mon Jun  3 20:40:51 2013
@@ -61,7 +61,7 @@ ThreadPlanStepOverBreakpoint::ValidatePl
 bool
 ThreadPlanStepOverBreakpoint::DoPlanExplainsStop (Event *event_ptr)
 {
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     if (stop_info_sp)
     {
         StopReason reason = stop_info_sp->GetStopReason();

Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Mon Jun  3 20:40:51 2013
@@ -300,7 +300,7 @@ ThreadPlanStepOverRange::DoPlanExplainsS
     // unexplained breakpoint/crash.
     
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     bool return_value;
     
     if (stop_info_sp)

Modified: lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepUntil.cpp?rev=183177&r1=183176&r2=183177&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepUntil.cpp Mon Jun  3 20:40:51 2013
@@ -176,7 +176,7 @@ ThreadPlanStepUntil::AnalyzeStop()
     if (m_ran_analyze)
         return;
         
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     m_should_stop = true;
     m_explains_stop = false;
     
@@ -320,7 +320,7 @@ ThreadPlanStepUntil::ShouldStop (Event *
     // do so here.  Otherwise, as long as this thread has stopped for a reason,
     // we will stop.
 
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
+    StopInfoSP stop_info_sp = GetPrivateStopInfo ();
     if (!stop_info_sp || stop_info_sp->GetStopReason() == eStopReasonNone)
         return false;
 





More information about the lldb-commits mailing list