21#include "opcode/i386.h"
49#include "gdbsupport/x86-xstate.h"
68#include <unordered_set>
77 "eax",
"ecx",
"edx",
"ebx",
78 "esp",
"ebp",
"esi",
"edi",
79 "eip",
"eflags",
"cs",
"ss",
80 "ds",
"es",
"fs",
"gs",
81 "st0",
"st1",
"st2",
"st3",
82 "st4",
"st5",
"st6",
"st7",
83 "fctrl",
"fstat",
"ftag",
"fiseg",
84 "fioff",
"foseg",
"fooff",
"fop",
85 "xmm0",
"xmm1",
"xmm2",
"xmm3",
86 "xmm4",
"xmm5",
"xmm6",
"xmm7",
92 "zmm0",
"zmm1",
"zmm2",
"zmm3",
93 "zmm4",
"zmm5",
"zmm6",
"zmm7"
98 "zmm0h",
"zmm1h",
"zmm2h",
"zmm3h",
99 "zmm4h",
"zmm5h",
"zmm6h",
"zmm7h"
104 "k0",
"k1",
"k2",
"k3",
105 "k4",
"k5",
"k6",
"k7"
110 "ymm0",
"ymm1",
"ymm2",
"ymm3",
111 "ymm4",
"ymm5",
"ymm6",
"ymm7",
116 "ymm0h",
"ymm1h",
"ymm2h",
"ymm3h",
117 "ymm4h",
"ymm5h",
"ymm6h",
"ymm7h",
122 "bnd0raw",
"bnd1raw",
"bnd2raw",
"bnd3raw",
"bndcfgu",
"bndstatus"
134 "bnd0",
"bnd1",
"bnd2",
"bnd3"
141 "mm0",
"mm1",
"mm2",
"mm3",
142 "mm4",
"mm5",
"mm6",
"mm7"
149 "al",
"cl",
"dl",
"bl",
150 "ah",
"ch",
"dh",
"bh"
157 "ax",
"cx",
"dx",
"bx",
227 if (zmm0h_regnum < 0)
266 if (ymm0h_regnum < 0)
294 if (ymm16h_regnum < 0)
307 if (ymm16_regnum < 0)
337 if (num_xmm_regs == 0)
352 if (num_xmm_avx512_regs == 0)
479 internal_error (_(
"invalid regnum"));
493 if (reg >= 0 && reg <= 7)
503 else if (reg >= 12 && reg <= 19)
508 else if (reg >= 21 && reg <= 28)
515 return reg - 21 + ymm0_regnum;
519 else if (reg >= 29 && reg <= 36)
542 if (reg >= 0 && reg <= 9)
547 else if (reg >= 11 && reg <= 18)
552 else if (reg >= 21 && reg <= 36)
627i386_skip_prefixes (gdb_byte *insn,
size_t max_len)
629 gdb_byte *end = insn + max_len;
635 case DATA_PREFIX_OPCODE:
636 case ADDR_PREFIX_OPCODE:
637 case CS_PREFIX_OPCODE:
638 case DS_PREFIX_OPCODE:
639 case ES_PREFIX_OPCODE:
640 case FS_PREFIX_OPCODE:
641 case GS_PREFIX_OPCODE:
642 case SS_PREFIX_OPCODE:
643 case LOCK_PREFIX_OPCODE:
644 case REPE_PREFIX_OPCODE:
645 case REPNE_PREFIX_OPCODE:
666 if ((insn[1] & 0x38) == 0x20)
670 if ((insn[1] & 0x38) == 0x28)
703 if ((insn[1] & 0x38) == 0x10)
707 if ((insn[1] & 0x38) == 0x18)
751 if ((insn[0] == 0xcd && insn[1] == 0x80)
753 || (insn[0] == 0x0f && insn[1] == 0x34)
755 || (insn[0] == 0x0f && insn[1] == 0x05))
807 CORE_ADDR from, CORE_ADDR to,
811 std::unique_ptr<i386_displaced_step_copy_insn_closure> closure
813 gdb_byte *buf = closure->buf.data ();
824 insn = i386_skip_prefixes (buf, len);
826 insn[syscall_length] = NOP_OPCODE;
833 bytes_to_string (buf, len).c_str ());
845 CORE_ADDR from, CORE_ADDR to,
846 struct regcache *regs,
bool completed_p)
854 ULONGEST insn_offset = to - from;
858 gdb_byte *insn = closure->
buf.data ();
860 gdb_byte *insn_start = insn;
877 gdb_byte *opcode = i386_skip_prefixes (insn, max_insn_len);
913 && pc != to + (insn - insn_start) + insn_len
918 && pc != to + (insn - insn_start) + insn_len + 1)
922 ULONGEST eip = (pc - insn_offset) & 0xffffffffUL;
948 const ULONGEST retaddr_len = 4;
952 retaddr = (retaddr - insn_offset) & 0xffffffffUL;
970 CORE_ADDR *to, CORE_ADDR oldloc)
974 int offset = 0, rel32, newrel;
976 gdb_byte *insn = buf;
991 gdb_byte push_buf[16];
992 unsigned int ret_addr;
995 ret_addr = oldloc + insn_length;
1006 newrel = (oldloc - *to) + rel32;
1020 if (insn[0] == 0xe9)
1023 else if (insn[0] == 0x0f && (insn[1] & 0xf0) == 0x80)
1029 newrel = (oldloc - *to) + rel32;
1042#ifdef I386_REGNO_TO_SYMMETRY
1043#error "The Sequent Symmetry is no longer supported."
1052#define I386_NUM_SAVED_REGS I386_NUM_GREGS
1147 delta += data16 + 2;
1174 static gdb_byte proto1[3] = { 0x87, 0x04, 0x24 };
1175 static gdb_byte proto2[4] = { 0x87, 0x44, 0x24, 0x00 };
1179 if (current_pc <=
pc)
1191 if (memcmp (buf, proto1, 3) != 0 && memcmp (buf, proto2, 4) != 0)
1194 if (current_pc ==
pc)
1200 if (current_pc ==
pc + 1)
1206 if (buf[1] == proto1[1])
1232 if (op == 0x68 || op == 0x6a)
1246 if (buf[0] == 0xe8 && buf[6] == 0xc4 && buf[7] == 0x4)
1247 pc += delta +
sizeof (buf);
1287 int offset, offset_and;
1288 static int regnums[8] = {
1304 if (buf[0] == 0x8d && buf[2] == 0x24 && buf[3] == 0x4)
1307 if ((buf[1] & 0xc7) != 0x44)
1311 reg = (buf[1] >> 3) & 7;
1318 if ((buf[0] & 0xf8) != 0x50)
1325 if (buf[1] != 0x8d || buf[3] != 0x24 || buf[4] != 0x8)
1329 if ((buf[2] & 0xc7) != 0x44)
1334 if (reg != ((buf[2] >> 3) & 7))
1341 if (reg == 4 || reg == 5)
1345 if (buf[offset + 1] != 0xe4
1346 || (buf[offset] != 0x81 && buf[offset] != 0x83))
1349 offset_and = offset;
1350 offset += buf[offset] == 0x81 ? 6 : 3;
1354 if (buf[offset] != 0xff
1355 || buf[offset + 2] != 0xfc
1356 || (buf[offset + 1] & 0xf8) != 0x70)
1361 if (reg != (buf[offset + 1] & 7))
1364 if (current_pc >
pc + offset_and)
1367 return std::min (
pc + offset + 3, current_pc);
1371#define I386_MAX_MATCHED_INSN_LEN 6
1391 if ((op & pattern.
mask[0]) == pattern.
insn[0])
1394 int insn_matched = 1;
1397 gdb_assert (pattern.
len > 1);
1403 for (i = 1; i < pattern.
len; i++)
1405 if ((buf[i - 1] & pattern.
mask[i]) != pattern.
insn[i])
1408 return insn_matched;
1422 for (pattern = insn_patterns; pattern->
len > 0; pattern++)
1437 CORE_ADDR current_pc;
1446 ix =
insn - insn_patterns;
1447 for (i = ix - 1; i >= 0; i--)
1449 current_pc -= insn_patterns[i].
len;
1455 current_pc = pc +
insn->len;
1461 current_pc +=
insn->len;
1481 { 2, { 0xb0, 0x00 }, { 0xfa, 0x00 } },
1483 { 2, { 0xb2, 0x00 }, { 0xfb, 0x00 } },
1485 { 5, { 0xb8 }, { 0xfe } },
1487 { 5, { 0xba }, { 0xff } },
1496 { 5, { 0xa1 }, { 0xff } },
1498 { 6, { 0x89, 0x05 }, {0xff, 0xf7 } },
1500 { 6, { 0x89, 0x15 }, {0xff, 0xff } },
1508 { 2, { 0x29, 0xc0 }, { 0xfd, 0xff } },
1510 { 2, { 0x29, 0xc9 }, { 0xfd, 0xff } },
1512 { 2, { 0x29, 0xd2 }, { 0xfd, 0xff } },
1514 { 2, { 0x31, 0xc0 }, { 0xfd, 0xff } },
1516 { 2, { 0x31, 0xc9 }, { 0xfd, 0xff } },
1518 { 2, { 0x31, 0xd2 }, { 0xfd, 0xff } },
1526 static const gdb_byte endbr32[] = { 0xf3, 0x0f, 0x1e, 0xfb };
1528 gdb_byte buf[
sizeof (endbr32)];
1535 if (memcmp (buf, endbr32,
sizeof (endbr32)) != 0)
1538 return pc +
sizeof (endbr32);
1573 else if (op == 0x8b)
1598 CORE_ADDR pc, CORE_ADDR limit,
1632 while (pc + skip < limit)
1642 if (limit <= pc + skip)
1719 else if (op == 0x81)
1730 else if (op == 0x8d)
1745 else if (op == 0xc8)
1763 CORE_ADDR offset = 0;
1769 for (i = 0; i < 8 && pc < current_pc; i++)
1773 if (op < 0x50 || op > 0x57)
1814 CORE_ADDR pc, CORE_ADDR current_pc,
1834 static gdb_byte pic_pat[6] =
1843 CORE_ADDR func_addr;
1847 CORE_ADDR post_prologue_pc
1854 if (post_prologue_pc
1859 return std::max (start_pc, post_prologue_pc);
1882 for (i = 0; i < 6; i++)
1887 if (pic_pat[i] != op)
1903 else if (op == 0x9d)
1913 if (delta > 0 && op == 0x81
1950 CORE_ADDR call_dest;
1953 call_dest = call_dest & 0xffffffffU;
2001 if (cache->
base == 0)
2031 cache->
base = ((cache->
saved_sp - 4) & 0xfffffff0) - 4;
2037 else if (cache->
pc != 0
2089 *this_cache = cache;
2095 catch (
const gdb_exception_error &ex)
2097 if (ex.error != NOT_AVAILABLE_ERROR)
2112 else if (cache->
base == 0)
2130 return UNWIND_UNAVAILABLE;
2133 if (cache->
base == 0)
2134 return UNWIND_OUTERMOST;
2136 return UNWIND_NO_REASON;
2139static struct value *
2145 gdb_assert (
regnum >= 0);
2234 void **this_prologue_cache,
bool override_p)
2254 if (!unwind_valid_p)
2267 void **this_prologue_cache)
2276 void **this_prologue_cache)
2292 *this_cache = cache;
2308 catch (
const gdb_exception_error &ex)
2310 if (ex.error != NOT_AVAILABLE_ERROR)
2325 return UNWIND_UNAVAILABLE;
2327 return UNWIND_NO_REASON;
2344static struct value *
2346 void **this_cache,
int regnum)
2356 "i386 epilogue override",
2389 { 5, { 0xb8 }, { 0xfe } },
2392 { 5, { 0xe9 }, { 0xff } },
2402 { 5, { 0x68 }, { 0xff } },
2405 { 5, { 0xe9 }, { 0xff } },
2516 catch (
const gdb_exception_error &ex)
2518 if (ex.error != NOT_AVAILABLE_ERROR)
2522 *this_cache = cache;
2534 return UNWIND_UNAVAILABLE;
2536 return UNWIND_NO_REASON;
2555static struct value *
2557 void **this_cache,
int regnum)
2568 void **this_prologue_cache)
2641 return sp & -(CORE_ADDR)16;
2655 CORE_ADDR sp, jb_addr;
2663 if (jb_pc_offset == -1)
2689 if ((
type->
code () == TYPE_CODE_DECFLOAT
2693 if (
type->
code () == TYPE_CODE_ARRAY)
2695 if (
type->
code () == TYPE_CODE_STRUCT
2696 ||
type->
code () == TYPE_CODE_UNION)
2714 struct value **args,
int nargs,
struct type *value_type,
2715 CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
2732 int nargs,
struct value **args, CORE_ADDR sp,
2734 CORE_ADDR struct_addr,
bool thiscall)
2753 for (write_pass = 0; write_pass < 2; write_pass++)
2755 int args_space_used = 0;
2764 args_space_used += 4;
2770 for (i = thiscall ? 1 : 0; i < nargs; i++)
2772 int len = args[i]->enclosing_type ()->length ();
2777 args_space_used = align_up (args_space_used, 16);
2780 args[i]->contents_all ().data (), len);
2788 args_space_used += align_up (len, 4);
2793 args_space = align_up (args_space, 16);
2794 args_space += align_up (len, 4);
2825 args[0]->contents_all ().data ());
2834 struct objfile *objf =
nullptr;
2835 asection *asect =
nullptr;
2840 if (func_section !=
nullptr)
2843 if (objf !=
nullptr)
2846 asect = bfd_get_section_by_name (objf->
obfd.get (),
".got.plt");
2847 if (asect ==
nullptr)
2848 asect = bfd_get_section_by_name (objf->
obfd.get (),
".got");
2851 if (asect !=
nullptr)
2856 if (osect !=
nullptr)
2886 struct value **args, CORE_ADDR sp,
2888 CORE_ADDR struct_addr)
2891 nargs, args, sp, return_method,
2892 struct_addr,
false);
2898#define LOW_RETURN_REGNUM I386_EAX_REGNUM
2899#define HIGH_RETURN_REGNUM I386_EDX_REGNUM
2913 if (((
type->
code () == TYPE_CODE_FLT) && len == 2)
2914 || ((
type->
code () == TYPE_CODE_COMPLEX) && len == 4))
2919 else if (
type->
code () == TYPE_CODE_FLT)
2923 warning (_(
"Cannot find floating-point return value."));
2924 memset (valbuf, 0, len);
2940 if (len <= low_size)
2943 memcpy (valbuf, buf, len);
2945 else if (len <= (low_size + high_size))
2948 memcpy (valbuf, buf, low_size);
2950 memcpy (valbuf + low_size, buf, len - low_size);
2953 internal_error (_(
"Cannot extract return value of %d bytes long."),
2968 if (
type->
code () == TYPE_CODE_FLT)
2975 warning (_(
"Cannot set floating-point return value."));
3008 if (len <= low_size)
3010 else if (len <= (low_size + high_size))
3017 internal_error (_(
"Cannot store return value of %d bytes long."), len);
3047 gdb_assert (
code == TYPE_CODE_STRUCT
3048 ||
code == TYPE_CODE_UNION
3049 ||
code == TYPE_CODE_ARRAY);
3062 if (
type->
code () == TYPE_CODE_FLT)
3063 return (len == 4 || len == 8 || len == 12);
3066 return (len == 1 || len == 2 || len == 4 || len == 8);
3078 struct value **read_value,
const gdb_byte *writebuf)
3082 if (((
code == TYPE_CODE_STRUCT
3083 ||
code == TYPE_CODE_UNION
3084 ||
code == TYPE_CODE_ARRAY)
3109 if (read_value !=
nullptr)
3132 read_value, writebuf);
3133 if (read_value !=
nullptr)
3134 (*read_value)->deprecated_set_type (
type);
3138 if (read_value !=
nullptr)
3142 (*read_value)->contents_raw ().data ());
3190 "__gdb_builtin_type_bound128", TYPE_CODE_STRUCT);
3195 t->
set_name (
"builtin_type_bound128");
3216 union __gdb_builtin_type_vec512i
3218 int128_t v4_int128[4];
3219 int64_t v8_int64[8];
3220 int32_t v16_int32[16];
3221 int16_t v32_int16[32];
3222 int8_t v64_int8[64];
3223 double v8_double[8];
3224 float v16_float[16];
3225 float16_t v32_half[32];
3226 bfloat16_t v32_bfloat16[32];
3233 "__gdb_builtin_type_vec512i", TYPE_CODE_UNION);
3254 t->
set_name (
"builtin_type_vec512i");
3275 union __gdb_builtin_type_vec256i
3277 int128_t v2_int128[2];
3278 int64_t v4_int64[4];
3279 int32_t v8_int32[8];
3280 int16_t v16_int16[16];
3281 int8_t v32_int8[32];
3282 double v4_double[4];
3284 float16_t v16_half[16];
3285 bfloat16_t v16_bfloat16[16];
3292 "__gdb_builtin_type_vec256i", TYPE_CODE_UNION);
3313 t->
set_name (
"builtin_type_vec256i");
3332 union __gdb_builtin_type_vec64i
3335 int32_t v2_int32[2];
3336 int16_t v4_int16[4];
3344 "__gdb_builtin_type_vec64i", TYPE_CODE_UNION);
3355 t->
set_name (
"builtin_type_vec64i");
3382 return bt->builtin_int8;
3384 return bt->builtin_int16;
3386 return bt->builtin_int32;
3388 return bt->builtin_int64;
3391 internal_error (_(
"invalid regnum"));
3408 tos = (fstat >> 11) & 0x7;
3409 fpreg = (mmxreg + tos) % 8;
3422 struct value *result_value)
3425 enum register_status
status;
3455 LONGEST upper, lower;
3462 memcpy (buf, &lower,
size);
3475 memcpy (buf, raw_buf, 8);
3489 memcpy (buf, raw_buf, 16);
3497 memcpy (buf + 16, raw_buf, 16);
3508 memcpy (buf, raw_buf, 16);
3517 memcpy (buf + 16, raw_buf, 16);
3526 memcpy (buf + 32, raw_buf, 32);
3538 memcpy (buf, raw_buf, 16);
3545 memcpy (buf + 16, raw_buf, 16);
3556 memcpy (buf, raw_buf, 16);
3563 memcpy (buf + 16, raw_buf, 16);
3575 memcpy (buf, raw_buf, 2);
3587 else if (gpnum >= 4)
3588 memcpy (buf, raw_buf + 1, 1);
3590 memcpy (buf, raw_buf, 1);
3593 internal_error (_(
"invalid regnum"));
3597static struct value *
3602 struct value *result;
3615 int regnum,
const gdb_byte *buf)
3636 ULONGEST upper, lower;
3652 memcpy (raw_buf, &lower, 8);
3653 memcpy (raw_buf + 8, &upper, 8);
3711 memcpy (raw_buf, buf, 2);
3723 memcpy (raw_buf + 1, buf, 1);
3725 memcpy (raw_buf, buf, 1);
3730 internal_error (_(
"invalid regnum"));
3749 for (i = 0; i < 8; i++)
3812 internal_error (_(
"invalid regnum"));
3829 static int next_regnum[] =
3840 if (
regnum >= 0 &&
regnum <
sizeof (next_regnum) /
sizeof (next_regnum[0]))
3841 return next_regnum[
regnum];
3860 if (len > 4 && len % 4 == 0)
3862 int last_regnum =
regnum;
3870 if (last_regnum != -1)
3883 int *optimizedp,
int *unavailablep)
3890 optimizedp, unavailablep);
3894 gdb_assert (len > 4 && len % 4 == 0);
3898 gdb_assert (
regnum != -1);
3902 gdb::make_array_view (to,
3905 optimizedp, unavailablep))
3913 *optimizedp = *unavailablep = 0;
3922 struct type *
type,
const gdb_byte *from)
3934 gdb_assert (len > 4 && len % 4 == 0);
3938 gdb_assert (
regnum != -1);
3954 int regnum,
const void *gregs,
size_t len)
3958 const gdb_byte *regs = (
const gdb_byte *) gregs;
3979 int regnum,
void *gregs,
size_t len)
3983 gdb_byte *regs = (gdb_byte *) gregs;
4002 int regnum,
const void *fpregs,
size_t len)
4025 int regnum,
void *fpregs,
size_t len)
4074 CORE_ADDR pc,
char *
name)
4082 unsigned long indirect =
4086 const char *symname = indsym ? indsym->
linkage_name () : 0;
4090 if (startswith (symname,
"__imp_")
4091 || startswith (symname,
"_imp_"))
4110 return (
name && strcmp (
"_sigtramp",
name) == 0);
4147 return (
name && (strcmp (
"_sigreturn",
name) == 0
4148 || strcmp (
"sigvechandler",
name) == 0));
4177 || (isdigit (*s) && s[1] ==
'(' && s[2] ==
'%')
4178 || (*s ==
'(' && s[1] ==
'%')
4179 || (*s ==
'%' && isalpha (s[1])));
4194 const char *s = p->
arg;
4196 if (isdigit (*s) || *s ==
'-' || *s ==
'+')
4200 long displacements[3];
4205 got_minus[0] =
false;
4211 got_minus[0] =
true;
4214 if (!isdigit ((
unsigned char) *s))
4217 displacements[0] = strtol (s, &endp, 10);
4220 if (*s !=
'+' && *s !=
'-')
4226 got_minus[1] =
false;
4232 got_minus[1] =
true;
4235 if (!isdigit ((
unsigned char) *s))
4238 displacements[1] = strtol (s, &endp, 10);
4241 if (*s !=
'+' && *s !=
'-')
4247 got_minus[2] =
false;
4253 got_minus[2] =
true;
4256 if (!isdigit ((
unsigned char) *s))
4259 displacements[2] = strtol (s, &endp, 10);
4262 if (*s !=
'(' || s[1] !=
'%')
4268 while (isalnum (*s))
4274 len = s - start - 1;
4275 std::string regname (start, len);
4278 error (_(
"Invalid register name `%s' on expression `%s'."),
4282 for (i = 0; i < 3; i++)
4284 LONGEST this_val = displacements[i];
4286 this_val = -this_val;
4292 using namespace expr;
4296 = make_operation<long_const_operation> (long_type,
value);
4299 = make_operation<register_operation> (std::move (regname));
4301 reg = make_operation<unop_cast_operation> (std::move (reg), void_ptr);
4304 = make_operation<add_operation> (std::move (reg), std::move (offset));
4306 sum = make_operation<unop_cast_operation> (std::move (sum),
4308 return make_operation<unop_ind_operation> (std::move (sum));
4327 const char *s = p->
arg;
4329 if (isdigit (*s) || *s ==
'(' || *s ==
'-' || *s ==
'+')
4331 bool offset_minus =
false;
4333 bool size_minus =
false;
4344 offset_minus =
true;
4347 if (offset_minus && !isdigit (*s))
4354 offset = strtol (s, &endp, 10);
4358 if (*s !=
'(' || s[1] !=
'%')
4364 while (isalnum (*s))
4367 if (*s !=
',' || s[1] !=
'%')
4370 len_base = s - start;
4371 std::string base (start, len_base);
4374 error (_(
"Invalid register name `%s' on expression `%s'."),
4380 while (isalnum (*s))
4383 len_index = s - start;
4384 std::string index (start, len_index);
4388 error (_(
"Invalid register name `%s' on expression `%s'."),
4391 if (*s !=
',' && *s !=
')')
4407 size = strtol (s, &endp, 10);
4417 using namespace expr;
4420 operation_up reg = make_operation<register_operation> (std::move (base));
4427 = make_operation<long_const_operation> (long_type, offset);
4428 reg = make_operation<add_operation> (std::move (reg),
4433 = make_operation<register_operation> (std::move (index));
4440 = make_operation<long_const_operation> (long_type,
size);
4441 ind_reg = make_operation<mul_operation> (std::move (ind_reg),
4446 = make_operation<add_operation> (std::move (reg),
4447 std::move (ind_reg));
4450 sum = make_operation<unop_cast_operation> (std::move (sum),
4452 return make_operation<unop_ind_operation> (std::move (sum));
4476 if (result ==
nullptr)
4487 const std::string ®name,
int regnum)
4489 static const std::unordered_set<std::string> reg_assoc
4490 = {
"ax",
"bx",
"cx",
"dx",
4491 "si",
"di",
"bp",
"sp" };
4498 && reg_assoc.find (regname) != reg_assoc.end ())
4499 return "e" + regname;
4513 return "(x86_64|i.86)";
4532 static const char *
const stap_integer_prefixes[] = {
"$", NULL };
4533 static const char *
const stap_register_prefixes[] = {
"%", NULL };
4608 int fp_regnum_p, mmx_regnum_p, xmm_regnum_p, mxcsr_regnum_p,
4609 ymm_regnum_p, ymmh_regnum_p, ymm_avx512_regnum_p, ymmh_avx512_regnum_p,
4610 bndr_regnum_p, bnd_regnum_p, zmm_regnum_p, zmmh_regnum_p,
4611 mpx_ctrl_regnum_p, xmm_avx512_regnum_p,
4612 avx512_p, avx_p, sse_p, pkru_regnum_p;
4627 return mmx_regnum_p;
4634 return xmm_regnum_p || xmm_avx512_regnum_p || mxcsr_regnum_p;
4640 avx512_p = ((tdep->
xcr0 & X86_XSTATE_AVX_AVX512_MASK)
4641 == X86_XSTATE_AVX_AVX512_MASK);
4642 avx_p = ((tdep->
xcr0 & X86_XSTATE_AVX_AVX512_MASK)
4643 == X86_XSTATE_AVX_MASK) && !avx512_p;
4644 sse_p = ((tdep->
xcr0 & X86_XSTATE_AVX_AVX512_MASK)
4645 == X86_XSTATE_SSE_MASK) && !avx512_p && ! avx_p;
4648 return (mmx_regnum_p
4649 || (zmm_regnum_p && avx512_p)
4650 || ((ymm_regnum_p || ymm_avx512_regnum_p) && avx_p)
4651 || ((xmm_regnum_p || xmm_avx512_regnum_p) && sse_p)
4665 && (((xmm_regnum_p || xmm_avx512_regnum_p) && !sse_p)
4666 || ((ymm_regnum_p || ymm_avx512_regnum_p) && !avx_p)
4668 || ymmh_avx512_regnum_p
4674 && ((bnd_regnum_p && (tdep->
xcr0 & X86_XSTATE_MPX_MASK))))
4675 return bnd_regnum_p;
4679 && ((bndr_regnum_p && (tdep->
xcr0 & X86_XSTATE_MPX_MASK))))
4684 && ((mpx_ctrl_regnum_p && (tdep->
xcr0 & X86_XSTATE_MPX_MASK))))
4685 return mpx_ctrl_regnum_p;
4688 return (!fp_regnum_p
4692 && !xmm_avx512_regnum_p
4695 && !ymm_avx512_regnum_p
4696 && !ymmh_avx512_regnum_p
4699 && !mpx_ctrl_regnum_p
4720#define PREFIX_REPZ 0x01
4721#define PREFIX_REPNZ 0x02
4722#define PREFIX_LOCK 0x04
4723#define PREFIX_DATA 0x08
4724#define PREFIX_ADDR 0x10
4806 uint8_t base = irp->
rm;
4814 scale = (
byte >> 6) & 3;
4815 index = ((
byte >> 3) & 7) | irp->
rex_x;
4823 if ((base & 7) == 5)
4838 *addr = (int8_t) buf[0];
4856 if (irp->
aflag == 2)
4861 *addr = (uint32_t) (offset64 + *addr);
4863 if (havesib && (index != 4 || scale != 0))
4867 if (irp->
aflag == 2)
4868 *addr += offset64 << scale;
4870 *addr = (uint32_t) (*addr + (offset64 << scale));
4877 *addr = (uint32_t) *addr;
4900 *addr = (int8_t) buf[0];
4916 *addr = (uint32_t) (*addr + offset64);
4920 *addr = (uint32_t) (*addr + offset64);
4926 *addr = (uint32_t) (*addr + offset64);
4930 *addr = (uint32_t) (*addr + offset64);
4936 *addr = (uint32_t) (*addr + offset64);
4940 *addr = (uint32_t) (*addr + offset64);
4946 *addr = (uint32_t) (*addr + offset64);
4950 *addr = (uint32_t) (*addr + offset64);
4956 *addr = (uint32_t) (*addr + offset64);
4962 *addr = (uint32_t) (*addr + offset64);
4968 *addr = (uint32_t) (*addr + offset64);
4974 *addr = (uint32_t) (*addr + offset64);
4999Process record ignores the memory change of instruction at address %s\n\
5000because it can't get the value of the segment register.\n\
5001Do you want to stop the program?"),
5040#define I386_SAVE_FPU_REGS 0xfffd
5041#define I386_SAVE_FPU_ENV 0xfffe
5042#define I386_SAVE_FPU_ENV_REG_STACK 0xffff
5108#define I386_RECORD_FULL_ARCH_LIST_ADD_REG(regnum) \
5109 record_full_arch_list_add_reg (ir.regcache, ir.regmap[(regnum)])
5113 CORE_ADDR input_addr)
5129 ir.
addr = input_addr;
5135 ir.
regmap = tdep->record_regmap;
5151 case REPE_PREFIX_OPCODE:
5154 case REPNE_PREFIX_OPCODE:
5157 case LOCK_PREFIX_OPCODE:
5160 case CS_PREFIX_OPCODE:
5163 case SS_PREFIX_OPCODE:
5166 case DS_PREFIX_OPCODE:
5169 case ES_PREFIX_OPCODE:
5172 case FS_PREFIX_OPCODE:
5175 case GS_PREFIX_OPCODE:
5178 case DATA_PREFIX_OPCODE:
5181 case ADDR_PREFIX_OPCODE:
5203 rex_w = (opcode8 >> 3) & 1;
5204 rex_r = (opcode8 & 0x4) << 1;
5205 ir.
rex_x = (opcode8 & 0x2) << 2;
5206 ir.
rex_b = (opcode8 & 0x1) << 3;
5232 opcode = (uint32_t) opcode8;
5240 opcode = (uint32_t) opcode8 | 0x0f00;
5292 if (((opcode >> 3) & 7) !=
OP_CMPL)
5294 if ((opcode & 1) == 0)
5299 switch ((opcode >> 1) & 3)
5342 if ((opcode & 1) == 0)
5386 if ((opcode & 1) == 0)
5393 if (ir.
mod != 3 && ir.
reg == 0)
5429 opcode = opcode << 8 | ir.
modrm;
5439 if (ir.
reg >= 2 && opcode == 0xfe)
5442 opcode = opcode << 8 | ir.
modrm;
5449 if ((opcode & 1) == 0)
5492 opcode = opcode << 8 | ir.
modrm;
5522 else if (opcode == 0x6b)
5533 if ((opcode & 1) == 0)
5562 if ((opcode & 1) == 0)
5593 if (ir.
reg == 6 || ir.
reg == 7)
5612 opcode = opcode << 8 | ir.
modrm;
5777 if ((opcode & 1) == 0)
5787 if (opcode == 0xc6 || opcode == 0xc7)
5794 if (opcode == 0xc6 || opcode == 0xc7)
5804 if ((opcode & 1) == 0)
5822 opcode = opcode << 8 | ir.
modrm;
5858 opcode = opcode << 8 | ir.
modrm;
5881 opcode = opcode << 8 | ir.
modrm;
5905Process record ignores the memory change of instruction at address %s\n\
5906because it can't get the value of the segment register.\n\
5907Do you want to stop the program?"),
5914 if ((opcode & 1) == 0)
5953 ? ((opcode & 0x7) | ir.
rex_b)
5954 : ((opcode & 0x7) & 0x3));
5981 if ((opcode & 1) == 0)
6024 opcode = opcode << 8 | ir.
modrm;
6056 if ((opcode & 1) == 0)
6062 if (ir.
mod != 3 && (opcode == 0xd2 || opcode == 0xd3))
6105 ir.
reg |= ((opcode & 7) << 3);
6185 switch (ir.
reg >> 4)
6204 switch (ir.
reg >> 4)
6209 if (3 == (ir.
reg & 7))
6220 if ((3 == (ir.
reg & 7))
6221 || (5 == (ir.
reg & 7))
6222 || (7 == (ir.
reg & 7)))
6233 if (3 == (ir.
reg & 7))
6242 if ((3 <= (ir.
reg & 7)) && (6 <= (ir.
reg & 7)))
6329 opcode = opcode << 8 | ir.
modrm;
6344 if (0x0c == (ir.
modrm >> 4))
6346 if ((ir.
modrm & 0x0f) <= 7)
6359 if ((ir.
modrm & 0x0f) - 0x08)
6363 ((ir.
modrm & 0x0f) - 0x08)))
6416 if (0xe9 == ir.
modrm)
6421 else if ((0x0c == ir.
modrm >> 4) || (0x0d == ir.
modrm >> 4))
6426 if (((ir.
modrm & 0x0f) > 0) && ((ir.
modrm & 0x0f) <= 7))
6433 else if ((ir.
modrm & 0x0f) - 0x08)
6437 ((ir.
modrm & 0x0f) - 0x08)))
6443 if (0xe3 == ir.
modrm)
6448 else if ((0x0c == ir.
modrm >> 4) || (0x0d == ir.
modrm >> 4))
6453 if (((ir.
modrm & 0x0f) > 0) && ((ir.
modrm & 0x0f) <= 7))
6460 else if ((ir.
modrm & 0x0f) - 0x08)
6464 ((ir.
modrm & 0x0f) - 0x08)))
6470 if ((0x0c == ir.
modrm >> 4)
6471 || (0x0d == ir.
modrm >> 4)
6472 || (0x0f == ir.
modrm >> 4))
6474 if ((ir.
modrm & 0x0f) <= 7)
6485 ((ir.
modrm & 0x0f) - 0x08)))
6491 if (0x0c == ir.
modrm >> 4)
6497 else if ((0x0d == ir.
modrm >> 4) || (0x0e == ir.
modrm >> 4))
6499 if ((ir.
modrm & 0x0f) <= 7)
6515 if ((0x0c == ir.
modrm >> 4)
6516 || (0x0e == ir.
modrm >> 4)
6517 || (0x0f == ir.
modrm >> 4)
6518 || (0xd9 == ir.
modrm))
6525 if (0xe0 == ir.
modrm)
6531 else if ((0x0f == ir.
modrm >> 4) || (0x0e == ir.
modrm >> 4))
6554 if ((opcode & 1) == 0)
6568 if (ir.
aflag && (es != ds))
6574Process record ignores the memory change of instruction at address %s\n\
6575because it can't get the value of the segment register.\n\
6576Do you want to stop the program?"),
6589 if (opcode == 0xa4 || opcode == 0xa5)
6815 opcode = opcode << 8 | ir.
modrm;
6854 addr64 += ((int16_t)
addr >> 4) << 4;
6857 addr64 += ((int32_t)
addr >> 5) << 5;
6860 addr64 += ((int64_t)
addr >> 6) << 6;
6905 opcode = (uint32_t) opcode8;
6913 _(
"Process record does not support instruction "
6927 if (interrupt != 0x80
6928 || tdep->i386_intx80_record == NULL)
6931 _(
"Process record does not support "
6932 "instruction int 0x%02x.\n"),
6937 ret = tdep->i386_intx80_record (ir.
regcache);
6946 _(
"Process record does not support "
6947 "instruction into.\n"));
6958 _(
"Process record does not support "
6959 "instruction bound.\n"));
6995 _(
"Process record does not support "
6996 "instruction wrmsr.\n"));
7003 _(
"Process record does not support "
7004 "instruction rdmsr.\n"));
7022 if (tdep->i386_sysenter_record == NULL)
7025 _(
"Process record does not support "
7026 "instruction sysenter.\n"));
7030 ret = tdep->i386_sysenter_record (ir.
regcache);
7038 _(
"Process record does not support "
7039 "instruction sysexit.\n"));
7047 if (tdep->i386_syscall_record == NULL)
7050 _(
"Process record does not support "
7051 "instruction syscall.\n"));
7055 ret = tdep->i386_syscall_record (ir.
regcache);
7063 _(
"Process record does not support "
7064 "instruction sysret.\n"));
7078 _(
"Process record does not support "
7079 "instruction hlt.\n"));
7109 opcode = opcode << 8 | ir.
modrm;
7127 opcode = opcode << 8 | ir.
modrm;
7135Process record ignores the memory change of instruction at address %s\n\
7136because it can't get the value of the segment register.\n\
7137Do you want to stop the program?"),
7174 opcode = opcode << 8 | ir.
modrm;
7187Process record ignores the memory change of instruction at address %s\n\
7188because it can't get the value of the segment register.\n\
7189Do you want to stop the program?"),
7227 else if (ir.
rm == 1)
7235 opcode = opcode << 8 | ir.
modrm;
7264 opcode = opcode << 8 | ir.
modrm;
7273 opcode = opcode << 8 | ir.
modrm;
7289 ? (ir.
reg | rex_r) : ir.
rm);
7312 if (ir.
mod == 3 && ir.
reg == 3)
7315 opcode = opcode << 8 | ir.
modrm;
7334 if ((ir.
modrm & 0xc0) != 0xc0)
7337 opcode = opcode << 8 | ir.
modrm;
7354 opcode = opcode << 8 | ir.
modrm;
7364 if ((ir.
modrm & 0xc0) != 0xc0 || ir.
reg == 4
7365 || ir.
reg == 5 || ir.
reg >= 8)
7368 opcode = opcode << 8 | ir.
modrm;
7426 goto no_support_3dnow_data;
7431no_support_3dnow_data:
7432 opcode = (opcode << 8) | opcode8;
7513 opcode = (opcode << 8) | ir.
modrm;
7669 opcode = (uint32_t) opcode8 | opcode << 8;
7670 goto reswitch_prefix_add;
7879 if ((opcode & 0xfffffffc) == 0x660f3a60)
7903 if (opcode == 0x0f13 || opcode == 0x660f13
7904 || opcode == 0x0f17 || opcode == 0x660f17)
7944 if (opcode == 0x0fe7)
8198 _(
"Process record does not support instruction 0x%02x "
8199 "at address %s.\n"),
8200 (
unsigned int) (opcode),
8209 0, 0, 0, 0, 0, 0, 0, 0,
8240 else if (jumplen == 0)
8259 *msg = string_printf (_(
"; instruction is only %d bytes long, "
8260 "need at least %d bytes for the jump"),
8276static const struct floatformat **
8278 const char *
name,
int len)
8280 if (len == 128 &&
name)
8281 if (strcmp (
name,
"__float128") == 0
8282 || strcmp (
name,
"_Float128") == 0
8283 || strcmp (
name,
"complex _Float128") == 0
8284 || strcmp (
name,
"complex(kind=16)") == 0
8285 || strcmp (
name,
"COMPLEX(16)") == 0
8286 || strcmp (
name,
"complex*32") == 0
8287 || strcmp (
name,
"COMPLEX*32") == 0
8288 || strcmp (
name,
"quad complex") == 0
8289 || strcmp (
name,
"real(kind=16)") == 0
8290 || strcmp (
name,
"real*16") == 0
8291 || strcmp (
name,
"REAL*16") == 0
8292 || strcmp (
name,
"REAL(16)") == 0)
8306 const struct tdesc_feature *feature_core;
8308 const struct tdesc_feature *feature_sse, *feature_avx, *feature_mpx,
8309 *feature_avx512, *feature_pkeys;
8313 if (feature_core == NULL)
8332 uint64_t xcr0 = X86_XSTATE_X87;
8335 xcr0 |= X86_XSTATE_SSE;
8343 xcr0 |= X86_XSTATE_AVX;
8347 xcr0 |= X86_XSTATE_MPX_MASK;
8355 xcr0 |= X86_XSTATE_AVX512;
8359 xcr0 |= X86_XSTATE_PKRU;
8369 const struct tdesc_feature *feature_core;
8371 const struct tdesc_feature *feature_sse, *feature_avx, *feature_mpx,
8372 *feature_avx512, *feature_pkeys, *feature_segments;
8373 int i, num_regs, valid_p;
8380 if (feature_core == NULL)
8410 tdep->
xcr0 = X86_XSTATE_AVX_AVX512_MASK;
8452 if (!feature_avx512)
8453 tdep->
xcr0 = X86_XSTATE_AVX_MASK;
8468 else if (feature_sse)
8469 tdep->
xcr0 = X86_XSTATE_SSE_MASK;
8472 tdep->
xcr0 = X86_XSTATE_X87_MASK;
8477 for (i = 0; i < num_regs; i++)
8485 for (; i < num_regs; i++)
8492 tdep->
xcr0 |= X86_XSTATE_MPX_MASK;
8507 if (feature_segments)
8519 tdep->
xcr0 |= X86_XSTATE_PKRU;
8547 if ((
type->
code () == TYPE_CODE_INT
8580 if (xsave_layout.sizeof_xsave == 0)
8592 = gdbarch_tdep<i386_gdbarch_tdep> (
arches->gdbarch);
8748 if (info.bfd_arch_info->bits_per_word == 32)
8756 if (info.bfd_arch_info->bits_per_word == 32)
8783 tdesc = info.target_desc;
8786 tdep->
tdesc = tdesc;
8867 tdesc = tdep->
tdesc;
8888 mm0_regnum = ymm0_regnum;
8916 bnd0_regnum = mm0_regnum;
8929 tdep-> bnd0_regnum = -1;
8932 if (info.bfd_arch_info->bits_per_word == 32)
8960 [2][2][2][2][2][2] = {};
8963 tdesc = &i386_tdescs[(xcr0 & X86_XSTATE_SSE) ? 1 : 0]
8964 [(xcr0 & X86_XSTATE_AVX) ? 1 : 0]
8965 [(xcr0 & X86_XSTATE_MPX) ? 1 : 0]
8966 [(xcr0 & X86_XSTATE_AVX512) ? 1 : 0]
8967 [(xcr0 & X86_XSTATE_PKRU) ? 1 : 0]
8976#define MPX_BASE_MASK (~(ULONGEST) 0xfff)
8985 enum register_status regstatus;
8993 if (regstatus != REG_VALID)
8994 error (_(
"BNDCFGU register invalid, read status %d."), regstatus);
9009#define MPX_BD_MASK 0xfffffff00000ULL
9010#define MPX_BT_MASK 0x0000000ffff8
9011#define MPX_BD_MASK_32 0xfffff000
9012#define MPX_BT_MASK_32 0x00000ffc
9022 CORE_ADDR mpx_bd_mask, bd_ptr_r_shift, bd_ptr_l_shift;
9023 CORE_ADDR bt_mask, bt_select_r_shift, bt_select_l_shift;
9024 CORE_ADDR bd_entry_addr;
9034 bd_ptr_r_shift = 20;
9036 bt_select_r_shift = 3;
9037 bt_select_l_shift = 5;
9040 if (
sizeof (CORE_ADDR) == 4)
9041 error (_(
"bound table examination not supported\
9042 for 64-bit process with 32-bit GDB"));
9047 bd_ptr_r_shift = 12;
9049 bt_select_r_shift = 2;
9050 bt_select_l_shift = 4;
9054 offset1 = ((ptr & mpx_bd_mask) >> bd_ptr_r_shift) << bd_ptr_l_shift;
9055 bd_entry_addr = bd_base +
offset1;
9058 if ((bd_entry & 0x1) == 0)
9059 error (_(
"Invalid bounds directory entry at %s."),
9064 bt_addr = bd_entry & ~bt_select_r_shift;
9065 offset2 = ((ptr & bt_mask) >> bt_select_r_shift) << bt_select_l_shift;
9067 return bt_addr + offset2;
9078 CORE_ADDR onecompl = ~((CORE_ADDR) 0);
9079 int bounds_in_map = ((~bt_entry[1] == 0 && bt_entry[0] == onecompl) ? 1 : 0);
9081 if (bounds_in_map == 1)
9083 uiout->
text (
"Null bounds on map:");
9084 uiout->
text (
" pointer value = ");
9091 uiout->
text (
"{lbound = ");
9093 uiout->
text (
", ubound = ");
9097 uiout->
text (
"}: pointer value = ");
9101 size = ( (~(int64_t) bt_entry[1]) - (int64_t) bt_entry[0]);
9103 size = ( ~((int32_t) bt_entry[1]) - (int32_t) bt_entry[0]);
9110 uiout->
text (
", size = ");
9113 uiout->
text (
", metadata = ");
9124 CORE_ADDR bd_base = 0;
9126 CORE_ADDR bt_entry_addr = 0;
9127 CORE_ADDR bt_entry[4];
9135 gdb_printf (_(
"Intel Memory Protection Extensions not "
9136 "supported on this target.\n"));
9142 gdb_printf (_(
"Address of pointer variable expected.\n"));
9151 memset (bt_entry, 0,
sizeof (bt_entry));
9153 for (i = 0; i < 4; i++)
9155 + i * data_ptr_type->
length (),
9166 CORE_ADDR bd_base = 0;
9167 CORE_ADDR addr, lower, upper;
9168 CORE_ADDR bt_entry_addr = 0;
9169 CORE_ADDR bt_entry[2];
9170 const char *input = args;
9178 error (_(
"Intel Memory Protection Extensions not supported\
9182 error (_(
"Pointer value expected."));
9186 if (input[0] ==
',')
9188 if (input[0] ==
'\0')
9189 error (_(
"wrong number of arguments: missing lower and upper bound."));
9192 if (input[0] ==
',')
9194 if (input[0] ==
'\0')
9195 error (_(
"Wrong number of arguments; Missing upper bound."));
9200 for (i = 0; i < 2; i++)
9202 + i * data_ptr_type->
length (),
9204 bt_entry[0] = (uint64_t) lower;
9205 bt_entry[1] = ~(uint64_t) upper;
9207 for (i = 0; i < 2; i++)
9209 + i * data_ptr_type->
length (),
9210 data_ptr_type->
length (), byte_order,
9225Set the disassembly flavor."), _(
"\
9226Show the disassembly flavor."), _(
"\
9227The valid values are \"att\" and \"intel\", and the default value is \"att\"."),
9236Set the convention for returning small structs."), _(
"\
9237Show the convention for returning small structs."), _(
"\
9238Valid values are \"default\", \"pcc\" and \"reg\", and the default value\n\
9248 _(
"Set Intel Memory Protection Extensions specific variables."),
9249 _(
"Show Intel Memory Protection Extensions specific variables."),
9255 "Show the memory bounds for a given array/pointer storage\
9256 in the bound table.",
9262 "Set the memory bounds for a given array/pointer storage\
9263 in the bound table.",
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep, gdbarch_supports_arch_info_ftype *supports_arch_info)
void gdbarch_free(struct gdbarch *arch)
int default_print_insn(bfd_vma memaddr, disassemble_info *info)
const struct floatformat ** default_floatformat_for_type(struct gdbarch *gdbarch, const char *name, int len)
struct gdbarch * get_current_arch(void)
struct gdbarch * target_gdbarch(void)
static std::vector< const char * > arches
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
#define BP_MANIPULATION(BREAK_INSN)
void ax_reg_mask(struct agent_expr *ax, int reg)
void ax_simple(struct agent_expr *x, enum agent_op op)
void ax_const_l(struct agent_expr *x, LONGEST l)
void ax_reg(struct agent_expr *x, int reg)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
enum register_status raw_read(int regnum, gdb_byte *buf)
void raw_collect(int regnum, void *buf) const override
void raw_supply(int regnum, const void *buf) override
void cooked_write(int regnum, const gdb_byte *buf)
void raw_write_part(int regnum, int offset, int len, const gdb_byte *buf)
void raw_write(int regnum, const gdb_byte *buf)
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
void text(const char *string)
struct cmd_list_element * showlist
struct cmd_list_element * setlist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
set_show_commands add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
CORE_ADDR read_memory_typed_address(CORE_ADDR addr, struct type *type)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
ULONGEST read_code_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
void read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
LONGEST read_code_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static void store_signed_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, LONGEST val)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
static LONGEST extract_signed_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_ABI_RETURNS_ADDRESS
@ RETURN_VALUE_REGISTER_CONVENTION
int gdb_buffered_insn_length(struct gdbarch *gdbarch, const gdb_byte *insn, int max_len, CORE_ADDR addr)
int gdb_insn_length(struct gdbarch *gdbarch, CORE_ADDR addr)
#define displaced_debug_printf(fmt,...)
std::unique_ptr< displaced_step_copy_insn_closure > displaced_step_copy_insn_closure_up
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
struct value * parse_to_comma_and_eval(const char **expp)
CORE_ADDR parse_and_eval_address(const char *exp)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
int default_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
struct value * frame_unwind_got_memory(frame_info_ptr frame, int regnum, CORE_ADDR addr)
struct value * frame_unwind_got_register(frame_info_ptr frame, int regnum, int new_regnum)
struct value * frame_unwind_got_constant(frame_info_ptr frame, int regnum, ULONGEST val)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
int frame_relative_level(frame_info_ptr fi)
ULONGEST get_frame_register_unsigned(frame_info_ptr frame, int regnum)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
void get_frame_register(frame_info_ptr frame, int regnum, gdb_byte *buf)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
void frame_unwind_register(frame_info_ptr next_frame, int regnum, gdb_byte *buf)
struct frame_id frame_id_build_unavailable_stack(CORE_ADDR code_addr)
CORE_ADDR get_frame_func(frame_info_ptr this_frame)
bool get_frame_register_bytes(frame_info_ptr frame, int regnum, CORE_ADDR offset, gdb::array_view< gdb_byte > buffer, int *optimizedp, int *unavailablep)
bool deprecated_frame_register_read(frame_info_ptr frame, int regnum, gdb_byte *myaddr)
void put_frame_register(frame_info_ptr frame, int regnum, const gdb_byte *buf)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void set_gdbarch_stab_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum)
void set_gdbarch_insn_is_jump(struct gdbarch *gdbarch, gdbarch_insn_is_jump_ftype *insn_is_jump)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc)
void set_gdbarch_return_value_as_value(struct gdbarch *gdbarch, gdbarch_return_value_as_value_ftype *return_value_as_value)
void set_gdbarch_fetch_pointer_argument(struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument)
void set_gdbarch_ps_regnum(struct gdbarch *gdbarch, int ps_regnum)
void set_gdbarch_register_to_value(struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value)
void set_gdbarch_gen_return_address(struct gdbarch *gdbarch, gdbarch_gen_return_address_ftype *gen_return_address)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
void set_gdbarch_value_to_register(struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register)
void set_gdbarch_stap_parse_special_token(struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype *stap_parse_special_token)
void set_gdbarch_stap_integer_prefixes(struct gdbarch *gdbarch, const char *const *stap_integer_prefixes)
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc)
void set_gdbarch_pseudo_register_read_value(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align)
void set_gdbarch_max_insn_length(struct gdbarch *gdbarch, ULONGEST max_insn_length)
void set_gdbarch_get_longjmp_target(struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)
void set_gdbarch_push_dummy_code(struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code)
void set_gdbarch_skip_trampoline_code(struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code)
void set_gdbarch_bfloat16_format(struct gdbarch *gdbarch, const struct floatformat **bfloat16_format)
void set_gdbarch_stap_is_single_operand(struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand)
void set_gdbarch_decr_pc_after_break(struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break)
void set_gdbarch_gnu_triplet_regexp(struct gdbarch *gdbarch, gdbarch_gnu_triplet_regexp_ftype *gnu_triplet_regexp)
int gdbarch_num_regs(struct gdbarch *gdbarch)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than)
void set_gdbarch_stap_register_indirection_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_prefixes)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
void set_gdbarch_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p)
void set_gdbarch_ax_pseudo_register_collect(struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect)
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
void set_gdbarch_call_dummy_location(struct gdbarch *gdbarch, enum call_dummy_location_type call_dummy_location)
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn)
int gdbarch_long_double_bit(struct gdbarch *gdbarch)
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum)
bool gdbarch_iterate_over_regset_sections_p(struct gdbarch *gdbarch)
void set_gdbarch_insn_is_ret(struct gdbarch *gdbarch, gdbarch_insn_is_ret_ftype *insn_is_ret)
void set_gdbarch_convert_register_p(struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p)
void set_gdbarch_type_align(struct gdbarch *gdbarch, gdbarch_type_align_ftype *type_align)
void set_gdbarch_fast_tracepoint_valid_at(struct gdbarch *gdbarch, gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at)
void set_gdbarch_insn_is_call(struct gdbarch *gdbarch, gdbarch_insn_is_call_ftype *insn_is_call)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
void set_gdbarch_sdb_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum)
void set_gdbarch_stap_register_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_prefixes)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype *dummy_id)
void set_gdbarch_relocate_instruction(struct gdbarch *gdbarch, gdbarch_relocate_instruction_ftype *relocate_instruction)
void set_gdbarch_print_float_info(struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info)
void set_gdbarch_stap_register_indirection_suffixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_suffixes)
ULONGEST gdbarch_max_insn_length(struct gdbarch *gdbarch)
void set_gdbarch_floatformat_for_type(struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call)
void set_gdbarch_in_indirect_branch_thunk(struct gdbarch *gdbarch, gdbarch_in_indirect_branch_thunk_ftype *in_indirect_branch_thunk)
void set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections)
void set_gdbarch_stap_adjust_register(struct gdbarch *gdbarch, gdbarch_stap_adjust_register_ftype *stap_adjust_register)
void set_gdbarch_frame_args_skip(struct gdbarch *gdbarch, CORE_ADDR frame_args_skip)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, gdbarch_tdep_up tdep)
std::unique_ptr< gdbarch_tdep_base > gdbarch_tdep_up
void iterate_over_regset_sections_cb(const char *sect_name, int supply_size, int collect_size, const struct regset *regset, const char *human_name, void *cb_data)
static int gdbarch_num_cooked_regs(gdbarch *arch)
function_call_return_method
struct type * lookup_pointer_type(struct type *type)
struct type * arch_composite_type(struct gdbarch *gdbarch, const char *name, enum type_code code)
const struct floatformat * floatformats_ieee_quad[BFD_ENDIAN_UNKNOWN]
struct type * init_vector_type(struct type *elt_type, int n)
const struct floatformat * floatformats_bfloat16[BFD_ENDIAN_UNKNOWN]
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void append_composite_type_field(struct type *t, const char *name, struct type *field)
const struct floatformat * floatformats_i387_ext[BFD_ENDIAN_UNKNOWN]
struct type * check_typedef(struct type *type)
#define TYPE_HAS_DYNAMIC_LENGTH(t)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
static void append_insns(CORE_ADDR *to, ULONGEST len, const gdb_byte *buf)
int i386_svr4_reg_to_regnum(struct gdbarch *gdbarch, int reg)
void i386_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
bool i386_pkru_regnum_p(struct gdbarch *gdbarch, int regnum)
static CORE_ADDR i386_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr)
static struct value * i386_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static CORE_ADDR i386_analyze_struct_return(CORE_ADDR pc, CORE_ADDR current_pc, struct i386_frame_cache *cache)
int i386_sigtramp_p(frame_info_ptr this_frame)
int i386_bnd_regnum_p(struct gdbarch *gdbarch, int regnum)
static int i386_mmx_regnum_p(struct gdbarch *gdbarch, int regnum)
static int i386_match_insn_block(CORE_ADDR pc, struct i386_insn *insn_patterns)
static struct frame_id i386_dummy_id(struct gdbarch *gdbarch, frame_info_ptr this_frame)
static struct cmd_list_element * mpx_show_cmdlist
#define I386_MAX_MATCHED_INSN_LEN
static int i386_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
static enum unwind_stop_reason i386_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
static CORE_ADDR i386_push_dummy_code(struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
int i386_fp_regnum_p(struct gdbarch *gdbarch, int regnum)
int i386_zmm_regnum_p(struct gdbarch *gdbarch, int regnum)
struct type * i387_ext_type(struct gdbarch *gdbarch)
const char * i386_pseudo_register_name(struct gdbarch *gdbarch, int regnum)
static const reggroup * i386_mmx_reggroup
static int i386_call_p(const gdb_byte *insn)
int i386_register_reggroup_p(struct gdbarch *gdbarch, int regnum, const struct reggroup *group)
#define HIGH_RETURN_REGNUM
const struct regset i386_fpregset
static CORE_ADDR i386_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
static int i386_absolute_call_p(const gdb_byte *insn)
static ULONGEST i386_type_align(struct gdbarch *gdbarch, struct type *type)
static CORE_ADDR i386_frame_base_address(frame_info_ptr this_frame, void **this_cache)
#define I386_SAVE_FPU_REGS
static int i386_validate_tdesc_p(i386_gdbarch_tdep *tdep, struct tdesc_arch_data *tdesc_data)
static int i386_fast_tracepoint_valid_at(struct gdbarch *gdbarch, CORE_ADDR addr, std::string *msg)
static int i386_mpx_ctrl_regnum_p(struct gdbarch *gdbarch, int regnum)
int i386_process_record(struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR input_addr)
int i386_stap_is_single_operand(struct gdbarch *gdbarch, const char *s)
static const char *const i386_ymmh_names[]
static int i386_jmp_p(const gdb_byte *insn)
static const char *const i386_zmm_names[]
static struct gdbarch * i386_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static CORE_ADDR i386_mpx_get_bt_entry(CORE_ADDR ptr, CORE_ADDR bd_base)
static int i386_convert_register_p(struct gdbarch *gdbarch, int regnum, struct type *type)
static void i386_mpx_info_bounds(const char *args, int from_tty)
static void i386_mpx_print_bounds(const CORE_ADDR bt_entry[4])
static const char *const i386_k_names[]
static int i386_record_lea_modrm_addr(struct i386_record_s *irp, uint64_t *addr)
static enum unwind_stop_reason i386_epilogue_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
void i386_svr4_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
static struct i386_frame_cache * i386_frame_cache(frame_info_ptr this_frame, void **this_cache)
static void i386_collect_gregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len)
static void i386_store_return_value(struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static CORE_ADDR i386_analyze_stack_align(CORE_ADDR pc, CORE_ADDR current_pc, struct i386_frame_cache *cache)
static const char *const i386_mpx_names[]
static i386_insn i386_frame_setup_skip_insns[]
static const char *const i386_mmx_names[]
static int i386_record_push(struct i386_record_s *irp, int size)
static CORE_ADDR i386_skip_noop(CORE_ADDR pc)
static CORE_ADDR i386_skip_endbr(CORE_ADDR pc)
int i386_dword_regnum_p(struct gdbarch *gdbarch, int regnum)
static std::string i386_stap_adjust_register(struct gdbarch *gdbarch, struct stap_parse_info *p, const std::string ®name, int regnum)
static int i386_print_insn(bfd_vma pc, struct disassemble_info *info)
static void i386_init_reggroups(void)
static void i386_relocate_instruction(struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR oldloc)
static int i386_record_lea_modrm(struct i386_record_s *irp)
const struct regset i386_gregset
int i386_ymm_avx512_regnum_p(struct gdbarch *gdbarch, int regnum)
static const char * i386_gnu_triplet_regexp(struct gdbarch *gdbarch)
static int i386_ymmh_regnum_p(struct gdbarch *gdbarch, int regnum)
int i386_k_regnum_p(struct gdbarch *gdbarch, int regnum)
const int num_lower_zmm_regs
static const char *const i386_pkeys_names[]
static int i386_ymmh_avx512_regnum_p(struct gdbarch *gdbarch, int regnum)
static i386_insn i386_tramp_chain_in_reg_insns[]
const struct target_desc * i386_target_description(uint64_t xcr0, bool segments)
constexpr gdb_byte i386_break_insn[]
static void i386_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
void i386_pseudo_register_read_into_value(struct gdbarch *gdbarch, readable_regcache *regcache, int regnum, struct value *result_value)
int i386_ymm_regnum_p(struct gdbarch *gdbarch, int regnum)
static void i386_extract_return_value(struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static int i386_ret_p(const gdb_byte *insn)
static int i386_epilogue_override_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
static int i386_match_pattern(CORE_ADDR pc, struct i386_insn pattern)
static CORE_ADDR i386_fetch_pointer_argument(frame_info_ptr frame, int argi, struct type *type)
static void i386_add_reggroups(struct gdbarch *gdbarch)
static i386_insn i386_tramp_chain_on_stack_insns[]
static const char att_flavor[]
static struct type * i386_zmm_type(struct gdbarch *gdbarch)
static const struct frame_unwind i386_stack_tramp_frame_unwind
#define LOW_RETURN_REGNUM
static uint64_t i386_xcr0_from_tdesc(const struct target_desc *tdesc)
static bool i386_in_indirect_branch_thunk(struct gdbarch *gdbarch, CORE_ADDR pc)
static struct type * i386_mmx_type(struct gdbarch *gdbarch)
static int i386_get_longjmp_target(frame_info_ptr frame, CORE_ADDR *pc)
void i386_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buf)
static int i386_dbx_reg_to_regnum(struct gdbarch *gdbarch, int reg)
static int i386_reg_struct_return_p(struct gdbarch *gdbarch, struct type *type)
static struct cmd_list_element * mpx_set_cmdlist
static const char * struct_convention
CORE_ADDR i386_thiscall_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr, bool thiscall)
static struct i386_frame_cache * i386_epilogue_frame_cache(frame_info_ptr this_frame, void **this_cache)
displaced_step_copy_insn_closure_up i386_displaced_step_copy_insn(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
#define I386_SAVE_FPU_ENV_REG_STACK
static struct type * i386_bnd_type(struct gdbarch *gdbarch)
static struct value * i386_epilogue_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static struct value * i386_sigtramp_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static const char reg_struct_convention[]
CORE_ADDR i386_pe_skip_trampoline_code(frame_info_ptr frame, CORE_ADDR pc, char *name)
static const char * disassembly_flavor
static const struct frame_base i386_frame_base
static const char *const i386_zmmh_names[]
#define I386_NUM_SAVED_REGS
static int i386_stack_tramp_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_cache)
static CORE_ADDR i386_skip_probe(CORE_ADDR pc)
static struct type * i386_ymm_type(struct gdbarch *gdbarch)
static int i386_insn_is_call(struct gdbarch *gdbarch, CORE_ADDR addr)
static int i386_record_floats(struct gdbarch *gdbarch, struct i386_record_s *ir, uint32_t iregnum)
int i386_fpc_regnum_p(struct gdbarch *gdbarch, int regnum)
static void i386_supply_fpregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len)
static unsigned long i386_mpx_bd_base(void)
static const char pcc_struct_convention[]
static CORE_ADDR i386_analyze_register_saves(CORE_ADDR pc, CORE_ADDR current_pc, struct i386_frame_cache *cache)
void i386_displaced_step_fixup(struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure_, CORE_ADDR from, CORE_ADDR to, struct regcache *regs, bool completed_p)
static void i386_collect_fpregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *fpregs, size_t len)
#define I386_RECORD_FULL_ARCH_LIST_ADD_REG(regnum)
int i386_xmm_avx512_regnum_p(struct gdbarch *gdbarch, int regnum)
static const struct frame_unwind i386_sigtramp_frame_unwind
static CORE_ADDR i386_unwind_pc(struct gdbarch *gdbarch, frame_info_ptr next_frame)
static const char * i386_register_name(struct gdbarch *gdbarch, int regnum)
static void i386_epilogue_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
static const char *const i386_ymm_names[]
#define I386_SAVE_FPU_ENV
static const char *const valid_flavors[]
static int i386_bndr_regnum_p(struct gdbarch *gdbarch, int regnum)
static struct i386_frame_cache * i386_alloc_frame_cache(void)
static struct i386_insn * i386_match_insn(CORE_ADDR pc, struct i386_insn *insn_patterns)
static enum return_value_convention i386_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, struct value **read_value, const gdb_byte *writebuf)
static const reggroup * i386_sse_reggroup
static CORE_ADDR i386_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc)
static void i386_gen_return_address(struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope)
static int i386_svr4_dwarf_reg_to_regnum(struct gdbarch *gdbarch, int reg)
static int i386_sigtramp_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
static int i386_next_regnum(int regnum)
static expr::operation_up i386_stap_parse_special_token_three_arg_disp(struct gdbarch *gdbarch, struct stap_parse_info *p)
CORE_ADDR i386_skip_main_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
int i386_byte_regnum_p(struct gdbarch *gdbarch, int regnum)
int i386_xmm_regnum_p(struct gdbarch *gdbarch, int regnum)
static int i386_register_to_value(frame_info_ptr frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
static const struct frame_unwind i386_frame_unwind
static int i386_syscall_p(const gdb_byte *insn, int *lengthp)
int i386_ax_pseudo_register_collect(struct gdbarch *gdbarch, struct agent_expr *ax, int regnum)
static const char intel_flavor[]
static int i386_epilogue_frame_sniffer_1(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache, bool override_p)
void i386_elf_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
static void i386_frame_cache_1(frame_info_ptr this_frame, struct i386_frame_cache *cache)
static CORE_ADDR i386_analyze_frame_setup(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR limit, struct i386_frame_cache *cache)
static const struct floatformat ** i386_floatformat_for_type(struct gdbarch *gdbarch, const char *name, int len)
static int i386_absolute_jmp_p(const gdb_byte *insn)
static enum unwind_stop_reason i386_sigtramp_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
static const int i386_record_regmap[]
static void i386_value_to_register(frame_info_ptr frame, int regnum, struct type *type, const gdb_byte *from)
static CORE_ADDR i386_follow_jump(struct gdbarch *gdbarch, CORE_ADDR pc)
static int i386_record_modrm(struct i386_record_s *irp)
static struct i386_frame_cache * i386_sigtramp_frame_cache(frame_info_ptr this_frame, void **this_cache)
static int i386_insn_is_ret(struct gdbarch *gdbarch, CORE_ADDR addr)
static const char *const i386_bnd_names[]
static int i386_epilogue_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
static int i386_svr4_sigtramp_p(frame_info_ptr this_frame)
static const char *const i386_word_names[]
static int i386_16_byte_align_p(struct type *type)
static const char *const i386_register_names[]
static int i386_mxcsr_regnum_p(struct gdbarch *gdbarch, int regnum)
static void i386_mpx_set_bounds(const char *args, int from_tty)
expr::operation_up i386_stap_parse_special_token(struct gdbarch *gdbarch, struct stap_parse_info *p)
static const struct frame_unwind i386_epilogue_frame_unwind
static expr::operation_up i386_stap_parse_special_token_triplet(struct gdbarch *gdbarch, struct stap_parse_info *p)
static const char default_struct_convention[]
void _initialize_i386_tdep()
void i386_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
static int i386_in_stack_tramp_p(CORE_ADDR pc)
static const char *const i386_byte_names[]
static int i386_mmx_regnum_to_fp_regnum(readable_regcache *regcache, int regnum)
static struct value * i386_pseudo_register_read_value(struct gdbarch *gdbarch, readable_regcache *regcache, int regnum)
static const struct frame_unwind i386_epilogue_override_frame_unwind
static int i386_insn_is_jump(struct gdbarch *gdbarch, CORE_ADDR addr)
static CORE_ADDR i386_svr4_sigcontext_addr(frame_info_ptr this_frame)
static const char *const valid_conventions[]
int i386_word_regnum_p(struct gdbarch *gdbarch, int regnum)
int i386_zmmh_regnum_p(struct gdbarch *gdbarch, int regnum)
static CORE_ADDR i386_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct i386_frame_cache *cache)
int i386_mpx_enabled(void)
static void i386_sigtramp_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
struct type * i386_pseudo_register_type(struct gdbarch *gdbarch, int regnum)
#define I386_MAX_REGISTER_SIZE
#define I386_MAX_INSN_LEN
@ X86_RECORD_EFLAGS_REGNUM
target_desc * i386_create_target_description(uint64_t xcr0, bool is_linux, bool segments)
void i387_value_to_register(frame_info_ptr frame, int regnum, struct type *type, const gdb_byte *from)
void i387_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
x86_xsave_layout i387_fallback_xsave_layout(uint64_t xcr0)
void i387_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
void i387_reset_bnd_regs(struct gdbarch *gdbarch, struct regcache *regcache)
int i387_convert_register_p(struct gdbarch *gdbarch, int regnum, struct type *type)
void i387_supply_fsave(struct regcache *regcache, int regnum, const void *fsave)
void i387_collect_fsave(const struct regcache *regcache, int regnum, void *fsave)
int i387_register_to_value(frame_info_ptr frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
void i387_print_float_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, const char *args)
#define I387_XMM0_REGNUM(tdep)
#define I387_ST0_REGNUM(tdep)
#define I387_YMM0_REGNUM(tdep)
#define I387_XMM16_REGNUM(tdep)
#define I387_NUM_MPX_REGS
#define I387_BND0R_REGNUM(tdep)
#define I387_NUM_BND_REGS
#define I387_YMM16H_REGNUM(tdep)
#define I387_SIZEOF_FSAVE
#define I387_NUM_PKEYS_REGS
#define I387_FSTAT_REGNUM(tdep)
#define I387_FOP_REGNUM(tdep)
#define I387_SIZEOF_FXSAVE
#define I387_FCTRL_REGNUM(tdep)
#define I387_NUM_XMM_AVX512_REGS(tdep)
#define I387_MXCSR_REGNUM(tdep)
#define I387_BNDCFGU_REGNUM(tdep)
#define I387_MM0_REGNUM(tdep)
#define I387_NUM_MPX_CTRL_REGS
#define I387_PKRU_REGNUM(tdep)
#define I387_FTAG_REGNUM(tdep)
#define I387_NUM_XMM_REGS(tdep)
CORE_ADDR find_function_addr(struct value *function, struct type **retval_type, struct type **function_type)
obj_section * maint_obj_section_from_bfd_section(bfd *abfd, asection *asection, objfile *ofile)
CORE_ADDR find_solib_trampoline_target(frame_info_ptr frame, CORE_ADDR pc)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
std::unique_ptr< operation > operation_up
struct obj_section * find_pc_section(CORE_ADDR pc)
static int in_plt_section(CORE_ADDR pc)
void gdbarch_register_osabi(enum bfd_architecture arch, unsigned long machine, enum gdb_osabi osabi, void(*init_osabi)(struct gdbarch_info, struct gdbarch *))
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
bool producer_is_llvm(const char *producer)
bool producer_is_icc_ge_19(const char *producer)
bool record_full_memory_query
int record_full_arch_list_add_reg(struct regcache *regcache, int regnum)
int record_full_arch_list_add_mem(CORE_ADDR addr, int len)
int record_full_arch_list_add_end(void)
unsigned int record_debug
int record_read_memory(struct gdbarch *gdbarch, CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
int register_size(struct gdbarch *gdbarch, int regnum)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
void regcache_raw_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
void regcache_write_pc(struct regcache *regcache, CORE_ADDR pc)
struct regcache * get_current_regcache(void)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
const reggroup *const general_reggroup
int default_register_reggroup_p(struct gdbarch *gdbarch, int regnum, const struct reggroup *group)
const reggroup * reggroup_new(const char *name, enum reggroup_type type)
const reggroup *const float_reggroup
const reggroup *const all_reggroup
void reggroup_add(struct gdbarch *gdbarch, const reggroup *group)
const reggroup *const vector_reggroup
void register_remote_support_xml(const char *xml)
static const char *const stap_register_indirection_prefixes[]
static const char *const stap_register_indirection_suffixes[]
struct minimal_symbol * minsym
struct type * builtin_long
struct type * builtin_data_ptr
const char * producer() const
struct type * type() const
const char * linkage_name() const
CORE_ADDR saved_regs[I386_NUM_SAVED_REGS]
const char *const * mpx_register_names
struct type * i386_bnd_type
const struct regset * fpregset
const char *const * zmmh_register_names
struct type * i387_ext_type
const char *const * k_register_names
struct type * i386_mmx_type
const char *const * register_names
int(* sigtramp_p)(frame_info_ptr)
const char *const * xmm_avx512_register_names
x86_xsave_layout xsave_layout
gdbarch_register_reggroup_p_ftype * register_reggroup_p
CORE_ADDR(* sigcontext_addr)(frame_info_ptr)
const char *const * pkeys_register_names
const char *const * ymmh_register_names
struct type * i386_zmm_type
const struct target_desc * tdesc
const int * record_regmap
struct type * i386_ymm_type
const char *const * ymm16h_register_names
gdb_byte mask[I386_MAX_MATCHED_INSN_LEN]
gdb_byte insn[I386_MAX_MATCHED_INSN_LEN]
struct regcache * regcache
struct type * target_type() const
struct field & field(int idx) const
unsigned int num_fields() const
void set_name(const char *name)
void set_is_vector(bool is_vector)
struct gdbarch * arch() const
static struct value * allocate(struct type *type)
void set_lval(lval_type val)
void mark_bytes_unavailable(LONGEST offset, ULONGEST length)
gdb::array_view< gdb_byte > contents_raw()
struct type * type() const
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
static bool compunit_epilogue_unwind_valid(struct compunit_symtab *cust)
tdesc_arch_data_up tdesc_data_alloc(void)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
static const registry< gdbarch >::key< tdesc_arch_data > tdesc_data
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, tdesc_arch_data_up &&early_data, tdesc_unknown_register_ftype unk_reg_cb)
void set_tdesc_pseudo_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *pseudo_name)
int tdesc_has_registers(const struct target_desc *target_desc)
void set_tdesc_pseudo_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *pseudo_type)
const char * tdesc_register_name(struct gdbarch *gdbarch, int regno)
struct type * tdesc_find_type(struct gdbarch *gdbarch, const char *id)
std::unique_ptr< tdesc_arch_data, tdesc_arch_data_deleter > tdesc_arch_data_up
void target_float_convert(const gdb_byte *from, const struct type *from_type, gdb_byte *to, const struct type *to_type)
int target_get_min_fast_tracepoint_insn_len()
int target_read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
x86_xsave_layout target_fetch_x86_xsave_layout()
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
int yquery(const char *ctlstr,...)
void gdb_printf(struct ui_file *stream, const char *format,...)
struct value * value_at_non_lval(struct type *type, CORE_ADDR addr)
CORE_ADDR value_as_address(struct value *val)
#define VALUE_REGNUM(val)
static void check(BOOL ok, const char *file, int line)
bool x86_in_indirect_branch_thunk(CORE_ADDR pc, const char *const *register_names, int lo, int hi)