[Lldb-commits] [lldb] r161086 - in /lldb/trunk/source/Target: Thread.cpp ThreadPlanStepOut.cpp

Sean Callanan scallanan at apple.com
Tue Jul 31 15:19:26 PDT 2012


Author: spyffe
Date: Tue Jul 31 17:19:25 2012
New Revision: 161086

URL: http://llvm.org/viewvc/llvm-project?rev=161086&view=rev
Log:
Fixed a problem where stepping out would turn into
a continue if the unwinder didn't unwind correctly.

<rdar://problem/11989668>

Modified:
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/Target/ThreadPlanStepOut.cpp

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=161086&r1=161085&r2=161086&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Tue Jul 31 17:19:25 2012
@@ -975,8 +975,16 @@
                                                         stop_vote, 
                                                         run_vote, 
                                                         frame_idx));
-    QueueThreadPlan (thread_plan_sp, abort_other_plans);
-    return thread_plan_sp.get();
+    
+    if (thread_plan_sp->ValidatePlan(NULL))
+    {
+        QueueThreadPlan (thread_plan_sp, abort_other_plans);
+        return thread_plan_sp.get();
+    }
+    else
+    {
+        return NULL;
+    }
 }
 
 ThreadPlan *

Modified: lldb/trunk/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOut.cpp?rev=161086&r1=161085&r2=161086&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOut.cpp Tue Jul 31 17:19:25 2012
@@ -95,6 +95,10 @@
         // FIXME - can we do this more securely if we know first_insn?
 
         m_return_addr = return_frame_sp->GetFrameCodeAddress().GetLoadAddress(&m_thread.GetProcess()->GetTarget());
+        
+        if (m_return_addr == LLDB_INVALID_ADDRESS)
+            return;
+        
         Breakpoint *return_bp = m_thread.CalculateTarget()->CreateBreakpoint (m_return_addr, true).get();
         if (return_bp != NULL)
         {
@@ -157,7 +161,8 @@
         return m_step_through_inline_plan_sp->ValidatePlan (error);
     else if (m_return_bp_id == LLDB_INVALID_BREAK_ID)
     {
-        error->PutCString("Could not create return address breakpoint.");
+        if (error)
+            error->PutCString("Could not create return address breakpoint.");
         return false;
     }
     else





More information about the lldb-commits mailing list