ThreadPlanPython.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //===-- ThreadPlanPython.h --------------------------------------------*- C++
  2. //-*-===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLDB_TARGET_THREADPLANPYTHON_H
  10. #define LLDB_TARGET_THREADPLANPYTHON_H
  11. #include <string>
  12. #include "lldb/lldb-forward.h"
  13. #include "lldb/Target/Process.h"
  14. #include "lldb/Target/StopInfo.h"
  15. #include "lldb/Target/Target.h"
  16. #include "lldb/Target/Thread.h"
  17. #include "lldb/Target/ThreadPlan.h"
  18. #include "lldb/Target/ThreadPlanTracer.h"
  19. #include "lldb/Utility/StructuredData.h"
  20. #include "lldb/Utility/UserID.h"
  21. #include "lldb/lldb-private.h"
  22. namespace lldb_private {
  23. // ThreadPlanPython:
  24. //
  25. class ThreadPlanPython : public ThreadPlan {
  26. public:
  27. ThreadPlanPython(Thread &thread, const char *class_name,
  28. StructuredDataImpl *args_data);
  29. ~ThreadPlanPython() override;
  30. void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
  31. bool ValidatePlan(Stream *error) override;
  32. bool ShouldStop(Event *event_ptr) override;
  33. bool MischiefManaged() override;
  34. bool WillStop() override;
  35. bool StopOthers() override { return m_stop_others; }
  36. void SetStopOthers(bool new_value) override { m_stop_others = new_value; }
  37. void DidPush() override;
  38. bool IsPlanStale() override;
  39. protected:
  40. bool DoPlanExplainsStop(Event *event_ptr) override;
  41. lldb::StateType GetPlanRunState() override;
  42. ScriptInterpreter *GetScriptInterpreter();
  43. private:
  44. std::string m_class_name;
  45. StructuredDataImpl *m_args_data; // We own this, but the implementation
  46. // has to manage the UP (since that is
  47. // how it gets stored in the
  48. // SBStructuredData).
  49. std::string m_error_str;
  50. StructuredData::ObjectSP m_implementation_sp;
  51. bool m_did_push;
  52. bool m_stop_others;
  53. ThreadPlanPython(const ThreadPlanPython &) = delete;
  54. const ThreadPlanPython &operator=(const ThreadPlanPython &) = delete;
  55. };
  56. } // namespace lldb_private
  57. #endif // LLDB_TARGET_THREADPLANPYTHON_H