]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Host/common/NativeThreadProtocol.h
file: update to 5.34
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Host / common / NativeThreadProtocol.h
1 //===-- NativeThreadProtocol.h ----------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_NativeThreadProtocol_h_
11 #define liblldb_NativeThreadProtocol_h_
12
13 #include <memory>
14
15 #include "lldb/Host/Debug.h"
16 #include "lldb/lldb-private-forward.h"
17 #include "lldb/lldb-types.h"
18
19 namespace lldb_private {
20 //------------------------------------------------------------------
21 // NativeThreadProtocol
22 //------------------------------------------------------------------
23 class NativeThreadProtocol {
24 public:
25   NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid);
26
27   virtual ~NativeThreadProtocol() {}
28
29   virtual std::string GetName() = 0;
30
31   virtual lldb::StateType GetState() = 0;
32
33   virtual NativeRegisterContext &GetRegisterContext() = 0;
34
35   virtual Status ReadRegister(uint32_t reg, RegisterValue &reg_value);
36
37   virtual Status WriteRegister(uint32_t reg, const RegisterValue &reg_value);
38
39   virtual Status SaveAllRegisters(lldb::DataBufferSP &data_sp);
40
41   virtual Status RestoreAllRegisters(lldb::DataBufferSP &data_sp);
42
43   virtual bool GetStopReason(ThreadStopInfo &stop_info,
44                              std::string &description) = 0;
45
46   lldb::tid_t GetID() const { return m_tid; }
47
48   NativeProcessProtocol &GetProcess() { return m_process; }
49
50   // ---------------------------------------------------------------------
51   // Thread-specific watchpoints
52   // ---------------------------------------------------------------------
53   virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
54                                uint32_t watch_flags, bool hardware) = 0;
55
56   virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0;
57
58   // ---------------------------------------------------------------------
59   // Thread-specific Hardware Breakpoint routines
60   // ---------------------------------------------------------------------
61   virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0;
62
63   virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0;
64
65 protected:
66   NativeProcessProtocol &m_process;
67   lldb::tid_t m_tid;
68 };
69 }
70
71 #endif // #ifndef liblldb_NativeThreadProtocol_h_