xref: /openbsd-src/gnu/usr.bin/binutils/gdb/alpha-tdep.h (revision 11efff7f3ac2b3cfeff0c0cddc14294d9b3aca4f)
1b725ae77Skettenis /* Common target dependent code for GDB on Alpha systems.
2b725ae77Skettenis    Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003 Free
3b725ae77Skettenis    Software Foundation, Inc.
4b725ae77Skettenis 
5b725ae77Skettenis    This file is part of GDB.
6b725ae77Skettenis 
7b725ae77Skettenis    This program is free software; you can redistribute it and/or modify
8b725ae77Skettenis    it under the terms of the GNU General Public License as published by
9b725ae77Skettenis    the Free Software Foundation; either version 2 of the License, or
10b725ae77Skettenis    (at your option) any later version.
11b725ae77Skettenis 
12b725ae77Skettenis    This program is distributed in the hope that it will be useful,
13b725ae77Skettenis    but WITHOUT ANY WARRANTY; without even the implied warranty of
14b725ae77Skettenis    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15b725ae77Skettenis    GNU General Public License for more details.
16b725ae77Skettenis 
17b725ae77Skettenis    You should have received a copy of the GNU General Public License
18b725ae77Skettenis    along with this program; if not, write to the Free Software
19b725ae77Skettenis    Foundation, Inc., 59 Temple Place - Suite 330,
20b725ae77Skettenis    Boston, MA 02111-1307, USA.  */
21b725ae77Skettenis 
22b725ae77Skettenis #ifndef ALPHA_TDEP_H
23b725ae77Skettenis #define ALPHA_TDEP_H
24b725ae77Skettenis 
25b725ae77Skettenis /* Say how long (ordinary) registers are.  This is a piece of bogosity
26*11efff7fSkettenis    used in push_word and a few other places; register_size() is the
27*11efff7fSkettenis    real way to know how big a register is.  */
28b725ae77Skettenis #define ALPHA_REGISTER_SIZE 8
29b725ae77Skettenis 
30b725ae77Skettenis /* Number of machine registers.  */
31b725ae77Skettenis #define ALPHA_NUM_REGS 67
32b725ae77Skettenis 
33b725ae77Skettenis /* Total amount of space needed to store our copies of the machine's
34b725ae77Skettenis    register state.  */
35b725ae77Skettenis #define ALPHA_REGISTER_BYTES (ALPHA_NUM_REGS * 8)
36b725ae77Skettenis 
37b725ae77Skettenis /* Register numbers of various important registers.  Note that most of
38b725ae77Skettenis    these values are "real" register numbers, and correspond to the
39b725ae77Skettenis    general registers of the machine.  */
40b725ae77Skettenis 
41b725ae77Skettenis #define ALPHA_V0_REGNUM	     0  /* Function integer return value */
42b725ae77Skettenis #define ALPHA_T7_REGNUM	     8  /* Return address register for OSF/1 __add* */
43b725ae77Skettenis #define ALPHA_GCC_FP_REGNUM 15  /* Used by gcc as frame register */
44b725ae77Skettenis #define ALPHA_A0_REGNUM     16  /* Loc of first arg during a subr call */
45b725ae77Skettenis #define ALPHA_T9_REGNUM     23  /* Return address register for OSF/1 __div* */
46b725ae77Skettenis #define ALPHA_RA_REGNUM     26  /* Contains return address value */
47b725ae77Skettenis #define ALPHA_T12_REGNUM    27  /* Contains start addr of current proc */
48b725ae77Skettenis #define ALPHA_GP_REGNUM     29  /* Contains the global pointer */
49b725ae77Skettenis #define ALPHA_SP_REGNUM     30  /* Contains address of top of stack */
50b725ae77Skettenis #define ALPHA_ZERO_REGNUM   31  /* Read-only register, always 0 */
51b725ae77Skettenis #define ALPHA_FP0_REGNUM    32  /* Floating point register 0 */
52b725ae77Skettenis #define ALPHA_FPA0_REGNUM   48  /* First float arg during a subr call */
53b725ae77Skettenis #define ALPHA_FPCR_REGNUM   63  /* Floating point control register */
54b725ae77Skettenis #define ALPHA_PC_REGNUM     64  /* Contains program counter */
55b725ae77Skettenis #define ALPHA_UNIQUE_REGNUM 66	/* PAL_rduniq value */
56b725ae77Skettenis 
57b725ae77Skettenis /* The alpha has two different virtual pointers for arguments and locals.
58b725ae77Skettenis 
59b725ae77Skettenis    The virtual argument pointer is pointing to the bottom of the argument
60b725ae77Skettenis    transfer area, which is located immediately below the virtual frame
61b725ae77Skettenis    pointer. Its size is fixed for the native compiler, it is either zero
62b725ae77Skettenis    (for the no arguments case) or large enough to hold all argument registers.
63b725ae77Skettenis    gcc uses a variable sized argument transfer area. As it has
64b725ae77Skettenis    to stay compatible with the native debugging tools it has to use the same
65b725ae77Skettenis    virtual argument pointer and adjust the argument offsets accordingly.
66b725ae77Skettenis 
67b725ae77Skettenis    The virtual local pointer is localoff bytes below the virtual frame
68b725ae77Skettenis    pointer, the value of localoff is obtained from the PDR.  */
69b725ae77Skettenis #define ALPHA_NUM_ARG_REGS   6
70b725ae77Skettenis 
71b725ae77Skettenis /* Target-dependent structure in gdbarch.  */
72b725ae77Skettenis struct gdbarch_tdep
73b725ae77Skettenis {
74b725ae77Skettenis   CORE_ADDR vm_min_address;	/* Used by alpha_heuristic_proc_start.  */
75b725ae77Skettenis 
76b725ae77Skettenis   /* If PC is inside a dynamically-generated signal trampoline function
77b725ae77Skettenis      (i.e. one copied onto the user stack at run-time), return how many
78b725ae77Skettenis      bytes PC is beyond the start of that function.  Otherwise, return -1.  */
79b725ae77Skettenis   LONGEST (*dynamic_sigtramp_offset) (CORE_ADDR);
80b725ae77Skettenis 
81b725ae77Skettenis   /* Translate a signal handler stack base address into the address of
82b725ae77Skettenis      the sigcontext structure for that signal handler.  */
83b725ae77Skettenis   CORE_ADDR (*sigcontext_addr) (struct frame_info *);
84b725ae77Skettenis 
85*11efff7fSkettenis   /* Does the PC fall in a signal trampoline.  */
86*11efff7fSkettenis   /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
87*11efff7fSkettenis      look at tramp-frame.h and other simplier per-architecture
88*11efff7fSkettenis      sigtramp unwinders.  */
89*11efff7fSkettenis   int (*pc_in_sigtramp) (CORE_ADDR pc, char *name);
90*11efff7fSkettenis 
91b725ae77Skettenis   /* Offset of registers in `struct sigcontext'.  */
92b725ae77Skettenis   int sc_pc_offset;
93b725ae77Skettenis   int sc_regs_offset;
94b725ae77Skettenis   int sc_fpregs_offset;
95b725ae77Skettenis 
96b725ae77Skettenis   int jb_pc;			/* Offset to PC value in jump buffer.
97b725ae77Skettenis 				   If htis is negative, longjmp support
98b725ae77Skettenis 				   will be disabled.  */
99b725ae77Skettenis   size_t jb_elt_size;		/* And the size of each entry in the buf. */
100b725ae77Skettenis };
101b725ae77Skettenis 
102b725ae77Skettenis extern unsigned int alpha_read_insn (CORE_ADDR pc);
103b725ae77Skettenis extern void alpha_software_single_step (enum target_signal, int);
104b725ae77Skettenis extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);
105b725ae77Skettenis 
106b725ae77Skettenis extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
107b725ae77Skettenis extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *);
108b725ae77Skettenis 
109b725ae77Skettenis extern void alpha_supply_int_regs (int, const void *, const void *,
110b725ae77Skettenis 				   const void *);
111b725ae77Skettenis extern void alpha_fill_int_regs (int, void *, void *, void *);
112b725ae77Skettenis extern void alpha_supply_fp_regs (int, const void *, const void *);
113b725ae77Skettenis extern void alpha_fill_fp_regs (int, void *, void *);
114b725ae77Skettenis 
115b725ae77Skettenis #endif /* ALPHA_TDEP_H */
116