18#include "llvm/Support/CheckedArithmetic.h"
28#define GPR_OFFSET(idx) ((idx)*8)
29#define GPR_OFFSET_NAME(reg) 0
30#define FPU_OFFSET(idx) ((idx)*16)
31#define FPU_OFFSET_NAME(reg) 0
32#define EXC_OFFSET_NAME(reg) 0
33#define DBG_OFFSET_NAME(reg) 0
34#define DBG_OFFSET_NAME(reg) 0
35#define DEFINE_DBG(re, y) \
36 "na", nullptr, 8, 0, lldb::eEncodingUint, lldb::eFormatHex, \
37 {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
38 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM}, \
39 nullptr, nullptr, nullptr
41#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
45#include "llvm/ADT/STLExtras.h"
46#include "llvm/Support/MathExtras.h"
56 if (reg_num >= std::size(g_register_infos_arm64_le))
58 return g_register_infos_arm64_le[reg_num];
62#define VFPv1 (1u << 1)
63#define VFPv2 (1u << 2)
64#define VFPv3 (1u << 3)
65#define AdvancedSIMD (1u << 4)
67#define VFPv1_ABOVE (VFPv1 | VFPv2 | VFPv3 | AdvancedSIMD)
68#define VFPv2_ABOVE (VFPv2 | VFPv3 | AdvancedSIMD)
69#define VFPv2v3 (VFPv2 | VFPv3)
71#define UInt(x) ((uint64_t)x)
72#define SInt(x) ((int64_t)x)
75#define integer int64_t
77static inline bool IsZero(uint64_t x) {
return x == 0; }
79static inline uint64_t
NOT(uint64_t x) {
return ~x; }
121 return "Emulate instructions for the ARM64 architecture.";
129 if (arch.
GetTriple().getArch() == llvm::Triple::aarch64 ||
130 arch.
GetTriple().getArch() == llvm::Triple::aarch64_32) {
139 if (arch.
GetTriple().getArch() == llvm::Triple::arm)
141 else if (arch.
GetTriple().getArch() == llvm::Triple::thumb)
147std::optional<RegisterInfo>
189 {0xff000000, 0xd1000000,
No_VFP,
191 "SUB <Xd|SP>, <Xn|SP>, #<imm> {, <shift>}"},
192 {0xff000000, 0xf1000000,
No_VFP,
194 "SUBS <Xd>, <Xn|SP>, #<imm> {, <shift>}"},
195 {0xff000000, 0x91000000,
No_VFP,
197 "ADD <Xd|SP>, <Xn|SP>, #<imm> {, <shift>}"},
198 {0xff000000, 0xb1000000,
No_VFP,
200 "ADDS <Xd>, <Xn|SP>, #<imm> {, <shift>}"},
202 {0xff000000, 0x51000000,
No_VFP,
204 "SUB <Wd|WSP>, <Wn|WSP>, #<imm> {, <shift>}"},
205 {0xff000000, 0x71000000,
No_VFP,
207 "SUBS <Wd>, <Wn|WSP>, #<imm> {, <shift>}"},
208 {0xff000000, 0x11000000,
No_VFP,
210 "ADD <Wd|WSP>, <Wn|WSP>, #<imm> {, <shift>}"},
211 {0xff000000, 0x31000000,
No_VFP,
213 "ADDS <Wd>, <Wn|WSP>, #<imm> {, <shift>}"},
215 {0xffc00000, 0x29000000,
No_VFP,
216 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
217 "STP <Wt>, <Wt2>, [<Xn|SP>{, #<imm>}]"},
218 {0xffc00000, 0xa9000000,
No_VFP,
219 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
220 "STP <Xt>, <Xt2>, [<Xn|SP>{, #<imm>}]"},
221 {0xffc00000, 0x2d000000,
No_VFP,
222 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
223 "STP <St>, <St2>, [<Xn|SP>{, #<imm>}]"},
224 {0xffc00000, 0x6d000000,
No_VFP,
225 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
226 "STP <Dt>, <Dt2>, [<Xn|SP>{, #<imm>}]"},
227 {0xffc00000, 0xad000000,
No_VFP,
228 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
229 "STP <Qt>, <Qt2>, [<Xn|SP>{, #<imm>}]"},
231 {0xffc00000, 0x29800000,
No_VFP,
232 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
233 "STP <Wt>, <Wt2>, [<Xn|SP>, #<imm>]!"},
234 {0xffc00000, 0xa9800000,
No_VFP,
235 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
236 "STP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!"},
237 {0xffc00000, 0x2d800000,
No_VFP,
238 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
239 "STP <St>, <St2>, [<Xn|SP>, #<imm>]!"},
240 {0xffc00000, 0x6d800000,
No_VFP,
241 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
242 "STP <Dt>, <Dt2>, [<Xn|SP>, #<imm>]!"},
243 {0xffc00000, 0xad800000,
No_VFP,
244 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
245 "STP <Qt>, <Qt2>, [<Xn|SP>, #<imm>]!"},
247 {0xffc00000, 0x28800000,
No_VFP,
248 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
249 "STP <Wt>, <Wt2>, [<Xn|SP>, #<imm>]!"},
250 {0xffc00000, 0xa8800000,
No_VFP,
251 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
252 "STP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!"},
253 {0xffc00000, 0x2c800000,
No_VFP,
254 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
255 "STP <St>, <St2>, [<Xn|SP>, #<imm>]!"},
256 {0xffc00000, 0x6c800000,
No_VFP,
257 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
258 "STP <Dt>, <Dt2>, [<Xn|SP>, #<imm>]!"},
259 {0xffc00000, 0xac800000,
No_VFP,
260 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
261 "STP <Qt>, <Qt2>, [<Xn|SP>, #<imm>]!"},
263 {0xffc00000, 0x29400000,
No_VFP,
264 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
265 "LDP <Wt>, <Wt2>, [<Xn|SP>{, #<imm>}]"},
266 {0xffc00000, 0xa9400000,
No_VFP,
267 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
268 "LDP <Xt>, <Xt2>, [<Xn|SP>{, #<imm>}]"},
269 {0xffc00000, 0x2d400000,
No_VFP,
270 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
271 "LDP <St>, <St2>, [<Xn|SP>{, #<imm>}]"},
272 {0xffc00000, 0x6d400000,
No_VFP,
273 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
274 "LDP <Dt>, <Dt2>, [<Xn|SP>{, #<imm>}]"},
275 {0xffc00000, 0xad400000,
No_VFP,
276 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_OFF>,
277 "LDP <Qt>, <Qt2>, [<Xn|SP>{, #<imm>}]"},
279 {0xffc00000, 0x29c00000,
No_VFP,
280 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
281 "LDP <Wt>, <Wt2>, [<Xn|SP>, #<imm>]!"},
282 {0xffc00000, 0xa9c00000,
No_VFP,
283 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
284 "LDP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!"},
285 {0xffc00000, 0x2dc00000,
No_VFP,
286 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
287 "LDP <St>, <St2>, [<Xn|SP>, #<imm>]!"},
288 {0xffc00000, 0x6dc00000,
No_VFP,
289 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
290 "LDP <Dt>, <Dt2>, [<Xn|SP>, #<imm>]!"},
291 {0xffc00000, 0xadc00000,
No_VFP,
292 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_PRE>,
293 "LDP <Qt>, <Qt2>, [<Xn|SP>, #<imm>]!"},
295 {0xffc00000, 0x28c00000,
No_VFP,
296 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
297 "LDP <Wt>, <Wt2>, [<Xn|SP>, #<imm>]!"},
298 {0xffc00000, 0xa8c00000,
No_VFP,
299 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
300 "LDP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!"},
301 {0xffc00000, 0x2cc00000,
No_VFP,
302 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
303 "LDP <St>, <St2>, [<Xn|SP>, #<imm>]!"},
304 {0xffc00000, 0x6cc00000,
No_VFP,
305 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
306 "LDP <Dt>, <Dt2>, [<Xn|SP>, #<imm>]!"},
307 {0xffc00000, 0xacc00000,
No_VFP,
308 &EmulateInstructionARM64::EmulateLDPSTP<AddrMode_POST>,
309 "LDP <Qt>, <Qt2>, [<Xn|SP>, #<imm>]!"},
311 {0xffe00c00, 0xb8000400,
No_VFP,
312 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_POST>,
313 "STR <Wt>, [<Xn|SP>], #<simm>"},
314 {0xffe00c00, 0xf8000400,
No_VFP,
315 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_POST>,
316 "STR <Xt>, [<Xn|SP>], #<simm>"},
317 {0xffe00c00, 0xb8000c00,
No_VFP,
318 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_PRE>,
319 "STR <Wt>, [<Xn|SP>, #<simm>]!"},
320 {0xffe00c00, 0xf8000c00,
No_VFP,
321 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_PRE>,
322 "STR <Xt>, [<Xn|SP>, #<simm>]!"},
323 {0xffc00000, 0xb9000000,
No_VFP,
324 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_OFF>,
325 "STR <Wt>, [<Xn|SP>{, #<pimm>}]"},
326 {0xffc00000, 0xf9000000,
No_VFP,
327 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_OFF>,
328 "STR <Xt>, [<Xn|SP>{, #<pimm>}]"},
330 {0xffe00c00, 0xb8400400,
No_VFP,
331 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_POST>,
332 "LDR <Wt>, [<Xn|SP>], #<simm>"},
333 {0xffe00c00, 0xf8400400,
No_VFP,
334 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_POST>,
335 "LDR <Xt>, [<Xn|SP>], #<simm>"},
336 {0xffe00c00, 0xb8400c00,
No_VFP,
337 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_PRE>,
338 "LDR <Wt>, [<Xn|SP>, #<simm>]!"},
339 {0xffe00c00, 0xf8400c00,
No_VFP,
340 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_PRE>,
341 "LDR <Xt>, [<Xn|SP>, #<simm>]!"},
342 {0xffc00000, 0xb9400000,
No_VFP,
343 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_OFF>,
344 "LDR <Wt>, [<Xn|SP>{, #<pimm>}]"},
345 {0xffc00000, 0xf9400000,
No_VFP,
346 &EmulateInstructionARM64::EmulateLDRSTRImm<AddrMode_OFF>,
347 "LDR <Xt>, [<Xn|SP>{, #<pimm>}]"},
354 "CBZ <Wt>, <label>"},
356 "CBNZ <Wt>, <label>"},
358 "TBZ <R><t>, #<imm>, <label>"},
360 "TBNZ <R><t>, #<imm>, <label>"},
363 static const size_t k_num_arm_opcodes = std::size(g_opcodes);
365 for (
size_t i = 0; i < k_num_arm_opcodes; ++i) {
366 if ((g_opcodes[i].mask & opcode) == g_opcodes[i].value)
367 return &g_opcodes[i];
373 bool success =
false;
390 const uint32_t opcode =
m_opcode.GetOpcode32();
392 if (opcode_data ==
nullptr)
395 const bool auto_advance_pc =
396 evaluate_options & eEmulateInstructionOptionAutoAdvancePC;
398 evaluate_options & eEmulateInstructionOptionIgnoreConditions;
400 bool success =
false;
407 uint32_t orig_pc_value = 0;
408 if (auto_advance_pc) {
416 success = (this->*opcode_data->
callback)(opcode);
420 if (auto_advance_pc) {
421 uint32_t new_pc_value =
426 if (new_pc_value == orig_pc_value) {
446 row->GetCFAValue().SetIsRegisterPlusOffset(
gpr_sp_arm64, 0);
479 Hint_Branch(branch_type);
482 _PC = ZeroExtend(target);
488 if target<55> ==
'1' && TCR_EL1.TBI1 ==
'1' then
489 target<63:56> =
'11111111';
490 if target<55> ==
'0' && TCR_EL1.TBI0 ==
'1' then
491 target<63:56> =
'00000000';
493 if TCR_EL2.TBI ==
'1' then
494 target<63:56> =
'00000000';
496 if TCR_EL3.TBI ==
'1' then
497 target<63:56> =
'00000000';
509 }
else if (N == 64) {
565 uint64_t unsigned_sum =
UInt(x) +
UInt(y) +
UInt(carry_in);
566 std::optional<int64_t> signed_sum = llvm::checkedAdd(
SInt(x),
SInt(y));
567 bool overflow = !signed_sum;
569 overflow |= !llvm::checkedAdd(*signed_sum,
SInt(carry_in));
570 uint64_t result = unsigned_sum;
572 result =
Bits64(result, N - 1, 0);
573 proc_state.
N =
Bit64(result, N - 1);
575 proc_state.
C =
UInt(result) != unsigned_sum;
576 proc_state.
V = overflow;
616 const uint32_t sf =
Bit32(opcode, 31);
617 const uint32_t op =
Bit32(opcode, 30);
618 const uint32_t S =
Bit32(opcode, 29);
619 const uint32_t shift =
Bits32(opcode, 23, 22);
620 const uint32_t imm12 =
Bits32(opcode, 21, 10);
621 const uint32_t Rn =
Bits32(opcode, 9, 5);
622 const uint32_t
Rd =
Bits32(opcode, 4, 0);
624 bool success =
false;
626 const uint32_t d =
UInt(
Rd);
627 const uint32_t n =
UInt(Rn);
628 const uint32_t datasize = (sf == 1) ? 64 : 32;
629 boolean sub_op = op == 1;
630 boolean setflags = S == 1;
638 imm =
static_cast<uint64_t
>(imm12) << 12;
646 uint64_t operand2 = imm;
650 operand2 =
NOT(operand2);
659 result =
AddWithCarry(datasize, operand1, operand2, carry_in, proc_state);
669 std::optional<RegisterInfo> reg_info_Rn =
695template <EmulateInstructionARM64::AddrMode a_mode>
697 uint32_t opc =
Bits32(opcode, 31, 30);
698 uint32_t V =
Bit32(opcode, 26);
699 uint32_t L =
Bit32(opcode, 22);
700 uint32_t imm7 =
Bits32(opcode, 21, 15);
701 uint32_t Rt2 =
Bits32(opcode, 14, 10);
702 uint32_t Rn =
Bits32(opcode, 9, 5);
703 uint32_t Rt =
Bits32(opcode, 4, 0);
711 boolean vector = (V == 1);
713 boolean is_signed =
false;
715 boolean wb_unknown =
false;
716 boolean rt_unknown =
false;
724 scale = 2 +
UInt(opc);
726 scale = (opc & 2) ? 3 : 2;
727 is_signed = (opc & 1) != 0;
732 if (!vector && wback && ((t == n) || (t2 == n))) {
768 idx =
LSL(llvm::SignExtend64<7>(imm7), scale);
770 uint64_t datasize = size * 8;
774 std::optional<RegisterInfo> reg_info_base =
779 std::optional<RegisterInfo> reg_info_Rt;
780 std::optional<RegisterInfo> reg_info_Rt2;
790 if (!reg_info_Rt || !reg_info_Rt2)
793 bool success =
false;
802 wb_address = address + idx;
804 address = wb_address;
828 std::optional<RegisterValue> data_Rt =
ReadRegister(*reg_info_Rt);
832 buffer.resize(reg_info_Rt->byte_size);
833 if (data_Rt->GetAsMemoryData(*reg_info_Rt, buffer.data(),
838 if (!
WriteMemory(context_t, address + 0, buffer.data(),
839 reg_info_Rt->byte_size))
842 std::optional<RegisterValue> data_Rt2 =
ReadRegister(*reg_info_Rt2);
846 buffer.resize(reg_info_Rt2->byte_size);
847 if (data_Rt2->GetAsMemoryData(*reg_info_Rt2, buffer.data(),
852 if (!
WriteMemory(context_t2, address + size, buffer.data(),
853 reg_info_Rt2->byte_size))
871 buffer.resize(reg_info_Rt->byte_size);
873 std::fill(buffer.begin(), buffer.end(),
'U');
875 if (!
ReadMemory(context_t, address, buffer.data(),
876 reg_info_Rt->byte_size))
886 if (!vector && is_signed && !data_Rt.
SignExtend(datasize))
892 buffer.resize(reg_info_Rt2->byte_size);
894 if (!
ReadMemory(context_t2, address + size, buffer.data(),
895 reg_info_Rt2->byte_size))
904 if (!vector && is_signed && !data_Rt2.
SignExtend(datasize))
929template <EmulateInstructionARM64::AddrMode a_mode>
931 uint32_t size =
Bits32(opcode, 31, 30);
932 uint32_t opc =
Bits32(opcode, 23, 22);
933 uint32_t n =
Bits32(opcode, 9, 5);
934 uint32_t t =
Bits32(opcode, 4, 0);
944 offset = llvm::SignExtend64<9>(
Bits32(opcode, 20, 12));
949 offset = llvm::SignExtend64<9>(
Bits32(opcode, 20, 12));
954 offset =
LSL(
Bits32(opcode, 21, 10), size);
960 if (
Bit32(opc, 1) == 0) {
964 if (size == 2 &&
Bit32(opc, 0) == 1)
969 bool success =
false;
986 std::optional<RegisterInfo> reg_info_base =
991 std::optional<RegisterInfo> reg_info_Rt =
1006 postindex ? 0 : offset);
1008 std::optional<RegisterValue> data_Rt =
ReadRegister(*reg_info_Rt);
1012 buffer.resize(reg_info_Rt->byte_size);
1013 if (data_Rt->GetAsMemoryData(*reg_info_Rt, buffer.data(),
1018 if (!
WriteMemory(context, address, buffer.data(), reg_info_Rt->byte_size))
1031 buffer.resize(reg_info_Rt->byte_size);
1032 if (!
ReadMemory(context, address, buffer.data(), reg_info_Rt->byte_size))
1068 BranchTo(PC[] + offset, branch_type);
1071 bool success =
false;
1080 int64_t offset = llvm::SignExtend64<28>(
Bits32(opcode, 25, 0) << 2);
1085 switch (branch_type) {
1097 return BranchTo(context, 64, target);
1103 bits(64) offset = SignExtend(imm19:
'00', 64);
1104 bits(4) condition = cond;
1110 bool success =
false;
1117 int64_t offset = llvm::SignExtend64<21>(
Bits32(opcode, 23, 5) << 2);
1123 if (!
BranchTo(context, 64, target))
1132 integer datasize =
if sf ==
'1' then 64
else 32;
1133 boolean iszero = (op ==
'0');
1134 bits(64) offset = SignExtend(imm19:
'00', 64);
1136 bits(datasize) operand1 = X[t];
1137 if IsZero(operand1) == iszero then
1141 bool success =
false;
1143 uint32_t t =
Bits32(opcode, 4, 0);
1144 bool is_zero =
Bit32(opcode, 24) == 0;
1145 int32_t offset = llvm::SignExtend64<21>(
Bits32(opcode, 23, 5) << 2);
1147 const uint64_t operand =
1170 integer datasize =
if b5 ==
'1' then 64
else 32;
1173 bits(64) offset = SignExtend(imm14:
'00', 64);
1176 bool success =
false;
1178 uint32_t t =
Bits32(opcode, 4, 0);
1179 uint32_t bit_pos = (
Bit32(opcode, 31) << 6) | (
Bits32(opcode, 23, 19));
1180 uint32_t bit_val =
Bit32(opcode, 24);
1181 int64_t offset = llvm::SignExtend64<16>(
Bits32(opcode, 18, 5) << 2);
1183 const uint64_t operand =
static llvm::raw_ostream & error(Stream &strm)
EmulateInstructionARM64::ConstraintType ConstrainUnpredictable(EmulateInstructionARM64::Unpredictable which)
static uint64_t NOT(uint64_t x)
static uint64_t LSL(uint64_t x, integer shift)
static std::optional< RegisterInfo > LLDBTableGetRegisterInfo(uint32_t reg_num)
static bool IsZero(uint64_t x)
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
bool EmulateLDRSTRImm(const uint32_t opcode)
std::optional< lldb_private::RegisterInfo > GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num) override
static bool SupportsEmulatingInstructionsOfTypeStatic(lldb_private::InstructionType inst_type)
bool ReadInstruction() override
static llvm::StringRef GetPluginNameStatic()
bool EmulateLDPSTP(const uint32_t opcode)
bool EmulateTBZ(const uint32_t opcode)
bool EmulateBcond(const uint32_t opcode)
static Opcode * GetOpcodeForInstruction(const uint32_t opcode)
@ Unpredictable_LDPOVERLAP
@ Unpredictable_WBOVERLAP
ProcState m_opcode_pstate
bool BranchTo(const Context &context, uint32_t N, lldb::addr_t target)
bool EmulateCBZ(const uint32_t opcode)
bool SetTargetTriple(const lldb_private::ArchSpec &arch) override
bool CreateFunctionEntryUnwind(lldb_private::UnwindPlan &unwind_plan) override
bool EvaluateInstruction(uint32_t evaluate_options) override
static llvm::StringRef GetPluginDescriptionStatic()
bool EmulateADDSUBImm(const uint32_t opcode)
bool ConditionHolds(const uint32_t cond)
bool EmulateB(const uint32_t opcode)
ProcState m_emulated_pstate
uint32_t GetFramePointerRegisterNumber() const
static lldb_private::EmulateInstruction * CreateInstance(const lldb_private::ArchSpec &arch, lldb_private::InstructionType inst_type)
static uint64_t AddWithCarry(uint32_t N, uint64_t x, uint64_t y, bool carry_in, EmulateInstructionARM64::ProcState &proc_state)
An architecture specification class.
llvm::Triple & GetTriple()
Architecture triple accessor.
"lldb/Core/EmulateInstruction.h" A class that allows emulation of CPU opcodes.
@ eContextRelativeBranchImmediate
@ eContextSetFramePointer
@ eContextAdjustBaseRegister
@ eContextAdjustStackPointer
@ eContextRestoreStackPointer
@ eContextPushRegisterOnStack
@ eContextPopRegisterOffStack
lldb::ByteOrder GetByteOrder() const
size_t ReadMemory(const Context &context, lldb::addr_t addr, void *dst, size_t dst_len)
std::optional< RegisterValue > ReadRegister(const RegisterInfo ®_info)
bool WriteRegister(const Context &context, const RegisterInfo &ref_info, const RegisterValue ®_value)
bool WriteRegisterUnsigned(const Context &context, const RegisterInfo ®_info, uint64_t reg_value)
bool WriteMemory(const Context &context, lldb::addr_t addr, const void *src, size_t src_len)
uint64_t ReadMemoryUnsigned(const Context &context, lldb::addr_t addr, size_t byte_size, uint64_t fail_value, bool *success_ptr)
uint64_t ReadRegisterUnsigned(const RegisterInfo ®_info, uint64_t fail_value, bool *success_ptr)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
bool SignExtend(uint32_t sign_bitpos)
uint32_t SetFromMemoryData(const RegisterInfo ®_info, const void *src, uint32_t src_len, lldb::ByteOrder src_byte_order, Status &error)
llvm::SmallVector< uint8_t, kTypicalRegisterByteSize > BytesContainer
void SetUnwindPlanForSignalTrap(lldb_private::LazyBool is_for_signal_trap)
void SetRegisterKind(lldb::RegisterKind kind)
void SetReturnAddressRegister(uint32_t regnum)
void AppendRow(const RowSP &row_sp)
std::shared_ptr< Row > RowSP
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
void SetSourceName(const char *)
void SetUnwindPlanValidAtAllInstructions(lldb_private::LazyBool valid_at_all_insn)
#define LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_INVALID_ADDRESS
#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.
static uint64_t Bits64(const uint64_t bits, const uint32_t msbit, const uint32_t lsbit)
InstructionType
Instruction types.
static uint64_t UnsignedBits(const uint64_t value, const uint64_t msbit, const uint64_t lsbit)
static uint32_t Bits32(const uint32_t bits, const uint32_t msbit, const uint32_t lsbit)
static uint64_t Bit64(const uint64_t bits, const uint32_t bit)
static uint32_t bits(const uint32_t val, const uint32_t msbit, const uint32_t lsbit)
static uint32_t Bit32(const uint32_t bits, const uint32_t bit)
RegisterKind
Register numbering types.
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindLLDB
lldb's internal register numbers
bool(EmulateInstructionARM64::* callback)(const uint32_t opcode)
void SetRegisterPlusOffset(RegisterInfo base_reg, int64_t signed_offset)
void SetImmediateSigned(int64_t signed_immediate)
void SetRegisterToRegisterPlusOffset(RegisterInfo data_reg, RegisterInfo base_reg, int64_t offset)
void SetAddress(lldb::addr_t address)
Every register is described in detail including its name, alternate name (optional),...