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