9#if defined(__aarch64__) || defined(_M_ARM64)
20#include "llvm/ADT/STLExtras.h"
25#define GPR_OFFSET(idx) 0
26#define GPR_OFFSET_NAME(reg) 0
28#define FPU_OFFSET(idx) 0
29#define FPU_OFFSET_NAME(reg) 0
31#define EXC_OFFSET_NAME(reg) 0
32#define DBG_OFFSET_NAME(reg) 0
34#define DEFINE_DBG(reg, i) \
36 0, DBG_OFFSET_NAME(reg[i]), eEncodingUint, eFormatHex, \
37 {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
38 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
39 LLDB_INVALID_REGNUM }, \
43#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
45#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
51uint32_t g_gpr_reg_indices[] = {
52 gpr_x0, gpr_x1, gpr_x2, gpr_x3, gpr_x4, gpr_x5, gpr_x6, gpr_x7,
53 gpr_x8, gpr_x9, gpr_x10, gpr_x11, gpr_x12, gpr_x13, gpr_x14, gpr_x15,
54 gpr_x16, gpr_x17, gpr_x18, gpr_x19, gpr_x20, gpr_x21, gpr_x22, gpr_x23,
55 gpr_x24, gpr_x25, gpr_x26, gpr_x27, gpr_x28, gpr_fp,
gpr_lr,
gpr_sp,
58 gpr_w0, gpr_w1, gpr_w2, gpr_w3, gpr_w4, gpr_w5, gpr_w6, gpr_w7,
59 gpr_w8, gpr_w9, gpr_w10, gpr_w11, gpr_w12, gpr_w13, gpr_w14, gpr_w15,
60 gpr_w16, gpr_w17, gpr_w18, gpr_w19, gpr_w20, gpr_w21, gpr_w22, gpr_w23,
61 gpr_w24, gpr_w25, gpr_w26, gpr_w27, gpr_w28,
64uint32_t g_fpu_reg_indices[] = {
65 fpu_v0, fpu_v1, fpu_v2, fpu_v3, fpu_v4, fpu_v5, fpu_v6, fpu_v7,
66 fpu_v8, fpu_v9, fpu_v10, fpu_v11, fpu_v12, fpu_v13, fpu_v14, fpu_v15,
67 fpu_v16, fpu_v17, fpu_v18, fpu_v19, fpu_v20, fpu_v21, fpu_v22, fpu_v23,
68 fpu_v24, fpu_v25, fpu_v26, fpu_v27, fpu_v28, fpu_v29, fpu_v30, fpu_v31,
75 fpu_d0, fpu_d1, fpu_d2, fpu_d3, fpu_d4, fpu_d5, fpu_d6, fpu_d7,
76 fpu_d8, fpu_d9, fpu_d10, fpu_d11, fpu_d12, fpu_d13, fpu_d14, fpu_d15,
77 fpu_d16, fpu_d17, fpu_d18, fpu_d19, fpu_d20, fpu_d21, fpu_d22, fpu_d23,
78 fpu_d24, fpu_d25, fpu_d26, fpu_d27, fpu_d28, fpu_d29, fpu_d30, fpu_d31,
84 {
"General Purpose Registers",
"gpr", std::size(g_gpr_reg_indices),
86 {
"Floating Point Registers",
"fpu", std::size(g_fpu_reg_indices),
91RegisterContextWindows_arm64::RegisterContextWindows_arm64(
92 Thread &thread, uint32_t concrete_frame_idx)
95RegisterContextWindows_arm64::~RegisterContextWindows_arm64() {}
97size_t RegisterContextWindows_arm64::GetRegisterCount() {
98 return std::size(g_register_infos_arm64_le);
102RegisterContextWindows_arm64::GetRegisterInfoAtIndex(
size_t reg) {
104 return &g_register_infos_arm64_le[reg];
108size_t RegisterContextWindows_arm64::GetRegisterSetCount() {
109 return std::size(g_register_sets);
113RegisterContextWindows_arm64::GetRegisterSet(
size_t reg_set) {
114 return &g_register_sets[reg_set];
117bool RegisterContextWindows_arm64::ReadRegister(
const RegisterInfo *reg_info,
119 if (!CacheAllRegisterValues())
122 if (reg_info ==
nullptr)
157 reg_value.
SetUInt64(m_context.X[reg - gpr_x0]);
206 static_cast<uint32_t
>(m_context.X[reg - gpr_w0] & 0xffffffff));
242 endian::InlHostByteOrder());
312 reg_value.
SetDouble(m_context.V[reg - fpu_d0].D[0]);
330bool RegisterContextWindows_arm64::WriteRegister(
336 if (!CacheAllRegisterValues())
371 m_context.X[reg - gpr_x0] = reg_value.
GetAsUInt64();
422 memcpy(m_context.V[reg - fpu_v0].B, reg_value.
GetBytes(), 16);
438 return ApplyAllRegisterValues();
static const uint32_t k_num_register_infos
void SetUInt64(uint64_t uint, Type t=eTypeUInt64)
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
void SetUInt32(uint32_t uint, Type t=eTypeUInt32)
A class that represents a running process on the host machine.
@ eRegisterKindLLDB
lldb's internal register numbers
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.