Fixed a problem where stepping out would turn into
a continue if the unwinder didn't unwind correctly.

<rdar://problem/11989668>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161086 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 5eeaca8..cbd7513 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -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 *
diff --git a/source/Target/ThreadPlanStepOut.cpp b/source/Target/ThreadPlanStepOut.cpp
index 9b0e320..44ede3a 100644
--- a/source/Target/ThreadPlanStepOut.cpp
+++ b/source/Target/ThreadPlanStepOut.cpp
@@ -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