]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Host/common/NativeThreadProtocol.h
Merge ^/head r311940 through r312200.
[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 std::enable_shared_from_this<NativeThreadProtocol> {
25 public:
26   NativeThreadProtocol(NativeProcessProtocol *process, lldb::tid_t tid);
27
28   virtual ~NativeThreadProtocol() {}
29
30   virtual std::string GetName() = 0;
31
32   virtual lldb::StateType GetState() = 0;
33
34   virtual NativeRegisterContextSP GetRegisterContext() = 0;
35
36   virtual Error ReadRegister(uint32_t reg, RegisterValue &reg_value);
37
38   virtual Error WriteRegister(uint32_t reg, const RegisterValue &reg_value);
39
40   virtual Error SaveAllRegisters(lldb::DataBufferSP &data_sp);
41
42   virtual Error RestoreAllRegisters(lldb::DataBufferSP &data_sp);
43
44   virtual bool GetStopReason(ThreadStopInfo &stop_info,
45                              std::string &description) = 0;
46
47   lldb::tid_t GetID() const { return m_tid; }
48
49   NativeProcessProtocolSP GetProcess();
50
51   // ---------------------------------------------------------------------
52   // Thread-specific watchpoints
53   // ---------------------------------------------------------------------
54   virtual Error SetWatchpoint(lldb::addr_t addr, size_t size,
55                               uint32_t watch_flags, bool hardware) = 0;
56
57   virtual Error RemoveWatchpoint(lldb::addr_t addr) = 0;
58
59 protected:
60   NativeProcessProtocolWP m_process_wp;
61   lldb::tid_t m_tid;
62 };
63 }
64
65 #endif // #ifndef liblldb_NativeThreadProtocol_h_