gdb/alpha-tdep.h - gdb

Data types defined

Macros defined

Source code

  1. /* Common target dependent code for GDB on Alpha systems.
  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 ALPHA_TDEP_H
  15. #define ALPHA_TDEP_H

  16. struct regcache;

  17. /* Say how long (ordinary) registers are.  This is a piece of bogosity
  18.    used in push_word and a few other places; register_size() is the
  19.    real way to know how big a register is.  */
  20. #define ALPHA_REGISTER_SIZE 8

  21. /* Number of machine registers.  */
  22. #define ALPHA_NUM_REGS 67

  23. /* Register numbers of various important registers.  Note that most of
  24.    these values are "real" register numbers, and correspond to the
  25.    general registers of the machine.  */

  26. #define ALPHA_V0_REGNUM             0  /* Function integer return value */
  27. #define ALPHA_T7_REGNUM             8  /* Return address register for OSF/1 __add* */
  28. #define ALPHA_S0_REGNUM      9        /* First saved register */
  29. #define ALPHA_GCC_FP_REGNUM 15  /* Used by gcc as frame register */
  30. #define ALPHA_A0_REGNUM     16  /* Loc of first arg during a subr call */
  31. #define ALPHA_T9_REGNUM     23  /* Return address register for OSF/1 __div* */
  32. #define ALPHA_RA_REGNUM     26  /* Contains return address value */
  33. #define ALPHA_T12_REGNUM    27  /* Contains start addr of current proc */
  34. #define ALPHA_GP_REGNUM     29  /* Contains the global pointer */
  35. #define ALPHA_SP_REGNUM     30  /* Contains address of top of stack */
  36. #define ALPHA_ZERO_REGNUM   31  /* Read-only register, always 0 */
  37. #define ALPHA_FP0_REGNUM    32  /* Floating point register 0 */
  38. #define ALPHA_FPA0_REGNUM   48  /* First float arg during a subr call */
  39. #define ALPHA_FPCR_REGNUM   63  /* Floating point control register */
  40. #define ALPHA_PC_REGNUM     64  /* Contains program counter */
  41. #define ALPHA_UNIQUE_REGNUM 66        /* PAL_rduniq value */

  42. /* Instruction size.  */
  43. #define ALPHA_INSN_SIZE        4

  44. /* The alpha has two different virtual pointers for arguments and locals.

  45.    The virtual argument pointer is pointing to the bottom of the argument
  46.    transfer area, which is located immediately below the virtual frame
  47.    pointer.  Its size is fixed for the native compiler, it is either zero
  48.    (for the no arguments case) or large enough to hold all argument registers.
  49.    gcc uses a variable sized argument transfer area.  As it has
  50.    to stay compatible with the native debugging tools it has to use the same
  51.    virtual argument pointer and adjust the argument offsets accordingly.

  52.    The virtual local pointer is localoff bytes below the virtual frame
  53.    pointer, the value of localoff is obtained from the PDR.  */
  54. #define ALPHA_NUM_ARG_REGS   6

  55. /* Target-dependent structure in gdbarch.  */
  56. struct gdbarch_tdep
  57. {
  58.   CORE_ADDR vm_min_address;        /* Used by alpha_heuristic_proc_start.  */

  59.   /* If PC is inside a dynamically-generated signal trampoline function
  60.      (i.e. one copied onto the user stack at run-time), return how many
  61.      bytes PC is beyond the start of that function.  Otherwise, return -1.  */
  62.   LONGEST (*dynamic_sigtramp_offset) (struct gdbarch *, CORE_ADDR);

  63.   /* Translate a signal handler stack base address into the address of
  64.      the sigcontext structure for that signal handler.  */
  65.   CORE_ADDR (*sigcontext_addr) (struct frame_info *);

  66.   /* Does the PC fall in a signal trampoline.  */
  67.   /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
  68.      look at tramp-frame.h and other simplier per-architecture
  69.      sigtramp unwinders.  */
  70.   int (*pc_in_sigtramp) (struct gdbarch *gdbarch, CORE_ADDR pc,
  71.                          const char *name);

  72.   /* If TYPE will be returned in memory, return true.  */
  73.   int (*return_in_memory) (struct type *type);

  74.   /* Offset of registers in `struct sigcontext'.  */
  75.   int sc_pc_offset;
  76.   int sc_regs_offset;
  77.   int sc_fpregs_offset;

  78.   int jb_pc;                        /* Offset to PC value in jump buffer.
  79.                                    If htis is negative, longjmp support
  80.                                    will be disabled.  */
  81.   size_t jb_elt_size;                /* And the size of each entry in the buf.  */
  82. };

  83. extern unsigned int alpha_read_insn (struct gdbarch *gdbarch, CORE_ADDR pc);
  84. extern int alpha_software_single_step (struct frame_info *frame);
  85. extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);

  86. extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
  87. extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *);

  88. extern void alpha_supply_int_regs (struct regcache *, int, const void *,
  89.                                    const void *, const void *);
  90. extern void alpha_fill_int_regs (const struct regcache *, int,
  91.                                  void *, void *, void *);
  92. extern void alpha_supply_fp_regs (struct regcache *, int,
  93.                                   const void *, const void *);
  94. extern void alpha_fill_fp_regs (const struct regcache *,
  95.                                 int, void *, void *);

  96. #endif /* ALPHA_TDEP_H */