gdb/amd64-tdep.h - gdb

Data types defined

Macros defined

Source code

  1. /* Target-dependent definitions for AMD64.

  2.    Copyright (C) 2001-2015 Free Software Foundation, Inc.
  3.    Contributed by Jiri Smid, SuSE Labs.

  4.    This file is part of GDB.

  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 3 of the License, or
  8.    (at your option) any later version.

  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.

  13.    You should have received a copy of the GNU General Public License
  14.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  15. #ifndef AMD64_TDEP_H
  16. #define AMD64_TDEP_H

  17. struct gdbarch;
  18. struct frame_info;
  19. struct regcache;

  20. #include "i386-tdep.h"

  21. /* Register numbers of various important registers.  */

  22. enum amd64_regnum
  23. {
  24.   AMD64_RAX_REGNUM,                /* %rax */
  25.   AMD64_RBX_REGNUM,                /* %rbx */
  26.   AMD64_RCX_REGNUM,                /* %rcx */
  27.   AMD64_RDX_REGNUM,                /* %rdx */
  28.   AMD64_RSI_REGNUM,                /* %rsi */
  29.   AMD64_RDI_REGNUM,                /* %rdi */
  30.   AMD64_RBP_REGNUM,                /* %rbp */
  31.   AMD64_RSP_REGNUM,                /* %rsp */
  32.   AMD64_R8_REGNUM,                /* %r8 */
  33.   AMD64_R9_REGNUM,                /* %r9 */
  34.   AMD64_R10_REGNUM,                /* %r10 */
  35.   AMD64_R11_REGNUM,                /* %r11 */
  36.   AMD64_R12_REGNUM,                /* %r12 */
  37.   AMD64_R13_REGNUM,                /* %r13 */
  38.   AMD64_R14_REGNUM,                /* %r14 */
  39.   AMD64_R15_REGNUM,                /* %r15 */
  40.   AMD64_RIP_REGNUM,                /* %rip */
  41.   AMD64_EFLAGS_REGNUM,                /* %eflags */
  42.   AMD64_CS_REGNUM,                /* %cs */
  43.   AMD64_SS_REGNUM,                /* %ss */
  44.   AMD64_DS_REGNUM,                /* %ds */
  45.   AMD64_ES_REGNUM,                /* %es */
  46.   AMD64_FS_REGNUM,                /* %fs */
  47.   AMD64_GS_REGNUM,                /* %gs */
  48.   AMD64_ST0_REGNUM = 24,        /* %st0 */
  49.   AMD64_ST1_REGNUM,                /* %st1 */
  50.   AMD64_FCTRL_REGNUM = AMD64_ST0_REGNUM + 8,
  51.   AMD64_FSTAT_REGNUM = AMD64_ST0_REGNUM + 9,
  52.   AMD64_FTAG_REGNUM = AMD64_ST0_REGNUM + 10,
  53.   AMD64_XMM0_REGNUM = 40,        /* %xmm0 */
  54.   AMD64_XMM1_REGNUM,                /* %xmm1 */
  55.   AMD64_MXCSR_REGNUM = AMD64_XMM0_REGNUM + 16,
  56.   AMD64_YMM0H_REGNUM,                /* %ymm0h */
  57.   AMD64_YMM15H_REGNUM = AMD64_YMM0H_REGNUM + 15,
  58.   AMD64_BND0R_REGNUM = AMD64_YMM15H_REGNUM + 1,
  59.   AMD64_BND3R_REGNUM = AMD64_BND0R_REGNUM + 3,
  60.   AMD64_BNDCFGU_REGNUM,
  61.   AMD64_BNDSTATUS_REGNUM,
  62.   AMD64_XMM16_REGNUM,
  63.   AMD64_XMM31_REGNUM = AMD64_XMM16_REGNUM + 15,
  64.   AMD64_YMM16H_REGNUM,
  65.   AMD64_YMM31H_REGNUM = AMD64_YMM16H_REGNUM + 15,
  66.   AMD64_K0_REGNUM,
  67.   AMD64_K7_REGNUM = AMD64_K0_REGNUM + 7,
  68.   AMD64_ZMM0H_REGNUM,
  69.   AMD64_ZMM31H_REGNUM = AMD64_ZMM0H_REGNUM + 31
  70. };

  71. /* Number of general purpose registers.  */
  72. #define AMD64_NUM_GREGS                24

  73. #define AMD64_NUM_REGS                (AMD64_ZMM31H_REGNUM + 1)

  74. extern struct displaced_step_closure *amd64_displaced_step_copy_insn
  75.   (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to,
  76.    struct regcache *regs);
  77. extern void amd64_displaced_step_fixup (struct gdbarch *gdbarch,
  78.                                         struct displaced_step_closure *closure,
  79.                                         CORE_ADDR from, CORE_ADDR to,
  80.                                         struct regcache *regs);

  81. extern void amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
  82. extern void amd64_x32_init_abi (struct gdbarch_info info,
  83.                                 struct gdbarch *gdbarch);

  84. /* Fill register REGNUM in REGCACHE with the appropriate
  85.    floating-point or SSE register value from *FXSAVE.  If REGNUM is
  86.    -1, do this for all registers.  This function masks off any of the
  87.    reserved bits in *FXSAVE.  */

  88. extern void amd64_supply_fxsave (struct regcache *regcache, int regnum,
  89.                                  const void *fxsave);

  90. /* Similar to amd64_supply_fxsave, but use XSAVE extended state.  */
  91. extern void amd64_supply_xsave (struct regcache *regcache, int regnum,
  92.                                 const void *xsave);

  93. /* Fill register REGNUM (if it is a floating-point or SSE register) in
  94.    *FXSAVE with the value from REGCACHE.  If REGNUM is -1, do this for
  95.    all registers.  This function doesn't touch any of the reserved
  96.    bits in *FXSAVE.  */

  97. extern void amd64_collect_fxsave (const struct regcache *regcache, int regnum,
  98.                                   void *fxsave);
  99. /* Similar to amd64_collect_fxsave, but use XSAVE extended state.  */
  100. extern void amd64_collect_xsave (const struct regcache *regcache,
  101.                                  int regnum, void *xsave, int gcore);

  102. /* Floating-point register set. */
  103. extern const struct regset amd64_fpregset;

  104. /* Variables exported from amd64-linux-tdep.c.  */
  105. extern int amd64_linux_gregset_reg_offset[];

  106. /* Variables exported from amd64nbsd-tdep.c.  */
  107. extern int amd64nbsd_r_reg_offset[];

  108. /* Variables exported from amd64obsd-tdep.c.  */
  109. extern int amd64obsd_r_reg_offset[];

  110. /* Variables exported from amd64fbsd-tdep.c.  */
  111. extern CORE_ADDR amd64fbsd_sigtramp_start_addr;
  112. extern CORE_ADDR amd64fbsd_sigtramp_end_addr;
  113. extern int amd64fbsd_sc_reg_offset[];

  114. #endif /* amd64-tdep.h */