Fixed the StackFrame to correctly resolve the StackID's SymbolContextScope.

Added extra logging for stepping.

Fixed an issue where cached stack frame data could be lost between runs when
the thread plans read a stack frame.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112973 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ThreadPlan.cpp b/source/Target/ThreadPlan.cpp
index 6d3e99c..9675292 100644
--- a/source/Target/ThreadPlan.cpp
+++ b/source/Target/ThreadPlan.cpp
@@ -13,9 +13,10 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Target/Thread.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/State.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/Thread.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -88,12 +89,21 @@
 Vote
 ThreadPlan::ShouldReportStop (Event *event_ptr)
 {
+    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
+
     if (m_stop_vote == eVoteNoOpinion)
     {
         ThreadPlan *prev_plan = GetPreviousPlan ();
         if (prev_plan)
-            return prev_plan->ShouldReportStop (event_ptr);
+        {
+            Vote prev_vote = prev_plan->ShouldReportStop (event_ptr);
+            if (log)
+                log->Printf ("ThreadPlan::ShouldReportStop() returning previous thread plan vote %s\n", GetVoteAsCString (prev_vote));
+            return prev_vote;
+        }
     }
+    if (log)
+        log->Printf ("ThreadPlan::ShouldReportStop() returning vote %s\n", GetVoteAsCString (m_stop_vote));
     return m_stop_vote;
 }
 
@@ -128,8 +138,21 @@
         Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
 
         if (log)
-            log->Printf("Thread #%u: tid = 0x%4.4x about to resume the \"%s\" plan - state: %s - stop others: %d.", 
-                        m_thread.GetIndexID(), m_thread.GetID(),  m_name.c_str(), StateAsCString(resume_state), StopOthers());
+        {
+            RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+            addr_t pc = reg_ctx->GetPC();
+            addr_t sp = reg_ctx->GetSP();
+            addr_t fp = reg_ctx->GetFP();
+            log->Printf("Thread #%u: tid = 0x%4.4x (pc = 0x%8.8llx, sp = 0x%8.8llx, fp = 0x%8.8llx) about to resume the \"%s\" plan - state: %s - stop others: %d.", 
+                        m_thread.GetIndexID(), 
+                        m_thread.GetID(),  
+                        (uint64_t)pc,
+                        (uint64_t)sp,
+                        (uint64_t)fp,
+                        m_name.c_str(), 
+                        StateAsCString(resume_state), 
+                        StopOthers());
+        }
     }
     return true;
 }