9#if defined(__i386__) || defined(__x86_64__)
11#ifndef lldb_NativeRegisterContextLinux_x86_64_h
12#define lldb_NativeRegisterContextLinux_x86_64_h
23namespace process_linux {
25class NativeProcessLinux;
27class NativeRegisterContextLinux_x86_64
28 :
public NativeRegisterContextLinux,
29 public NativeRegisterContextDBReg_x86 {
31 NativeRegisterContextLinux_x86_64(
const ArchSpec &target_arch,
32 NativeThreadProtocol &native_thread);
34 uint32_t GetRegisterSetCount()
const override;
36 const RegisterSet *GetRegisterSet(uint32_t set_index)
const override;
38 uint32_t GetUserRegisterCount()
const override;
40 Status ReadRegister(
const RegisterInfo *reg_info,
41 RegisterValue ®_value)
override;
43 Status WriteRegister(
const RegisterInfo *reg_info,
44 const RegisterValue ®_value)
override;
50 std::optional<SyscallData> GetSyscallData()
override;
52 std::optional<MmapData> GetMmapData()
override;
54 const RegisterInfo *GetDR(
int num)
const override;
57 void *GetGPRBuffer()
override {
return &m_gpr_x86_64; }
59 void *GetFPRBuffer()
override;
61 size_t GetFPRSize()
override;
65 Status WriteFPR()
override;
67 uint32_t GetPtraceOffset(uint32_t reg_index)
override;
71 enum class XStateType {
Invalid, FXSAVE, XSAVE };
72 enum class RegSet { gpr, fpu, avx, mpx };
76 uint32_t num_registers;
77 uint32_t num_gpr_registers;
78 uint32_t num_fpr_registers;
79 uint32_t num_avx_registers;
80 uint32_t num_mpx_registers;
102 mutable XStateType m_xstate_type;
103 std::unique_ptr<FPR, llvm::FreeDeleter>
105 struct iovec m_iovec;
109 uint64_t m_gpr_x86_64[x86_64_with_base::k_num_gpr_registers];
110 uint32_t m_fctrl_offset_in_userarea;
113 bool IsCPUFeatureAvailable(RegSet feature_code)
const;
115 bool IsRegisterSetAvailable(uint32_t set_index)
const;
117 bool IsGPR(uint32_t reg_index)
const;
119 bool IsFPR(uint32_t reg_index)
const;
121 bool IsDR(uint32_t reg_index)
const;
127 bool IsAVX(uint32_t reg_index)
const;
129 bool CopyXSTATEtoMPX(uint32_t reg);
131 bool CopyMPXtoXSTATE(uint32_t reg);
133 bool IsMPX(uint32_t reg_index)
const;
135 void UpdateXSTATEforWrite(uint32_t reg_index);
137 RegisterContextLinux_x86 &GetRegisterInfo()
const {
138 return static_cast<RegisterContextLinux_x86 &
>(
139 *m_register_info_interface_up);
A class that represents a running process on the host machine.
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP