24#include "llvm-c/Disassembler.h"
25#include "llvm/MC/MCAsmInfo.h"
26#include "llvm/MC/MCContext.h"
27#include "llvm/MC/MCDisassembler/MCDisassembler.h"
28#include "llvm/MC/MCInst.h"
29#include "llvm/MC/MCInstrInfo.h"
30#include "llvm/MC/MCRegisterInfo.h"
31#include "llvm/MC/MCSubtargetInfo.h"
32#include "llvm/MC/MCTargetOptions.h"
33#include "llvm/MC/TargetRegistry.h"
34#include "llvm/Support/TargetSelect.h"
36#include "llvm/ADT/STLExtras.h"
46#define UInt(x) ((uint64_t)x)
47#define integer int64_t
55void LLVMInitializeMipsTargetInfo();
56void LLVMInitializeMipsTarget();
57void LLVMInitializeMipsAsmPrinter();
58void LLVMInitializeMipsTargetMC();
59void LLVMInitializeMipsDisassembler();
69 const llvm::Target *target =
70 llvm::TargetRegistry::lookupTarget(triple.getTriple(),
Status);
82 LLVMInitializeMipsTargetInfo();
83 LLVMInitializeMipsTarget();
84 LLVMInitializeMipsAsmPrinter();
85 LLVMInitializeMipsTargetMC();
86 LLVMInitializeMipsDisassembler();
87 target = llvm::TargetRegistry::lookupTarget(triple.getTriple(),
Status);
141 std::string features;
142 uint32_t arch_flags = arch.
GetFlags();
148 features +=
"+dspr2,";
150 features +=
"+mips16,";
152 features +=
"+micromips,";
154 m_reg_info.reset(target->createMCRegInfo(triple.getTriple()));
160 llvm::MCTargetOptions MCOptions;
162 target->createMCAsmInfo(*
m_reg_info, triple.getTriple(), MCOptions));
164 target->createMCSubtargetInfo(triple.getTriple(), cpu, features));
167 m_context = std::make_unique<llvm::MCContext>(
185 return "Emulate instructions for the MIPS64 architecture.";
193 if (arch.
GetTriple().getArch() == llvm::Triple::mips64 ||
194 arch.
GetTriple().getArch() == llvm::Triple::mips64el) {
203 return arch.
GetTriple().getArch() == llvm::Triple::mips64 ||
204 arch.
GetTriple().getArch() == llvm::Triple::mips64el;
208 bool alternate_name) {
209 if (alternate_name) {
576std::optional<RegisterInfo>
664 "DADDIU rt, rs, immediate"},
666 "ADDIU rt, rs, immediate"},
688 "LB rt, offset(base)"},
690 "LBE rt, offset(base)"},
692 "LBU rt, offset(base)"},
694 "LBUE rt, offset(base)"},
696 "LDC1 ft, offset(base)"},
698 "LDL rt, offset(base)"},
700 "LDR rt, offset(base)"},
702 "LLD rt, offset(base)"},
704 "LDC2 rt, offset(base)"},
706 "LDXC1 fd, index (base)"},
708 "LH rt, offset(base)"},
710 "LHE rt, offset(base)"},
712 "LHU rt, offset(base)"},
714 "LHUE rt, offset(base)"},
716 "LL rt, offset(base)"},
718 "LLE rt, offset(base)"},
720 "LUXC1 fd, index (base)"},
722 "LW rt, offset(rs)"},
724 "LWC1 ft, offset(base)"},
726 "LWC2 rt, offset(base)"},
728 "LWE rt, offset(base)"},
730 "LWL rt, offset(base)"},
732 "LWLE rt, offset(base)"},
734 "LWR rt, offset(base)"},
736 "LWRE rt, offset(base)"},
738 "LWXC1 fd, index (base)"},
741 "SB rt, offset(base)"},
743 "SBE rt, offset(base)"},
745 "SC rt, offset(base)"},
747 "SCE rt, offset(base)"},
749 "SCD rt, offset(base)"},
751 "SDL rt, offset(base)"},
753 "SDR rt, offset(base)"},
755 "SDC1 ft, offset(base)"},
757 "SDC2 rt, offset(base)"},
759 "SDXC1 fs, index (base)"},
761 "SH rt, offset(base)"},
763 "SHE rt, offset(base)"},
765 "SUXC1 fs, index (base)"},
767 "SW rt, offset(rs)"},
769 "SWC1 ft, offset(base)"},
771 "SWC2 rt, offset(base)"},
773 "SWE rt, offset(base)"},
775 "SWL rt, offset(base)"},
777 "SWLE rt, offset(base)"},
779 "SWR rt, offset(base)"},
781 "SWRE rt, offset(base)"},
783 "SWXC1 fs, index (base)"},
791 "BEQL rs,rt,offset"},
793 "BNEL rs,rt,offset"},
795 "BGEZALL rt,offset"},
804 "BLEZALC rs,offset"},
806 "BGEZALC rs,offset"},
808 "BLTZALC rs,offset"},
810 "BGTZALC rs,offset"},
812 "BEQZALC rs,offset"},
814 "BNEZALC rs,offset"},
816 "BEQC rs,rt,offset"},
818 "BEQC rs,rt,offset"},
820 "BNEC rs,rt,offset"},
822 "BNEC rs,rt,offset"},
824 "BLTC rs,rt,offset"},
826 "BLTC rs,rt,offset"},
828 "BGEC rs,rt,offset"},
830 "BGEC rs,rt,offset"},
832 "BLTUC rs,rt,offset"},
834 "BLTUC rs,rt,offset"},
836 "BGEUC rs,rt,offset"},
838 "BGEUC rs,rt,offset"},
875 "BLTZALL rt,offset"},
878 "BOVC rs,rt,offset"},
880 "BNVC rs,rt,offset"},
901 "BC1EQZ ft, offset"},
903 "BC1NEZ ft, offset"},
905 "BC1ANY2F cc, offset"},
907 "BC1ANY2T cc, offset"},
909 "BC1ANY4F cc, offset"},
911 "BC1ANY4T cc, offset"},
925 if (op_name.equals_insensitive(opcode.op_name))
932 bool success =
false;
949 bool success =
false;
950 llvm::MCInst mc_insn;
957 llvm::MCDisassembler::DecodeStatus decode_status;
959 decode_status =
m_disasm->getInstruction(mc_insn, insn_size, raw_insn,
961 if (decode_status != llvm::MCDisassembler::Success)
969 llvm::StringRef op_name =
m_insn_info->getName(mc_insn.getOpcode());
977 if (opcode_data ==
nullptr)
980 uint64_t old_pc = 0, new_pc = 0;
981 const bool auto_advance_pc =
982 evaluate_options & eEmulateInstructionOptionAutoAdvancePC;
984 if (auto_advance_pc) {
992 success = (this->*opcode_data->
callback)(mc_insn);
996 if (auto_advance_pc) {
1003 if (old_pc == new_pc) {
1017 unwind_plan.
Clear();
1021 const bool can_replace =
false;
1068 bool success =
false;
1069 const uint32_t imm16 = insn.getOperand(2).getImm();
1072 dst =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1073 src =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1101 uint64_t result = src_opd_val + imm;
1102 std::optional<RegisterInfo> reg_info_sp =
1129 bool success =
false;
1130 uint32_t imm16 = insn.getOperand(2).getImm();
1135 src =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1136 base =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1138 std::optional<RegisterInfo> reg_info_base =
1140 std::optional<RegisterInfo> reg_info_src =
1142 if (!reg_info_base || !reg_info_src)
1152 address = address + imm;
1160 std::optional<RegisterValue> data_src =
ReadRegister(*reg_info_base);
1166 if (data_src->GetAsMemoryData(*reg_info_src, buffer.data(),
1171 if (!
WriteMemory(context, address, buffer.data(), reg_info_src->byte_size))
1184 bool success =
false;
1186 int64_t imm, address;
1189 src =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1190 base =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1191 imm = insn.getOperand(2).getImm();
1203 address = address + imm;
1212 std::optional<RegisterInfo> reg_info_src =
1230 const uint32_t imm32 = insn.getOperand(1).getImm() << 16;
1235 rt =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1248 bool success =
false;
1250 uint8_t src, dst, rt;
1251 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1253 dst =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1254 src =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1258 rt =
m_reg_info->getEncodingValue(insn.getOperand(2).getReg());
1272 if (op_name.equals_insensitive(
"DSUBU") ||
1273 op_name.equals_insensitive(
"SUBU"))
1274 result = src_opd_val - rt_opd_val;
1276 result = src_opd_val + rt_opd_val;
1279 std::optional<RegisterInfo> reg_info_sp =
1291 rt =
m_reg_info->getEncodingValue(insn.getOperand(2).getReg());
1307 if (op_name.equals_insensitive(
"DSUBU") ||
1308 op_name.equals_insensitive(
"SUBU"))
1309 result = src_opd_val - rt_opd_val;
1311 result = src_opd_val + rt_opd_val;
1330 bool success =
false;
1332 int64_t offset,
pc, rs_val, rt_val, target = 0;
1333 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1335 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1336 rt =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1337 offset = insn.getOperand(2).getImm();
1353 if (op_name.equals_insensitive(
"BEQ") || op_name.equals_insensitive(
"BEQL") ||
1354 op_name.equals_insensitive(
"BEQ64")) {
1355 if (rs_val == rt_val)
1356 target =
pc + offset;
1359 }
else if (op_name.equals_insensitive(
"BNE") ||
1360 op_name.equals_insensitive(
"BNEL") ||
1361 op_name.equals_insensitive(
"BNE64")) {
1362 if (rs_val != rt_val)
1363 target =
pc + offset;
1382 bool success =
false;
1384 int64_t offset,
pc, target = 0;
1386 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1388 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1389 offset = insn.getOperand(1).getImm();
1400 if (op_name.equals_insensitive(
"BLTZAL") ||
1401 op_name.equals_insensitive(
"BLTZALL")) {
1403 target =
pc + offset;
1406 }
else if (op_name.equals_insensitive(
"BGEZAL") ||
1407 op_name.equals_insensitive(
"BGEZALL")) {
1409 target =
pc + offset;
1428 bool success =
false;
1429 int64_t offset,
pc, target;
1437 offset = insn.getOperand(0).getImm();
1443 target =
pc + offset;
1459 bool success =
false;
1460 int64_t offset,
pc, target;
1468 offset = insn.getOperand(0).getImm();
1474 target =
pc + offset;
1494 bool success =
false;
1496 int64_t offset,
pc, rs_val, target = 0;
1497 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1499 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1500 offset = insn.getOperand(1).getImm();
1511 if (op_name.equals_insensitive(
"BLEZALC")) {
1513 target =
pc + offset;
1516 }
else if (op_name.equals_insensitive(
"BGEZALC")) {
1518 target =
pc + offset;
1521 }
else if (op_name.equals_insensitive(
"BLTZALC")) {
1523 target =
pc + offset;
1526 }
else if (op_name.equals_insensitive(
"BGTZALC")) {
1528 target =
pc + offset;
1531 }
else if (op_name.equals_insensitive(
"BEQZALC")) {
1533 target =
pc + offset;
1536 }
else if (op_name.equals_insensitive(
"BNEZALC")) {
1538 target =
pc + offset;
1562 bool success =
false;
1564 int64_t offset,
pc, rs_val, target = 0;
1565 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1567 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1568 offset = insn.getOperand(1).getImm();
1579 if (op_name.equals_insensitive(
"BLTZL") ||
1580 op_name.equals_insensitive(
"BLTZ") ||
1581 op_name.equals_insensitive(
"BLTZ64")) {
1583 target =
pc + offset;
1586 }
else if (op_name.equals_insensitive(
"BGEZL") ||
1587 op_name.equals_insensitive(
"BGEZ") ||
1588 op_name.equals_insensitive(
"BGEZ64")) {
1590 target =
pc + offset;
1593 }
else if (op_name.equals_insensitive(
"BGTZL") ||
1594 op_name.equals_insensitive(
"BGTZ") ||
1595 op_name.equals_insensitive(
"BGTZ64")) {
1597 target =
pc + offset;
1600 }
else if (op_name.equals_insensitive(
"BLEZL") ||
1601 op_name.equals_insensitive(
"BLEZ") ||
1602 op_name.equals_insensitive(
"BLEZ64")) {
1604 target =
pc + offset;
1618 bool success =
false;
1619 int64_t offset,
pc, target;
1626 offset = insn.getOperand(0).getImm();
1632 target =
pc + offset;
1641 int64_t r = (uint64_t)a + (uint64_t)b;
1642 return (a < 0 && b < 0 && r >= 0) || (a >= 0 && b >= 0 && r < 0);
1651 bool success =
false;
1653 int64_t offset,
pc, rs_val, rt_val, target = 0;
1654 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1655 uint32_t current_inst_size =
m_insn_info->get(insn.getOpcode()).getSize();
1657 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1658 rt =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1659 offset = insn.getOperand(2).getImm();
1675 if (op_name.equals_insensitive(
"BEQC") ||
1676 op_name.equals_insensitive(
"BEQC64")) {
1677 if (rs_val == rt_val)
1678 target =
pc + offset;
1681 }
else if (op_name.equals_insensitive(
"BNEC") ||
1682 op_name.equals_insensitive(
"BNEC64")) {
1683 if (rs_val != rt_val)
1684 target =
pc + offset;
1687 }
else if (op_name.equals_insensitive(
"BLTC") ||
1688 op_name.equals_insensitive(
"BLTC64")) {
1689 if (rs_val < rt_val)
1690 target =
pc + offset;
1693 }
else if (op_name.equals_insensitive(
"BGEC64") ||
1694 op_name.equals_insensitive(
"BGEC")) {
1695 if (rs_val >= rt_val)
1696 target =
pc + offset;
1699 }
else if (op_name.equals_insensitive(
"BLTUC") ||
1700 op_name.equals_insensitive(
"BLTUC64")) {
1701 if (rs_val < rt_val)
1702 target =
pc + offset;
1705 }
else if (op_name.equals_insensitive(
"BGEUC") ||
1706 op_name.equals_insensitive(
"BGEUC64")) {
1707 if ((uint32_t)rs_val >= (uint32_t)rt_val)
1708 target =
pc + offset;
1711 }
else if (op_name.equals_insensitive(
"BOVC")) {
1713 target =
pc + offset;
1716 }
else if (op_name.equals_insensitive(
"BNVC")) {
1718 target =
pc + offset;
1736 bool success =
false;
1738 int64_t offset,
pc, target = 0;
1740 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1741 uint32_t current_inst_size =
m_insn_info->get(insn.getOpcode()).getSize();
1743 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1744 offset = insn.getOperand(1).getImm();
1755 if (op_name.equals_insensitive(
"BLTZC") ||
1756 op_name.equals_insensitive(
"BLTZC64")) {
1758 target =
pc + offset;
1761 }
else if (op_name.equals_insensitive(
"BLEZC") ||
1762 op_name.equals_insensitive(
"BLEZC64")) {
1764 target =
pc + offset;
1767 }
else if (op_name.equals_insensitive(
"BGEZC") ||
1768 op_name.equals_insensitive(
"BGEZC64")) {
1770 target =
pc + offset;
1773 }
else if (op_name.equals_insensitive(
"BGTZC") ||
1774 op_name.equals_insensitive(
"BGTZC64")) {
1776 target =
pc + offset;
1779 }
else if (op_name.equals_insensitive(
"BEQZC") ||
1780 op_name.equals_insensitive(
"BEQZC64")) {
1782 target =
pc + offset;
1785 }
else if (op_name.equals_insensitive(
"BNEZC") ||
1786 op_name.equals_insensitive(
"BNEZC64")) {
1788 target =
pc + offset;
1802 bool success =
false;
1803 uint64_t offset,
pc;
1810 offset = insn.getOperand(0).getImm();
1817 pc = (
pc & 0xFFFFFFFFF0000000ULL) | offset;
1826 bool success =
false;
1827 uint64_t offset, target,
pc;
1834 offset = insn.getOperand(0).getImm();
1841 target = (
pc & 0xFFFFFFFFF0000000ULL) | offset;
1857 bool success =
false;
1859 uint64_t
pc, rs_val;
1866 rt =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1867 rs =
m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
1892 bool success =
false;
1894 int64_t target, offset,
pc, rt_val;
1902 rt =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1903 offset = insn.getOperand(1).getImm();
1914 target = rt_val + offset;
1930 bool success =
false;
1932 int64_t target, offset, rt_val;
1939 rt =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1940 offset = insn.getOperand(1).getImm();
1947 target = rt_val + offset;
1956 bool success =
false;
1964 rs =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1983 bool success =
false;
1985 int64_t
pc, offset, target = 0;
1986 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
1995 cc =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
1996 offset = insn.getOperand(1).getImm();
2008 fcsr = ((fcsr >> 24) & 0xfe) | ((fcsr >> 23) & 0x01);
2010 if (op_name.equals_insensitive(
"BC1F") ||
2011 op_name.equals_insensitive(
"BC1FL")) {
2012 if ((fcsr & (1 << cc)) == 0)
2013 target =
pc + offset;
2016 }
else if (op_name.equals_insensitive(
"BC1T") ||
2017 op_name.equals_insensitive(
"BC1TL")) {
2018 if ((fcsr & (1 << cc)) != 0)
2019 target =
pc + offset;
2031 bool success =
false;
2034 int64_t target,
pc, offset;
2043 ft =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
2044 offset = insn.getOperand(1).getImm();
2055 if ((ft_val & 1) == 0)
2056 target =
pc + 4 + offset;
2067 bool success =
false;
2070 int64_t target,
pc, offset;
2079 ft =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
2080 offset = insn.getOperand(1).getImm();
2091 if ((ft_val & 1) != 0)
2092 target =
pc + 4 + offset;
2110 bool success =
false;
2112 int64_t
pc, offset, target = 0;
2113 llvm::StringRef op_name =
m_insn_info->getName(insn.getOpcode());
2115 cc =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
2116 offset = insn.getOperand(1).getImm();
2128 fcsr = ((fcsr >> 24) & 0xfe) | ((fcsr >> 23) & 0x01);
2130 if (op_name.equals_insensitive(
"BC1ANY2F")) {
2132 if (((fcsr >> cc) & 3) != 3)
2133 target =
pc + offset;
2136 }
else if (op_name.equals_insensitive(
"BC1ANY2T")) {
2138 if (((fcsr >> cc) & 3) != 0)
2139 target =
pc + offset;
2142 }
else if (op_name.equals_insensitive(
"BC1ANY4F")) {
2144 if (((fcsr >> cc) & 0xf) != 0xf)
2145 target =
pc + offset;
2148 }
else if (op_name.equals_insensitive(
"BC1ANY4T")) {
2150 if (((fcsr >> cc) & 0xf) != 0)
2151 target =
pc + offset;
2195 int element_byte_size,
2197 bool success =
false, branch_hit =
true;
2200 const uint8_t *ptr =
nullptr;
2202 uint32_t wt =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
2203 int64_t offset = insn.getOperand(1).getImm();
2211 ptr = (
const uint8_t *)reg_value.
GetBytes();
2215 for (
int i = 0; i < 16 / element_byte_size; i++) {
2216 switch (element_byte_size) {
2218 if ((*ptr == 0 && bnz) || (*ptr != 0 && !bnz))
2222 if ((*(
const uint16_t *)ptr == 0 && bnz) ||
2223 (*(
const uint16_t *)ptr != 0 && !bnz))
2227 if ((*(
const uint32_t *)ptr == 0 && bnz) ||
2228 (*(
const uint32_t *)ptr != 0 && !bnz))
2232 if ((*(
const uint64_t *)ptr == 0 && bnz) ||
2233 (*(
const uint64_t *)ptr != 0 && !bnz))
2239 ptr = ptr + element_byte_size;
2243 target =
pc + offset;
2264 bool success =
false;
2266 llvm::APInt wr_val = llvm::APInt::getZero(128);
2267 llvm::APInt fail_value = llvm::APInt::getMaxValue(128);
2268 llvm::APInt zero_value = llvm::APInt::getZero(128);
2271 uint32_t wt =
m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
2272 int64_t offset = insn.getOperand(1).getImm();
2284 if ((llvm::APInt::isSameValue(zero_value, wr_val) && !bnz) ||
2285 (!llvm::APInt::isSameValue(zero_value, wr_val) && bnz))
2286 target =
pc + offset;
2298 bool success =
false;
2300 int64_t imm, address;
2303 uint32_t num_operands = insn.getNumOperands();
2305 m_reg_info->getEncodingValue(insn.getOperand(num_operands - 2).getReg());
2306 imm = insn.getOperand(num_operands - 1).getImm();
2318 address = address + imm;
2329 bool success =
false;
2330 uint32_t base, index;
2331 int64_t address, index_address;
2334 uint32_t num_operands = insn.getNumOperands();
2336 m_reg_info->getEncodingValue(insn.getOperand(num_operands - 2).getReg());
2338 m_reg_info->getEncodingValue(insn.getOperand(num_operands - 1).getReg());
2359 address = address + index_address;
static llvm::raw_ostream & error(Stream &strm)
static int IsAdd64bitOverflow(int64_t a, int64_t b)
static int IsAdd64bitOverflow(int32_t a, int32_t b)
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
bool ReadInstruction() override
std::unique_ptr< llvm::MCAsmInfo > m_asm_info
const char * GetRegisterName(unsigned reg_num, bool alternate_name)
bool Emulate_FP_branch(llvm::MCInst &insn)
bool Emulate_JIALC(llvm::MCInst &insn)
bool Emulate_BNZH(llvm::MCInst &insn)
bool Emulate_BXX_2ops(llvm::MCInst &insn)
static lldb_private::EmulateInstruction * CreateInstance(const lldb_private::ArchSpec &arch, lldb_private::InstructionType inst_type)
bool Emulate_Bcond_Link_C(llvm::MCInst &insn)
bool Emulate_SD(llvm::MCInst &insn)
bool Emulate_LD(llvm::MCInst &insn)
bool Emulate_BAL(llvm::MCInst &insn)
bool Emulate_BC(llvm::MCInst &insn)
bool Emulate_BXX_3ops_C(llvm::MCInst &insn)
bool Emulate_MSA_Branch_V(llvm::MCInst &insn, bool bnz)
bool Emulate_BZD(llvm::MCInst &insn)
bool Emulate_BNZV(llvm::MCInst &insn)
bool Emulate_BXX_3ops(llvm::MCInst &insn)
bool SetTargetTriple(const lldb_private::ArchSpec &arch) override
std::unique_ptr< llvm::MCDisassembler > m_disasm
bool Emulate_JR(llvm::MCInst &insn)
bool Emulate_JIC(llvm::MCInst &insn)
bool Emulate_LUI(llvm::MCInst &insn)
std::unique_ptr< llvm::MCContext > m_context
static MipsOpcode * GetOpcodeForInstruction(llvm::StringRef op_name)
bool Emulate_BXX_2ops_C(llvm::MCInst &insn)
bool Emulate_BNZB(llvm::MCInst &insn)
bool Emulate_3D_branch(llvm::MCInst &insn)
bool Emulate_BNZD(llvm::MCInst &insn)
static llvm::StringRef GetPluginDescriptionStatic()
static bool SupportsEmulatingInstructionsOfTypeStatic(lldb_private::InstructionType inst_type)
bool Emulate_LDST_Reg(llvm::MCInst &insn)
bool Emulate_LDST_Imm(llvm::MCInst &insn)
bool Emulate_BZW(llvm::MCInst &insn)
bool Emulate_DSUBU_DADDU(llvm::MCInst &insn)
bool Emulate_BZB(llvm::MCInst &insn)
bool Emulate_J(llvm::MCInst &insn)
bool Emulate_JALR(llvm::MCInst &insn)
bool Emulate_DADDiu(llvm::MCInst &insn)
std::unique_ptr< llvm::MCSubtargetInfo > m_subtype_info
std::unique_ptr< llvm::MCInstrInfo > m_insn_info
bool Emulate_BC1NEZ(llvm::MCInst &insn)
bool Emulate_MSA_Branch_DF(llvm::MCInst &insn, int element_byte_size, bool bnz)
std::unique_ptr< llvm::MCRegisterInfo > m_reg_info
bool Emulate_Bcond_Link(llvm::MCInst &insn)
bool Emulate_BC1EQZ(llvm::MCInst &insn)
bool Emulate_BZH(llvm::MCInst &insn)
bool Emulate_JAL(llvm::MCInst &insn)
bool Emulate_BZV(llvm::MCInst &insn)
bool nonvolatile_reg_p(uint64_t regnum)
bool CreateFunctionEntryUnwind(lldb_private::UnwindPlan &unwind_plan) override
EmulateInstructionMIPS64(const lldb_private::ArchSpec &arch)
bool Emulate_BALC(llvm::MCInst &insn)
std::optional< lldb_private::RegisterInfo > GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num) override
bool Emulate_BNZW(llvm::MCInst &insn)
static llvm::StringRef GetPluginNameStatic()
bool EvaluateInstruction(uint32_t evaluate_options) override
An architecture specification class.
llvm::Triple & GetTriple()
Architecture triple accessor.
uint32_t GetFlags() const
"lldb/Core/EmulateInstruction.h" A class that allows emulation of CPU opcodes.
@ eContextRelativeBranchImmediate
@ eContextAdjustStackPointer
@ eContextPushRegisterOnStack
lldb::ByteOrder GetByteOrder() const
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)
uint32_t GetData(DataExtractor &data) const
void SetOpcode32(uint32_t inst, lldb::ByteOrder order)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
llvm::APInt GetAsUInt128(const llvm::APInt &fail_value, bool *success_ptr=nullptr) const
const void * GetBytes() const
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.
InstructionType
Instruction types.
static int64_t SignedBits(const uint64_t value, const uint64_t msbit, const uint64_t lsbit)
@ eEncodingVector
vector registers
@ eEncodingUint
unsigned integer
RegisterKind
Register numbering types.
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindDWARF
the register numbers seen DWARF
bool(EmulateInstructionMIPS64::* callback)(llvm::MCInst &insn)
void SetImmediate(uint64_t immediate)
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)
Every register is described in detail including its name, alternate name (optional),...
lldb::Encoding encoding
Encoding of the register bits.
const char * alt_name
Alternate name of this register, can be NULL.
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.
const char * name
Name of this register, can't be NULL.
lldb::Format format
Default display format.