1 //===-- NativeRegisterContextNetBSD_x86_64.h --------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #if defined(__x86_64__)
12 #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
13 #define lldb_NativeRegisterContextNetBSD_x86_64_h
16 #include <sys/param.h>
17 #include <sys/types.h>
18 #include <machine/reg.h>
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"
25 namespace lldb_private {
26 namespace process_netbsd {
28 class NativeProcessNetBSD;
30 class NativeRegisterContextNetBSD_x86_64 : public NativeRegisterContextNetBSD {
32 NativeRegisterContextNetBSD_x86_64(const ArchSpec &target_arch,
33 NativeThreadProtocol &native_thread,
34 uint32_t concrete_frame_idx);
35 uint32_t GetRegisterSetCount() const override;
37 const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
39 Error ReadRegister(const RegisterInfo *reg_info,
40 RegisterValue ®_value) override;
42 Error WriteRegister(const RegisterInfo *reg_info,
43 const RegisterValue ®_value) override;
45 Error ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override;
47 Error WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
50 void *GetGPRBuffer() override { return &m_gpr_x86_64; }
51 void *GetFPRBuffer() override { return &m_fpr_x86_64; }
54 // Private member types.
55 enum { GPRegSet, FPRegSet };
57 // Private member variables.
58 struct reg m_gpr_x86_64;
59 struct fpreg m_fpr_x86_64;
61 int GetSetForNativeRegNum(int reg_num) const;
63 int ReadRegisterSet(uint32_t set);
64 int WriteRegisterSet(uint32_t set);
67 } // namespace process_netbsd
68 } // namespace lldb_private
70 #endif // #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
72 #endif // defined(__x86_64__)