GDB (xrefs)
/tmp/gdb-8.1/gdb/amd64-tdep.h
Go to the documentation of this file.
1 /* Target-dependent definitions for AMD64.
2 
3  Copyright (C) 2001-2018 Free Software Foundation, Inc.
4  Contributed by Jiri Smid, SuSE Labs.
5 
6  This file is part of GDB.
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 
21 #ifndef AMD64_TDEP_H
22 #define AMD64_TDEP_H
23 
24 struct gdbarch;
25 struct frame_info;
26 struct regcache;
27 
28 #include "i386-tdep.h"
29 
30 /* Register numbers of various important registers. */
31 
33 {
34  AMD64_RAX_REGNUM, /* %rax */
35  AMD64_RBX_REGNUM, /* %rbx */
36  AMD64_RCX_REGNUM, /* %rcx */
37  AMD64_RDX_REGNUM, /* %rdx */
38  AMD64_RSI_REGNUM, /* %rsi */
39  AMD64_RDI_REGNUM, /* %rdi */
40  AMD64_RBP_REGNUM, /* %rbp */
41  AMD64_RSP_REGNUM, /* %rsp */
42  AMD64_R8_REGNUM, /* %r8 */
43  AMD64_R9_REGNUM, /* %r9 */
44  AMD64_R10_REGNUM, /* %r10 */
45  AMD64_R11_REGNUM, /* %r11 */
46  AMD64_R12_REGNUM, /* %r12 */
47  AMD64_R13_REGNUM, /* %r13 */
48  AMD64_R14_REGNUM, /* %r14 */
49  AMD64_R15_REGNUM, /* %r15 */
50  AMD64_RIP_REGNUM, /* %rip */
51  AMD64_EFLAGS_REGNUM, /* %eflags */
52  AMD64_CS_REGNUM, /* %cs */
53  AMD64_SS_REGNUM, /* %ss */
54  AMD64_DS_REGNUM, /* %ds */
55  AMD64_ES_REGNUM, /* %es */
56  AMD64_FS_REGNUM, /* %fs */
57  AMD64_GS_REGNUM, /* %gs */
58  AMD64_ST0_REGNUM = 24, /* %st0 */
59  AMD64_ST1_REGNUM, /* %st1 */
63  AMD64_XMM0_REGNUM = 40, /* %xmm0 */
64  AMD64_XMM1_REGNUM, /* %xmm1 */
66  AMD64_YMM0H_REGNUM, /* %ymm0h */
83 };
84 
85 /* Number of general purpose registers. */
86 #define AMD64_NUM_GREGS 24
87 
88 #define AMD64_NUM_REGS (AMD64_GSBASE_REGNUM + 1)
89 
91  (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to,
92  struct regcache *regs);
93 extern void amd64_displaced_step_fixup (struct gdbarch *gdbarch,
94  struct displaced_step_closure *closure,
95  CORE_ADDR from, CORE_ADDR to,
96  struct regcache *regs);
97 
98 /* Initialize the ABI for amd64. Uses DEFAULT_TDESC as fallback
99  tdesc, if INFO does not specify one. */
100 extern void amd64_init_abi (struct gdbarch_info info,
101  struct gdbarch *gdbarch,
102  const target_desc *default_tdesc);
103 
104 /* Initialize the ABI for x32. Uses DEFAULT_TDESC as fallback tdesc,
105  if INFO does not specify one. */
106 extern void amd64_x32_init_abi (struct gdbarch_info info,
107  struct gdbarch *gdbarch,
108  const target_desc *default_tdesc);
109 extern const struct target_desc *amd64_target_description (uint64_t xcr0);
110 
111 /* Fill register REGNUM in REGCACHE with the appropriate
112  floating-point or SSE register value from *FXSAVE. If REGNUM is
113  -1, do this for all registers. This function masks off any of the
114  reserved bits in *FXSAVE. */
115 
116 extern void amd64_supply_fxsave (struct regcache *regcache, int regnum,
117  const void *fxsave);
118 
119 /* Similar to amd64_supply_fxsave, but use XSAVE extended state. */
120 extern void amd64_supply_xsave (struct regcache *regcache, int regnum,
121  const void *xsave);
122 
123 /* Fill register REGNUM (if it is a floating-point or SSE register) in
124  *FXSAVE with the value from REGCACHE. If REGNUM is -1, do this for
125  all registers. This function doesn't touch any of the reserved
126  bits in *FXSAVE. */
127 
128 extern void amd64_collect_fxsave (const struct regcache *regcache, int regnum,
129  void *fxsave);
130 /* Similar to amd64_collect_fxsave, but use XSAVE extended state. */
131 extern void amd64_collect_xsave (const struct regcache *regcache,
132  int regnum, void *xsave, int gcore);
133 
134 /* Floating-point register set. */
135 extern const struct regset amd64_fpregset;
136 
137 /* Variables exported from amd64-linux-tdep.c. */
138 extern int amd64_linux_gregset_reg_offset[];
139 
140 /* Variables exported from amd64-nbsd-tdep.c. */
141 extern int amd64nbsd_r_reg_offset[];
142 
143 /* Variables exported from amd64-obsd-tdep.c. */
144 extern int amd64obsd_r_reg_offset[];
145 
146 /* Variables exported from amd64-fbsd-tdep.c. */
149 extern int amd64fbsd_sc_reg_offset[];
150 
151 #endif /* amd64-tdep.h */
int amd64fbsd_sc_reg_offset[]
amd64_regnum
Definition: amd64-tdep.h:32
bfd_vma CORE_ADDR
Definition: common-types.h:41
void amd64_collect_xsave(const struct regcache *regcache, int regnum, void *xsave, int gcore)
Definition: amd64-tdep.c:3376
CORE_ADDR amd64fbsd_sigtramp_start_addr
Definition: regset.h:34
void amd64_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
Definition: amd64-tdep.c:3355
void amd64_displaced_step_fixup(struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
Definition: amd64-tdep.c:1622
int amd64obsd_r_reg_offset[]
int regnum
Definition: aarch64-tdep.c:77
void amd64_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
Definition: amd64-tdep.c:3327
const struct target_desc * amd64_target_description(uint64_t xcr0)
Definition: amd64-tdep.c:3246
void amd64_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch, const target_desc *default_tdesc)
Definition: amd64-tdep.c:3037
void amd64_x32_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch, const target_desc *default_tdesc)
Definition: amd64-tdep.c:3229
CORE_ADDR amd64fbsd_sigtramp_end_addr
void amd64_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
Definition: amd64-tdep.c:3304
int amd64nbsd_r_reg_offset[]
const struct regset amd64_fpregset
Definition: amd64-tdep.c:2989
struct displaced_step_closure * amd64_displaced_step_copy_insn(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
Definition: amd64-tdep.c:1416
int amd64_linux_gregset_reg_offset[]