Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ThreadPlanContinue.cpp b/source/Target/ThreadPlanContinue.cpp
new file mode 100644
index 0000000..63d8a33
--- /dev/null
+++ b/source/Target/ThreadPlanContinue.cpp
@@ -0,0 +1,120 @@
+//===-- ThreadPlanContinue.cpp ----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Target/ThreadPlanContinue.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/lldb-private-log.h"
+#include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+//----------------------------------------------------------------------
+// ThreadPlanContinue: Continue plan
+//----------------------------------------------------------------------
+
+ThreadPlanContinue::ThreadPlanContinue (Thread &thread, bool stop_others, Vote stop_vote, Vote run_vote, bool immediate) :
+    ThreadPlan ("Continue after previous plan", thread, stop_vote, run_vote),
+    m_stop_others (stop_others),
+    m_did_run (false),
+    m_immediate (immediate)
+{
+}
+
+ThreadPlanContinue::~ThreadPlanContinue ()
+{
+}
+
+void
+ThreadPlanContinue::GetDescription (Stream *s, lldb::DescriptionLevel level)
+{
+    if (level == lldb::eDescriptionLevelBrief)
+        s->Printf ("continue");
+    else
+    {
+        s->Printf ("Continue from the previous plan");
+    }
+}
+
+bool
+ThreadPlanContinue::ValidatePlan (Stream *error)
+{
+    // Since we read the instruction we're stepping over from the thread,
+    // this plan will always work.
+    return true;
+}
+
+bool
+ThreadPlanContinue::PlanExplainsStop ()
+{
+    return true;
+}
+
+bool
+ThreadPlanContinue::ShouldStop (Event *event_ptr)
+{
+    return false;
+}
+
+bool
+ThreadPlanContinue::IsImmediate () const
+{
+    return m_immediate;
+    return false;
+}
+
+bool
+ThreadPlanContinue::StopOthers ()
+{
+    return m_stop_others;
+}
+
+StateType
+ThreadPlanContinue::RunState ()
+{
+    return eStateRunning;
+}
+
+bool
+ThreadPlanContinue::WillResume (StateType resume_state, bool current_plan)
+{
+    ThreadPlan::WillResume (resume_state, current_plan);
+    if (current_plan)
+    {
+        m_did_run = true;
+    }
+    return true;
+}
+
+bool
+ThreadPlanContinue::WillStop ()
+{
+    return true;
+}
+
+bool
+ThreadPlanContinue::MischiefManaged ()
+{
+    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
+
+    if (m_did_run)
+    {
+        if (log)
+            log->Printf("Completed continue plan.");
+        ThreadPlan::MischiefManaged ();
+        return true;
+    }
+    else
+        return false;
+}