15#include "llvm/ADT/STLExtras.h"
16#include "llvm/Support/Compiler.h"
130#define GPR_OFFSET(reg) \
131 (LLVM_EXTENSION offsetof(RegisterContextDarwin_i386::GPR, reg))
132#define FPU_OFFSET(reg) \
133 (LLVM_EXTENSION offsetof(RegisterContextDarwin_i386::FPU, reg) + \
134 sizeof(RegisterContextDarwin_i386::GPR))
135#define EXC_OFFSET(reg) \
136 (LLVM_EXTENSION offsetof(RegisterContextDarwin_i386::EXC, reg) + \
137 sizeof(RegisterContextDarwin_i386::GPR) + \
138 sizeof(RegisterContextDarwin_i386::FPU))
144#define DEFINE_GPR(reg, alt) \
145 #reg, alt, sizeof(((RegisterContextDarwin_i386::GPR *) NULL)->reg), \
146 GPR_OFFSET(reg), eEncodingUint, eFormatHex
147#define DEFINE_FPU_UINT(reg) \
148 #reg, NULL, sizeof(((RegisterContextDarwin_i386::FPU *) NULL)->reg), \
149 FPU_OFFSET(reg), eEncodingUint, eFormatHex
150#define DEFINE_FPU_VECT(reg, i) \
152 sizeof(((RegisterContextDarwin_i386::FPU *) NULL)->reg[i].bytes), \
153 FPU_OFFSET(reg[i]), eEncodingVector, eFormatVectorOfUInt8, \
154 {LLDB_INVALID_REGNUM, dwarf_##reg##i, \
155 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
157 nullptr, nullptr, nullptr,
159#define DEFINE_EXC(reg) \
160 #reg, NULL, sizeof(((RegisterContextDarwin_i386::EXC *) NULL)->reg), \
161 EXC_OFFSET(reg), eEncodingUint, eFormatHex
162#define REG_CONTEXT_SIZE \
163 (sizeof(RegisterContextDarwin_i386::GPR) + \
164 sizeof(RegisterContextDarwin_i386::FPU) + \
165 sizeof(RegisterContextDarwin_i386::EXC))
398 Thread &thread, uint32_t concrete_frame_idx)
828 uint8_t *dst = data_sp->GetBytes();
829 ::memcpy(dst, &
gpr,
sizeof(
gpr));
832 ::memcpy(dst, &
fpu,
sizeof(
fpu));
835 ::memcpy(dst, &
exc,
sizeof(
exc));
844 const uint8_t *src = data_sp->GetBytes();
845 ::memcpy(&
gpr, src,
sizeof(
gpr));
848 ::memcpy(&
fpu, src,
sizeof(
fpu));
851 ::memcpy(&
exc, src,
sizeof(
exc));
852 uint32_t success_count = 0;
859 return success_count == 3;
947 const uint32_t trace_bit = 0x100u;
static const uint32_t k_num_register_infos
static const RegisterInfo g_register_infos[]
#define LLDB_LOGF(log,...)
const size_t k_num_regsets
const size_t k_num_gpr_registers
const size_t k_num_regsets
static uint32_t g_fpu_regnums[]
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[]
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
int WriteRegisterSet(uint32_t set)
static int GetSetForNativeRegNum(int reg_num)
bool HardwareSingleStep(bool enable) override
virtual int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr)=0
bool RegisterSetIsCached(int set) const
int GetError(int flavor, uint32_t err_idx) const
bool SetError(int flavor, uint32_t err_idx, int err)
void InvalidateAllRegisterStates()
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
int ReadRegisterSet(uint32_t set, bool force)
static const lldb_private::RegisterInfo * GetRegisterInfos()
~RegisterContextDarwin_i386() override
size_t GetRegisterCount() override
virtual int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu)=0
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
void LogGPR(lldb_private::Log *log, const char *title)
size_t GetRegisterSetCount() override
virtual int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu)=0
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
virtual int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr)=0
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
virtual int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc)=0
static size_t GetRegisterInfosCount()
RegisterContextDarwin_i386(lldb_private::Thread &thread, uint32_t concrete_frame_idx)
virtual int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc)=0
void InvalidateAllRegisters() override
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) 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
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
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 kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
Registers are grouped into register sets.