23 #include "opcode/i386.h"
67 "rax",
"rbx",
"rcx",
"rdx",
"rsi",
"rdi",
"rbp",
"rsp",
70 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
71 "rip",
"eflags",
"cs",
"ss",
"ds",
"es",
"fs",
"gs",
74 "st0",
"st1",
"st2",
"st3",
"st4",
"st5",
"st6",
"st7",
75 "fctrl",
"fstat",
"ftag",
"fiseg",
"fioff",
"foseg",
"fooff",
"fop",
78 "xmm0",
"xmm1",
"xmm2",
"xmm3",
"xmm4",
"xmm5",
"xmm6",
"xmm7",
79 "xmm8",
"xmm9",
"xmm10",
"xmm11",
"xmm12",
"xmm13",
"xmm14",
"xmm15",
85 "ymm0",
"ymm1",
"ymm2",
"ymm3",
86 "ymm4",
"ymm5",
"ymm6",
"ymm7",
87 "ymm8",
"ymm9",
"ymm10",
"ymm11",
88 "ymm12",
"ymm13",
"ymm14",
"ymm15"
93 "ymm16",
"ymm17",
"ymm18",
"ymm19",
94 "ymm20",
"ymm21",
"ymm22",
"ymm23",
95 "ymm24",
"ymm25",
"ymm26",
"ymm27",
96 "ymm28",
"ymm29",
"ymm30",
"ymm31"
101 "ymm0h",
"ymm1h",
"ymm2h",
"ymm3h",
102 "ymm4h",
"ymm5h",
"ymm6h",
"ymm7h",
103 "ymm8h",
"ymm9h",
"ymm10h",
"ymm11h",
104 "ymm12h",
"ymm13h",
"ymm14h",
"ymm15h"
109 "ymm16h",
"ymm17h",
"ymm18h",
"ymm19h",
110 "ymm20h",
"ymm21h",
"ymm22h",
"ymm23h",
111 "ymm24h",
"ymm25h",
"ymm26h",
"ymm27h",
112 "ymm28h",
"ymm29h",
"ymm30h",
"ymm31h"
117 "bnd0raw",
"bnd1raw",
"bnd2raw",
"bnd3raw",
"bndcfgu",
"bndstatus"
122 "k0",
"k1",
"k2",
"k3",
123 "k4",
"k5",
"k6",
"k7"
128 "zmm0h",
"zmm1h",
"zmm2h",
"zmm3h",
129 "zmm4h",
"zmm5h",
"zmm6h",
"zmm7h",
130 "zmm8h",
"zmm9h",
"zmm10h",
"zmm11h",
131 "zmm12h",
"zmm13h",
"zmm14h",
"zmm15h",
132 "zmm16h",
"zmm17h",
"zmm18h",
"zmm19h",
133 "zmm20h",
"zmm21h",
"zmm22h",
"zmm23h",
134 "zmm24h",
"zmm25h",
"zmm26h",
"zmm27h",
135 "zmm28h",
"zmm29h",
"zmm30h",
"zmm31h"
140 "zmm0",
"zmm1",
"zmm2",
"zmm3",
141 "zmm4",
"zmm5",
"zmm6",
"zmm7",
142 "zmm8",
"zmm9",
"zmm10",
"zmm11",
143 "zmm12",
"zmm13",
"zmm14",
"zmm15",
144 "zmm16",
"zmm17",
"zmm18",
"zmm19",
145 "zmm20",
"zmm21",
"zmm22",
"zmm23",
146 "zmm24",
"zmm25",
"zmm26",
"zmm27",
147 "zmm28",
"zmm29",
"zmm30",
"zmm31"
151 "xmm16",
"xmm17",
"xmm18",
"xmm19",
152 "xmm20",
"xmm21",
"xmm22",
"xmm23",
153 "xmm24",
"xmm25",
"xmm26",
"xmm27",
154 "xmm28",
"xmm29",
"xmm30",
"xmm31"
188 AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3,
189 AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5,
190 AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
193 AMD64_XMM0_REGNUM + 8, AMD64_XMM0_REGNUM + 9,
194 AMD64_XMM0_REGNUM + 10, AMD64_XMM0_REGNUM + 11,
195 AMD64_XMM0_REGNUM + 12, AMD64_XMM0_REGNUM + 13,
196 AMD64_XMM0_REGNUM + 14, AMD64_XMM0_REGNUM + 15,
200 AMD64_ST0_REGNUM + 2, AMD64_ST0_REGNUM + 3,
201 AMD64_ST0_REGNUM + 4, AMD64_ST0_REGNUM + 5,
202 AMD64_ST0_REGNUM + 6, AMD64_ST0_REGNUM + 7,
208 -1, -1, -1, -1, -1, -1, -1, -1,
252 if (reg >= 0 && reg < amd64_dwarf_regmap_len)
253 regnum = amd64_dwarf_regmap[reg];
256 warning (
_(
"Unmapped DWARF Register #%d encountered."), reg);
257 else if (ymm0_regnum >= 0
266 static const int amd64_arch_regmap[16] =
286 static const int amd64_arch_regmap_len =
295 gdb_assert (reg >= 0 && reg < amd64_arch_regmap_len);
297 return amd64_arch_regmap[reg];
302 static const char *amd64_byte_names[] =
304 "al",
"bl",
"cl",
"dl",
"sil",
"dil",
"bpl",
"spl",
305 "r8l",
"r9l",
"r10l",
"r11l",
"r12l",
"r13l",
"r14l",
"r15l",
306 "ah",
"bh",
"ch",
"dh"
310 #define AMD64_NUM_LOWER_BYTE_REGS 16
314 static const char *amd64_word_names[] =
316 "ax",
"bx",
"cx",
"dx",
"si",
"di",
"bp",
"",
317 "r8w",
"r9w",
"r10w",
"r11w",
"r12w",
"r13w",
"r14w",
"r15w"
322 static const char *amd64_dword_names[] =
324 "eax",
"ebx",
"ecx",
"edx",
"esi",
"edi",
"ebp",
"esp",
325 "r8d",
"r9d",
"r10d",
"r11d",
"r12d",
"r13d",
"r14d",
"r15d",
336 return amd64_byte_names[regnum - tdep->
al_regnum];
338 return amd64_zmm_names[regnum - tdep->
zmm0_regnum];
340 return amd64_ymm_names[regnum - tdep->
ymm0_regnum];
342 return amd64_ymm_avx512_names[regnum - tdep->
ymm16_regnum];
344 return amd64_word_names[regnum - tdep->
ax_regnum];
346 return amd64_dword_names[regnum - tdep->
eax_regnum];
351 static struct value *
359 struct value *result_value;
379 memcpy (buf, raw_buf + 1, 1);
388 memcpy (buf, raw_buf, 1);
400 memcpy (buf, raw_buf, 4);
430 memcpy (raw_buf + 1, buf, 1);
440 memcpy (raw_buf, buf, 1);
452 memcpy (raw_buf, buf, 4);
483 if (class1 == class2)
557 theclass[1] = theclass[0];
587 if (bitsize <= 64 && pos == 0 && endpos == 1)
649 && (len == 1 || len == 2 || len == 4 || len == 8))
655 && (len == 4 || len == 8))
767 for (i = 0; len > 0; i++, len -= 8)
777 regnum = integer_regnum[integer_reg++];
783 regnum = sse_regnum[sse_reg++];
790 regnum = sse_regnum[sse_reg - 1];
836 static int integer_regnum[] =
845 static int sse_regnum[] =
850 AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5,
851 AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
853 struct value **stack_args = alloca (nargs *
sizeof (
struct value *));
854 int num_stack_args = 0;
855 int num_elements = 0;
865 for (i = 0; i < nargs; i++)
870 int needed_integer_regs = 0;
871 int needed_sse_regs = 0;
879 for (j = 0; j < 2; j++)
882 needed_integer_regs++;
889 if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum)
890 || sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum)
891 || (needed_integer_regs == 0 && needed_sse_regs == 0))
894 num_elements += ((len + 7) / 8);
895 stack_args[num_stack_args++] = args[i];
905 for (j = 0; len > 0; j++, len -= 8)
913 regnum = integer_regnum[integer_reg++];
917 regnum = sse_regnum[sse_reg++];
922 regnum = sse_regnum[sse_reg - 1];
931 memset (buf, 0,
sizeof buf);
932 memcpy (buf, valbuf + j * 8,
min (len, 8));
939 sp -= num_elements * 8;
946 for (i = 0; i < num_stack_args; i++)
953 element += ((len + 7) / 8);
1040 static const unsigned char onebyte_has_modrm[256] = {
1043 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1044 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1045 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1046 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
1047 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1048 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1049 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
1050 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1051 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1052 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1053 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1054 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1055 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
1056 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
1057 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1058 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1
1063 static const unsigned char twobyte_has_modrm[256] = {
1066 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1,
1067 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1068 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
1069 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,
1070 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1071 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1072 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1073 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
1074 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1075 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1076 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,
1077 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,
1078 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
1079 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1080 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1081 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
1091 return REX_PREFIX_P (pfx);
1105 case DATA_PREFIX_OPCODE:
1106 case ADDR_PREFIX_OPCODE:
1107 case CS_PREFIX_OPCODE:
1108 case DS_PREFIX_OPCODE:
1109 case ES_PREFIX_OPCODE:
1110 case FS_PREFIX_OPCODE:
1111 case GS_PREFIX_OPCODE:
1112 case SS_PREFIX_OPCODE:
1113 case LOCK_PREFIX_OPCODE:
1114 case REPE_PREFIX_OPCODE:
1115 case REPNE_PREFIX_OPCODE:
1138 int used_regs_mask = 0;
1147 used_regs_mask |= 1 << EAX_REG_NUM;
1149 used_regs_mask |= 1 << EDX_REG_NUM;
1151 used_regs_mask |= 1 << ESP_REG_NUM;
1162 int mod = MODRM_MOD_FIELD (modrm);
1163 int reg = MODRM_REG_FIELD (modrm);
1164 int rm = MODRM_RM_FIELD (modrm);
1165 int have_sib = mod != 3 && rm == 4;
1168 used_regs_mask |= 1 << reg;
1174 used_regs_mask |= 1 << base;
1175 used_regs_mask |= 1 << idx;
1179 used_regs_mask |= 1 << rm;
1190 for (i = 0; i < 8; ++i)
1192 if (! (used_regs_mask & (1 << i)))
1228 if (*insn == TWO_BYTE_OPCODE_ESCAPE)
1232 need_modrm = twobyte_has_modrm[*insn];
1254 need_modrm = onebyte_has_modrm[*insn];
1284 int arch_tmp_regno, tmp_regno;
1294 rip_base = from + insn_length;
1320 "displaced: using temp reg %d, old value %s, new value %s\n",
1336 if ((modrm & 0xc7) == 0x05)
1353 int fixup_sentinel_space =
len;
1355 xmalloc (
sizeof (*dsc) + len + fixup_sentinel_space);
1360 dsc->
max_len = len + fixup_sentinel_space;
1367 memset (buf + len, 0, fixup_sentinel_space);
1402 if (insn[0] == 0xff)
1405 if ((insn[1] & 0x38) == 0x20)
1409 if ((insn[1] & 0x38) == 0x28)
1424 if (insn[0] == 0xeb)
1428 if (insn[0] == 0xe9)
1439 if (insn[0] == 0xff)
1442 if ((insn[1] & 0x38) == 0x10)
1446 if ((insn[1] & 0x38) == 0x18)
1482 if (insn[0] == 0xe8)
1496 if (insn[0] == 0x0f && insn[1] == 0x05)
1514 int len, classification;
1522 classification = pred (&details);
1524 return classification;
1568 "displaced: fixup (%s, %s), "
1569 "insn = 0x%02x 0x%02x ...\n",
1619 && orig_rip != to + insn_len
1623 && orig_rip != to + insn_len + 1)
1627 "displaced: syscall changed %%rip; "
1628 "not relocating\n");
1632 ULONGEST rip = orig_rip - insn_offset;
1643 "relocated %%rip from %s to %s\n",
1665 retaddr = (retaddr - insn_offset) & 0xffffffffffffffffULL;
1670 "displaced: relocated return addr at %s "
1689 if ((modrm & 0xc7) == 0x05)
1713 int fixup_sentinel_space =
len;
1726 memset (buf + len, 0, fixup_sentinel_space);
1739 if (insn[0] == 0xe8)
1742 unsigned int ret_addr;
1745 ret_addr = oldloc + insn_length;
1756 newrel = (oldloc - *
to) + rel32;
1761 "Adjusted insn rel32=%s at %s to"
1762 " rel32=%s at %s\n",
1776 if (insn[0] == 0xe9)
1779 else if (insn[0] == 0x0f && (insn[1] & 0xf0) == 0x80)
1786 newrel = (oldloc - *
to) + rel32;
1790 "Adjusted insn rel32=%s at %s to"
1791 " rel32=%s at %s\n",
1802 #define AMD64_NUM_SAVED_REGS AMD64_NUM_GREGS
1901 if ((buf[0] & 0xfb) == 0x48
1907 if ((buf[2] & 0xc7) != 0x44)
1911 reg = (buf[2] >> 3) & 7;
1924 if ((buf[0] & 0xf8) == 0x50)
1926 else if ((buf[0] & 0xf6) == 0x40
1927 && (buf[1] & 0xf8) == 0x50)
1930 if ((buf[0] & 1) != 0)
1939 reg += buf[
offset] & 0x7;
1944 if ((buf[offset] & 0xfb) != 0x48
1945 || buf[offset + 1] != 0x8d
1946 || buf[offset + 3] != 0x24
1947 || buf[offset + 4] != 0x10)
1951 if ((buf[offset + 2] & 0xc7) != 0x44)
1955 r = (buf[offset + 2] >> 3) & 7;
1958 if (buf[offset] == 0x4c)
1969 if (reg == 4 || reg == 5)
1973 if (buf[offset] != 0x48
1974 || buf[offset + 2] != 0xe4
1975 || (buf[offset + 1] != 0x81 && buf[offset + 1] != 0x83))
1979 offset += buf[offset + 1] == 0x81 ? 7 : 4;
1983 if (buf[offset] == 0xff)
1985 else if ((buf[offset] & 0xf6) == 0x40
1986 && buf[offset + 1] == 0xff)
1989 if ((buf[offset] & 0x1) != 0)
1998 if (buf[offset + 1] != 0xf8
1999 || (buf[offset] & 0xf8) != 0x70)
2009 if (current_pc > pc + offset_and)
2012 return min (pc + offset + 2, current_pc);
2069 offset = buf[0] == 0x67 ? 1 : 0;
2073 if (((buf[offset] & 0xfb) == 0x48 || (buf[offset] & 0xfb) == 0x40)
2074 && buf[offset + 1] == 0x8d
2075 && buf[offset + 3] == 0x24
2076 && buf[offset + 4] == 0x8)
2079 if ((buf[offset + 2] & 0xc7) != 0x44)
2083 reg = (buf[offset + 2] >> 3) & 7;
2086 if ((buf[offset] & 0x4) != 0)
2096 if ((buf[offset] & 0xf6) == 0x40
2097 && (buf[offset + 1] & 0xf8) == 0x50)
2100 if ((buf[offset] & 1) != 0)
2105 else if ((buf[offset] & 0xf8) != 0x50)
2109 reg += buf[
offset] & 0x7;
2114 if (buf[offset] == 0x67)
2119 if (((buf[offset] & 0xfb) != 0x48 && (buf[
offset] & 0xfb) != 0x40)
2120 || buf[offset + 1] != 0x8d
2121 || buf[offset + 3] != 0x24
2122 || buf[offset + 4] != 0x10)
2126 if ((buf[offset + 2] & 0xc7) != 0x44)
2130 r = (buf[offset + 2] >> 3) & 7;
2133 if ((buf[offset] & 0x4) != 0)
2144 if (reg == 4 || reg == 5)
2149 if (buf[offset] != 0x48)
2152 if (buf[offset + 2] != 0xe4
2153 || (buf[offset + 1] != 0x81 && buf[offset + 1] != 0x83))
2157 offset += buf[offset + 1] == 0x81 ? 7 : 4;
2160 if (buf[offset] == 0x67)
2165 if (buf[offset] == 0xff)
2167 else if ((buf[offset] & 0xf6) == 0x40
2168 && buf[offset + 1] == 0xff)
2171 if ((buf[offset] & 0x1) != 0)
2180 if (buf[offset + 1] != 0xf8
2181 || (buf[offset] & 0xf8) != 0x70)
2191 if (current_pc > pc + offset_and)
2194 return min (pc + offset + 2, current_pc);
2222 static const gdb_byte mov_rsp_rbp_1[3] = { 0x48, 0x89, 0xe5 };
2223 static const gdb_byte mov_rsp_rbp_2[3] = { 0x48, 0x8b, 0xec };
2225 static const gdb_byte mov_esp_ebp_1[2] = { 0x89, 0xe5 };
2226 static const gdb_byte mov_esp_ebp_2[2] = { 0x8b, 0xec };
2231 if (current_pc <= pc)
2249 if (current_pc <= pc + 1)
2255 if (memcmp (buf, mov_rsp_rbp_1, 3) == 0
2256 || memcmp (buf, mov_rsp_rbp_2, 3) == 0)
2266 if (memcmp (buf, mov_esp_ebp_1, 2) == 0
2267 || memcmp (buf, mov_esp_ebp_2, 2) == 0)
2310 if (start_pc_sal.
symtab == NULL
2313 || start_pc_sal.
pc != start_pc || pc >= start_pc_sal.
end)
2317 if (next_sal.
line != start_pc_sal.
line)
2325 if (buf[0] != 0x84 || buf[1] != 0xc0)
2332 for (xmmreg = 0; xmmreg < 8; xmmreg++)
2335 if (buf[offset] != 0x0f || buf[offset + 1] != 0x29
2336 || (buf[offset + 2] & 0x3f) != (xmmreg << 3 | 0x5))
2340 if ((buf[offset + 2] & 0xc0) == 0x40)
2346 else if ((buf[offset + 2] & 0xc0) == 0x80)
2356 if (offset - 4 != buf[3])
2359 return next_sal.
end;
2379 if (post_prologue_pc
2383 return max (start_pc, post_prologue_pc);
2428 cache->
base = ((cache->
saved_sp - 8) & 0xfffffffffffffff0LL) - 8;
2476 *this_cache = cache;
2500 return UNWIND_UNAVAILABLE;
2503 if (cache->
base == 0)
2504 return UNWIND_OUTERMOST;
2506 return UNWIND_NO_REASON;
2518 else if (cache->
base == 0)
2527 static struct value *
2540 if (regnum < AMD64_NUM_SAVED_REGS && cache->
saved_regs[regnum] != -1)
2617 *this_cache = cache;
2629 return UNWIND_UNAVAILABLE;
2631 return UNWIND_NO_REASON;
2636 void **this_cache,
struct frame_id *this_id)
2643 else if (cache->
base == 0)
2652 static struct value *
2654 void **this_cache,
int regnum)
2717 amd64_frame_base_address
2750 void **this_prologue_cache)
2771 *this_cache = cache;
2809 return UNWIND_UNAVAILABLE;
2811 return UNWIND_NO_REASON;
2863 int regnum,
const void *fpregs,
size_t len)
2912 if (jb_pc_offset == -1)
2926 static const int amd64_record_regmap[] =
2941 static const char *
const stap_integer_prefixes[] = {
"$", NULL };
2942 static const char *
const stap_register_prefixes[] = {
"%", NULL };
2943 static const char *
const stap_register_indirection_prefixes[] = {
"(",
2945 static const char *
const stap_register_indirection_suffixes[] = {
")",
2955 tdep->
tdesc = tdesc;
3075 stap_register_indirection_prefixes);
3077 stap_register_indirection_suffixes);
3088 static struct type *
3115 tdep->
tdesc = tdesc;
3246 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)
struct target_desc * tdesc_amd64_avx
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
char * hex_string(LONGEST num)
static enum unwind_stop_reason amd64_sigtramp_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
#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)
struct target_desc * tdesc_amd64_mpx
CORE_ADDR get_frame_pc(struct frame_info *frame)
static void fixup_riprel(struct gdbarch *gdbarch, struct displaced_step_closure *dsc, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
static int amd64_arch_reg_to_regnum(int reg)
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
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)
int producer_is_gcc_ge_4(const char *producer)
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 store_signed_integer(gdb_byte *, int, enum bfd_endian, LONGEST)
#define X86_XSTATE_MPX_MASK
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
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 warning(const char *fmt,...)
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 amd64_displaced_step_fixup(struct gdbarch *gdbarch, struct displaced_step_closure *dsc, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
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 internal_error(const char *file, int line, const char *fmt,...)
#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 void initialize_tdesc_amd64(void)
static int amd64_get_longjmp_target(struct frame_info *frame, CORE_ADDR *pc)
struct target_desc * tdesc_x32
struct target_desc * tdesc_amd64
void mark_value_bytes_unavailable(struct value *value, int offset, int length)
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 void amd64_classify_aggregate(struct type *type, enum amd64_reg_class theclass[2])
static int rip_relative_offset(struct amd64_insn *insn)
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
#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)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
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)
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)
void amd64_x32_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
static int amd64_dwarf_regmap[]
static void initialize_tdesc_x32(void)
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)
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)
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)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
static void amd64_classify(struct type *type, enum amd64_reg_class theclass[2])
static void initialize_tdesc_amd64_avx(void)
void amd64_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
static int rex_prefix_p(gdb_byte pfx)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
#define I387_FISEG_REGNUM(tdep)
static void initialize_tdesc_x32_avx(void)
static void amd64_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
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)
#define AMD64_NUM_LOWER_BYTE_REGS
#define X86_XSTATE_MPX_AVX512_MASK
void ax_simple(struct agent_expr *x, enum agent_op op)
static int startswith(const char *string, const char *pattern)
static struct value * amd64_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
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 void initialize_tdesc_amd64_avx512(void)
static int amd64_absolute_jmp_p(const struct amd64_insn *details)
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)
struct ui_file * gdb_stdlog
#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)
#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 struct regset amd64_fpregset
#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 void fixup_displaced_copy(struct gdbarch *gdbarch, struct displaced_step_closure *dsc, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
#define X86_XSTATE_AVX512_MASK
#define TYPE_TARGET_TYPE(thistype)
void set_gdbarch_convert_register_p(struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype convert_register_p)
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)
void amd64_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct type * builtin_data_ptr
static void initialize_tdesc_x32_avx512(void)
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 struct amd64_frame_cache * amd64_frame_cache(struct frame_info *this_frame, void **this_cache)
static const int amd64_record_regmap[]
struct m32c_reg regs[M32C_MAX_NUM_REGS]
static void initialize_tdesc_amd64_mpx(void)
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
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)
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_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)
static int amd64_absolute_call_p(const struct amd64_insn *details)
gdb_byte * value_contents_raw(struct value *value)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
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)
LONGEST extract_signed_integer(const gdb_byte *, int, enum bfd_endian)
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)
enum axs_lvalue_kind kind
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 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)
struct target_desc * tdesc_amd64_avx512
static gdb_byte * amd64_skip_prefixes(gdb_byte *insn)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
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 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)
const ULONGEST const LONGEST len
struct amd64_insn insn_details
static const char * amd64_zmmh_names[]
#define X86_XSTATE_ALL_MASK
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