[Lldb-commits] [lldb] r187173 - Refine the fix in r187094 to only distrust the StackID comparision when we are starting from an address with no symbols.

Jim Ingham jingham at apple.com
Thu Jul 25 17:27:57 PDT 2013


Author: jingham
Date: Thu Jul 25 19:27:57 2013
New Revision: 187173

URL: http://llvm.org/viewvc/llvm-project?rev=187173&view=rev
Log:
Refine the fix in r187094 to only distrust the StackID comparision when we are starting from an address with no symbols.
If we don't do that "nexti" will stop too soon when stepping past a tail call jump.

rdar://problem/14516227

Modified:
    lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
    lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h?rev=187173&r1=187172&r2=187173&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h Thu Jul 25 19:27:57 2013
@@ -50,6 +50,7 @@ private:
     bool m_stop_other_threads;
     bool m_step_over;
     // These two are used only for the step over case.
+    bool m_start_has_symbol;
     StackID m_stack_id;
     StackID m_parent_frame_id;
 

Modified: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=187173&r1=187172&r2=187173&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp Thu Jul 25 19:27:57 2013
@@ -44,7 +44,11 @@ ThreadPlanStepInstruction::ThreadPlanSte
     m_step_over (step_over)
 {
     m_instruction_addr = m_thread.GetRegisterContext()->GetPC(0);
-    m_stack_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
+    StackFrameSP m_start_frame_sp(m_thread.GetStackFrameAtIndex(0));
+    m_stack_id = m_start_frame_sp->GetStackID();
+    
+    m_start_has_symbol = m_start_frame_sp->GetSymbolContext(eSymbolContextSymbol).symbol != NULL;
+    
     StackFrameSP parent_frame_sp = m_thread.GetStackFrameAtIndex(1);
     if (parent_frame_sp)
         m_parent_frame_id = parent_frame_sp->GetStackID();
@@ -68,6 +72,9 @@ ThreadPlanStepInstruction::GetDescriptio
     {
         s->Printf ("Stepping one instruction past ");
         s->Address(m_instruction_addr, sizeof (addr_t));
+        if (!m_start_has_symbol)
+            s->Printf(" which has no symbol");
+        
         if (m_step_over)
             s->Printf(" stepping over calls");
         else
@@ -123,7 +130,7 @@ ThreadPlanStepInstruction::ShouldStop (E
             StackFrame *return_frame = m_thread.GetStackFrameAtIndex(1).get();
             if (return_frame)
             {
-                if (return_frame->GetStackID() != m_parent_frame_id)
+                if (return_frame->GetStackID() != m_parent_frame_id || m_start_has_symbol)
                 {
                     if (log)
                     {
@@ -153,7 +160,7 @@ ThreadPlanStepInstruction::ShouldStop (E
                 {
                     if (log)
                     {
-                        log->PutCString("The stack id we are stepping in changed, but our parent frame did not.  "
+                        log->PutCString("The stack id we are stepping in changed, but our parent frame did not when stepping from code with no symbols.  "
                         "We are probably just confused about where we are, stopping.");
                     }
                     SetPlanComplete();





More information about the lldb-commits mailing list