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 GetRegisterSetCount() const override; 35 36 const RegisterSet *GetRegisterSet(uint32_t set_index) const override; 37 38 Status ReadRegister(const RegisterInfo *reg_info, 39 RegisterValue ®_value) override; 40 41 Status WriteRegister(const RegisterInfo *reg_info, 42 const RegisterValue ®_value) override; 43 44 Status ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; 45 46 Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; 47 48 Status IsWatchpointHit(uint32_t wp_index, bool &is_hit) override; 49 50 Status GetWatchpointHitIndex(uint32_t &wp_index, 51 lldb::addr_t trap_addr) override; 52 53 Status IsWatchpointVacant(uint32_t wp_index, bool &is_vacant) override; 54 55 bool ClearHardwareWatchpoint(uint32_t wp_index) override; 56 57 Status ClearAllHardwareWatchpoints() override; 58 59 Status SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, 60 uint32_t watch_flags, 61 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__) 96