NativeThreadProtocol.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //===-- NativeThreadProtocol.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_HOST_COMMON_NATIVETHREADPROTOCOL_H
  9. #define LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H
  10. #include <memory>
  11. #include "lldb/Host/Debug.h"
  12. #include "lldb/lldb-private-forward.h"
  13. #include "lldb/lldb-types.h"
  14. namespace lldb_private {
  15. // NativeThreadProtocol
  16. class NativeThreadProtocol {
  17. public:
  18. NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
  19. virtual ~NativeThreadProtocol() {}
  20. virtual std::string GetName() = 0;
  21. virtual lldb::StateType GetState() = 0;
  22. virtual NativeRegisterContext &GetRegisterContext() = 0;
  23. virtual bool GetStopReason(ThreadStopInfo &stop_info,
  24. std::string &description) = 0;
  25. lldb::tid_t GetID() const { return m_tid; }
  26. NativeProcessProtocol &GetProcess() { return m_process; }
  27. // Thread-specific watchpoints
  28. virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
  29. uint32_t watch_flags, bool hardware) = 0;
  30. virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0;
  31. // Thread-specific Hardware Breakpoint routines
  32. virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
  33. virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
  34. protected:
  35. NativeProcessProtocol &m_process;
  36. lldb::tid_t m_tid;
  37. };
  38. }
  39. #endif // LLDB_HOST_COMMON_NATIVETHREADPROTOCOL_H