[Lldb-commits] [lldb] r215411 - Fetching the parent frame may fail, handle that case. Patch from Tong Shen.

Jim Ingham jingham at apple.com
Mon Aug 11 16:57:43 PDT 2014


Author: jingham
Date: Mon Aug 11 18:57:43 2014
New Revision: 215411

URL: http://llvm.org/viewvc/llvm-project?rev=215411&view=rev
Log:
Fetching the parent frame may fail, handle that case.  Patch from Tong Shen.

Modified:
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepUntil.cpp

Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=215411&r1=215410&r2=215411&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Mon Aug 11 18:57:43 2014
@@ -58,7 +58,9 @@ ThreadPlanStepRange::ThreadPlanStepRange
     m_use_fast_step = GetTarget().GetUseFastStepping();
     AddRange(range);
     m_stack_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
-    m_parent_stack_id = m_thread.GetStackFrameAtIndex(1)->GetStackID();
+    StackFrameSP parent_stack = m_thread.GetStackFrameAtIndex(1);
+    if (parent_stack)
+      m_parent_stack_id = parent_stack->GetStackID();
 }
 
 ThreadPlanStepRange::~ThreadPlanStepRange ()
@@ -272,7 +274,10 @@ ThreadPlanStepRange::CompareCurrentFrame
     }
     else
     {
-        StackID cur_parent_id = m_thread.GetStackFrameAtIndex(1)->GetStackID();
+        StackFrameSP cur_parent_frame = m_thread.GetStackFrameAtIndex(1);
+        StackID cur_parent_id;
+        if (cur_parent_frame)
+          cur_parent_id = cur_parent_frame->GetStackID();
         if (m_parent_stack_id.IsValid()
             && cur_parent_id.IsValid()
             && m_parent_stack_id == cur_parent_id)

Modified: lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepUntil.cpp?rev=215411&r1=215410&r2=215411&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepUntil.cpp Mon Aug 11 18:57:43 2014
@@ -77,7 +77,7 @@ ThreadPlanStepUntil::ThreadPlanStepUntil
             }
         }
 
-        m_stack_id = m_thread.GetStackFrameAtIndex(frame_idx)->GetStackID();
+        m_stack_id = frame_sp->GetStackID();
 
         // Now set breakpoints on all our return addresses:
         for (size_t i = 0; i < num_addresses; i++)





More information about the lldb-commits mailing list