ThreadPlanBase.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //===-- ThreadPlanBase.h ----------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_TARGET_THREADPLANBASE_H
  9. #define LLDB_TARGET_THREADPLANBASE_H
  10. #include "lldb/Target/Process.h"
  11. #include "lldb/Target/Thread.h"
  12. #include "lldb/Target/ThreadPlan.h"
  13. namespace lldb_private {
  14. // Base thread plans:
  15. // This is the generic version of the bottom most plan on the plan stack. It
  16. // should
  17. // be able to handle generic breakpoint hitting, and signals and exceptions.
  18. class ThreadPlanBase : public ThreadPlan {
  19. friend class Process; // RunThreadPlan manages "stopper" base plans.
  20. public:
  21. ~ThreadPlanBase() override;
  22. void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
  23. bool ValidatePlan(Stream *error) override;
  24. bool ShouldStop(Event *event_ptr) override;
  25. Vote ShouldReportStop(Event *event_ptr) override;
  26. bool StopOthers() override;
  27. lldb::StateType GetPlanRunState() override;
  28. bool WillStop() override;
  29. bool MischiefManaged() override;
  30. bool OkayToDiscard() override { return false; }
  31. bool IsBasePlan() override { return true; }
  32. protected:
  33. bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
  34. bool DoPlanExplainsStop(Event *event_ptr) override;
  35. ThreadPlanBase(Thread &thread);
  36. private:
  37. friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans);
  38. ThreadPlanBase(const ThreadPlanBase &) = delete;
  39. const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete;
  40. };
  41. } // namespace lldb_private
  42. #endif // LLDB_TARGET_THREADPLANBASE_H