]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
Merge llvm, clang, lld and lldb trunk r300890, and update build glue.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / Process / NetBSD / NativeRegisterContextNetBSD_x86_64.h
1 //===-- NativeRegisterContextNetBSD_x86_64.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 #if defined(__x86_64__)
11
12 #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
13 #define lldb_NativeRegisterContextNetBSD_x86_64_h
14
15 // clang-format off
16 #include <sys/param.h>
17 #include <sys/types.h>
18 #include <machine/reg.h>
19 // clang-format on
20
21 #include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"
22 #include "Plugins/Process/Utility/RegisterContext_x86.h"
23 #include "Plugins/Process/Utility/lldb-x86-register-enums.h"
24
25 namespace lldb_private {
26 namespace process_netbsd {
27
28 class NativeProcessNetBSD;
29
30 class NativeRegisterContextNetBSD_x86_64 : public NativeRegisterContextNetBSD {
31 public:
32   NativeRegisterContextNetBSD_x86_64(const ArchSpec &target_arch,
33                                      NativeThreadProtocol &native_thread,
34                                      uint32_t concrete_frame_idx);
35   uint32_t GetRegisterSetCount() const override;
36
37   const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
38
39   Error ReadRegister(const RegisterInfo *reg_info,
40                      RegisterValue &reg_value) override;
41
42   Error WriteRegister(const RegisterInfo *reg_info,
43                       const RegisterValue &reg_value) override;
44
45   Error ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override;
46
47   Error WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
48
49   Error IsWatchpointHit(uint32_t wp_index, bool &is_hit) override;
50
51   Error GetWatchpointHitIndex(uint32_t &wp_index,
52                               lldb::addr_t trap_addr) override;
53
54   Error IsWatchpointVacant(uint32_t wp_index, bool &is_vacant) override;
55
56   bool ClearHardwareWatchpoint(uint32_t wp_index) override;
57
58   Error ClearAllHardwareWatchpoints() override;
59
60   Error SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size,
61                                        uint32_t watch_flags, uint32_t wp_index);
62
63   uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size,
64                                  uint32_t watch_flags) override;
65
66   lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override;
67
68   uint32_t NumSupportedHardwareWatchpoints() override;
69
70 protected:
71   void *GetGPRBuffer() override { return &m_gpr_x86_64; }
72   void *GetFPRBuffer() override { return &m_fpr_x86_64; }
73   void *GetDBRBuffer() override { return &m_dbr_x86_64; }
74
75 private:
76   // Private member types.
77   enum { GPRegSet, FPRegSet, DBRegSet };
78
79   // Private member variables.
80   struct reg m_gpr_x86_64;
81   struct fpreg m_fpr_x86_64;
82   struct dbreg m_dbr_x86_64;
83
84   int GetSetForNativeRegNum(int reg_num) const;
85
86   int ReadRegisterSet(uint32_t set);
87   int WriteRegisterSet(uint32_t set);
88 };
89
90 } // namespace process_netbsd
91 } // namespace lldb_private
92
93 #endif // #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
94
95 #endif // defined(__x86_64__)