53 uint32_t regs[16 + 1];
55 uint32_t r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, ip, sp, lr, pc,
83 std::memset(&gp, 0,
sizeof(gp));
84 std::memset(&vfp, 0,
sizeof(vfp));
85 std::memset(&hbp, 0,
sizeof(hbp));
92 inline uint32_t pc()
const {
return gp.pc; }
93 inline void setPC(uint32_t pc) { gp.pc = pc; }
98 inline uint32_t xpc()
const {
return gp.pc | (isThumb() ? 1 : 0); }
100 inline uint32_t sp()
const {
return gp.sp; }
101 inline void setSP(uint32_t sp) { gp.sp = sp; }
103 inline uint32_t retval()
const {
return gp.r0; }
105 inline bool isThumb()
const {
return (gp.cpsr & (1 << 5)) != 0; }
108 inline void getGPState(GPRegisterValueVector ®s)
const {
110 for (
size_t n = 0; n < array_sizeof(gp.regs); n++) {
115 inline void setGPState(std::vector<uint64_t>
const ®s) {
116 for (
size_t n = 0; n < regs.size() && n < array_sizeof(gp.regs); n++) {
117 gp.regs[n] = regs[n];
122 inline void getStopGPState(GPRegisterStopMap ®s,
bool forLLDB)
const {
124 for (
size_t n = 0; n < 16; n++) {
125 regs[n + reg_lldb_r0] =
GPRegisterValue{
sizeof(gp.regs[n]), gp.regs[n]};
132 for (
size_t n = 0; n < 16; n++) {
134 regs[n + reg_gdb_r0] =
143 inline bool getLLDBRegisterPtr(
int regno,
void **ptr,
size_t *length)
const {
144 if (regno >= reg_lldb_r0 && regno <= reg_lldb_r15) {
145 *ptr =
const_cast<uint32_t *
>(&gp.regs[regno - reg_lldb_r0]);
146 *length =
sizeof(gp.regs[0]);
147 }
else if (regno == reg_lldb_cpsr) {
148 *ptr =
const_cast<uint32_t *
>(&gp.cpsr);
149 *length =
sizeof(gp.cpsr);
150 }
else if (regno >= reg_lldb_d0 && regno <= reg_lldb_d31) {
151 *ptr =
const_cast<VFPDouble *
>(&vfp.dbl[regno - reg_lldb_d0]);
152 *length =
sizeof(vfp.dbl[0]);
153 }
else if (regno >= reg_lldb_s0 && regno <= reg_lldb_s31) {
154 *ptr =
const_cast<uint32_t *
>(&vfp.sng[regno - reg_lldb_s0].value);
155 *length =
sizeof(vfp.sng[0].value);
156 }
else if (regno >= reg_lldb_q0 && regno <= reg_lldb_q15) {
157 *ptr =
const_cast<VFPQuad *
>(&vfp.quad[regno - reg_lldb_q0]);
158 *length =
sizeof(vfp.quad[0]);
159 }
else if (regno == reg_lldb_fpscr) {
160 *ptr =
const_cast<uint32_t *
>(&vfp.fpscr);
161 *length =
sizeof(vfp.fpscr);
169 inline bool getGDBRegisterPtr(
int regno,
void **ptr,
size_t *length)
const {
170 if (regno >= reg_gdb_r0 && regno <= reg_gdb_r15) {
171 *ptr =
const_cast<uint32_t *
>(&gp.regs[regno - reg_gdb_r0]);
172 *length =
sizeof(gp.regs[0]);
173 }
else if (regno == reg_gdb_cpsr) {
174 *ptr =
const_cast<uint32_t *
>(&gp.cpsr);
175 *length =
sizeof(gp.cpsr);
176 }
else if (regno >= reg_gdb_d0 && regno <= reg_gdb_d31) {
177 *ptr =
const_cast<VFPDouble *
>(&vfp.dbl[regno - reg_gdb_d0]);
178 *length =
sizeof(vfp.dbl[0]);
179 }
else if (regno == reg_gdb_fpscr) {
180 *ptr =
const_cast<uint32_t *
>(&vfp.fpscr);
181 *length =
sizeof(vfp.fpscr);