]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/alpha-tdep.h
Fix regression on aarch64-linux gdbserver
[thirdparty/binutils-gdb.git] / gdb / alpha-tdep.h
CommitLineData
dc129d82 1/* Common target dependent code for GDB on Alpha systems.
1d506c26 2 Copyright (C) 1993-2024 Free Software Foundation, Inc.
dc129d82
JT
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
a9762ec7 8 the Free Software Foundation; either version 3 of the License, or
dc129d82
JT
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
a9762ec7 17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
dc129d82
JT
18
19#ifndef ALPHA_TDEP_H
20#define ALPHA_TDEP_H
21
345bd07c
SM
22#include "gdbarch.h"
23
390c1522
UW
24struct regcache;
25
dc129d82 26/* Say how long (ordinary) registers are. This is a piece of bogosity
3acba339
AC
27 used in push_word and a few other places; register_size() is the
28 real way to know how big a register is. */
dc129d82
JT
29#define ALPHA_REGISTER_SIZE 8
30
31/* Number of machine registers. */
87d1b352 32#define ALPHA_NUM_REGS 67
dc129d82 33
0ba6dca9
AC
34/* Register numbers of various important registers. Note that most of
35 these values are "real" register numbers, and correspond to the
44d88583 36 general registers of the machine. */
dc129d82
JT
37
38#define ALPHA_V0_REGNUM 0 /* Function integer return value */
39#define ALPHA_T7_REGNUM 8 /* Return address register for OSF/1 __add* */
4816ec69 40#define ALPHA_S0_REGNUM 9 /* First saved register */
dc129d82
JT
41#define ALPHA_GCC_FP_REGNUM 15 /* Used by gcc as frame register */
42#define ALPHA_A0_REGNUM 16 /* Loc of first arg during a subr call */
43#define ALPHA_T9_REGNUM 23 /* Return address register for OSF/1 __div* */
72667056 44#define ALPHA_RA_REGNUM 26 /* Contains return address value */
dc129d82 45#define ALPHA_T12_REGNUM 27 /* Contains start addr of current proc */
72667056 46#define ALPHA_GP_REGNUM 29 /* Contains the global pointer */
dc129d82 47#define ALPHA_SP_REGNUM 30 /* Contains address of top of stack */
dc129d82
JT
48#define ALPHA_ZERO_REGNUM 31 /* Read-only register, always 0 */
49#define ALPHA_FP0_REGNUM 32 /* Floating point register 0 */
50#define ALPHA_FPA0_REGNUM 48 /* First float arg during a subr call */
51#define ALPHA_FPCR_REGNUM 63 /* Floating point control register */
52#define ALPHA_PC_REGNUM 64 /* Contains program counter */
87d1b352 53#define ALPHA_UNIQUE_REGNUM 66 /* PAL_rduniq value */
dc129d82 54
24c41760
MK
55/* Instruction size. */
56#define ALPHA_INSN_SIZE 4
57
dc129d82
JT
58/* The alpha has two different virtual pointers for arguments and locals.
59
60 The virtual argument pointer is pointing to the bottom of the argument
61 transfer area, which is located immediately below the virtual frame
0963b4bd 62 pointer. Its size is fixed for the native compiler, it is either zero
dc129d82 63 (for the no arguments case) or large enough to hold all argument registers.
0963b4bd 64 gcc uses a variable sized argument transfer area. As it has
dc129d82
JT
65 to stay compatible with the native debugging tools it has to use the same
66 virtual argument pointer and adjust the argument offsets accordingly.
67
68 The virtual local pointer is localoff bytes below the virtual frame
69 pointer, the value of localoff is obtained from the PDR. */
70#define ALPHA_NUM_ARG_REGS 6
71
dc129d82 72/* Target-dependent structure in gdbarch. */
ab25d9bb 73struct alpha_gdbarch_tdep : gdbarch_tdep_base
dc129d82 74{
345bd07c 75 CORE_ADDR vm_min_address = 0; /* Used by alpha_heuristic_proc_start. */
36a6271d
JT
76
77 /* If PC is inside a dynamically-generated signal trampoline function
78 (i.e. one copied onto the user stack at run-time), return how many
79 bytes PC is beyond the start of that function. Otherwise, return -1. */
345bd07c 80 LONGEST (*dynamic_sigtramp_offset) (struct gdbarch *, CORE_ADDR) = nullptr;
36a6271d 81
d2427a71
RH
82 /* Translate a signal handler stack base address into the address of
83 the sigcontext structure for that signal handler. */
8480a37e 84 CORE_ADDR (*sigcontext_addr) (const frame_info_ptr &) = nullptr;
5868c862 85
f2524b93
AC
86 /* Does the PC fall in a signal trampoline. */
87 /* NOTE: cagney/2004-04-30: Do not copy/clone this code. Instead
85102364 88 look at tramp-frame.h and other simpler per-architecture
f2524b93 89 sigtramp unwinders. */
2c02bd72 90 int (*pc_in_sigtramp) (struct gdbarch *gdbarch, CORE_ADDR pc,
345bd07c 91 const char *name) = nullptr;
f2524b93 92
9823e921 93 /* If TYPE will be returned in memory, return true. */
345bd07c 94 int (*return_in_memory) (struct type *type) = nullptr;
9823e921 95
138e7be5 96 /* Offset of registers in `struct sigcontext'. */
345bd07c
SM
97 int sc_pc_offset = 0;
98 int sc_regs_offset = 0;
99 int sc_fpregs_offset = 0;
138e7be5 100
345bd07c 101 int jb_pc = 0; /* Offset to PC value in jump buffer.
accc6d1f
JT
102 If htis is negative, longjmp support
103 will be disabled. */
345bd07c 104 size_t jb_elt_size = 0; /* And the size of each entry in the buf. */
dc129d82
JT
105};
106
e17a4113 107extern unsigned int alpha_read_insn (struct gdbarch *gdbarch, CORE_ADDR pc);
a0ff9e1a
SM
108extern std::vector<CORE_ADDR> alpha_software_single_step
109 (struct regcache *regcache);
d2427a71 110extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);
d2427a71
RH
111
112extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
baa490c4 113extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *);
4bcbd6cb 114
390c1522
UW
115extern void alpha_supply_int_regs (struct regcache *, int, const void *,
116 const void *, const void *);
117extern void alpha_fill_int_regs (const struct regcache *, int,
118 void *, void *, void *);
119extern void alpha_supply_fp_regs (struct regcache *, int,
120 const void *, const void *);
121extern void alpha_fill_fp_regs (const struct regcache *,
122 int, void *, void *);
98a8e1e5 123
dc129d82 124#endif /* ALPHA_TDEP_H */