ThreadPlanStepUntil.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //===-- ThreadPlanStepUntil.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_THREADPLANSTEPUNTIL_H
  9. #define LLDB_TARGET_THREADPLANSTEPUNTIL_H
  10. #include "lldb/Target/Thread.h"
  11. #include "lldb/Target/ThreadPlan.h"
  12. namespace lldb_private {
  13. class ThreadPlanStepUntil : public ThreadPlan {
  14. public:
  15. ~ThreadPlanStepUntil() override;
  16. void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
  17. bool ValidatePlan(Stream *error) override;
  18. bool ShouldStop(Event *event_ptr) override;
  19. bool StopOthers() override;
  20. lldb::StateType GetPlanRunState() override;
  21. bool WillStop() override;
  22. bool MischiefManaged() override;
  23. protected:
  24. bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
  25. bool DoPlanExplainsStop(Event *event_ptr) override;
  26. ThreadPlanStepUntil(Thread &thread, lldb::addr_t *address_list,
  27. size_t num_addresses, bool stop_others,
  28. uint32_t frame_idx = 0);
  29. void AnalyzeStop();
  30. private:
  31. StackID m_stack_id;
  32. lldb::addr_t m_step_from_insn;
  33. lldb::break_id_t m_return_bp_id;
  34. lldb::addr_t m_return_addr;
  35. bool m_stepped_out;
  36. bool m_should_stop;
  37. bool m_ran_analyze;
  38. bool m_explains_stop;
  39. typedef std::map<lldb::addr_t, lldb::break_id_t> until_collection;
  40. until_collection m_until_points;
  41. bool m_stop_others;
  42. void Clear();
  43. friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepUntil(
  44. bool abort_other_plans, lldb::addr_t *address_list, size_t num_addresses,
  45. bool stop_others, uint32_t frame_idx, Status &status);
  46. // Need an appropriate marker for the current stack so we can tell step out
  47. // from step in.
  48. ThreadPlanStepUntil(const ThreadPlanStepUntil &) = delete;
  49. const ThreadPlanStepUntil &operator=(const ThreadPlanStepUntil &) = delete;
  50. };
  51. } // namespace lldb_private
  52. #endif // LLDB_TARGET_THREADPLANSTEPUNTIL_H