21#include "llvm/ADT/STLExtras.h"
22#include "llvm/Support/Compiler.h"
148#define GPR_OFFSET(reg) \
149 (LLVM_EXTENSION offsetof(RegisterContextDarwin_x86_64::GPR, reg))
150#define FPU_OFFSET(reg) \
151 (LLVM_EXTENSION offsetof(RegisterContextDarwin_x86_64::FPU, reg) + \
152 sizeof(RegisterContextDarwin_x86_64::GPR))
153#define EXC_OFFSET(reg) \
154 (LLVM_EXTENSION offsetof(RegisterContextDarwin_x86_64::EXC, reg) + \
155 sizeof(RegisterContextDarwin_x86_64::GPR) + \
156 sizeof(RegisterContextDarwin_x86_64::FPU))
162#define DEFINE_GPR(reg, alt) \
163 #reg, alt, sizeof(((RegisterContextDarwin_x86_64::GPR *) NULL)->reg), \
164 GPR_OFFSET(reg), eEncodingUint, eFormatHex
165#define DEFINE_FPU_UINT(reg) \
166 #reg, NULL, sizeof(((RegisterContextDarwin_x86_64::FPU *) NULL)->reg), \
167 FPU_OFFSET(reg), eEncodingUint, eFormatHex
168#define DEFINE_FPU_VECT(reg, i) \
170 sizeof(((RegisterContextDarwin_x86_64::FPU *) NULL)->reg[i].bytes), \
171 FPU_OFFSET(reg[i]), eEncodingVector, eFormatVectorOfUInt8, \
172 {ehframe_dwarf_fpu_##reg##i, \
173 ehframe_dwarf_fpu_##reg##i, LLDB_INVALID_REGNUM, \
174 LLDB_INVALID_REGNUM, fpu_##reg##i }, \
175 nullptr, nullptr, nullptr,
176#define DEFINE_EXC(reg) \
177 #reg, NULL, sizeof(((RegisterContextDarwin_x86_64::EXC *) NULL)->reg), \
178 EXC_OFFSET(reg), eEncodingUint, eFormatHex
180#define REG_CONTEXT_SIZE \
181 (sizeof(RegisterContextDarwin_x86_64::GPR) + \
182 sizeof(RegisterContextDarwin_x86_64::FPU) + \
183 sizeof(RegisterContextDarwin_x86_64::EXC))
460 Thread &thread, uint32_t concrete_frame_idx)
892 uint8_t *dst = data_sp->GetBytes();
893 ::memcpy(dst, &
gpr,
sizeof(
gpr));
896 ::memcpy(dst, &
fpu,
sizeof(
fpu));
899 ::memcpy(dst, &
exc,
sizeof(
exc));
908 const uint8_t *src = data_sp->GetBytes();
909 ::memcpy(&
gpr, src,
sizeof(
gpr));
912 ::memcpy(&
fpu, src,
sizeof(
fpu));
915 ::memcpy(&
exc, src,
sizeof(
exc));
916 uint32_t success_count = 0;
923 return success_count == 3;
1041 const uint64_t trace_bit = 0x100ull;
static const uint32_t k_num_register_infos
static const RegisterInfo g_register_infos[]
const size_t k_num_regsets
const size_t k_num_regsets
static uint32_t g_fpu_regnums[]
@ ehframe_dwarf_fpu_stmm3
@ ehframe_dwarf_fpu_xmm11
@ ehframe_dwarf_fpu_xmm14
@ ehframe_dwarf_fpu_xmm12
@ ehframe_dwarf_fpu_stmm0
@ ehframe_dwarf_fpu_stmm6
@ ehframe_dwarf_fpu_stmm4
@ ehframe_dwarf_fpu_stmm7
@ ehframe_dwarf_fpu_xmm13
@ ehframe_dwarf_fpu_stmm2
@ ehframe_dwarf_fpu_stmm5
@ ehframe_dwarf_fpu_xmm15
@ ehframe_dwarf_fpu_xmm10
@ ehframe_dwarf_fpu_stmm1
static uint32_t g_gpr_regnums[]
static RegisterInfo g_register_infos[]
static uint32_t g_exc_regnums[]
const size_t k_num_gpr_registers
const size_t k_num_fpu_registers
#define DEFINE_FPU_VECT(reg, i)
#define DEFINE_FPU_UINT(reg)
static const RegisterSet g_reg_sets[]
const size_t k_num_exc_registers
#define DEFINE_GPR(reg, alt)
static size_t k_num_register_infos
static RegisterSet g_reg_sets[]
virtual int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc)=0
bool RegisterSetIsCached(int set) const
virtual int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc)=0
virtual int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr)=0
int WriteRegisterSet(uint32_t set)
static int GetSetForNativeRegNum(int reg_num)
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
RegisterContextDarwin_x86_64(lldb_private::Thread &thread, uint32_t concrete_frame_idx)
virtual int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu)=0
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
size_t GetRegisterSetCount() override
virtual int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu)=0
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
size_t GetRegisterCount() override
static size_t GetRegisterInfosCount()
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
void InvalidateAllRegisterStates()
int GetError(int flavor, uint32_t err_idx) const
void InvalidateAllRegisters() override
bool SetError(int flavor, uint32_t err_idx, int err)
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
virtual int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr)=0
int ReadRegisterSet(uint32_t set, bool force)
static const lldb_private::RegisterInfo * GetRegisterInfos()
~RegisterContextDarwin_x86_64() override
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool HardwareSingleStep(bool enable) override
virtual lldb::tid_t GetThreadID() const
uint16_t GetAsUInt16(uint16_t fail_value=UINT16_MAX, bool *success_ptr=nullptr) const
uint8_t GetAsUInt8(uint8_t fail_value=UINT8_MAX, bool *success_ptr=nullptr) const
uint64_t GetAsUInt64(uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
void SetBytes(const void *bytes, size_t length, lldb::ByteOrder byte_order)
const void * GetBytes() const
uint32_t GetAsUInt32(uint32_t fail_value=UINT32_MAX, bool *success_ptr=nullptr) const
uint32_t GetByteSize() const
#define LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_INVALID_REGNUM
#define LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_FP
lldb::ByteOrder InlHostByteOrder()
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
RegisterKind
Register numbering types.
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindLLDB
lldb's internal register numbers
@ eRegisterKindDWARF
the register numbers seen DWARF
@ eRegisterKindEHFrame
the register numbers seen in eh_frame
Every register is described in detail including its name, alternate name (optional),...
uint32_t byte_size
Size in bytes of the register.
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
Registers are grouped into register sets.