61d956176b05e839fa18f4b172de4744fffb2eb2
[external/binutils.git] / gdb / config / alpha / tm-alpha.h
1 /* Definitions to make GDB run on an Alpha box under OSF1.  This is
2    also used by the Alpha/Netware and Alpha GNU/Linux targets.
3
4    Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002 Free
5    Software Foundation, Inc.
6
7    This file is part of GDB.
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place - Suite 330,
22    Boston, MA 02111-1307, USA.  */
23
24 #ifndef TM_ALPHA_H
25 #define TM_ALPHA_H
26
27 #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
28
29 #include "bfd.h"
30 #include "coff/sym.h"           /* Needed for PDR below.  */
31 #include "coff/symconst.h"
32
33 struct frame_info;
34 struct type;
35 struct value;
36 struct symbol;
37
38 /* Number of traps that happen between exec'ing the shell
39    to run an inferior, and when we finally get to
40    the inferior code.  This is 2 on most implementations.  */
41 #define START_INFERIOR_TRAPS_EXPECTED 3
42
43 /* Offset from address of function to start of its code.
44    Zero on most machines.  */
45
46 #define FUNCTION_START_OFFSET 0
47
48 /* Are we currently handling a signal ?  */
49
50 #define IN_SIGTRAMP(pc, name) alpha_osf_in_sigtramp ((pc), (name))
51 extern int alpha_osf_in_sigtramp (CORE_ADDR, char *);
52
53 #define BREAKPOINT {0x80, 0, 0, 0}      /* call_pal bpt */
54
55 /* Special symbol found in blocks associated with routines.  We can hang
56    alpha_extra_func_info_t's off of this.  */
57
58 #define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"
59 extern void ecoff_relocate_efi (struct symbol *, CORE_ADDR);
60
61 #define RA_REGNUM 26            /* XXXJRT needed by mdebugread.c */
62
63 /* Specific information about a procedure.
64    This overlays the ALPHA's PDR records, 
65    alpharead.c (ab)uses this to save memory */
66
67 typedef struct alpha_extra_func_info
68   {
69     long numargs;               /* number of args to procedure (was iopt) */
70     PDR pdr;                    /* Procedure descriptor record */
71   }
72  *alpha_extra_func_info_t;
73
74 /* Define the extra_func_info that mipsread.c needs.
75    FIXME: We should define our own PDR interface, perhaps in a separate
76    header file. This would get rid of the <bfd.h> inclusion in all sources
77    and would abstract the mips/alpha interface from ecoff.  */
78 #define mips_extra_func_info alpha_extra_func_info
79 #define mips_extra_func_info_t alpha_extra_func_info_t
80
81
82 #define PRINT_EXTRA_FRAME_INFO(fi) alpha_print_extra_frame_info ((fi))
83 extern void alpha_print_extra_frame_info (struct frame_info *);
84
85
86 /* It takes two values to specify a frame on the ALPHA.  Sigh.
87
88    In fact, at the moment, the *PC* is the primary value that sets up
89    a frame.  The PC is looked up to see what function it's in; symbol
90    information from that function tells us which register is the frame
91    pointer base, and what offset from there is the "virtual frame pointer".
92    (This is usually an offset from SP.)  FIXME -- this should be cleaned
93    up so that the primary value is the SP, and the PC is used to disambiguate
94    multiple functions with the same SP that are at different stack levels. */
95
96 #define SETUP_ARBITRARY_FRAME(argc, argv) \
97   alpha_setup_arbitrary_frame (argc, argv)
98 extern struct frame_info *alpha_setup_arbitrary_frame (int, CORE_ADDR *);
99
100 /* Translate a signal handler frame into the address of the sigcontext
101    structure.  */
102
103 #define SIGCONTEXT_ADDR(frame) \
104   (read_memory_integer ((frame)->next ? frame->next->frame : frame->frame, 8))
105
106 #endif /* TM_ALPHA_H */