gdb/sh-tdep.h - gdb

Data types defined

Macros defined

Source code

  1. /* Target-specific definition for a Renesas Super-H.
  2.    Copyright (C) 1993-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

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

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

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

  14. #ifndef SH_TDEP_H
  15. #define SH_TDEP_H

  16. /* Contributed by Steve Chamberlain sac@cygnus.com.  */

  17. /* Registers for all SH variants.  Used also by sh3-rom.c.  */
  18. enum
  19.   {
  20.     R0_REGNUM = 0,
  21.     STRUCT_RETURN_REGNUM = 2,
  22.     ARG0_REGNUM = 4,
  23.     ARGLAST_REGNUM = 7,
  24.     FP_REGNUM = 14,
  25.     PC_REGNUM = 16,
  26.     PR_REGNUM = 17,
  27.     GBR_REGNUM = 18,
  28.     VBR_REGNUM = 19,
  29.     MACH_REGNUM = 20,
  30.     MACL_REGNUM = 21,
  31.     SR_REGNUM = 22,
  32.     FPUL_REGNUM = 23,
  33.     /* Floating point registers */
  34.     FPSCR_REGNUM = 24,
  35.     FR0_REGNUM = 25,
  36.     FLOAT_ARG0_REGNUM = 29,
  37.     FLOAT_ARGLAST_REGNUM = 36,
  38.     FP_LAST_REGNUM = 40,
  39.     /* sh3,sh4 registers */
  40.     SSR_REGNUM = 41,
  41.     SPC_REGNUM = 42,
  42.     /* DSP registers */
  43.     DSR_REGNUM = 24,
  44.     A0G_REGNUM = 25,
  45.     A0_REGNUM = 26,
  46.     A1G_REGNUM = 27,
  47.     A1_REGNUM = 28,
  48.     M0_REGNUM = 29,
  49.     M1_REGNUM = 30,
  50.     X0_REGNUM = 31,
  51.     X1_REGNUM = 32,
  52.     Y0_REGNUM = 33,
  53.     Y1_REGNUM = 34,
  54.     MOD_REGNUM = 40,
  55.     RS_REGNUM = 43,
  56.     RE_REGNUM = 44,
  57.     DSP_R0_BANK_REGNUM = 51,
  58.     DSP_R7_BANK_REGNUM = 58,
  59.     /* sh2a register */
  60.     R0_BANK0_REGNUM = 43,
  61.     MACHB_REGNUM = 58,
  62.     IVNB_REGNUM = 59,
  63.     PRB_REGNUM = 60,
  64.     GBRB_REGNUM = 61,
  65.     MACLB_REGNUM = 62,
  66.     BANK_REGNUM = 63,
  67.     IBCR_REGNUM = 64,
  68.     IBNR_REGNUM = 65,
  69.     TBR_REGNUM = 66,
  70.     PSEUDO_BANK_REGNUM = 67,
  71.     /* Floating point pseudo registers */
  72.     DR0_REGNUM = 68,
  73.     DR_LAST_REGNUM = 75,
  74.     FV0_REGNUM = 76,
  75.     FV_LAST_REGNUM = 79
  76.   };

  77. /* This structure describes a register in a core-file.  */
  78. struct sh_corefile_regmap
  79. {
  80.   int regnum;
  81.   unsigned int offset;
  82. };

  83. struct gdbarch_tdep
  84. {
  85.   /* Non-NULL when debugging from a core file.  Provides the offset
  86.      where each general-purpose register is stored inside the associated
  87.      core file section.  */
  88.   struct sh_corefile_regmap *core_gregmap;
  89.   int sizeof_gregset;
  90.   /* Non-NULL when debugging from a core file and when FP registers are
  91.      available.  Provides the offset where each FP register is stored
  92.      inside the associated core file section.  */
  93.   struct sh_corefile_regmap *core_fpregmap;
  94.   int sizeof_fpregset;
  95. };

  96. extern const struct regset sh_corefile_gregset;

  97. void sh_corefile_supply_regset (const struct regset *regset,
  98.                                 struct regcache *regcache,
  99.                                 int regnum, const void *regs, size_t len);
  100. void sh_corefile_collect_regset (const struct regset *regset,
  101.                                  const struct regcache *regcache,
  102.                                  int regnum, void *regs, size_t len);
  103. #endif /* SH_TDEP_H */