23 #include "opcode/i386.h" 62 "rax",
"rbx",
"rcx",
"rdx",
"rsi",
"rdi",
"rbp",
"rsp",
65 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
66 "rip",
"eflags",
"cs",
"ss",
"ds",
"es",
"fs",
"gs",
69 "st0",
"st1",
"st2",
"st3",
"st4",
"st5",
"st6",
"st7",
70 "fctrl",
"fstat",
"ftag",
"fiseg",
"fioff",
"foseg",
"fooff",
"fop",
73 "xmm0",
"xmm1",
"xmm2",
"xmm3",
"xmm4",
"xmm5",
"xmm6",
"xmm7",
74 "xmm8",
"xmm9",
"xmm10",
"xmm11",
"xmm12",
"xmm13",
"xmm14",
"xmm15",
80 "ymm0",
"ymm1",
"ymm2",
"ymm3",
81 "ymm4",
"ymm5",
"ymm6",
"ymm7",
82 "ymm8",
"ymm9",
"ymm10",
"ymm11",
83 "ymm12",
"ymm13",
"ymm14",
"ymm15" 88 "ymm16",
"ymm17",
"ymm18",
"ymm19",
89 "ymm20",
"ymm21",
"ymm22",
"ymm23",
90 "ymm24",
"ymm25",
"ymm26",
"ymm27",
91 "ymm28",
"ymm29",
"ymm30",
"ymm31" 96 "ymm0h",
"ymm1h",
"ymm2h",
"ymm3h",
97 "ymm4h",
"ymm5h",
"ymm6h",
"ymm7h",
98 "ymm8h",
"ymm9h",
"ymm10h",
"ymm11h",
99 "ymm12h",
"ymm13h",
"ymm14h",
"ymm15h" 104 "ymm16h",
"ymm17h",
"ymm18h",
"ymm19h",
105 "ymm20h",
"ymm21h",
"ymm22h",
"ymm23h",
106 "ymm24h",
"ymm25h",
"ymm26h",
"ymm27h",
107 "ymm28h",
"ymm29h",
"ymm30h",
"ymm31h" 112 "bnd0raw",
"bnd1raw",
"bnd2raw",
"bnd3raw",
"bndcfgu",
"bndstatus" 117 "k0",
"k1",
"k2",
"k3",
118 "k4",
"k5",
"k6",
"k7" 123 "zmm0h",
"zmm1h",
"zmm2h",
"zmm3h",
124 "zmm4h",
"zmm5h",
"zmm6h",
"zmm7h",
125 "zmm8h",
"zmm9h",
"zmm10h",
"zmm11h",
126 "zmm12h",
"zmm13h",
"zmm14h",
"zmm15h",
127 "zmm16h",
"zmm17h",
"zmm18h",
"zmm19h",
128 "zmm20h",
"zmm21h",
"zmm22h",
"zmm23h",
129 "zmm24h",
"zmm25h",
"zmm26h",
"zmm27h",
130 "zmm28h",
"zmm29h",
"zmm30h",
"zmm31h" 135 "zmm0",
"zmm1",
"zmm2",
"zmm3",
136 "zmm4",
"zmm5",
"zmm6",
"zmm7",
137 "zmm8",
"zmm9",
"zmm10",
"zmm11",
138 "zmm12",
"zmm13",
"zmm14",
"zmm15",
139 "zmm16",
"zmm17",
"zmm18",
"zmm19",
140 "zmm20",
"zmm21",
"zmm22",
"zmm23",
141 "zmm24",
"zmm25",
"zmm26",
"zmm27",
142 "zmm28",
"zmm29",
"zmm30",
"zmm31" 146 "xmm16",
"xmm17",
"xmm18",
"xmm19",
147 "xmm20",
"xmm21",
"xmm22",
"xmm23",
148 "xmm24",
"xmm25",
"xmm26",
"xmm27",
149 "xmm28",
"xmm29",
"xmm30",
"xmm31" 207 -1, -1, -1, -1, -1, -1, -1, -1,
301 "al",
"bl",
"cl",
"dl",
"sil",
"dil",
"bpl",
"spl",
302 "r8l",
"r9l",
"r10l",
"r11l",
"r12l",
"r13l",
"r14l",
"r15l",
303 "ah",
"bh",
"ch",
"dh" 307 #define AMD64_NUM_LOWER_BYTE_REGS 16 313 "ax",
"bx",
"cx",
"dx",
"si",
"di",
"bp",
"",
314 "r8w",
"r9w",
"r10w",
"r11w",
"r12w",
"r13w",
"r14w",
"r15w" 321 "eax",
"ebx",
"ecx",
"edx",
"esi",
"edi",
"ebp",
"esp",
322 "r8d",
"r9d",
"r10d",
"r11d",
"r12d",
"r13d",
"r14d",
"r15d",
348 static struct value *
356 struct value *result_value;
376 memcpy (buf, raw_buf + 1, 1);
385 memcpy (buf, raw_buf, 1);
397 memcpy (buf, raw_buf, 4);
427 memcpy (raw_buf + 1, buf, 1);
437 memcpy (raw_buf, buf, 1);
449 memcpy (raw_buf, buf, 4);
509 if (class1 == class2)
583 theclass[1] = theclass[0];
613 if (bitsize <= 64 && pos == 0 && endpos == 1)
675 && (len == 1 || len == 2 || len == 4 || len == 8))
681 && (len == 4 || len == 8))
793 for (i = 0; len > 0; i++, len -= 8)
803 regnum = integer_regnum[integer_reg++];
809 regnum = sse_regnum[sse_reg++];
816 regnum = sse_regnum[sse_reg - 1];
862 static int integer_regnum[] =
871 static int sse_regnum[] =
879 struct value **stack_args = XALLOCAVEC (
struct value *, nargs);
880 int num_stack_args = 0;
881 int num_elements = 0;
891 for (i = 0; i < nargs; i++)
896 int needed_integer_regs = 0;
897 int needed_sse_regs = 0;
905 for (j = 0; j < 2; j++)
908 needed_integer_regs++;
915 if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum)
916 || sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum)
917 || (needed_integer_regs == 0 && needed_sse_regs == 0))
920 num_elements += ((len + 7) / 8);
921 stack_args[num_stack_args++] = args[i];
931 for (j = 0; len > 0; j++, len -= 8)
939 regnum = integer_regnum[integer_reg++];
943 regnum = sse_regnum[sse_reg++];
948 regnum = sse_regnum[sse_reg - 1];
957 memset (buf, 0,
sizeof buf);
958 memcpy (buf, valbuf + j * 8, std::min (len, 8));
965 sp -= num_elements * 8;
972 for (i = 0; i < num_stack_args; i++)
979 element += ((len + 7) / 8);
1077 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1078 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1079 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1080 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1081 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1082 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1083 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
1084 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1085 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1086 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1087 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1088 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1089 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
1090 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
1091 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1092 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1
1100 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1,
1101 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1102 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
1103 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,
1104 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1105 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1106 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1107 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
1108 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1109 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1110 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,
1111 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,
1112 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
1113 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1114 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1115 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
1125 return REX_PREFIX_P (pfx);
1155 case DATA_PREFIX_OPCODE:
1156 case ADDR_PREFIX_OPCODE:
1157 case CS_PREFIX_OPCODE:
1158 case DS_PREFIX_OPCODE:
1159 case ES_PREFIX_OPCODE:
1160 case FS_PREFIX_OPCODE:
1161 case GS_PREFIX_OPCODE:
1162 case SS_PREFIX_OPCODE:
1163 case LOCK_PREFIX_OPCODE:
1164 case REPE_PREFIX_OPCODE:
1165 case REPNE_PREFIX_OPCODE:
1188 int used_regs_mask = 0;
1197 used_regs_mask |= 1 << EAX_REG_NUM;
1199 used_regs_mask |= 1 << EDX_REG_NUM;
1201 used_regs_mask |= 1 << ESP_REG_NUM;
1212 int mod = MODRM_MOD_FIELD (modrm);
1213 int reg = MODRM_REG_FIELD (modrm);
1214 int rm = MODRM_RM_FIELD (modrm);
1215 int have_sib = mod != 3 && rm == 4;
1218 used_regs_mask |= 1 <<
reg;
1224 used_regs_mask |= 1 << base;
1225 used_regs_mask |= 1 << idx;
1229 used_regs_mask |= 1 << rm;
1240 for (i = 0; i < 8; ++i)
1242 if (! (used_regs_mask & (1 << i)))
1289 if (*insn == TWO_BYTE_OPCODE_ESCAPE)
1343 int arch_tmp_regno, tmp_regno;
1352 rip_base = from + insn_length;
1361 static constexpr
gdb_byte VEX3_NOT_B = 0x20;
1372 pfx[1] |= VEX3_NOT_B;
1390 "displaced: using temp reg %d, old value %s, new value %s\n",
1406 if ((modrm & 0xc7) == 0x05)
1423 int fixup_sentinel_space = len;
1434 memset (buf + len, 0, fixup_sentinel_space);
1469 if (insn[0] == 0xff)
1472 if ((insn[1] & 0x38) == 0x20)
1476 if ((insn[1] & 0x38) == 0x28)
1491 if (insn[0] == 0xeb)
1495 if (insn[0] == 0xe9)
1506 if (insn[0] == 0xff)
1509 if ((insn[1] & 0x38) == 0x10)
1513 if ((insn[1] & 0x38) == 0x18)
1549 if (insn[0] == 0xe8)
1563 if (insn[0] == 0x0f && insn[1] == 0x05)
1581 int len, classification;
1589 classification = pred (&details);
1591 return classification;
1636 "displaced: fixup (%s, %s), " 1637 "insn = 0x%02x 0x%02x ...\n",
1687 && orig_rip != to + insn_len
1691 && orig_rip != to + insn_len + 1)
1695 "displaced: syscall changed %%rip; " 1696 "not relocating\n");
1700 ULONGEST rip = orig_rip - insn_offset;
1711 "relocated %%rip from %s to %s\n",
1733 retaddr = (retaddr - insn_offset) & 0xffffffffffffffffULL;
1738 "displaced: relocated return addr at %s " 1757 if ((modrm & 0xc7) == 0x05)
1781 int fixup_sentinel_space = len;
1794 memset (buf + len, 0, fixup_sentinel_space);
1807 if (insn[0] == 0xe8)
1814 ret_addr = oldloc + insn_length;
1819 if (ret_addr <= 0x7fffffff)
1827 push_buf[i++] = 0x48;
1828 push_buf[i++] = 0x83;
1829 push_buf[i++] = 0xec;
1830 push_buf[i++] = 0x08;
1832 push_buf[i++] = 0xc7;
1833 push_buf[i++] = 0x04;
1834 push_buf[i++] = 0x24;
1836 ret_addr & 0xffffffff);
1839 push_buf[i++] = 0xc7;
1840 push_buf[i++] = 0x44;
1841 push_buf[i++] = 0x24;
1842 push_buf[i++] = 0x04;
1856 newrel = (oldloc - *to) + rel32;
1861 "Adjusted insn rel32=%s at %s to" 1862 " rel32=%s at %s\n",
1876 if (insn[0] == 0xe9)
1879 else if (insn[0] == 0x0f && (insn[1] & 0xf0) == 0x80)
1886 newrel = (oldloc - *to) + rel32;
1890 "Adjusted insn rel32=%s at %s to" 1891 " rel32=%s at %s\n",
1902 #define AMD64_NUM_SAVED_REGS AMD64_NUM_GREGS 2001 if ((buf[0] & 0xfb) == 0x48
2007 if ((buf[2] & 0xc7) != 0x44)
2011 reg = (buf[2] >> 3) & 7;
2024 if ((buf[0] & 0xf8) == 0x50)
2026 else if ((buf[0] & 0xf6) == 0x40
2027 && (buf[1] & 0xf8) == 0x50)
2030 if ((buf[0] & 1) != 0)
2044 if ((buf[
offset] & 0xfb) != 0x48
2045 || buf[
offset + 1] != 0x8d
2046 || buf[
offset + 3] != 0x24
2047 || buf[
offset + 4] != 0x10)
2051 if ((buf[
offset + 2] & 0xc7) != 0x44)
2055 r = (buf[
offset + 2] >> 3) & 7;
2069 if (
reg == 4 ||
reg == 5)
2074 || buf[
offset + 2] != 0xe4
2075 || (buf[
offset + 1] != 0x81 && buf[
offset + 1] != 0x83))
2085 else if ((buf[
offset] & 0xf6) == 0x40
2086 && buf[
offset + 1] == 0xff)
2089 if ((buf[
offset] & 0x1) != 0)
2098 if (buf[
offset + 1] != 0xf8
2099 || (buf[
offset] & 0xf8) != 0x70)
2109 if (current_pc >
pc + offset_and)
2112 return std::min (
pc +
offset + 2, current_pc);
2169 offset = buf[0] == 0x67 ? 1 : 0;
2173 if (((buf[
offset] & 0xfb) == 0x48 || (buf[
offset] & 0xfb) == 0x40)
2174 && buf[
offset + 1] == 0x8d
2175 && buf[
offset + 3] == 0x24
2176 && buf[
offset + 4] == 0x8)
2179 if ((buf[
offset + 2] & 0xc7) != 0x44)
2186 if ((buf[
offset] & 0x4) != 0)
2196 if ((buf[
offset] & 0xf6) == 0x40
2197 && (buf[
offset + 1] & 0xf8) == 0x50)
2200 if ((buf[
offset] & 1) != 0)
2205 else if ((buf[
offset] & 0xf8) != 0x50)
2219 if (((buf[
offset] & 0xfb) != 0x48 && (buf[
offset] & 0xfb) != 0x40)
2220 || buf[
offset + 1] != 0x8d
2221 || buf[
offset + 3] != 0x24
2222 || buf[
offset + 4] != 0x10)
2226 if ((buf[
offset + 2] & 0xc7) != 0x44)
2230 r = (buf[
offset + 2] >> 3) & 7;
2233 if ((buf[
offset] & 0x4) != 0)
2244 if (
reg == 4 ||
reg == 5)
2252 if (buf[
offset + 2] != 0xe4
2253 || (buf[
offset + 1] != 0x81 && buf[
offset + 1] != 0x83))
2267 else if ((buf[
offset] & 0xf6) == 0x40
2268 && buf[
offset + 1] == 0xff)
2271 if ((buf[
offset] & 0x1) != 0)
2280 if (buf[
offset + 1] != 0xf8
2281 || (buf[
offset] & 0xf8) != 0x70)
2291 if (current_pc >
pc + offset_and)
2294 return std::min (
pc +
offset + 2, current_pc);
2322 static const gdb_byte mov_rsp_rbp_1[3] = { 0x48, 0x89, 0xe5 };
2323 static const gdb_byte mov_rsp_rbp_2[3] = { 0x48, 0x8b, 0xec };
2325 static const gdb_byte mov_esp_ebp_1[2] = { 0x89, 0xe5 };
2326 static const gdb_byte mov_esp_ebp_2[2] = { 0x8b, 0xec };
2331 if (current_pc <=
pc)
2349 if (current_pc <=
pc + 1)
2355 if (memcmp (buf, mov_rsp_rbp_1, 3) == 0
2356 || memcmp (buf, mov_rsp_rbp_2, 3) == 0)
2366 if (memcmp (buf, mov_esp_ebp_1, 2) == 0
2367 || memcmp (buf, mov_esp_ebp_2, 2) == 0)
2410 if (start_pc_sal.
symtab == NULL
2413 || start_pc_sal.
pc != start_pc ||
pc >= start_pc_sal.
end)
2417 if (next_sal.
line != start_pc_sal.
line)
2425 if (buf[0] != 0x84 || buf[1] != 0xc0)
2432 for (xmmreg = 0; xmmreg < 8; xmmreg++)
2436 || (buf[
offset + 2] & 0x3f) != (xmmreg << 3 | 0x5))
2440 if ((buf[
offset + 2] & 0xc0) == 0x40)
2446 else if ((buf[
offset + 2] & 0xc0) == 0x80)
2456 if (
offset - 4 != buf[3])
2459 return next_sal.
end;
2479 if (post_prologue_pc
2483 return std::max (start_pc, post_prologue_pc);
2528 cache->
base = ((cache->
saved_sp - 8) & 0xfffffffffffffff0LL) - 8;
2576 *this_cache = cache;
2600 return UNWIND_UNAVAILABLE;
2603 if (cache->
base == 0)
2604 return UNWIND_OUTERMOST;
2606 return UNWIND_NO_REASON;
2618 else if (cache->
base == 0)
2627 static struct value *
2717 *this_cache = cache;
2729 return UNWIND_UNAVAILABLE;
2731 return UNWIND_NO_REASON;
2736 void **this_cache,
struct frame_id *this_id)
2743 else if (cache->
base == 0)
2752 static struct value *
2754 void **this_cache,
int regnum)
2850 void **this_prologue_cache)
2871 *this_cache = cache;
2909 return UNWIND_UNAVAILABLE;
2911 return UNWIND_NO_REASON;
2963 int regnum,
const void *fpregs,
size_t len)
2980 int regnum,
void *fpregs,
size_t len)
3012 if (jb_pc_offset == -1)
3042 static const char *
const stap_integer_prefixes[] = {
"$", NULL };
3043 static const char *
const stap_register_prefixes[] = {
"%", NULL };
3044 static const char *
const stap_register_indirection_prefixes[] = {
"(",
3046 static const char *
const stap_register_indirection_suffixes[] = {
")",
3055 tdesc = default_tdesc;
3056 tdep->
tdesc = tdesc;
3198 stap_register_indirection_prefixes);
3200 stap_register_indirection_suffixes);
3211 static struct type *
3277 {
"i386/amd64-avx-mpx-avx512-pku.xml",
3281 for (
auto &a : xml_masks)
3285 selftests::record_xml_tdesc (a.xml, tdesc);
3377 void *xsave,
int gcore)
int i386_zmm_regnum_p(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
#define X86_XSTATE_AVX_MASK
void set_gdbarch_value_to_register(struct gdbarch *gdbarch, gdbarch_value_to_register_ftype value_to_register)
char * hex_string(LONGEST num)
static enum unwind_stop_reason amd64_sigtramp_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
void amd64_x32_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch, const target_desc *default_tdesc)
#define SYMTAB_COMPUNIT(symtab)
static CORE_ADDR amd64_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc)
void set_gdbarch_ps_regnum(struct gdbarch *gdbarch, int ps_regnum)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
void set_gdbarch_get_longjmp_target(struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype get_longjmp_target)
static int amd64_syscall_p(const struct amd64_insn *insn, int *lengthp)
struct type * builtin_func_ptr
void set_tdesc_pseudo_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *pseudo_name)
CORE_ADDR get_frame_pc(struct frame_info *frame)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
static int amd64_arch_reg_to_regnum(int reg)
#define X86_XSTATE_SSE_MASK
static CORE_ADDR amd64_push_arguments(struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp, int struct_return)
static void append_insns(CORE_ADDR *to, ULONGEST len, const gdb_byte *buf)
static CORE_ADDR amd64_skip_xmm_prologue(CORE_ADDR pc, CORE_ADDR start_pc)
const char ** mpx_register_names
static bool vex2_prefix_p(gdb_byte pfx)
void displaced_step_dump_bytes(struct ui_file *file, const gdb_byte *buf, size_t len)
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
#define TYPE_N_BASECLASSES(thistype)
struct type * i386_pseudo_register_type(struct gdbarch *gdbarch, int regnum)
static enum return_value_convention amd64_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
void ax_reg_mask(struct agent_expr *ax, int reg)
static int amd64_call_p(const struct amd64_insn *details)
void set_gdbarch_stap_parse_special_token(struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype stap_parse_special_token)
int i386_dword_regnum_p(struct gdbarch *gdbarch, int regnum)
const char ** ymm16h_register_names
struct displaced_step_closure * amd64_displaced_step_copy_insn(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
static int amd64_insn_is_ret(struct gdbarch *gdbarch, CORE_ADDR addr)
void amd64_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch, const target_desc *default_tdesc)
#define X86_XSTATE_MPX_MASK
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value)
static const char * amd64_register_names[]
void set_tdesc_pseudo_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *pseudo_type)
void _initialize_amd64_tdep(void)
void set_gdbarch_relocate_instruction(struct gdbarch *gdbarch, gdbarch_relocate_instruction_ftype relocate_instruction)
void set_gdbarch_gen_return_address(struct gdbarch *gdbarch, gdbarch_gen_return_address_ftype gen_return_address)
void i387_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
void set_gdbarch_stab_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
static void amd64_get_insn_details(gdb_byte *insn, struct amd64_insn *details)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
static int amd64_insn_is_jump(struct gdbarch *gdbarch, CORE_ADDR addr)
void set_gdbarch_stap_register_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_prefixes)
static enum unwind_stop_reason amd64_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static struct amd64_frame_cache * amd64_sigtramp_frame_cache(struct frame_info *this_frame, void **this_cache)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void mark_value_bytes_unavailable(struct value *value, LONGEST offset, LONGEST length)
struct frame_id frame_id_build_unavailable_stack(CORE_ADDR code_addr)
void set_gdbarch_frame_red_zone_size(struct gdbarch *gdbarch, int frame_red_zone_size)
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
void set_gdbarch_ax_pseudo_register_collect(struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
#define AMD64_NUM_SAVED_REGS
static CORE_ADDR amd64_analyze_stack_align(CORE_ADDR pc, CORE_ADDR current_pc, struct amd64_frame_cache *cache)
static int amd64_ret_p(const struct amd64_insn *details)
int i386_stap_parse_special_token(struct gdbarch *gdbarch, struct stap_parse_info *p)
static enum unwind_stop_reason amd64_epilogue_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static const char * amd64_zmm_names[]
static struct type * amd64_x32_pseudo_register_type(struct gdbarch *gdbarch, int regnum)
CORE_ADDR(* sigcontext_addr)(struct frame_info *)
static int amd64_get_longjmp_target(struct frame_info *frame, CORE_ADDR *pc)
static const unsigned char onebyte_has_modrm[256]
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
static const char * amd64_ymmh_avx512_names[]
void ax_reg(struct agent_expr *x, int reg)
static const unsigned char twobyte_has_modrm[256]
static void amd64_classify_aggregate(struct type *type, enum amd64_reg_class theclass[2])
static int rip_relative_offset(struct amd64_insn *insn)
void i387_reset_bnd_regs(struct gdbarch *gdbarch, struct regcache *regcache)
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
struct gdbarch_tdep_info * tdep_info
#define TYPE_FIELD(thistype, n)
static void amd64_supply_fpregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
static struct value * amd64_sigtramp_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
#define TYPE_FIELD_TYPE(thistype, n)
void frame_unwind_prepend_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
struct value * allocate_value(struct type *type)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
static const char * amd64_ymm_avx512_names[]
#define FRAME_OBSTACK_ZALLOC(TYPE)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void set_gdbarch_stap_register_indirection_suffixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_suffixes)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
int i386_xmm_regnum_p(struct gdbarch *gdbarch, int regnum)
#define TYPE_IS_REFERENCE(t)
void i387_value_to_register(struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from)
ULONGEST read_code_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static enum amd64_reg_class amd64_merge_classes(enum amd64_reg_class class1, enum amd64_reg_class class2)
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)
int target_read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int i386_byte_regnum_p(struct gdbarch *gdbarch, int regnum)
static struct amd64_frame_cache * amd64_alloc_frame_cache(void)
int i386_ymm_regnum_p(struct gdbarch *gdbarch, int regnum)
static CORE_ADDR amd64_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct amd64_frame_cache *cache)
void amd64_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
void set_gdbarch_stap_integer_prefixes(struct gdbarch *gdbarch, const char *const *stap_integer_prefixes)
static const int amd64_dwarf_regmap_len
void i387_return_value(struct gdbarch *gdbarch, struct regcache *regcache)
static struct frame_id amd64_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
static int amd64_dwarf_regmap[]
target_desc * amd64_create_target_description(uint64_t xcr0, bool is_x32, bool is_linux)
static const char * amd64_mpx_names[]
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype pseudo_register_write)
static const char * amd64_xmm_avx512_names[]
static const char * amd64_ymmh_names[]
void set_gdbarch_pseudo_register_read_value(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value)
struct type * check_typedef(struct type *type)
ULONGEST gdbarch_max_insn_length(struct gdbarch *gdbarch)
const gdb_byte * value_contents(struct value *value)
#define CATCH(EXCEPTION, MASK)
enum register_status regcache_raw_read_part(struct regcache *regcache, int regnum, int offset, int len, gdb_byte *buf)
void i387_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
#define X86_XSTATE_AVX_AVX512_MASK
void amd64_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
static int amd64_non_pod_p(struct type *type)
static const char * amd64_ymm_names[]
int field_is_static(struct field *f)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
void set_gdbarch_insn_is_ret(struct gdbarch *gdbarch, gdbarch_insn_is_ret_ftype insn_is_ret)
static void amd64_collect_fpregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *fpregs, size_t len)
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
const char ** ymmh_register_names
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
static int amd64_jmp_p(const struct amd64_insn *details)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
#define I387_XMM0_REGNUM(tdep)
static void amd64_classify(struct type *type, enum amd64_reg_class theclass[2])
#define gdb_assert_not_reached(message)
void amd64_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
static const int amd64_arch_regmap_len
static int rex_prefix_p(gdb_byte pfx)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
#define I387_FISEG_REGNUM(tdep)
static void amd64_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
const char ** pkeys_register_names
static const struct frame_base amd64_frame_base
void set_gdbarch_stap_register_indirection_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_prefixes)
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
#define VALUE_REGNUM(val)
void set_gdbarch_register_to_value(struct gdbarch *gdbarch, gdbarch_register_to_value_ftype register_to_value)
void read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
#define COMPUNIT_PRODUCER(cust)
static bool vex3_prefix_p(gdb_byte pfx)
#define AMD64_NUM_LOWER_BYTE_REGS
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void ax_simple(struct agent_expr *x, enum agent_op op)
static int startswith(const char *string, const char *pattern)
amd64_displaced_step_closure(int insn_buf_len)
static struct value * amd64_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
int producer_is_gcc_ge_4(const char *producer)
const char ** zmmh_register_names
static CORE_ADDR amd64_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static void amd64_gen_return_address(struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope)
static void amd64_init_frame_cache(struct amd64_frame_cache *cache)
static const char * amd64_byte_names[]
static int amd64_absolute_jmp_p(const struct amd64_insn *details)
static const char * amd64_dword_names[]
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void set_gdbarch_insn_is_jump(struct gdbarch *gdbarch, gdbarch_insn_is_jump_ftype insn_is_jump)
int i386_word_regnum_p(struct gdbarch *gdbarch, int regnum)
#define I387_FOSEG_REGNUM(tdep)
static CORE_ADDR amd64_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
int i387_convert_register_p(struct gdbarch *gdbarch, int regnum, struct type *type)
#define TYPE_FIELD_BITSIZE(thistype, n)
static int amd64_sigtramp_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static CORE_ADDR amd64_x32_analyze_stack_align(CORE_ADDR pc, CORE_ADDR current_pc, struct amd64_frame_cache *cache)
const char ** xmm_avx512_register_names
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
int i386_ax_pseudo_register_collect(struct gdbarch *gdbarch, struct agent_expr *ax, int regnum)
struct amd64_insn insn_details
#define TYPE_FIELD_BITPOS(thistype, n)
const struct target_desc * target_desc
void i387_collect_xsave(const struct regcache *regcache, int regnum, void *xsave, int gcore)
const char ** register_names
const struct regset amd64_fpregset
static const struct frame_unwind amd64_epilogue_frame_unwind
#define I387_SIZEOF_FXSAVE
CORE_ADDR saved_regs[AMD64_NUM_SAVED_REGS]
void regcache_raw_write_part(struct regcache *regcache, int regnum, int offset, int len, const gdb_byte *buf)
const char * i386_pseudo_register_name(struct gdbarch *gdbarch, int regnum)
static int amd64_dwarf_reg_to_regnum(struct gdbarch *gdbarch, int reg)
void throw_exception(struct gdb_exception exception)
static int amd64_get_unused_input_int_reg(const struct amd64_insn *details)
static int amd64_epilogue_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
static const char * amd64_pseudo_register_name(struct gdbarch *gdbarch, int regnum)
int(* sigtramp_p)(struct frame_info *)
static void amd64_frame_cache_1(struct frame_info *this_frame, struct amd64_frame_cache *cache)
static const char * amd64_pkeys_names[]
#define TYPE_TARGET_TYPE(thistype)
void set_gdbarch_convert_register_p(struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype convert_register_p)
static void fixup_riprel(struct gdbarch *gdbarch, amd64_displaced_step_closure *dsc, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
int frame_relative_level(struct frame_info *fi)
#define TYPE_CODE(thistype)
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
const int * record_regmap
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
#define X86_XSTATE_AVX512
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct type * builtin_data_ptr
int i386_stap_is_single_operand(struct gdbarch *gdbarch, const char *s)
void set_gdbarch_stap_is_single_operand(struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype stap_is_single_operand)
static const char * amd64_k_names[]
static void amd64_sigtramp_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
void regcache_raw_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
void get_frame_register(struct frame_info *frame, int regnum, gdb_byte *buf)
#define TYPE_NFIELDS(thistype)
static void fixup_displaced_copy(struct gdbarch *gdbarch, amd64_displaced_step_closure *dsc, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
static struct amd64_frame_cache * amd64_frame_cache(struct frame_info *this_frame, void **this_cache)
static const struct frame_unwind amd64_sigtramp_frame_unwind
static const int amd64_record_regmap[]
static LONGEST extract_signed_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
struct m32c_reg regs[M32C_MAX_NUM_REGS]
const struct target_desc * tdesc
int i386_ymm_avx512_regnum_p(struct gdbarch *gdbarch, int regnum)
void ax_const_l(struct agent_expr *x, LONGEST l)
const struct regset * fpregset
gdb::def_vector< gdb_byte > byte_vector
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
unsigned long long ULONGEST
static int amd64_insn_is_call(struct gdbarch *gdbarch, CORE_ADDR addr)
int i387_register_to_value(struct frame_info *frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
struct symtab_and_line find_pc_sect_line(CORE_ADDR pc, struct obj_section *section, int notcurrent)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int register_size(struct gdbarch *gdbarch, int regnum)
static void amd64_relocate_instruction(struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR oldloc)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
struct type * value_type(const struct value *value)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
void amd64_displaced_step_fixup(struct gdbarch *gdbarch, struct displaced_step_closure *dsc_, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
#define X86_XSTATE_AVX_MPX_MASK
void amd64_collect_xsave(const struct regcache *regcache, int regnum, void *xsave, int gcore)
static void amd64_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buf)
gdb::byte_vector insn_buf
static int amd64_absolute_call_p(const struct amd64_insn *details)
gdb_byte * value_contents_raw(struct value *value)
static int amd64_ax_pseudo_register_collect(struct gdbarch *gdbarch, struct agent_expr *ax, int regnum)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
#define COMPUNIT_EPILOGUE_UNWIND_VALID(cust)
static const int amd64_arch_regmap[16]
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static CORE_ADDR amd64_frame_base_address(struct frame_info *this_frame, void **this_cache)
void set_gdbarch_insn_is_call(struct gdbarch *gdbarch, gdbarch_insn_is_call_ftype insn_is_call)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype skip_prologue)
const char ** k_register_names
void i386_pseudo_register_read_into_value(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, struct value *result_value)
static int amd64_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
void i387_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
const struct target_desc * amd64_target_description(uint64_t xcr0)
enum bfd_endian byte_order
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
static int amd64_classify_insn_at(struct gdbarch *gdbarch, CORE_ADDR addr, int(*pred)(const struct amd64_insn *))
static const char * amd64_word_names[]
static struct value * amd64_pseudo_register_read_value(struct gdbarch *gdbarch, struct regcache *regcache, int regnum)
int tdesc_has_registers(const struct target_desc *target_desc)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
static void store_signed_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, LONGEST val)
static gdb_byte * amd64_skip_prefixes(gdb_byte *insn)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
#define X86_XSTATE_AVX_MPX_AVX512_PKU_MASK
int gdb_buffered_insn_length(struct gdbarch *gdbarch, const gdb_byte *insn, int max_len, CORE_ADDR addr)
void i386_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buf)
void regcache_cooked_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
static struct amd64_frame_cache * amd64_epilogue_frame_cache(struct frame_info *this_frame, void **this_cache)
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
static const char * amd64_zmmh_names[]
static void amd64_epilogue_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static const struct frame_unwind amd64_frame_unwind