Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Definitions to make GDB run on an Alpha box under OSF1. This is |
92362027 AC |
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. | |
c906108c | 6 | |
c5aa993b | 7 | This file is part of GDB. |
c906108c | 8 | |
c5aa993b JM |
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. | |
c906108c | 13 | |
c5aa993b JM |
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. | |
c906108c | 18 | |
c5aa993b JM |
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. */ | |
c906108c SS |
23 | |
24 | #ifndef TM_ALPHA_H | |
25 | #define TM_ALPHA_H | |
26 | ||
dc129d82 JT |
27 | #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL |
28 | ||
f88e2c52 | 29 | #include "regcache.h" |
c906108c SS |
30 | #include "bfd.h" |
31 | #include "coff/sym.h" /* Needed for PDR below. */ | |
32 | #include "coff/symconst.h" | |
33 | ||
c906108c SS |
34 | struct frame_info; |
35 | struct type; | |
36 | struct value; | |
37 | struct symbol; | |
c906108c | 38 | |
c906108c SS |
39 | /* Number of traps that happen between exec'ing the shell |
40 | * to run an inferior, and when we finally get to | |
41 | * the inferior code. This is 2 on most implementations. | |
42 | */ | |
43 | #define START_INFERIOR_TRAPS_EXPECTED 3 | |
44 | ||
45 | /* Offset from address of function to start of its code. | |
46 | Zero on most machines. */ | |
47 | ||
48 | #define FUNCTION_START_OFFSET 0 | |
49 | ||
c906108c SS |
50 | /* Are we currently handling a signal ? */ |
51 | ||
d734c450 JT |
52 | #define IN_SIGTRAMP(pc, name) alpha_osf_in_sigtramp ((pc), (name)) |
53 | extern int alpha_osf_in_sigtramp (CORE_ADDR, char *); | |
c906108c | 54 | |
c5aa993b | 55 | #define BREAKPOINT {0x80, 0, 0, 0} /* call_pal bpt */ |
c906108c | 56 | |
c906108c SS |
57 | /* Special symbol found in blocks associated with routines. We can hang |
58 | alpha_extra_func_info_t's off of this. */ | |
59 | ||
60 | #define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__" | |
a14ed312 | 61 | extern void ecoff_relocate_efi (struct symbol *, CORE_ADDR); |
c906108c | 62 | |
dc129d82 JT |
63 | #define RA_REGNUM 26 /* XXXJRT needed by mdebugread.c */ |
64 | ||
c906108c SS |
65 | /* Specific information about a procedure. |
66 | This overlays the ALPHA's PDR records, | |
67 | alpharead.c (ab)uses this to save memory */ | |
68 | ||
c5aa993b JM |
69 | typedef struct alpha_extra_func_info |
70 | { | |
71 | long numargs; /* number of args to procedure (was iopt) */ | |
72 | PDR pdr; /* Procedure descriptor record */ | |
73 | } | |
74 | *alpha_extra_func_info_t; | |
c906108c SS |
75 | |
76 | /* Define the extra_func_info that mipsread.c needs. | |
77 | FIXME: We should define our own PDR interface, perhaps in a separate | |
78 | header file. This would get rid of the <bfd.h> inclusion in all sources | |
79 | and would abstract the mips/alpha interface from ecoff. */ | |
80 | #define mips_extra_func_info alpha_extra_func_info | |
81 | #define mips_extra_func_info_t alpha_extra_func_info_t | |
82 | ||
c906108c | 83 | |
140f9984 JT |
84 | #define PRINT_EXTRA_FRAME_INFO(fi) alpha_print_extra_frame_info ((fi)) |
85 | extern void alpha_print_extra_frame_info (struct frame_info *); | |
c906108c | 86 | |
c906108c SS |
87 | |
88 | /* It takes two values to specify a frame on the ALPHA. Sigh. | |
89 | ||
90 | In fact, at the moment, the *PC* is the primary value that sets up | |
91 | a frame. The PC is looked up to see what function it's in; symbol | |
92 | information from that function tells us which register is the frame | |
93 | pointer base, and what offset from there is the "virtual frame pointer". | |
94 | (This is usually an offset from SP.) FIXME -- this should be cleaned | |
95 | up so that the primary value is the SP, and the PC is used to disambiguate | |
96 | multiple functions with the same SP that are at different stack levels. */ | |
97 | ||
a57f9e49 JT |
98 | #define SETUP_ARBITRARY_FRAME(argc, argv) \ |
99 | alpha_setup_arbitrary_frame (argc, argv) | |
100 | extern struct frame_info *alpha_setup_arbitrary_frame (int, CORE_ADDR *); | |
c906108c SS |
101 | |
102 | /* This is used by heuristic_proc_start. It should be shot it the head. */ | |
103 | #ifndef VM_MIN_ADDRESS | |
104 | #define VM_MIN_ADDRESS (CORE_ADDR)0x120000000 | |
105 | #endif | |
106 | ||
107 | /* If PC is in a shared library trampoline code, return the PC | |
108 | where the function itself actually starts. If not, return 0. */ | |
109 | #define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc) | |
110 | ||
111 | /* If the current gcc for for this target does not produce correct debugging | |
112 | information for float parameters, both prototyped and unprototyped, then | |
113 | define this macro. This forces gdb to always assume that floats are | |
114 | passed as doubles and then converted in the callee. | |
115 | ||
116 | For the alpha, it appears that the debug info marks the parameters as | |
117 | floats regardless of whether the function is prototyped, but the actual | |
118 | values are always passed in as doubles. Thus by setting this to 1, both | |
119 | types of calls will work. */ | |
120 | ||
f8453e34 JT |
121 | #define COERCE_FLOAT_TO_DOUBLE(formal, actual) \ |
122 | standard_coerce_float_to_double ((formal), (actual)) | |
c906108c SS |
123 | |
124 | /* Return TRUE if procedure descriptor PROC is a procedure descriptor | |
125 | that refers to a dynamically generated sigtramp function. | |
126 | ||
127 | OSF/1 doesn't use dynamic sigtramp functions, so this is always | |
128 | FALSE. */ | |
129 | ||
130 | #define PROC_DESC_IS_DYN_SIGTRAMP(proc) (0) | |
131 | #define SET_PROC_DESC_IS_DYN_SIGTRAMP(proc) | |
132 | ||
133 | /* If PC is inside a dynamically generated sigtramp function, return | |
134 | how many bytes the program counter is beyond the start of that | |
135 | function. Otherwise, return a negative value. | |
136 | ||
137 | OSF/1 doesn't use dynamic sigtramp functions, so this always | |
138 | returns -1. */ | |
139 | ||
140 | #define DYNAMIC_SIGTRAMP_OFFSET(pc) (-1) | |
141 | ||
142 | /* Translate a signal handler frame into the address of the sigcontext | |
143 | structure. */ | |
144 | ||
145 | #define SIGCONTEXT_ADDR(frame) \ | |
146 | (read_memory_integer ((frame)->next ? frame->next->frame : frame->frame, 8)) | |
147 | ||
148 | /* If FRAME refers to a sigtramp frame, return the address of the next | |
149 | frame. */ | |
150 | ||
151 | #define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) \ | |
152 | (alpha_osf_skip_sigtramp_frame (frame, pc)) | |
a14ed312 KB |
153 | extern CORE_ADDR alpha_osf_skip_sigtramp_frame (struct frame_info *, |
154 | CORE_ADDR); | |
c906108c | 155 | |
ec32e4be JT |
156 | /* Single step based on where the current instruction will take us. */ |
157 | extern void alpha_software_single_step (enum target_signal, int); | |
158 | ||
c906108c | 159 | #endif /* TM_ALPHA_H */ |