]>
Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
1e698235 | 4 | Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
c906108c | 5 | |
c5aa993b | 6 | This file is part of GDB. |
c906108c | 7 | |
c5aa993b JM |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
c906108c | 12 | |
c5aa993b JM |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
c906108c | 17 | |
c5aa993b JM |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, | |
21 | Boston, MA 02111-1307, USA. */ | |
c906108c | 22 | |
104c1213 JM |
23 | /* This file was created with the aid of ``gdbarch.sh''. |
24 | ||
52204a0b | 25 | The Bourne shell script ``gdbarch.sh'' creates the files |
104c1213 JM |
26 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them |
27 | against the existing ``gdbarch.[hc]''. Any differences found | |
28 | being reported. | |
29 | ||
30 | If editing this file, please also run gdbarch.sh and merge any | |
52204a0b | 31 | changes into that script. Conversely, when making sweeping changes |
104c1213 JM |
32 | to this file, modifying gdbarch.sh and using its output may prove |
33 | easier. */ | |
adf40b2e | 34 | |
c906108c SS |
35 | #ifndef GDBARCH_H |
36 | #define GDBARCH_H | |
37 | ||
2bf0cb65 | 38 | #include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */ |
fd0407d6 | 39 | #if !GDB_MULTI_ARCH |
67a2b77e | 40 | /* Pull in function declarations refered to, indirectly, via macros. */ |
67a2b77e | 41 | #include "inferior.h" /* For unsigned_address_to_pointer(). */ |
e9a2674e | 42 | #include "symfile.h" /* For entry_point_address(). */ |
fd0407d6 | 43 | #endif |
2bf0cb65 | 44 | |
da3331ec AC |
45 | struct floatformat; |
46 | struct ui_file; | |
cce74817 JM |
47 | struct frame_info; |
48 | struct value; | |
b6af0555 | 49 | struct objfile; |
a2cf933a | 50 | struct minimal_symbol; |
049ee0e4 | 51 | struct regcache; |
b59ff9d5 | 52 | struct reggroup; |
0f71a2f6 | 53 | |
0f71a2f6 JM |
54 | extern struct gdbarch *current_gdbarch; |
55 | ||
56 | ||
0f71a2f6 JM |
57 | /* If any of the following are defined, the target wasn't correctly |
58 | converted. */ | |
59 | ||
83905903 AC |
60 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE) |
61 | #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file." | |
62 | #endif | |
63 | ||
0f71a2f6 JM |
64 | |
65 | /* The following are pre-initialized by GDBARCH. */ | |
66 | ||
104c1213 | 67 | extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch); |
0f71a2f6 | 68 | /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */ |
83905903 AC |
69 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE) |
70 | #error "Non multi-arch definition of TARGET_ARCHITECTURE" | |
71 | #endif | |
0f71a2f6 | 72 | #if GDB_MULTI_ARCH |
6166d547 | 73 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE) |
0f71a2f6 JM |
74 | #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch)) |
75 | #endif | |
76 | #endif | |
77 | ||
104c1213 | 78 | extern int gdbarch_byte_order (struct gdbarch *gdbarch); |
0f71a2f6 | 79 | /* set_gdbarch_byte_order() - not applicable - pre-initialized. */ |
83905903 AC |
80 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER) |
81 | #error "Non multi-arch definition of TARGET_BYTE_ORDER" | |
82 | #endif | |
0f71a2f6 | 83 | #if GDB_MULTI_ARCH |
6166d547 | 84 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER) |
0f71a2f6 JM |
85 | #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch)) |
86 | #endif | |
87 | #endif | |
88 | ||
4be87837 DJ |
89 | extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch); |
90 | /* set_gdbarch_osabi() - not applicable - pre-initialized. */ | |
91 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_OSABI) | |
92 | #error "Non multi-arch definition of TARGET_OSABI" | |
93 | #endif | |
94 | #if GDB_MULTI_ARCH | |
95 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_OSABI) | |
96 | #define TARGET_OSABI (gdbarch_osabi (current_gdbarch)) | |
97 | #endif | |
98 | #endif | |
99 | ||
0f71a2f6 | 100 | |
99e7bb18 | 101 | /* The following are initialized by the target dependent code. */ |
0f71a2f6 | 102 | |
66b43ecb AC |
103 | /* Number of bits in a char or unsigned char for the target machine. |
104 | Just like CHAR_BIT in <limits.h> but describes the target machine. | |
e669114a | 105 | v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0: |
66b43ecb AC |
106 | |
107 | Number of bits in a short or unsigned short for the target machine. */ | |
c4093a6a | 108 | |
66b43ecb AC |
109 | /* Default (value) for non- multi-arch platforms. */ |
110 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT) | |
111 | #define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT) | |
0f71a2f6 JM |
112 | #endif |
113 | ||
104c1213 JM |
114 | extern int gdbarch_short_bit (struct gdbarch *gdbarch); |
115 | extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit); | |
83905903 AC |
116 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT) |
117 | #error "Non multi-arch definition of TARGET_SHORT_BIT" | |
118 | #endif | |
0f71a2f6 | 119 | #if GDB_MULTI_ARCH |
6166d547 | 120 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT) |
0f71a2f6 JM |
121 | #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch)) |
122 | #endif | |
123 | #endif | |
124 | ||
66b43ecb AC |
125 | /* Number of bits in an int or unsigned int for the target machine. */ |
126 | ||
127 | /* Default (value) for non- multi-arch platforms. */ | |
128 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT) | |
129 | #define TARGET_INT_BIT (4*TARGET_CHAR_BIT) | |
130 | #endif | |
131 | ||
104c1213 JM |
132 | extern int gdbarch_int_bit (struct gdbarch *gdbarch); |
133 | extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); | |
83905903 AC |
134 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT) |
135 | #error "Non multi-arch definition of TARGET_INT_BIT" | |
136 | #endif | |
0f71a2f6 | 137 | #if GDB_MULTI_ARCH |
6166d547 | 138 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT) |
0f71a2f6 JM |
139 | #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch)) |
140 | #endif | |
141 | #endif | |
142 | ||
66b43ecb AC |
143 | /* Number of bits in a long or unsigned long for the target machine. */ |
144 | ||
145 | /* Default (value) for non- multi-arch platforms. */ | |
146 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT) | |
147 | #define TARGET_LONG_BIT (4*TARGET_CHAR_BIT) | |
148 | #endif | |
149 | ||
104c1213 JM |
150 | extern int gdbarch_long_bit (struct gdbarch *gdbarch); |
151 | extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); | |
83905903 AC |
152 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT) |
153 | #error "Non multi-arch definition of TARGET_LONG_BIT" | |
154 | #endif | |
0f71a2f6 | 155 | #if GDB_MULTI_ARCH |
6166d547 | 156 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT) |
0f71a2f6 JM |
157 | #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch)) |
158 | #endif | |
159 | #endif | |
160 | ||
66b43ecb AC |
161 | /* Number of bits in a long long or unsigned long long for the target |
162 | machine. */ | |
163 | ||
164 | /* Default (value) for non- multi-arch platforms. */ | |
165 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT) | |
166 | #define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT) | |
167 | #endif | |
168 | ||
104c1213 JM |
169 | extern int gdbarch_long_long_bit (struct gdbarch *gdbarch); |
170 | extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit); | |
83905903 AC |
171 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT) |
172 | #error "Non multi-arch definition of TARGET_LONG_LONG_BIT" | |
173 | #endif | |
0f71a2f6 | 174 | #if GDB_MULTI_ARCH |
6166d547 | 175 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT) |
0f71a2f6 JM |
176 | #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch)) |
177 | #endif | |
178 | #endif | |
179 | ||
66b43ecb AC |
180 | /* Number of bits in a float for the target machine. */ |
181 | ||
182 | /* Default (value) for non- multi-arch platforms. */ | |
183 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT) | |
184 | #define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT) | |
185 | #endif | |
186 | ||
104c1213 JM |
187 | extern int gdbarch_float_bit (struct gdbarch *gdbarch); |
188 | extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); | |
83905903 AC |
189 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT) |
190 | #error "Non multi-arch definition of TARGET_FLOAT_BIT" | |
191 | #endif | |
0f71a2f6 | 192 | #if GDB_MULTI_ARCH |
6166d547 | 193 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT) |
0f71a2f6 JM |
194 | #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) |
195 | #endif | |
196 | #endif | |
197 | ||
66b43ecb AC |
198 | /* Number of bits in a double for the target machine. */ |
199 | ||
200 | /* Default (value) for non- multi-arch platforms. */ | |
201 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT) | |
202 | #define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT) | |
203 | #endif | |
204 | ||
104c1213 JM |
205 | extern int gdbarch_double_bit (struct gdbarch *gdbarch); |
206 | extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); | |
83905903 AC |
207 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT) |
208 | #error "Non multi-arch definition of TARGET_DOUBLE_BIT" | |
209 | #endif | |
0f71a2f6 | 210 | #if GDB_MULTI_ARCH |
6166d547 | 211 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT) |
0f71a2f6 JM |
212 | #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) |
213 | #endif | |
214 | #endif | |
215 | ||
66b43ecb AC |
216 | /* Number of bits in a long double for the target machine. */ |
217 | ||
218 | /* Default (value) for non- multi-arch platforms. */ | |
219 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT) | |
17ef5d92 | 220 | #define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT) |
66b43ecb AC |
221 | #endif |
222 | ||
104c1213 JM |
223 | extern int gdbarch_long_double_bit (struct gdbarch *gdbarch); |
224 | extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit); | |
83905903 AC |
225 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT) |
226 | #error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT" | |
227 | #endif | |
0f71a2f6 | 228 | #if GDB_MULTI_ARCH |
6166d547 | 229 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT) |
0f71a2f6 JM |
230 | #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) |
231 | #endif | |
232 | #endif | |
233 | ||
52204a0b DT |
234 | /* For most targets, a pointer on the target and its representation as an |
235 | address in GDB have the same size and "look the same". For such a | |
236 | target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT | |
237 | / addr_bit will be set from it. | |
238 | ||
239 | If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably | |
240 | also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well. | |
241 | ||
242 | ptr_bit is the size of a pointer on the target */ | |
66b43ecb AC |
243 | |
244 | /* Default (value) for non- multi-arch platforms. */ | |
245 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT) | |
246 | #define TARGET_PTR_BIT (TARGET_INT_BIT) | |
247 | #endif | |
248 | ||
249 | extern int gdbarch_ptr_bit (struct gdbarch *gdbarch); | |
250 | extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); | |
83905903 AC |
251 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT) |
252 | #error "Non multi-arch definition of TARGET_PTR_BIT" | |
253 | #endif | |
66b43ecb AC |
254 | #if GDB_MULTI_ARCH |
255 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT) | |
256 | #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch)) | |
257 | #endif | |
258 | #endif | |
259 | ||
52204a0b DT |
260 | /* addr_bit is the size of a target address as represented in gdb */ |
261 | ||
262 | /* Default (value) for non- multi-arch platforms. */ | |
263 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT) | |
264 | #define TARGET_ADDR_BIT (TARGET_PTR_BIT) | |
265 | #endif | |
266 | ||
267 | extern int gdbarch_addr_bit (struct gdbarch *gdbarch); | |
268 | extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit); | |
83905903 AC |
269 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT) |
270 | #error "Non multi-arch definition of TARGET_ADDR_BIT" | |
271 | #endif | |
52204a0b DT |
272 | #if GDB_MULTI_ARCH |
273 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT) | |
274 | #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch)) | |
275 | #endif | |
276 | #endif | |
277 | ||
66b43ecb AC |
278 | /* Number of bits in a BFD_VMA for the target object file format. */ |
279 | ||
280 | /* Default (value) for non- multi-arch platforms. */ | |
281 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT) | |
282 | #define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address) | |
283 | #endif | |
284 | ||
285 | extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch); | |
286 | extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); | |
83905903 AC |
287 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT) |
288 | #error "Non multi-arch definition of TARGET_BFD_VMA_BIT" | |
289 | #endif | |
66b43ecb AC |
290 | #if GDB_MULTI_ARCH |
291 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT) | |
292 | #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch)) | |
293 | #endif | |
294 | #endif | |
295 | ||
4e409299 JB |
296 | /* One if `char' acts like `signed char', zero if `unsigned char'. */ |
297 | ||
298 | /* Default (value) for non- multi-arch platforms. */ | |
299 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED) | |
300 | #define TARGET_CHAR_SIGNED (1) | |
301 | #endif | |
302 | ||
303 | extern int gdbarch_char_signed (struct gdbarch *gdbarch); | |
304 | extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed); | |
305 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED) | |
306 | #error "Non multi-arch definition of TARGET_CHAR_SIGNED" | |
307 | #endif | |
308 | #if GDB_MULTI_ARCH | |
309 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED) | |
310 | #define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch)) | |
311 | #endif | |
312 | #endif | |
313 | ||
be8dfb87 AC |
314 | /* Default (function) for non- multi-arch platforms. */ |
315 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC) | |
39f77062 | 316 | #define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid)) |
be8dfb87 AC |
317 | #endif |
318 | ||
39f77062 KB |
319 | typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid); |
320 | extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid); | |
104c1213 | 321 | extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); |
83905903 AC |
322 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC) |
323 | #error "Non multi-arch definition of TARGET_READ_PC" | |
324 | #endif | |
0f71a2f6 | 325 | #if GDB_MULTI_ARCH |
6166d547 | 326 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC) |
39f77062 | 327 | #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid)) |
0f71a2f6 JM |
328 | #endif |
329 | #endif | |
330 | ||
be8dfb87 AC |
331 | /* Default (function) for non- multi-arch platforms. */ |
332 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC) | |
39f77062 | 333 | #define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid)) |
be8dfb87 AC |
334 | #endif |
335 | ||
39f77062 KB |
336 | typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid); |
337 | extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid); | |
104c1213 | 338 | extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc); |
83905903 AC |
339 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC) |
340 | #error "Non multi-arch definition of TARGET_WRITE_PC" | |
341 | #endif | |
0f71a2f6 | 342 | #if GDB_MULTI_ARCH |
6166d547 | 343 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC) |
39f77062 | 344 | #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid)) |
0f71a2f6 JM |
345 | #endif |
346 | #endif | |
347 | ||
be8dfb87 AC |
348 | /* Default (function) for non- multi-arch platforms. */ |
349 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP) | |
350 | #define TARGET_READ_FP() (generic_target_read_fp ()) | |
351 | #endif | |
352 | ||
104c1213 JM |
353 | typedef CORE_ADDR (gdbarch_read_fp_ftype) (void); |
354 | extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch); | |
355 | extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp); | |
83905903 AC |
356 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP) |
357 | #error "Non multi-arch definition of TARGET_READ_FP" | |
358 | #endif | |
0f71a2f6 | 359 | #if GDB_MULTI_ARCH |
6166d547 | 360 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP) |
0f71a2f6 JM |
361 | #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch)) |
362 | #endif | |
363 | #endif | |
364 | ||
be8dfb87 AC |
365 | /* Default (function) for non- multi-arch platforms. */ |
366 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP) | |
367 | #define TARGET_READ_SP() (generic_target_read_sp ()) | |
368 | #endif | |
369 | ||
104c1213 JM |
370 | typedef CORE_ADDR (gdbarch_read_sp_ftype) (void); |
371 | extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch); | |
372 | extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp); | |
83905903 AC |
373 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP) |
374 | #error "Non multi-arch definition of TARGET_READ_SP" | |
375 | #endif | |
0f71a2f6 | 376 | #if GDB_MULTI_ARCH |
6166d547 | 377 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP) |
0f71a2f6 JM |
378 | #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch)) |
379 | #endif | |
380 | #endif | |
381 | ||
6c0e89ed AC |
382 | /* The dummy call frame SP should be set by push_dummy_call. */ |
383 | ||
384 | #if defined (DEPRECATED_DUMMY_WRITE_SP) | |
385 | /* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */ | |
386 | #if !defined (DEPRECATED_DUMMY_WRITE_SP_P) | |
387 | #define DEPRECATED_DUMMY_WRITE_SP_P() (1) | |
388 | #endif | |
389 | #endif | |
390 | ||
391 | /* Default predicate for non- multi-arch targets. */ | |
392 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P) | |
393 | #define DEPRECATED_DUMMY_WRITE_SP_P() (0) | |
394 | #endif | |
395 | ||
396 | extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch); | |
397 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P) | |
398 | #error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" | |
399 | #endif | |
400 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P) | |
401 | #define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch)) | |
402 | #endif | |
403 | ||
be8dfb87 | 404 | /* Default (function) for non- multi-arch platforms. */ |
6c0e89ed AC |
405 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP) |
406 | #define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0) | |
be8dfb87 AC |
407 | #endif |
408 | ||
6c0e89ed AC |
409 | typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val); |
410 | extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); | |
411 | extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp); | |
412 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP) | |
413 | #error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" | |
83905903 | 414 | #endif |
0f71a2f6 | 415 | #if GDB_MULTI_ARCH |
6c0e89ed AC |
416 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP) |
417 | #define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val)) | |
0f71a2f6 JM |
418 | #endif |
419 | #endif | |
420 | ||
39d4ef09 AC |
421 | /* Function for getting target's idea of a frame pointer. FIXME: GDB's |
422 | whole scheme for dealing with "frames" and "frame pointers" needs a | |
423 | serious shakedown. */ | |
424 | ||
425 | /* Default (function) for non- multi-arch platforms. */ | |
426 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER) | |
427 | #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset)) | |
428 | #endif | |
429 | ||
430 | typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset); | |
431 | extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset); | |
432 | extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer); | |
433 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER) | |
434 | #error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER" | |
435 | #endif | |
436 | #if GDB_MULTI_ARCH | |
437 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER) | |
438 | #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset)) | |
439 | #endif | |
440 | #endif | |
441 | ||
d8124050 | 442 | extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch); |
61a0eb5b | 443 | |
d8124050 AC |
444 | typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf); |
445 | extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf); | |
446 | extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read); | |
61a0eb5b | 447 | |
d8124050 | 448 | extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch); |
61a0eb5b | 449 | |
d8124050 AC |
450 | typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf); |
451 | extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf); | |
452 | extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write); | |
61a0eb5b | 453 | |
104c1213 JM |
454 | extern int gdbarch_num_regs (struct gdbarch *gdbarch); |
455 | extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); | |
83905903 AC |
456 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS) |
457 | #error "Non multi-arch definition of NUM_REGS" | |
458 | #endif | |
0f71a2f6 | 459 | #if GDB_MULTI_ARCH |
6166d547 | 460 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS) |
0f71a2f6 JM |
461 | #define NUM_REGS (gdbarch_num_regs (current_gdbarch)) |
462 | #endif | |
463 | #endif | |
464 | ||
34620563 AC |
465 | /* This macro gives the number of pseudo-registers that live in the |
466 | register namespace but do not get fetched or stored on the target. | |
467 | These pseudo-registers may be aliases for other registers, | |
468 | combinations of other registers, or they may be computed by GDB. */ | |
469 | ||
0aba1244 | 470 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 471 | #if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS) |
0aba1244 EZ |
472 | #define NUM_PSEUDO_REGS (0) |
473 | #endif | |
474 | ||
475 | extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch); | |
476 | extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs); | |
83905903 AC |
477 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS) |
478 | #error "Non multi-arch definition of NUM_PSEUDO_REGS" | |
479 | #endif | |
0aba1244 | 480 | #if GDB_MULTI_ARCH |
6166d547 | 481 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS) |
0aba1244 EZ |
482 | #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) |
483 | #endif | |
484 | #endif | |
485 | ||
c2169756 AC |
486 | /* GDB's standard (or well known) register numbers. These can map onto |
487 | a real register or a pseudo (computed) register or not be defined at | |
1200cd6e AC |
488 | all (-1). */ |
489 | ||
490 | /* Default (value) for non- multi-arch platforms. */ | |
491 | #if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM) | |
492 | #define SP_REGNUM (-1) | |
493 | #endif | |
c2169756 | 494 | |
104c1213 JM |
495 | extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); |
496 | extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); | |
83905903 AC |
497 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM) |
498 | #error "Non multi-arch definition of SP_REGNUM" | |
499 | #endif | |
0f71a2f6 | 500 | #if GDB_MULTI_ARCH |
6166d547 | 501 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM) |
0f71a2f6 JM |
502 | #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch)) |
503 | #endif | |
504 | #endif | |
505 | ||
1200cd6e AC |
506 | /* Default (value) for non- multi-arch platforms. */ |
507 | #if (!GDB_MULTI_ARCH) && !defined (FP_REGNUM) | |
508 | #define FP_REGNUM (-1) | |
509 | #endif | |
510 | ||
104c1213 JM |
511 | extern int gdbarch_fp_regnum (struct gdbarch *gdbarch); |
512 | extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); | |
83905903 AC |
513 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM) |
514 | #error "Non multi-arch definition of FP_REGNUM" | |
515 | #endif | |
0f71a2f6 | 516 | #if GDB_MULTI_ARCH |
6166d547 | 517 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM) |
0f71a2f6 JM |
518 | #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch)) |
519 | #endif | |
520 | #endif | |
521 | ||
1200cd6e AC |
522 | /* Default (value) for non- multi-arch platforms. */ |
523 | #if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM) | |
524 | #define PC_REGNUM (-1) | |
525 | #endif | |
526 | ||
104c1213 JM |
527 | extern int gdbarch_pc_regnum (struct gdbarch *gdbarch); |
528 | extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); | |
83905903 AC |
529 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM) |
530 | #error "Non multi-arch definition of PC_REGNUM" | |
531 | #endif | |
0f71a2f6 | 532 | #if GDB_MULTI_ARCH |
6166d547 | 533 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM) |
0f71a2f6 JM |
534 | #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) |
535 | #endif | |
536 | #endif | |
537 | ||
c2169756 AC |
538 | /* Default (value) for non- multi-arch platforms. */ |
539 | #if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM) | |
540 | #define PS_REGNUM (-1) | |
541 | #endif | |
542 | ||
543 | extern int gdbarch_ps_regnum (struct gdbarch *gdbarch); | |
544 | extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum); | |
545 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM) | |
546 | #error "Non multi-arch definition of PS_REGNUM" | |
547 | #endif | |
548 | #if GDB_MULTI_ARCH | |
549 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM) | |
550 | #define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch)) | |
551 | #endif | |
552 | #endif | |
553 | ||
60054393 | 554 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 555 | #if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM) |
60054393 MS |
556 | #define FP0_REGNUM (-1) |
557 | #endif | |
558 | ||
559 | extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch); | |
560 | extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); | |
83905903 AC |
561 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM) |
562 | #error "Non multi-arch definition of FP0_REGNUM" | |
563 | #endif | |
60054393 | 564 | #if GDB_MULTI_ARCH |
6166d547 | 565 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM) |
60054393 MS |
566 | #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch)) |
567 | #endif | |
568 | #endif | |
569 | ||
03863182 | 570 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 571 | #if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM) |
03863182 AC |
572 | #define NPC_REGNUM (-1) |
573 | #endif | |
574 | ||
575 | extern int gdbarch_npc_regnum (struct gdbarch *gdbarch); | |
576 | extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); | |
83905903 AC |
577 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM) |
578 | #error "Non multi-arch definition of NPC_REGNUM" | |
579 | #endif | |
03863182 | 580 | #if GDB_MULTI_ARCH |
6166d547 | 581 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM) |
03863182 AC |
582 | #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch)) |
583 | #endif | |
584 | #endif | |
585 | ||
88c72b7d AC |
586 | /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */ |
587 | ||
588 | /* Default (function) for non- multi-arch platforms. */ | |
589 | #if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM) | |
590 | #define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr)) | |
591 | #endif | |
592 | ||
593 | typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr); | |
594 | extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr); | |
595 | extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum); | |
83905903 AC |
596 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM) |
597 | #error "Non multi-arch definition of STAB_REG_TO_REGNUM" | |
598 | #endif | |
88c72b7d AC |
599 | #if GDB_MULTI_ARCH |
600 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM) | |
601 | #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr)) | |
602 | #endif | |
603 | #endif | |
604 | ||
605 | /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */ | |
606 | ||
607 | /* Default (function) for non- multi-arch platforms. */ | |
608 | #if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM) | |
609 | #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr)) | |
610 | #endif | |
611 | ||
612 | typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr); | |
613 | extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr); | |
614 | extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum); | |
83905903 AC |
615 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM) |
616 | #error "Non multi-arch definition of ECOFF_REG_TO_REGNUM" | |
617 | #endif | |
88c72b7d AC |
618 | #if GDB_MULTI_ARCH |
619 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM) | |
620 | #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr)) | |
621 | #endif | |
622 | #endif | |
623 | ||
624 | /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */ | |
625 | ||
626 | /* Default (function) for non- multi-arch platforms. */ | |
627 | #if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM) | |
628 | #define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr)) | |
629 | #endif | |
630 | ||
631 | typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr); | |
632 | extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr); | |
633 | extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum); | |
83905903 AC |
634 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM) |
635 | #error "Non multi-arch definition of DWARF_REG_TO_REGNUM" | |
636 | #endif | |
88c72b7d AC |
637 | #if GDB_MULTI_ARCH |
638 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM) | |
639 | #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr)) | |
640 | #endif | |
641 | #endif | |
642 | ||
643 | /* Convert from an sdb register number to an internal gdb register number. | |
644 | This should be defined in tm.h, if REGISTER_NAMES is not set up | |
645 | to map one to one onto the sdb register numbers. */ | |
646 | ||
647 | /* Default (function) for non- multi-arch platforms. */ | |
648 | #if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM) | |
649 | #define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr)) | |
650 | #endif | |
651 | ||
652 | typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr); | |
653 | extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr); | |
654 | extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum); | |
83905903 AC |
655 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM) |
656 | #error "Non multi-arch definition of SDB_REG_TO_REGNUM" | |
657 | #endif | |
88c72b7d AC |
658 | #if GDB_MULTI_ARCH |
659 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM) | |
660 | #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr)) | |
661 | #endif | |
662 | #endif | |
663 | ||
664 | /* Default (function) for non- multi-arch platforms. */ | |
665 | #if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM) | |
666 | #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr)) | |
667 | #endif | |
668 | ||
669 | typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr); | |
670 | extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr); | |
671 | extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum); | |
83905903 AC |
672 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM) |
673 | #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM" | |
674 | #endif | |
88c72b7d AC |
675 | #if GDB_MULTI_ARCH |
676 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM) | |
677 | #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr)) | |
678 | #endif | |
679 | #endif | |
680 | ||
33489c5b | 681 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 682 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME) |
33489c5b AC |
683 | #define REGISTER_NAME(regnr) (legacy_register_name (regnr)) |
684 | #endif | |
685 | ||
fa88f677 AC |
686 | typedef const char * (gdbarch_register_name_ftype) (int regnr); |
687 | extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); | |
104c1213 | 688 | extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); |
83905903 AC |
689 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME) |
690 | #error "Non multi-arch definition of REGISTER_NAME" | |
691 | #endif | |
33489c5b | 692 | #if GDB_MULTI_ARCH |
6166d547 | 693 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME) |
0f71a2f6 JM |
694 | #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr)) |
695 | #endif | |
33489c5b | 696 | #endif |
0f71a2f6 | 697 | |
104c1213 JM |
698 | extern int gdbarch_register_size (struct gdbarch *gdbarch); |
699 | extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size); | |
83905903 AC |
700 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE) |
701 | #error "Non multi-arch definition of REGISTER_SIZE" | |
702 | #endif | |
0f71a2f6 | 703 | #if GDB_MULTI_ARCH |
6166d547 | 704 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE) |
0f71a2f6 JM |
705 | #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch)) |
706 | #endif | |
707 | #endif | |
708 | ||
104c1213 JM |
709 | extern int gdbarch_register_bytes (struct gdbarch *gdbarch); |
710 | extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes); | |
83905903 AC |
711 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES) |
712 | #error "Non multi-arch definition of REGISTER_BYTES" | |
713 | #endif | |
0f71a2f6 | 714 | #if GDB_MULTI_ARCH |
6166d547 | 715 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES) |
0f71a2f6 JM |
716 | #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch)) |
717 | #endif | |
718 | #endif | |
719 | ||
a7e3c2ad AC |
720 | /* Default (function) for non- multi-arch platforms. */ |
721 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE) | |
722 | #define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr)) | |
723 | #endif | |
724 | ||
104c1213 JM |
725 | typedef int (gdbarch_register_byte_ftype) (int reg_nr); |
726 | extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); | |
727 | extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); | |
83905903 AC |
728 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE) |
729 | #error "Non multi-arch definition of REGISTER_BYTE" | |
730 | #endif | |
0f71a2f6 | 731 | #if GDB_MULTI_ARCH |
6166d547 | 732 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE) |
0f71a2f6 JM |
733 | #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr)) |
734 | #endif | |
735 | #endif | |
736 | ||
35cac7cf AC |
737 | /* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, |
738 | MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, | |
739 | REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced | |
740 | by REGISTER_TYPE. */ | |
741 | ||
b2e75d78 AC |
742 | /* Default (function) for non- multi-arch platforms. */ |
743 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE) | |
744 | #define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr)) | |
745 | #endif | |
746 | ||
104c1213 JM |
747 | typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); |
748 | extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); | |
749 | extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); | |
83905903 AC |
750 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE) |
751 | #error "Non multi-arch definition of REGISTER_RAW_SIZE" | |
752 | #endif | |
0f71a2f6 | 753 | #if GDB_MULTI_ARCH |
6166d547 | 754 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE) |
0f71a2f6 JM |
755 | #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr)) |
756 | #endif | |
757 | #endif | |
758 | ||
35cac7cf AC |
759 | /* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, |
760 | MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, | |
761 | REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced | |
762 | by REGISTER_TYPE. */ | |
763 | ||
a0ed5532 AC |
764 | #if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) |
765 | /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */ | |
766 | #if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) | |
767 | #define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (1) | |
768 | #endif | |
769 | #endif | |
770 | ||
771 | /* Default predicate for non- multi-arch targets. */ | |
772 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) | |
773 | #define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (0) | |
774 | #endif | |
775 | ||
776 | extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch); | |
777 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) | |
778 | #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE" | |
779 | #endif | |
780 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) | |
781 | #define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch)) | |
782 | #endif | |
783 | ||
784 | /* Default (value) for non- multi-arch platforms. */ | |
785 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) | |
786 | #define DEPRECATED_MAX_REGISTER_RAW_SIZE (0) | |
787 | #endif | |
788 | ||
789 | extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch); | |
790 | extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size); | |
791 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) | |
792 | #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE" | |
83905903 | 793 | #endif |
0f71a2f6 | 794 | #if GDB_MULTI_ARCH |
a0ed5532 AC |
795 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) |
796 | #define DEPRECATED_MAX_REGISTER_RAW_SIZE (gdbarch_deprecated_max_register_raw_size (current_gdbarch)) | |
0f71a2f6 JM |
797 | #endif |
798 | #endif | |
799 | ||
35cac7cf AC |
800 | /* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, |
801 | MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, | |
802 | REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced | |
803 | by REGISTER_TYPE. */ | |
804 | ||
b2e75d78 AC |
805 | /* Default (function) for non- multi-arch platforms. */ |
806 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE) | |
807 | #define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr)) | |
808 | #endif | |
809 | ||
104c1213 JM |
810 | typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); |
811 | extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); | |
812 | extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); | |
83905903 AC |
813 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE) |
814 | #error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE" | |
815 | #endif | |
0f71a2f6 | 816 | #if GDB_MULTI_ARCH |
6166d547 | 817 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE) |
0f71a2f6 JM |
818 | #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr)) |
819 | #endif | |
820 | #endif | |
821 | ||
35cac7cf AC |
822 | /* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, |
823 | MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, | |
824 | REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced | |
825 | by REGISTER_TYPE. */ | |
826 | ||
a0ed5532 AC |
827 | #if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) |
828 | /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */ | |
829 | #if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) | |
830 | #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (1) | |
831 | #endif | |
832 | #endif | |
833 | ||
834 | /* Default predicate for non- multi-arch targets. */ | |
835 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) | |
836 | #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (0) | |
837 | #endif | |
838 | ||
839 | extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch); | |
840 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) | |
841 | #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE" | |
842 | #endif | |
843 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) | |
844 | #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch)) | |
845 | #endif | |
846 | ||
847 | /* Default (value) for non- multi-arch platforms. */ | |
848 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) | |
849 | #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (0) | |
850 | #endif | |
851 | ||
852 | extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch); | |
853 | extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size); | |
854 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) | |
855 | #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE" | |
83905903 | 856 | #endif |
0f71a2f6 | 857 | #if GDB_MULTI_ARCH |
a0ed5532 AC |
858 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) |
859 | #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (gdbarch_deprecated_max_register_virtual_size (current_gdbarch)) | |
0f71a2f6 JM |
860 | #endif |
861 | #endif | |
862 | ||
35cac7cf AC |
863 | /* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, |
864 | MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, | |
865 | REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced | |
866 | by REGISTER_TYPE. */ | |
867 | ||
868 | #if defined (REGISTER_VIRTUAL_TYPE) | |
869 | /* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */ | |
870 | #if !defined (REGISTER_VIRTUAL_TYPE_P) | |
871 | #define REGISTER_VIRTUAL_TYPE_P() (1) | |
872 | #endif | |
873 | #endif | |
874 | ||
875 | /* Default predicate for non- multi-arch targets. */ | |
876 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE_P) | |
877 | #define REGISTER_VIRTUAL_TYPE_P() (0) | |
878 | #endif | |
879 | ||
880 | extern int gdbarch_register_virtual_type_p (struct gdbarch *gdbarch); | |
881 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE_P) | |
882 | #error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" | |
883 | #endif | |
884 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE_P) | |
885 | #define REGISTER_VIRTUAL_TYPE_P() (gdbarch_register_virtual_type_p (current_gdbarch)) | |
886 | #endif | |
887 | ||
888 | /* Default (function) for non- multi-arch platforms. */ | |
889 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE) | |
890 | #define REGISTER_VIRTUAL_TYPE(reg_nr) (internal_error (__FILE__, __LINE__, "REGISTER_VIRTUAL_TYPE"), 0) | |
891 | #endif | |
892 | ||
104c1213 JM |
893 | typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); |
894 | extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); | |
895 | extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); | |
83905903 AC |
896 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE) |
897 | #error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" | |
898 | #endif | |
0f71a2f6 | 899 | #if GDB_MULTI_ARCH |
6166d547 | 900 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE) |
0f71a2f6 JM |
901 | #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr)) |
902 | #endif | |
903 | #endif | |
904 | ||
35cac7cf AC |
905 | extern int gdbarch_register_type_p (struct gdbarch *gdbarch); |
906 | ||
907 | typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr); | |
908 | extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr); | |
909 | extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type); | |
910 | ||
903ad3a6 AC |
911 | #if defined (DEPRECATED_DO_REGISTERS_INFO) |
912 | /* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */ | |
913 | #if !defined (DEPRECATED_DO_REGISTERS_INFO_P) | |
914 | #define DEPRECATED_DO_REGISTERS_INFO_P() (1) | |
0ab7a791 AC |
915 | #endif |
916 | #endif | |
917 | ||
918 | /* Default predicate for non- multi-arch targets. */ | |
903ad3a6 AC |
919 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO_P) |
920 | #define DEPRECATED_DO_REGISTERS_INFO_P() (0) | |
0ab7a791 AC |
921 | #endif |
922 | ||
903ad3a6 AC |
923 | extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch); |
924 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P) | |
925 | #error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO" | |
0ab7a791 | 926 | #endif |
903ad3a6 AC |
927 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P) |
928 | #define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch)) | |
0ab7a791 AC |
929 | #endif |
930 | ||
666e11c5 | 931 | /* Default (function) for non- multi-arch platforms. */ |
903ad3a6 AC |
932 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO) |
933 | #define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DEPRECATED_DO_REGISTERS_INFO"), 0) | |
666e11c5 EZ |
934 | #endif |
935 | ||
903ad3a6 AC |
936 | typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs); |
937 | extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs); | |
938 | extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info); | |
939 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO) | |
940 | #error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO" | |
83905903 | 941 | #endif |
666e11c5 | 942 | #if GDB_MULTI_ARCH |
903ad3a6 AC |
943 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO) |
944 | #define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_deprecated_do_registers_info (current_gdbarch, reg_nr, fpregs)) | |
666e11c5 EZ |
945 | #endif |
946 | #endif | |
947 | ||
0ab7a791 AC |
948 | typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); |
949 | extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); | |
950 | extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info); | |
951 | ||
23e3a7ac AC |
952 | extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch); |
953 | ||
954 | typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); | |
955 | extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); | |
5e74b15c | 956 | extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); |
5e74b15c | 957 | |
e76f1f2e AC |
958 | extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch); |
959 | ||
960 | typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); | |
961 | extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); | |
962 | extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info); | |
963 | ||
7c7651b2 AC |
964 | /* MAP a GDB RAW register number onto a simulator register number. See |
965 | also include/...-sim.h. */ | |
966 | ||
967 | /* Default (function) for non- multi-arch platforms. */ | |
968 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO) | |
8238d0bf | 969 | #define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr)) |
7c7651b2 AC |
970 | #endif |
971 | ||
972 | typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr); | |
973 | extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr); | |
974 | extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno); | |
83905903 AC |
975 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO) |
976 | #error "Non multi-arch definition of REGISTER_SIM_REGNO" | |
977 | #endif | |
7c7651b2 AC |
978 | #if GDB_MULTI_ARCH |
979 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO) | |
980 | #define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr)) | |
981 | #endif | |
982 | #endif | |
983 | ||
2649061d AC |
984 | #if defined (REGISTER_BYTES_OK) |
985 | /* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */ | |
eee30e78 | 986 | #if !defined (REGISTER_BYTES_OK_P) |
2649061d AC |
987 | #define REGISTER_BYTES_OK_P() (1) |
988 | #endif | |
eee30e78 | 989 | #endif |
2649061d AC |
990 | |
991 | /* Default predicate for non- multi-arch targets. */ | |
992 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P) | |
993 | #define REGISTER_BYTES_OK_P() (0) | |
994 | #endif | |
995 | ||
996 | extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); | |
83905903 AC |
997 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P) |
998 | #error "Non multi-arch definition of REGISTER_BYTES_OK" | |
999 | #endif | |
2649061d AC |
1000 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P) |
1001 | #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch)) | |
1002 | #endif | |
1003 | ||
1004 | /* Default (function) for non- multi-arch platforms. */ | |
1005 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK) | |
8e65ff28 | 1006 | #define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0) |
2649061d AC |
1007 | #endif |
1008 | ||
1009 | typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes); | |
1010 | extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes); | |
1011 | extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok); | |
83905903 AC |
1012 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK) |
1013 | #error "Non multi-arch definition of REGISTER_BYTES_OK" | |
1014 | #endif | |
2649061d AC |
1015 | #if GDB_MULTI_ARCH |
1016 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK) | |
1017 | #define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes)) | |
1018 | #endif | |
1019 | #endif | |
1020 | ||
01fb7433 AC |
1021 | /* Default (function) for non- multi-arch platforms. */ |
1022 | #if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER) | |
1023 | #define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum)) | |
1024 | #endif | |
1025 | ||
1026 | typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); | |
1027 | extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum); | |
1028 | extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register); | |
83905903 AC |
1029 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER) |
1030 | #error "Non multi-arch definition of CANNOT_FETCH_REGISTER" | |
1031 | #endif | |
01fb7433 AC |
1032 | #if GDB_MULTI_ARCH |
1033 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER) | |
1034 | #define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum)) | |
1035 | #endif | |
1036 | #endif | |
1037 | ||
1038 | /* Default (function) for non- multi-arch platforms. */ | |
1039 | #if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER) | |
1040 | #define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum)) | |
1041 | #endif | |
1042 | ||
1043 | typedef int (gdbarch_cannot_store_register_ftype) (int regnum); | |
1044 | extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum); | |
1045 | extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register); | |
83905903 AC |
1046 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER) |
1047 | #error "Non multi-arch definition of CANNOT_STORE_REGISTER" | |
1048 | #endif | |
01fb7433 AC |
1049 | #if GDB_MULTI_ARCH |
1050 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER) | |
1051 | #define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum)) | |
1052 | #endif | |
1053 | #endif | |
1054 | ||
9df628e0 RE |
1055 | /* setjmp/longjmp support. */ |
1056 | ||
1057 | #if defined (GET_LONGJMP_TARGET) | |
1058 | /* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */ | |
1059 | #if !defined (GET_LONGJMP_TARGET_P) | |
1060 | #define GET_LONGJMP_TARGET_P() (1) | |
1061 | #endif | |
1062 | #endif | |
1063 | ||
1064 | /* Default predicate for non- multi-arch targets. */ | |
1065 | #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P) | |
1066 | #define GET_LONGJMP_TARGET_P() (0) | |
1067 | #endif | |
1068 | ||
1069 | extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch); | |
1070 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P) | |
1071 | #error "Non multi-arch definition of GET_LONGJMP_TARGET" | |
1072 | #endif | |
1073 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P) | |
1074 | #define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch)) | |
1075 | #endif | |
1076 | ||
1077 | /* Default (function) for non- multi-arch platforms. */ | |
1078 | #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET) | |
1079 | #define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0) | |
1080 | #endif | |
1081 | ||
1082 | typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc); | |
1083 | extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc); | |
1084 | extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target); | |
1085 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET) | |
1086 | #error "Non multi-arch definition of GET_LONGJMP_TARGET" | |
1087 | #endif | |
1088 | #if GDB_MULTI_ARCH | |
1089 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET) | |
1090 | #define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc)) | |
1091 | #endif | |
1092 | #endif | |
1093 | ||
028c194b AC |
1094 | /* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that |
1095 | much better but at least they are vaguely consistent). The headers | |
1096 | and body contain convoluted #if/#else sequences for determine how | |
1097 | things should be compiled. Instead of trying to mimic that | |
1098 | behaviour here (and hence entrench it further) gdbarch simply | |
1099 | reqires that these methods be set up from the word go. This also | |
1100 | avoids any potential problems with moving beyond multi-arch partial. */ | |
1101 | ||
b99fa2d2 | 1102 | /* Default (value) for non- multi-arch platforms. */ |
07555a72 AC |
1103 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) |
1104 | #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (1) | |
b99fa2d2 AC |
1105 | #endif |
1106 | ||
07555a72 AC |
1107 | extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch); |
1108 | extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames); | |
55e1d7e7 | 1109 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) |
07555a72 | 1110 | #error "Non multi-arch definition of DEPRECATED_USE_GENERIC_DUMMY_FRAMES" |
83905903 | 1111 | #endif |
55e1d7e7 | 1112 | #if !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) |
07555a72 | 1113 | #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch)) |
0f71a2f6 | 1114 | #endif |
0f71a2f6 | 1115 | |
b99fa2d2 AC |
1116 | /* Default (value) for non- multi-arch platforms. */ |
1117 | #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_LOCATION) | |
1118 | #define CALL_DUMMY_LOCATION (AT_ENTRY_POINT) | |
1119 | #endif | |
1120 | ||
104c1213 JM |
1121 | extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); |
1122 | extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); | |
55e1d7e7 | 1123 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION) |
83905903 AC |
1124 | #error "Non multi-arch definition of CALL_DUMMY_LOCATION" |
1125 | #endif | |
55e1d7e7 | 1126 | #if !defined (CALL_DUMMY_LOCATION) |
0f71a2f6 JM |
1127 | #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch)) |
1128 | #endif | |
0f71a2f6 | 1129 | |
e9a2674e AC |
1130 | /* Default (function) for non- multi-arch platforms. */ |
1131 | #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_ADDRESS) | |
1132 | #define CALL_DUMMY_ADDRESS() (entry_point_address ()) | |
1133 | #endif | |
1134 | ||
104c1213 JM |
1135 | typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void); |
1136 | extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch); | |
1137 | extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address); | |
83905903 AC |
1138 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS) |
1139 | #error "Non multi-arch definition of CALL_DUMMY_ADDRESS" | |
1140 | #endif | |
0f71a2f6 | 1141 | #if GDB_MULTI_ARCH |
6166d547 | 1142 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS) |
0f71a2f6 JM |
1143 | #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch)) |
1144 | #endif | |
1145 | #endif | |
1146 | ||
104c1213 JM |
1147 | extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch); |
1148 | extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset); | |
83905903 AC |
1149 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET) |
1150 | #error "Non multi-arch definition of CALL_DUMMY_START_OFFSET" | |
1151 | #endif | |
3d30e9c2 | 1152 | #if !defined (CALL_DUMMY_START_OFFSET) |
0f71a2f6 JM |
1153 | #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch)) |
1154 | #endif | |
0f71a2f6 | 1155 | |
104c1213 JM |
1156 | extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); |
1157 | extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset); | |
83905903 AC |
1158 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET) |
1159 | #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET" | |
1160 | #endif | |
73dd234f | 1161 | #if !defined (CALL_DUMMY_BREAKPOINT_OFFSET) |
0f71a2f6 JM |
1162 | #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch)) |
1163 | #endif | |
0f71a2f6 | 1164 | |
104c1213 JM |
1165 | extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch); |
1166 | extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length); | |
83905903 AC |
1167 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH) |
1168 | #error "Non multi-arch definition of CALL_DUMMY_LENGTH" | |
1169 | #endif | |
3d30e9c2 | 1170 | #if !defined (CALL_DUMMY_LENGTH) |
0f71a2f6 JM |
1171 | #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch)) |
1172 | #endif | |
0f71a2f6 | 1173 | |
ae45cd16 AC |
1174 | /* NOTE: cagney/2002-11-24: This function with predicate has a valid |
1175 | (callable) initial value. As a consequence, even when the predicate | |
1176 | is false, the corresponding function works. This simplifies the | |
1177 | migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), | |
1178 | doesn't need to be modified. */ | |
1179 | ||
1180 | #if defined (DEPRECATED_PC_IN_CALL_DUMMY) | |
1181 | /* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */ | |
1182 | #if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) | |
1183 | #define DEPRECATED_PC_IN_CALL_DUMMY_P() (1) | |
1184 | #endif | |
1185 | #endif | |
1186 | ||
1187 | /* Default predicate for non- multi-arch targets. */ | |
1188 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) | |
1189 | #define DEPRECATED_PC_IN_CALL_DUMMY_P() (0) | |
1190 | #endif | |
1191 | ||
1192 | extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch); | |
55e1d7e7 | 1193 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P) |
ae45cd16 AC |
1194 | #error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" |
1195 | #endif | |
55e1d7e7 | 1196 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) |
ae45cd16 AC |
1197 | #define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch)) |
1198 | #endif | |
1199 | ||
b99fa2d2 | 1200 | /* Default (function) for non- multi-arch platforms. */ |
ae45cd16 AC |
1201 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY) |
1202 | #define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address)) | |
b99fa2d2 AC |
1203 | #endif |
1204 | ||
ae45cd16 AC |
1205 | typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); |
1206 | extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); | |
1207 | extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy); | |
55e1d7e7 | 1208 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY) |
ae45cd16 | 1209 | #error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" |
83905903 | 1210 | #endif |
0f71a2f6 | 1211 | #if GDB_MULTI_ARCH |
55e1d7e7 | 1212 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY) |
ae45cd16 | 1213 | #define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) |
0f71a2f6 JM |
1214 | #endif |
1215 | #endif | |
1216 | ||
33489c5b | 1217 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 1218 | #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS) |
33489c5b AC |
1219 | #define CALL_DUMMY_WORDS (legacy_call_dummy_words) |
1220 | #endif | |
1221 | ||
104c1213 JM |
1222 | extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch); |
1223 | extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); | |
83905903 AC |
1224 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS) |
1225 | #error "Non multi-arch definition of CALL_DUMMY_WORDS" | |
1226 | #endif | |
4d628cd7 | 1227 | #if !defined (CALL_DUMMY_WORDS) |
0f71a2f6 JM |
1228 | #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) |
1229 | #endif | |
33489c5b AC |
1230 | |
1231 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 1232 | #if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS) |
33489c5b AC |
1233 | #define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words) |
1234 | #endif | |
0f71a2f6 | 1235 | |
104c1213 JM |
1236 | extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); |
1237 | extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words); | |
83905903 AC |
1238 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS) |
1239 | #error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS" | |
1240 | #endif | |
4d628cd7 | 1241 | #if !defined (SIZEOF_CALL_DUMMY_WORDS) |
0f71a2f6 JM |
1242 | #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) |
1243 | #endif | |
0f71a2f6 | 1244 | |
1bf6d5cc AC |
1245 | #if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) |
1246 | /* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */ | |
1247 | #if !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) | |
1248 | #define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (1) | |
83905903 | 1249 | #endif |
0f71a2f6 | 1250 | #endif |
1bf6d5cc AC |
1251 | |
1252 | /* Default predicate for non- multi-arch targets. */ | |
1253 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) | |
1254 | #define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (0) | |
1255 | #endif | |
1256 | ||
1257 | extern int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); | |
1258 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) | |
1259 | #error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST" | |
1260 | #endif | |
1261 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) | |
1262 | #define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (gdbarch_deprecated_call_dummy_stack_adjust_p (current_gdbarch)) | |
1263 | #endif | |
1264 | ||
1265 | /* Default (value) for non- multi-arch platforms. */ | |
1266 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) | |
1267 | #define DEPRECATED_CALL_DUMMY_STACK_ADJUST (0) | |
0f71a2f6 JM |
1268 | #endif |
1269 | ||
1bf6d5cc AC |
1270 | extern int gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch); |
1271 | extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch, int deprecated_call_dummy_stack_adjust); | |
1272 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) | |
1273 | #error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST" | |
83905903 | 1274 | #endif |
0f71a2f6 | 1275 | #if GDB_MULTI_ARCH |
1bf6d5cc AC |
1276 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) |
1277 | #define DEPRECATED_CALL_DUMMY_STACK_ADJUST (gdbarch_deprecated_call_dummy_stack_adjust (current_gdbarch)) | |
0f71a2f6 JM |
1278 | #endif |
1279 | #endif | |
1280 | ||
e8ab51f7 AC |
1281 | #if defined (FIX_CALL_DUMMY) |
1282 | /* Legacy for systems yet to multi-arch FIX_CALL_DUMMY */ | |
1283 | #if !defined (FIX_CALL_DUMMY_P) | |
1284 | #define FIX_CALL_DUMMY_P() (1) | |
1285 | #endif | |
1286 | #endif | |
1287 | ||
1288 | /* Default predicate for non- multi-arch targets. */ | |
1289 | #if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY_P) | |
1290 | #define FIX_CALL_DUMMY_P() (0) | |
1291 | #endif | |
1292 | ||
1293 | extern int gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch); | |
1294 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY_P) | |
1295 | #error "Non multi-arch definition of FIX_CALL_DUMMY" | |
1296 | #endif | |
1297 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY_P) | |
1298 | #define FIX_CALL_DUMMY_P() (gdbarch_fix_call_dummy_p (current_gdbarch)) | |
1299 | #endif | |
1300 | ||
1301 | /* Default (function) for non- multi-arch platforms. */ | |
1302 | #if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY) | |
1303 | #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0) | |
1304 | #endif | |
1305 | ||
104c1213 JM |
1306 | typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); |
1307 | extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); | |
1308 | extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy); | |
83905903 AC |
1309 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY) |
1310 | #error "Non multi-arch definition of FIX_CALL_DUMMY" | |
1311 | #endif | |
0f71a2f6 | 1312 | #if GDB_MULTI_ARCH |
6166d547 | 1313 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY) |
0f71a2f6 JM |
1314 | #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p)) |
1315 | #endif | |
1316 | #endif | |
1317 | ||
2ca6c561 AC |
1318 | #if defined (DEPRECATED_INIT_FRAME_PC_FIRST) |
1319 | /* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */ | |
1320 | #if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) | |
1321 | #define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1) | |
1322 | #endif | |
1323 | #endif | |
1324 | ||
1325 | /* Default predicate for non- multi-arch targets. */ | |
1326 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) | |
1327 | #define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0) | |
1328 | #endif | |
1329 | ||
1330 | extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch); | |
1331 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) | |
1332 | #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" | |
1333 | #endif | |
1334 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) | |
1335 | #define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch)) | |
1336 | #endif | |
1337 | ||
10312cc4 | 1338 | /* Default (function) for non- multi-arch platforms. */ |
2ca6c561 AC |
1339 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST) |
1340 | #define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0) | |
10312cc4 AC |
1341 | #endif |
1342 | ||
97f46953 AC |
1343 | typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); |
1344 | extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); | |
2ca6c561 AC |
1345 | extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first); |
1346 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST) | |
1347 | #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" | |
83905903 | 1348 | #endif |
10312cc4 | 1349 | #if GDB_MULTI_ARCH |
2ca6c561 AC |
1350 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST) |
1351 | #define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev)) | |
10312cc4 AC |
1352 | #endif |
1353 | #endif | |
1354 | ||
a5afb99f AC |
1355 | #if defined (DEPRECATED_INIT_FRAME_PC) |
1356 | /* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */ | |
1357 | #if !defined (DEPRECATED_INIT_FRAME_PC_P) | |
1358 | #define DEPRECATED_INIT_FRAME_PC_P() (1) | |
1359 | #endif | |
1360 | #endif | |
1361 | ||
1362 | /* Default predicate for non- multi-arch targets. */ | |
1363 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_P) | |
1364 | #define DEPRECATED_INIT_FRAME_PC_P() (0) | |
1365 | #endif | |
1366 | ||
1367 | extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch); | |
1368 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P) | |
1369 | #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" | |
1370 | #endif | |
1371 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P) | |
1372 | #define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch)) | |
1373 | #endif | |
1374 | ||
10312cc4 | 1375 | /* Default (function) for non- multi-arch platforms. */ |
a5afb99f AC |
1376 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC) |
1377 | #define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC"), 0) | |
10312cc4 AC |
1378 | #endif |
1379 | ||
a5afb99f AC |
1380 | typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); |
1381 | extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); | |
1382 | extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc); | |
1383 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC) | |
1384 | #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" | |
83905903 | 1385 | #endif |
10312cc4 | 1386 | #if GDB_MULTI_ARCH |
a5afb99f AC |
1387 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC) |
1388 | #define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (gdbarch_deprecated_init_frame_pc (current_gdbarch, fromleaf, prev)) | |
10312cc4 AC |
1389 | #endif |
1390 | #endif | |
1391 | ||
104c1213 JM |
1392 | extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); |
1393 | extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); | |
83905903 AC |
1394 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION) |
1395 | #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION" | |
1396 | #endif | |
0f71a2f6 | 1397 | #if GDB_MULTI_ARCH |
6166d547 | 1398 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION) |
0f71a2f6 JM |
1399 | #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) |
1400 | #endif | |
1401 | #endif | |
1402 | ||
104c1213 JM |
1403 | extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); |
1404 | extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); | |
83905903 AC |
1405 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) |
1406 | #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" | |
1407 | #endif | |
e669114a | 1408 | #if !defined (BELIEVE_PCC_PROMOTION_TYPE) |
0f71a2f6 JM |
1409 | #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) |
1410 | #endif | |
0f71a2f6 | 1411 | |
129c1cd6 AC |
1412 | #if defined (DEPRECATED_GET_SAVED_REGISTER) |
1413 | /* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */ | |
1414 | #if !defined (DEPRECATED_GET_SAVED_REGISTER_P) | |
1415 | #define DEPRECATED_GET_SAVED_REGISTER_P() (1) | |
a216a322 AC |
1416 | #endif |
1417 | #endif | |
1418 | ||
1419 | /* Default predicate for non- multi-arch targets. */ | |
129c1cd6 AC |
1420 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P) |
1421 | #define DEPRECATED_GET_SAVED_REGISTER_P() (0) | |
a216a322 AC |
1422 | #endif |
1423 | ||
129c1cd6 AC |
1424 | extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch); |
1425 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P) | |
1426 | #error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER" | |
a216a322 | 1427 | #endif |
129c1cd6 AC |
1428 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P) |
1429 | #define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch)) | |
a216a322 AC |
1430 | #endif |
1431 | ||
e4b415d9 | 1432 | /* Default (function) for non- multi-arch platforms. */ |
129c1cd6 AC |
1433 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER) |
1434 | #define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0) | |
e4b415d9 | 1435 | #endif |
028c194b | 1436 | |
129c1cd6 AC |
1437 | typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); |
1438 | extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); | |
1439 | extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register); | |
1440 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER) | |
1441 | #error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER" | |
83905903 | 1442 | #endif |
0f71a2f6 | 1443 | #if GDB_MULTI_ARCH |
129c1cd6 AC |
1444 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER) |
1445 | #define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) | |
0f71a2f6 JM |
1446 | #endif |
1447 | #endif | |
1448 | ||
33489c5b | 1449 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1450 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE) |
33489c5b AC |
1451 | #define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr)) |
1452 | #endif | |
1453 | ||
104c1213 JM |
1454 | typedef int (gdbarch_register_convertible_ftype) (int nr); |
1455 | extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); | |
1456 | extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); | |
83905903 AC |
1457 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE) |
1458 | #error "Non multi-arch definition of REGISTER_CONVERTIBLE" | |
1459 | #endif | |
33489c5b | 1460 | #if GDB_MULTI_ARCH |
6166d547 | 1461 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE) |
0f71a2f6 JM |
1462 | #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr)) |
1463 | #endif | |
33489c5b AC |
1464 | #endif |
1465 | ||
1466 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1467 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL) |
8e65ff28 | 1468 | #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0) |
33489c5b | 1469 | #endif |
0f71a2f6 | 1470 | |
104c1213 JM |
1471 | typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); |
1472 | extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); | |
1473 | extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); | |
83905903 AC |
1474 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL) |
1475 | #error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL" | |
1476 | #endif | |
33489c5b | 1477 | #if GDB_MULTI_ARCH |
6166d547 | 1478 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL) |
0f71a2f6 JM |
1479 | #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) |
1480 | #endif | |
33489c5b AC |
1481 | #endif |
1482 | ||
1483 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1484 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW) |
8e65ff28 | 1485 | #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0) |
33489c5b | 1486 | #endif |
0f71a2f6 | 1487 | |
104c1213 JM |
1488 | typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); |
1489 | extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); | |
1490 | extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); | |
83905903 AC |
1491 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW) |
1492 | #error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW" | |
1493 | #endif | |
33489c5b | 1494 | #if GDB_MULTI_ARCH |
6166d547 | 1495 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW) |
0f71a2f6 JM |
1496 | #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) |
1497 | #endif | |
33489c5b AC |
1498 | #endif |
1499 | ||
13d01224 AC |
1500 | /* Default (function) for non- multi-arch platforms. */ |
1501 | #if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P) | |
1502 | #define CONVERT_REGISTER_P(regnum) (legacy_convert_register_p (regnum)) | |
1503 | #endif | |
1504 | ||
1505 | typedef int (gdbarch_convert_register_p_ftype) (int regnum); | |
1506 | extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum); | |
1507 | extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p); | |
1508 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P) | |
1509 | #error "Non multi-arch definition of CONVERT_REGISTER_P" | |
1510 | #endif | |
1511 | #if GDB_MULTI_ARCH | |
1512 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_REGISTER_P) | |
1513 | #define CONVERT_REGISTER_P(regnum) (gdbarch_convert_register_p (current_gdbarch, regnum)) | |
1514 | #endif | |
1515 | #endif | |
1516 | ||
1517 | /* Default (function) for non- multi-arch platforms. */ | |
1518 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE) | |
1519 | #define REGISTER_TO_VALUE(regnum, type, from, to) (legacy_register_to_value (regnum, type, from, to)) | |
1520 | #endif | |
1521 | ||
1522 | typedef void (gdbarch_register_to_value_ftype) (int regnum, struct type *type, char *from, char *to); | |
1523 | extern void gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); | |
1524 | extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value); | |
1525 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE) | |
1526 | #error "Non multi-arch definition of REGISTER_TO_VALUE" | |
1527 | #endif | |
1528 | #if GDB_MULTI_ARCH | |
1529 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_TO_VALUE) | |
1530 | #define REGISTER_TO_VALUE(regnum, type, from, to) (gdbarch_register_to_value (current_gdbarch, regnum, type, from, to)) | |
1531 | #endif | |
1532 | #endif | |
1533 | ||
1534 | /* Default (function) for non- multi-arch platforms. */ | |
1535 | #if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER) | |
1536 | #define VALUE_TO_REGISTER(type, regnum, from, to) (legacy_value_to_register (type, regnum, from, to)) | |
1537 | #endif | |
1538 | ||
1539 | typedef void (gdbarch_value_to_register_ftype) (struct type *type, int regnum, char *from, char *to); | |
1540 | extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); | |
1541 | extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register); | |
1542 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER) | |
1543 | #error "Non multi-arch definition of VALUE_TO_REGISTER" | |
1544 | #endif | |
1545 | #if GDB_MULTI_ARCH | |
1546 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (VALUE_TO_REGISTER) | |
1547 | #define VALUE_TO_REGISTER(type, regnum, from, to) (gdbarch_value_to_register (current_gdbarch, type, regnum, from, to)) | |
1548 | #endif | |
1549 | #endif | |
1550 | ||
33489c5b | 1551 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1552 | #if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS) |
ac2e2ef7 | 1553 | #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) |
33489c5b | 1554 | #endif |
4478b372 | 1555 | |
66140c26 AC |
1556 | typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf); |
1557 | extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf); | |
4478b372 | 1558 | extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); |
83905903 AC |
1559 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS) |
1560 | #error "Non multi-arch definition of POINTER_TO_ADDRESS" | |
1561 | #endif | |
33489c5b | 1562 | #if GDB_MULTI_ARCH |
6166d547 | 1563 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS) |
4478b372 JB |
1564 | #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) |
1565 | #endif | |
33489c5b AC |
1566 | #endif |
1567 | ||
1568 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1569 | #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER) |
ac2e2ef7 | 1570 | #define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr)) |
33489c5b | 1571 | #endif |
4478b372 | 1572 | |
ac2e2ef7 AC |
1573 | typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); |
1574 | extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); | |
4478b372 | 1575 | extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); |
83905903 AC |
1576 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER) |
1577 | #error "Non multi-arch definition of ADDRESS_TO_POINTER" | |
1578 | #endif | |
33489c5b | 1579 | #if GDB_MULTI_ARCH |
6166d547 | 1580 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER) |
4478b372 JB |
1581 | #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) |
1582 | #endif | |
33489c5b AC |
1583 | #endif |
1584 | ||
fc0c74b1 AC |
1585 | #if defined (INTEGER_TO_ADDRESS) |
1586 | /* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */ | |
1587 | #if !defined (INTEGER_TO_ADDRESS_P) | |
1588 | #define INTEGER_TO_ADDRESS_P() (1) | |
1589 | #endif | |
1590 | #endif | |
1591 | ||
1592 | /* Default predicate for non- multi-arch targets. */ | |
1593 | #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P) | |
1594 | #define INTEGER_TO_ADDRESS_P() (0) | |
1595 | #endif | |
1596 | ||
1597 | extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch); | |
1598 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P) | |
1599 | #error "Non multi-arch definition of INTEGER_TO_ADDRESS" | |
1600 | #endif | |
1601 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P) | |
1602 | #define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch)) | |
1603 | #endif | |
1604 | ||
1605 | /* Default (function) for non- multi-arch platforms. */ | |
1606 | #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS) | |
73d3c16e | 1607 | #define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0) |
fc0c74b1 AC |
1608 | #endif |
1609 | ||
1610 | typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf); | |
1611 | extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); | |
1612 | extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address); | |
1613 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS) | |
1614 | #error "Non multi-arch definition of INTEGER_TO_ADDRESS" | |
1615 | #endif | |
1616 | #if GDB_MULTI_ARCH | |
1617 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS) | |
1618 | #define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf)) | |
1619 | #endif | |
1620 | #endif | |
1621 | ||
33489c5b | 1622 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1623 | #if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK) |
33489c5b AC |
1624 | #define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type)) |
1625 | #endif | |
0f71a2f6 | 1626 | |
71a9f22e JB |
1627 | typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); |
1628 | extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); | |
1629 | extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); | |
83905903 AC |
1630 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK) |
1631 | #error "Non multi-arch definition of RETURN_VALUE_ON_STACK" | |
1632 | #endif | |
33489c5b | 1633 | #if GDB_MULTI_ARCH |
6166d547 | 1634 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK) |
71a9f22e JB |
1635 | #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) |
1636 | #endif | |
33489c5b | 1637 | #endif |
71a9f22e | 1638 | |
b81774d8 AC |
1639 | /* Replaced by PUSH_DUMMY_CALL */ |
1640 | ||
1641 | #if defined (DEPRECATED_PUSH_ARGUMENTS) | |
1642 | /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_ARGUMENTS */ | |
1643 | #if !defined (DEPRECATED_PUSH_ARGUMENTS_P) | |
1644 | #define DEPRECATED_PUSH_ARGUMENTS_P() (1) | |
1645 | #endif | |
1646 | #endif | |
1647 | ||
1648 | /* Default predicate for non- multi-arch targets. */ | |
1649 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS_P) | |
1650 | #define DEPRECATED_PUSH_ARGUMENTS_P() (0) | |
1651 | #endif | |
1652 | ||
1653 | extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch); | |
1654 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P) | |
1655 | #error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" | |
1656 | #endif | |
1657 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P) | |
1658 | #define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch)) | |
1659 | #endif | |
1660 | ||
c203844d | 1661 | /* Default (function) for non- multi-arch platforms. */ |
b81774d8 AC |
1662 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS) |
1663 | #define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_ARGUMENTS"), 0) | |
c203844d AC |
1664 | #endif |
1665 | ||
b81774d8 AC |
1666 | typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); |
1667 | extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); | |
1668 | extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments); | |
1669 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS) | |
1670 | #error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" | |
83905903 | 1671 | #endif |
0f71a2f6 | 1672 | #if GDB_MULTI_ARCH |
b81774d8 AC |
1673 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS) |
1674 | #define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) | |
0f71a2f6 JM |
1675 | #endif |
1676 | #endif | |
1677 | ||
b81774d8 AC |
1678 | extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch); |
1679 | ||
1680 | typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); | |
1681 | extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); | |
1682 | extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call); | |
1683 | ||
f3824013 AC |
1684 | #if defined (DEPRECATED_PUSH_DUMMY_FRAME) |
1685 | /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_DUMMY_FRAME */ | |
1686 | #if !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) | |
1687 | #define DEPRECATED_PUSH_DUMMY_FRAME_P() (1) | |
1688 | #endif | |
1689 | #endif | |
1690 | ||
1691 | /* Default predicate for non- multi-arch targets. */ | |
1692 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) | |
1693 | #define DEPRECATED_PUSH_DUMMY_FRAME_P() (0) | |
1694 | #endif | |
1695 | ||
1696 | extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch); | |
1697 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME_P) | |
1698 | #error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME" | |
1699 | #endif | |
1700 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) | |
1701 | #define DEPRECATED_PUSH_DUMMY_FRAME_P() (gdbarch_deprecated_push_dummy_frame_p (current_gdbarch)) | |
1702 | #endif | |
1703 | ||
1704 | /* Default (function) for non- multi-arch platforms. */ | |
1705 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME) | |
1706 | #define DEPRECATED_PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_DUMMY_FRAME"), 0) | |
f3824013 AC |
1707 | #endif |
1708 | ||
1709 | typedef void (gdbarch_deprecated_push_dummy_frame_ftype) (void); | |
1710 | extern void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch); | |
1711 | extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame); | |
1712 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME) | |
1713 | #error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME" | |
83905903 | 1714 | #endif |
0f71a2f6 | 1715 | #if GDB_MULTI_ARCH |
f3824013 AC |
1716 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME) |
1717 | #define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch)) | |
0f71a2f6 JM |
1718 | #endif |
1719 | #endif | |
1720 | ||
28f617b3 AC |
1721 | /* NOTE: This can be handled directly in push_dummy_call. */ |
1722 | ||
1723 | #if defined (DEPRECATED_PUSH_RETURN_ADDRESS) | |
1724 | /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_RETURN_ADDRESS */ | |
1725 | #if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) | |
1726 | #define DEPRECATED_PUSH_RETURN_ADDRESS_P() (1) | |
69a0d5f4 AC |
1727 | #endif |
1728 | #endif | |
1729 | ||
1730 | /* Default predicate for non- multi-arch targets. */ | |
28f617b3 AC |
1731 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) |
1732 | #define DEPRECATED_PUSH_RETURN_ADDRESS_P() (0) | |
69a0d5f4 AC |
1733 | #endif |
1734 | ||
28f617b3 AC |
1735 | extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch); |
1736 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) | |
1737 | #error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" | |
69a0d5f4 | 1738 | #endif |
28f617b3 AC |
1739 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) |
1740 | #define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch)) | |
69a0d5f4 AC |
1741 | #endif |
1742 | ||
1743 | /* Default (function) for non- multi-arch platforms. */ | |
28f617b3 AC |
1744 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS) |
1745 | #define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_RETURN_ADDRESS"), 0) | |
69a0d5f4 AC |
1746 | #endif |
1747 | ||
28f617b3 AC |
1748 | typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); |
1749 | extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); | |
1750 | extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address); | |
1751 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS) | |
1752 | #error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" | |
83905903 | 1753 | #endif |
0f71a2f6 | 1754 | #if GDB_MULTI_ARCH |
28f617b3 AC |
1755 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS) |
1756 | #define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_deprecated_push_return_address (current_gdbarch, pc, sp)) | |
0f71a2f6 JM |
1757 | #endif |
1758 | #endif | |
1759 | ||
749b82f6 AC |
1760 | #if defined (DEPRECATED_POP_FRAME) |
1761 | /* Legacy for systems yet to multi-arch DEPRECATED_POP_FRAME */ | |
1762 | #if !defined (DEPRECATED_POP_FRAME_P) | |
1763 | #define DEPRECATED_POP_FRAME_P() (1) | |
dedc2a2b AC |
1764 | #endif |
1765 | #endif | |
1766 | ||
1767 | /* Default predicate for non- multi-arch targets. */ | |
749b82f6 AC |
1768 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME_P) |
1769 | #define DEPRECATED_POP_FRAME_P() (0) | |
dedc2a2b AC |
1770 | #endif |
1771 | ||
749b82f6 AC |
1772 | extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch); |
1773 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P) | |
1774 | #error "Non multi-arch definition of DEPRECATED_POP_FRAME" | |
dedc2a2b | 1775 | #endif |
749b82f6 AC |
1776 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME_P) |
1777 | #define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch)) | |
dedc2a2b AC |
1778 | #endif |
1779 | ||
1780 | /* Default (function) for non- multi-arch platforms. */ | |
749b82f6 AC |
1781 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME) |
1782 | #define DEPRECATED_POP_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_POP_FRAME"), 0) | |
dedc2a2b AC |
1783 | #endif |
1784 | ||
749b82f6 AC |
1785 | typedef void (gdbarch_deprecated_pop_frame_ftype) (void); |
1786 | extern void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch); | |
1787 | extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame); | |
1788 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME) | |
1789 | #error "Non multi-arch definition of DEPRECATED_POP_FRAME" | |
83905903 | 1790 | #endif |
0f71a2f6 | 1791 | #if GDB_MULTI_ARCH |
749b82f6 AC |
1792 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME) |
1793 | #define DEPRECATED_POP_FRAME (gdbarch_deprecated_pop_frame (current_gdbarch)) | |
0f71a2f6 JM |
1794 | #endif |
1795 | #endif | |
1796 | ||
4183d812 AC |
1797 | /* NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. */ |
1798 | ||
1799 | #if defined (DEPRECATED_STORE_STRUCT_RETURN) | |
1800 | /* Legacy for systems yet to multi-arch DEPRECATED_STORE_STRUCT_RETURN */ | |
1801 | #if !defined (DEPRECATED_STORE_STRUCT_RETURN_P) | |
1802 | #define DEPRECATED_STORE_STRUCT_RETURN_P() (1) | |
1803 | #endif | |
1804 | #endif | |
1805 | ||
1806 | /* Default predicate for non- multi-arch targets. */ | |
1807 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN_P) | |
1808 | #define DEPRECATED_STORE_STRUCT_RETURN_P() (0) | |
1809 | #endif | |
1810 | ||
1811 | extern int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch); | |
1812 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN_P) | |
1813 | #error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN" | |
1814 | #endif | |
1815 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN_P) | |
1816 | #define DEPRECATED_STORE_STRUCT_RETURN_P() (gdbarch_deprecated_store_struct_return_p (current_gdbarch)) | |
1817 | #endif | |
1818 | ||
1819 | /* Default (function) for non- multi-arch platforms. */ | |
1820 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN) | |
1821 | #define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_STORE_STRUCT_RETURN"), 0) | |
1822 | #endif | |
1823 | ||
1824 | typedef void (gdbarch_deprecated_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); | |
1825 | extern void gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); | |
1826 | extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return); | |
1827 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN) | |
1828 | #error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN" | |
83905903 | 1829 | #endif |
0f71a2f6 | 1830 | #if GDB_MULTI_ARCH |
4183d812 AC |
1831 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN) |
1832 | #define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (gdbarch_deprecated_store_struct_return (current_gdbarch, addr, sp)) | |
0f71a2f6 JM |
1833 | #endif |
1834 | #endif | |
1835 | ||
ebba8386 AC |
1836 | /* Default (function) for non- multi-arch platforms. */ |
1837 | #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE) | |
1838 | #define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf)) | |
1839 | #endif | |
1840 | ||
1841 | typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf); | |
1842 | extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf); | |
1843 | extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); | |
1844 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) | |
1845 | #error "Non multi-arch definition of EXTRACT_RETURN_VALUE" | |
1846 | #endif | |
1847 | #if GDB_MULTI_ARCH | |
1848 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) | |
1849 | #define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf)) | |
1850 | #endif | |
1851 | #endif | |
1852 | ||
1853 | /* Default (function) for non- multi-arch platforms. */ | |
1854 | #if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE) | |
1855 | #define STORE_RETURN_VALUE(type, regcache, valbuf) (legacy_store_return_value (type, regcache, valbuf)) | |
1856 | #endif | |
1857 | ||
1858 | typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf); | |
1859 | extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf); | |
104c1213 | 1860 | extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); |
83905903 AC |
1861 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE) |
1862 | #error "Non multi-arch definition of STORE_RETURN_VALUE" | |
1863 | #endif | |
0f71a2f6 | 1864 | #if GDB_MULTI_ARCH |
6166d547 | 1865 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) |
ebba8386 AC |
1866 | #define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf)) |
1867 | #endif | |
1868 | #endif | |
1869 | ||
1870 | typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); | |
1871 | extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); | |
1872 | extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value); | |
1873 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE) | |
1874 | #error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE" | |
1875 | #endif | |
1876 | #if GDB_MULTI_ARCH | |
1877 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE) | |
1878 | #define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf)) | |
1879 | #endif | |
1880 | #endif | |
1881 | ||
1882 | typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf); | |
1883 | extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); | |
1884 | extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value); | |
1885 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE) | |
1886 | #error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE" | |
1887 | #endif | |
1888 | #if GDB_MULTI_ARCH | |
1889 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_RETURN_VALUE) | |
1890 | #define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf)) | |
0f71a2f6 JM |
1891 | #endif |
1892 | #endif | |
1893 | ||
049ee0e4 AC |
1894 | #if defined (EXTRACT_STRUCT_VALUE_ADDRESS) |
1895 | /* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */ | |
1896 | #if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1897 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1) | |
1898 | #endif | |
1899 | #endif | |
1900 | ||
1901 | /* Default predicate for non- multi-arch targets. */ | |
1902 | #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1903 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0) | |
1904 | #endif | |
1905 | ||
1906 | extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch); | |
1907 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1908 | #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" | |
1909 | #endif | |
1910 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1911 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch)) | |
1912 | #endif | |
1913 | ||
1914 | /* Default (function) for non- multi-arch platforms. */ | |
1915 | #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS) | |
1916 | #define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0) | |
1917 | #endif | |
1918 | ||
1919 | typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache); | |
1920 | extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache); | |
1921 | extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address); | |
1922 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS) | |
1923 | #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" | |
1924 | #endif | |
1925 | #if GDB_MULTI_ARCH | |
1926 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) | |
1927 | #define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache)) | |
1928 | #endif | |
1929 | #endif | |
1930 | ||
26e9b323 AC |
1931 | #if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) |
1932 | /* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */ | |
1933 | #if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1934 | #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1) | |
d6dd581e AC |
1935 | #endif |
1936 | #endif | |
1937 | ||
1938 | /* Default predicate for non- multi-arch targets. */ | |
26e9b323 AC |
1939 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) |
1940 | #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (0) | |
d6dd581e AC |
1941 | #endif |
1942 | ||
26e9b323 AC |
1943 | extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch); |
1944 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1945 | #error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" | |
83905903 | 1946 | #endif |
26e9b323 AC |
1947 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) |
1948 | #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)) | |
d6dd581e AC |
1949 | #endif |
1950 | ||
1951 | /* Default (function) for non- multi-arch platforms. */ | |
26e9b323 AC |
1952 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) |
1953 | #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"), 0) | |
d6dd581e AC |
1954 | #endif |
1955 | ||
26e9b323 AC |
1956 | typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (char *regbuf); |
1957 | extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); | |
1958 | extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address); | |
1959 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) | |
1960 | #error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" | |
83905903 | 1961 | #endif |
0f71a2f6 | 1962 | #if GDB_MULTI_ARCH |
26e9b323 AC |
1963 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) |
1964 | #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf)) | |
0f71a2f6 JM |
1965 | #endif |
1966 | #endif | |
1967 | ||
56f12751 AC |
1968 | /* Default (function) for non- multi-arch platforms. */ |
1969 | #if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION) | |
1970 | #define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type)) | |
1971 | #endif | |
1972 | ||
104c1213 JM |
1973 | typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type); |
1974 | extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type); | |
1975 | extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention); | |
83905903 AC |
1976 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION) |
1977 | #error "Non multi-arch definition of USE_STRUCT_CONVENTION" | |
1978 | #endif | |
0f71a2f6 | 1979 | #if GDB_MULTI_ARCH |
6166d547 | 1980 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION) |
0f71a2f6 JM |
1981 | #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type)) |
1982 | #endif | |
1983 | #endif | |
1984 | ||
f30ee0bc AC |
1985 | #if defined (DEPRECATED_FRAME_INIT_SAVED_REGS) |
1986 | /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_INIT_SAVED_REGS */ | |
1987 | #if !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) | |
1988 | #define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (1) | |
8f871025 AC |
1989 | #endif |
1990 | #endif | |
1991 | ||
1992 | /* Default predicate for non- multi-arch targets. */ | |
f30ee0bc AC |
1993 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) |
1994 | #define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (0) | |
8f871025 AC |
1995 | #endif |
1996 | ||
f30ee0bc AC |
1997 | extern int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch); |
1998 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) | |
1999 | #error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS" | |
8f871025 | 2000 | #endif |
f30ee0bc AC |
2001 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) |
2002 | #define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch)) | |
8f871025 AC |
2003 | #endif |
2004 | ||
2005 | /* Default (function) for non- multi-arch platforms. */ | |
f30ee0bc AC |
2006 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS) |
2007 | #define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_INIT_SAVED_REGS"), 0) | |
8f871025 AC |
2008 | #endif |
2009 | ||
f30ee0bc AC |
2010 | typedef void (gdbarch_deprecated_frame_init_saved_regs_ftype) (struct frame_info *frame); |
2011 | extern void gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); | |
2012 | extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs); | |
2013 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS) | |
2014 | #error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS" | |
83905903 | 2015 | #endif |
0f71a2f6 | 2016 | #if GDB_MULTI_ARCH |
f30ee0bc AC |
2017 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS) |
2018 | #define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (gdbarch_deprecated_frame_init_saved_regs (current_gdbarch, frame)) | |
0f71a2f6 JM |
2019 | #endif |
2020 | #endif | |
2021 | ||
e9582e71 AC |
2022 | #if defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) |
2023 | /* Legacy for systems yet to multi-arch DEPRECATED_INIT_EXTRA_FRAME_INFO */ | |
2024 | #if !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) | |
2025 | #define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (1) | |
5fdff426 AC |
2026 | #endif |
2027 | #endif | |
2028 | ||
2029 | /* Default predicate for non- multi-arch targets. */ | |
e9582e71 AC |
2030 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) |
2031 | #define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (0) | |
5fdff426 AC |
2032 | #endif |
2033 | ||
e9582e71 AC |
2034 | extern int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch); |
2035 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) | |
2036 | #error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO" | |
5fdff426 | 2037 | #endif |
e9582e71 AC |
2038 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) |
2039 | #define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch)) | |
5fdff426 AC |
2040 | #endif |
2041 | ||
2042 | /* Default (function) for non- multi-arch platforms. */ | |
e9582e71 AC |
2043 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) |
2044 | #define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_EXTRA_FRAME_INFO"), 0) | |
5fdff426 AC |
2045 | #endif |
2046 | ||
e9582e71 AC |
2047 | typedef void (gdbarch_deprecated_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); |
2048 | extern void gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); | |
2049 | extern void set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info); | |
2050 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) | |
2051 | #error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO" | |
83905903 | 2052 | #endif |
0f71a2f6 | 2053 | #if GDB_MULTI_ARCH |
e9582e71 AC |
2054 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) |
2055 | #define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_deprecated_init_extra_frame_info (current_gdbarch, fromleaf, frame)) | |
0f71a2f6 JM |
2056 | #endif |
2057 | #endif | |
2058 | ||
104c1213 JM |
2059 | typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); |
2060 | extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); | |
2061 | extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue); | |
83905903 AC |
2062 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE) |
2063 | #error "Non multi-arch definition of SKIP_PROLOGUE" | |
2064 | #endif | |
0f71a2f6 | 2065 | #if GDB_MULTI_ARCH |
6166d547 | 2066 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE) |
0f71a2f6 JM |
2067 | #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip)) |
2068 | #endif | |
2069 | #endif | |
2070 | ||
33489c5b | 2071 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 2072 | #if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P) |
33489c5b AC |
2073 | #define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip)) |
2074 | #endif | |
2075 | ||
dad41f9a AC |
2076 | typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip); |
2077 | extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip); | |
2078 | extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p); | |
83905903 AC |
2079 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P) |
2080 | #error "Non multi-arch definition of PROLOGUE_FRAMELESS_P" | |
2081 | #endif | |
33489c5b | 2082 | #if GDB_MULTI_ARCH |
6166d547 | 2083 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P) |
dad41f9a AC |
2084 | #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip)) |
2085 | #endif | |
33489c5b | 2086 | #endif |
dad41f9a | 2087 | |
104c1213 JM |
2088 | typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); |
2089 | extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); | |
2090 | extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); | |
83905903 AC |
2091 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN) |
2092 | #error "Non multi-arch definition of INNER_THAN" | |
2093 | #endif | |
0f71a2f6 | 2094 | #if GDB_MULTI_ARCH |
6166d547 | 2095 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN) |
0f71a2f6 JM |
2096 | #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs)) |
2097 | #endif | |
2098 | #endif | |
2099 | ||
33489c5b | 2100 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 2101 | #if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC) |
33489c5b AC |
2102 | #define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) |
2103 | #endif | |
2104 | ||
f4f9705a AC |
2105 | typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); |
2106 | extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); | |
104c1213 | 2107 | extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); |
83905903 AC |
2108 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC) |
2109 | #error "Non multi-arch definition of BREAKPOINT_FROM_PC" | |
2110 | #endif | |
33489c5b | 2111 | #if GDB_MULTI_ARCH |
6166d547 | 2112 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC) |
0f71a2f6 JM |
2113 | #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr)) |
2114 | #endif | |
33489c5b AC |
2115 | #endif |
2116 | ||
2117 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 2118 | #if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT) |
33489c5b AC |
2119 | #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache)) |
2120 | #endif | |
0f71a2f6 | 2121 | |
917317f4 JM |
2122 | typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); |
2123 | extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); | |
2124 | extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint); | |
83905903 AC |
2125 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT) |
2126 | #error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT" | |
2127 | #endif | |
33489c5b | 2128 | #if GDB_MULTI_ARCH |
6166d547 | 2129 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT) |
917317f4 JM |
2130 | #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache)) |
2131 | #endif | |
33489c5b AC |
2132 | #endif |
2133 | ||
2134 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 2135 | #if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT) |
33489c5b AC |
2136 | #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache)) |
2137 | #endif | |
917317f4 JM |
2138 | |
2139 | typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); | |
2140 | extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); | |
2141 | extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint); | |
83905903 AC |
2142 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT) |
2143 | #error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT" | |
2144 | #endif | |
33489c5b | 2145 | #if GDB_MULTI_ARCH |
6166d547 | 2146 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT) |
917317f4 JM |
2147 | #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache)) |
2148 | #endif | |
33489c5b | 2149 | #endif |
917317f4 | 2150 | |
104c1213 JM |
2151 | extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch); |
2152 | extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break); | |
83905903 AC |
2153 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK) |
2154 | #error "Non multi-arch definition of DECR_PC_AFTER_BREAK" | |
2155 | #endif | |
0f71a2f6 | 2156 | #if GDB_MULTI_ARCH |
6166d547 | 2157 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK) |
0f71a2f6 JM |
2158 | #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch)) |
2159 | #endif | |
2160 | #endif | |
2161 | ||
e02bc4cc DS |
2162 | /* Default (function) for non- multi-arch platforms. */ |
2163 | #if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED) | |
2164 | #define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it)) | |
2165 | #endif | |
2166 | ||
2167 | typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it); | |
2168 | extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it); | |
2169 | extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed); | |
83905903 AC |
2170 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED) |
2171 | #error "Non multi-arch definition of PREPARE_TO_PROCEED" | |
2172 | #endif | |
e02bc4cc DS |
2173 | #if GDB_MULTI_ARCH |
2174 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED) | |
2175 | #define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it)) | |
2176 | #endif | |
2177 | #endif | |
2178 | ||
104c1213 JM |
2179 | extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch); |
2180 | extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset); | |
83905903 AC |
2181 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET) |
2182 | #error "Non multi-arch definition of FUNCTION_START_OFFSET" | |
2183 | #endif | |
0f71a2f6 | 2184 | #if GDB_MULTI_ARCH |
6166d547 | 2185 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET) |
0f71a2f6 JM |
2186 | #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch)) |
2187 | #endif | |
2188 | #endif | |
2189 | ||
33489c5b | 2190 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 2191 | #if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
33489c5b AC |
2192 | #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len)) |
2193 | #endif | |
2194 | ||
104c1213 JM |
2195 | typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); |
2196 | extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); | |
2197 | extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); | |
83905903 AC |
2198 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
2199 | #error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS" | |
2200 | #endif | |
33489c5b | 2201 | #if GDB_MULTI_ARCH |
6166d547 | 2202 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
0f71a2f6 JM |
2203 | #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len)) |
2204 | #endif | |
33489c5b | 2205 | #endif |
0f71a2f6 | 2206 | |
104c1213 JM |
2207 | extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch); |
2208 | extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip); | |
83905903 AC |
2209 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP) |
2210 | #error "Non multi-arch definition of FRAME_ARGS_SKIP" | |
2211 | #endif | |
0f71a2f6 | 2212 | #if GDB_MULTI_ARCH |
6166d547 | 2213 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP) |
0f71a2f6 JM |
2214 | #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch)) |
2215 | #endif | |
2216 | #endif | |
2217 | ||
33489c5b | 2218 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 2219 | #if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION) |
33489c5b AC |
2220 | #define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi)) |
2221 | #endif | |
2222 | ||
104c1213 JM |
2223 | typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi); |
2224 | extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi); | |
2225 | extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation); | |
83905903 AC |
2226 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION) |
2227 | #error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION" | |
2228 | #endif | |
33489c5b | 2229 | #if GDB_MULTI_ARCH |
6166d547 | 2230 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION) |
0f71a2f6 JM |
2231 | #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi)) |
2232 | #endif | |
33489c5b | 2233 | #endif |
0f71a2f6 | 2234 | |
618ce49f AC |
2235 | #if defined (DEPRECATED_FRAME_CHAIN) |
2236 | /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN */ | |
2237 | #if !defined (DEPRECATED_FRAME_CHAIN_P) | |
2238 | #define DEPRECATED_FRAME_CHAIN_P() (1) | |
d62d1979 AC |
2239 | #endif |
2240 | #endif | |
2241 | ||
2242 | /* Default predicate for non- multi-arch targets. */ | |
618ce49f AC |
2243 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_P) |
2244 | #define DEPRECATED_FRAME_CHAIN_P() (0) | |
d62d1979 AC |
2245 | #endif |
2246 | ||
618ce49f AC |
2247 | extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch); |
2248 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P) | |
2249 | #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN" | |
d62d1979 | 2250 | #endif |
618ce49f AC |
2251 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_P) |
2252 | #define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch)) | |
d62d1979 AC |
2253 | #endif |
2254 | ||
2255 | /* Default (function) for non- multi-arch platforms. */ | |
618ce49f AC |
2256 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN) |
2257 | #define DEPRECATED_FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN"), 0) | |
d62d1979 AC |
2258 | #endif |
2259 | ||
618ce49f AC |
2260 | typedef CORE_ADDR (gdbarch_deprecated_frame_chain_ftype) (struct frame_info *frame); |
2261 | extern CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); | |
2262 | extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain); | |
2263 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN) | |
2264 | #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN" | |
83905903 | 2265 | #endif |
0f71a2f6 | 2266 | #if GDB_MULTI_ARCH |
618ce49f AC |
2267 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN) |
2268 | #define DEPRECATED_FRAME_CHAIN(frame) (gdbarch_deprecated_frame_chain (current_gdbarch, frame)) | |
0f71a2f6 JM |
2269 | #endif |
2270 | #endif | |
2271 | ||
618ce49f AC |
2272 | #if defined (DEPRECATED_FRAME_CHAIN_VALID) |
2273 | /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN_VALID */ | |
2274 | #if !defined (DEPRECATED_FRAME_CHAIN_VALID_P) | |
2275 | #define DEPRECATED_FRAME_CHAIN_VALID_P() (1) | |
51603483 DJ |
2276 | #endif |
2277 | #endif | |
2278 | ||
2279 | /* Default predicate for non- multi-arch targets. */ | |
618ce49f AC |
2280 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID_P) |
2281 | #define DEPRECATED_FRAME_CHAIN_VALID_P() (0) | |
51603483 DJ |
2282 | #endif |
2283 | ||
618ce49f AC |
2284 | extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch); |
2285 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P) | |
2286 | #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID" | |
51603483 | 2287 | #endif |
618ce49f AC |
2288 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID_P) |
2289 | #define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch)) | |
51603483 | 2290 | #endif |
7f55af32 AC |
2291 | |
2292 | /* Default (function) for non- multi-arch platforms. */ | |
618ce49f AC |
2293 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID) |
2294 | #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN_VALID"), 0) | |
7f55af32 | 2295 | #endif |
028c194b | 2296 | |
618ce49f AC |
2297 | typedef int (gdbarch_deprecated_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); |
2298 | extern int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); | |
2299 | extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid); | |
2300 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID) | |
2301 | #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID" | |
83905903 | 2302 | #endif |
0f71a2f6 | 2303 | #if GDB_MULTI_ARCH |
618ce49f AC |
2304 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID) |
2305 | #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_deprecated_frame_chain_valid (current_gdbarch, chain, thisframe)) | |
0f71a2f6 JM |
2306 | #endif |
2307 | #endif | |
2308 | ||
8bedc050 AC |
2309 | /* DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please |
2310 | note, per UNWIND_PC's doco, that while the two have similar | |
2311 | interfaces they have very different underlying implementations. */ | |
12cc2063 | 2312 | |
8bedc050 AC |
2313 | #if defined (DEPRECATED_FRAME_SAVED_PC) |
2314 | /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_SAVED_PC */ | |
2315 | #if !defined (DEPRECATED_FRAME_SAVED_PC_P) | |
2316 | #define DEPRECATED_FRAME_SAVED_PC_P() (1) | |
d62d1979 AC |
2317 | #endif |
2318 | #endif | |
2319 | ||
2320 | /* Default predicate for non- multi-arch targets. */ | |
8bedc050 AC |
2321 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC_P) |
2322 | #define DEPRECATED_FRAME_SAVED_PC_P() (0) | |
d62d1979 AC |
2323 | #endif |
2324 | ||
8bedc050 AC |
2325 | extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch); |
2326 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P) | |
2327 | #error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC" | |
d62d1979 | 2328 | #endif |
8bedc050 AC |
2329 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC_P) |
2330 | #define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch)) | |
d62d1979 AC |
2331 | #endif |
2332 | ||
2333 | /* Default (function) for non- multi-arch platforms. */ | |
8bedc050 AC |
2334 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC) |
2335 | #define DEPRECATED_FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_SAVED_PC"), 0) | |
d62d1979 AC |
2336 | #endif |
2337 | ||
8bedc050 AC |
2338 | typedef CORE_ADDR (gdbarch_deprecated_frame_saved_pc_ftype) (struct frame_info *fi); |
2339 | extern CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi); | |
2340 | extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc); | |
2341 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC) | |
2342 | #error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC" | |
83905903 | 2343 | #endif |
0f71a2f6 | 2344 | #if GDB_MULTI_ARCH |
8bedc050 AC |
2345 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC) |
2346 | #define DEPRECATED_FRAME_SAVED_PC(fi) (gdbarch_deprecated_frame_saved_pc (current_gdbarch, fi)) | |
0f71a2f6 JM |
2347 | #endif |
2348 | #endif | |
2349 | ||
12cc2063 AC |
2350 | extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch); |
2351 | ||
2352 | typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame); | |
2353 | extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame); | |
2354 | extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc); | |
2355 | ||
f4ded5b1 AC |
2356 | /* Default (function) for non- multi-arch platforms. */ |
2357 | #if (!GDB_MULTI_ARCH) && !defined (FRAME_ARGS_ADDRESS) | |
7d6a26a7 | 2358 | #define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi)) |
f4ded5b1 AC |
2359 | #endif |
2360 | ||
104c1213 JM |
2361 | typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); |
2362 | extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); | |
2363 | extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); | |
83905903 AC |
2364 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS) |
2365 | #error "Non multi-arch definition of FRAME_ARGS_ADDRESS" | |
2366 | #endif | |
0f71a2f6 | 2367 | #if GDB_MULTI_ARCH |
6166d547 | 2368 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS) |
0f71a2f6 JM |
2369 | #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi)) |
2370 | #endif | |
2371 | #endif | |
2372 | ||
f4ded5b1 AC |
2373 | /* Default (function) for non- multi-arch platforms. */ |
2374 | #if (!GDB_MULTI_ARCH) && !defined (FRAME_LOCALS_ADDRESS) | |
7d6a26a7 | 2375 | #define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi)) |
f4ded5b1 AC |
2376 | #endif |
2377 | ||
104c1213 JM |
2378 | typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); |
2379 | extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); | |
2380 | extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); | |
83905903 AC |
2381 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS) |
2382 | #error "Non multi-arch definition of FRAME_LOCALS_ADDRESS" | |
2383 | #endif | |
0f71a2f6 | 2384 | #if GDB_MULTI_ARCH |
6166d547 | 2385 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS) |
0f71a2f6 JM |
2386 | #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi)) |
2387 | #endif | |
2388 | #endif | |
2389 | ||
6913c89a AC |
2390 | #if defined (DEPRECATED_SAVED_PC_AFTER_CALL) |
2391 | /* Legacy for systems yet to multi-arch DEPRECATED_SAVED_PC_AFTER_CALL */ | |
2392 | #if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P) | |
2393 | #define DEPRECATED_SAVED_PC_AFTER_CALL_P() (1) | |
4443bd83 AC |
2394 | #endif |
2395 | #endif | |
2396 | ||
2397 | /* Default predicate for non- multi-arch targets. */ | |
6913c89a AC |
2398 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P) |
2399 | #define DEPRECATED_SAVED_PC_AFTER_CALL_P() (0) | |
4443bd83 AC |
2400 | #endif |
2401 | ||
6913c89a AC |
2402 | extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch); |
2403 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P) | |
2404 | #error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL" | |
4443bd83 | 2405 | #endif |
6913c89a AC |
2406 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P) |
2407 | #define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch)) | |
4443bd83 AC |
2408 | #endif |
2409 | ||
2410 | /* Default (function) for non- multi-arch platforms. */ | |
6913c89a AC |
2411 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL) |
2412 | #define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_SAVED_PC_AFTER_CALL"), 0) | |
4443bd83 AC |
2413 | #endif |
2414 | ||
6913c89a AC |
2415 | typedef CORE_ADDR (gdbarch_deprecated_saved_pc_after_call_ftype) (struct frame_info *frame); |
2416 | extern CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame); | |
2417 | extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call); | |
2418 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL) | |
2419 | #error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL" | |
83905903 | 2420 | #endif |
0f71a2f6 | 2421 | #if GDB_MULTI_ARCH |
6913c89a AC |
2422 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL) |
2423 | #define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (gdbarch_deprecated_saved_pc_after_call (current_gdbarch, frame)) | |
0f71a2f6 JM |
2424 | #endif |
2425 | #endif | |
2426 | ||
104c1213 JM |
2427 | typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame); |
2428 | extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame); | |
2429 | extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args); | |
83905903 AC |
2430 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS) |
2431 | #error "Non multi-arch definition of FRAME_NUM_ARGS" | |
2432 | #endif | |
0f71a2f6 | 2433 | #if GDB_MULTI_ARCH |
6166d547 | 2434 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS) |
0f71a2f6 JM |
2435 | #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame)) |
2436 | #endif | |
2437 | #endif | |
2438 | ||
2ada493a AC |
2439 | #if defined (STACK_ALIGN) |
2440 | /* Legacy for systems yet to multi-arch STACK_ALIGN */ | |
eee30e78 | 2441 | #if !defined (STACK_ALIGN_P) |
2ada493a AC |
2442 | #define STACK_ALIGN_P() (1) |
2443 | #endif | |
eee30e78 | 2444 | #endif |
2ada493a | 2445 | |
33489c5b | 2446 | /* Default predicate for non- multi-arch targets. */ |
6166d547 | 2447 | #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P) |
33489c5b AC |
2448 | #define STACK_ALIGN_P() (0) |
2449 | #endif | |
2450 | ||
2ada493a | 2451 | extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); |
83905903 AC |
2452 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P) |
2453 | #error "Non multi-arch definition of STACK_ALIGN" | |
2454 | #endif | |
6166d547 | 2455 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P) |
2ada493a AC |
2456 | #define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch)) |
2457 | #endif | |
2458 | ||
33489c5b | 2459 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 2460 | #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN) |
8e65ff28 | 2461 | #define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0) |
33489c5b AC |
2462 | #endif |
2463 | ||
2ada493a AC |
2464 | typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp); |
2465 | extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp); | |
2466 | extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align); | |
83905903 AC |
2467 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN) |
2468 | #error "Non multi-arch definition of STACK_ALIGN" | |
2469 | #endif | |
33489c5b | 2470 | #if GDB_MULTI_ARCH |
6166d547 | 2471 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN) |
2ada493a AC |
2472 | #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp)) |
2473 | #endif | |
33489c5b | 2474 | #endif |
2ada493a | 2475 | |
dc604539 AC |
2476 | extern int gdbarch_frame_align_p (struct gdbarch *gdbarch); |
2477 | ||
2478 | typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address); | |
2479 | extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address); | |
2480 | extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align); | |
2481 | ||
f933a9c5 AC |
2482 | /* NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. */ |
2483 | ||
0a49d05e | 2484 | /* Default (value) for non- multi-arch platforms. */ |
f933a9c5 AC |
2485 | #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) |
2486 | #define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0) | |
0a49d05e AC |
2487 | #endif |
2488 | ||
f933a9c5 AC |
2489 | extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch); |
2490 | extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed); | |
2491 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) | |
2492 | #error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED" | |
83905903 | 2493 | #endif |
0a49d05e | 2494 | #if GDB_MULTI_ARCH |
f933a9c5 AC |
2495 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) |
2496 | #define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch)) | |
0a49d05e AC |
2497 | #endif |
2498 | #endif | |
2499 | ||
d03e67c9 AC |
2500 | #if defined (REG_STRUCT_HAS_ADDR) |
2501 | /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */ | |
eee30e78 | 2502 | #if !defined (REG_STRUCT_HAS_ADDR_P) |
d03e67c9 AC |
2503 | #define REG_STRUCT_HAS_ADDR_P() (1) |
2504 | #endif | |
eee30e78 | 2505 | #endif |
d03e67c9 | 2506 | |
33489c5b | 2507 | /* Default predicate for non- multi-arch targets. */ |
6166d547 | 2508 | #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P) |
33489c5b AC |
2509 | #define REG_STRUCT_HAS_ADDR_P() (0) |
2510 | #endif | |
2511 | ||
d03e67c9 | 2512 | extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); |
83905903 AC |
2513 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P) |
2514 | #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" | |
2515 | #endif | |
6166d547 | 2516 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P) |
d03e67c9 AC |
2517 | #define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch)) |
2518 | #endif | |
2519 | ||
33489c5b | 2520 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 2521 | #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR) |
8e65ff28 | 2522 | #define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0) |
33489c5b AC |
2523 | #endif |
2524 | ||
d03e67c9 AC |
2525 | typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); |
2526 | extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type); | |
2527 | extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr); | |
83905903 AC |
2528 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR) |
2529 | #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" | |
2530 | #endif | |
33489c5b | 2531 | #if GDB_MULTI_ARCH |
6166d547 | 2532 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR) |
d03e67c9 AC |
2533 | #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type)) |
2534 | #endif | |
33489c5b | 2535 | #endif |
d03e67c9 | 2536 | |
a2ce2e56 AC |
2537 | /* FIXME: kettenis/2003-03-08: This should be replaced by a function |
2538 | parametrized with (at least) the regcache. */ | |
2539 | ||
d1e3cf49 AC |
2540 | #if defined (SAVE_DUMMY_FRAME_TOS) |
2541 | /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */ | |
eee30e78 | 2542 | #if !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
2543 | #define SAVE_DUMMY_FRAME_TOS_P() (1) |
2544 | #endif | |
eee30e78 | 2545 | #endif |
d1e3cf49 AC |
2546 | |
2547 | /* Default predicate for non- multi-arch targets. */ | |
6166d547 | 2548 | #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
2549 | #define SAVE_DUMMY_FRAME_TOS_P() (0) |
2550 | #endif | |
2551 | ||
2552 | extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); | |
83905903 AC |
2553 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P) |
2554 | #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" | |
2555 | #endif | |
6166d547 | 2556 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
2557 | #define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch)) |
2558 | #endif | |
2559 | ||
2560 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 2561 | #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS) |
8e65ff28 | 2562 | #define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0) |
d1e3cf49 AC |
2563 | #endif |
2564 | ||
2565 | typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); | |
2566 | extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); | |
2567 | extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos); | |
83905903 AC |
2568 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS) |
2569 | #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" | |
2570 | #endif | |
d1e3cf49 | 2571 | #if GDB_MULTI_ARCH |
6166d547 | 2572 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS) |
d1e3cf49 AC |
2573 | #define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp)) |
2574 | #endif | |
2575 | #endif | |
2576 | ||
6314f104 AC |
2577 | extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch); |
2578 | ||
2579 | typedef struct frame_id (gdbarch_unwind_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *info); | |
2580 | extern struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info); | |
2581 | extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind_dummy_id_ftype *unwind_dummy_id); | |
2582 | ||
58d5518e ND |
2583 | extern int gdbarch_parm_boundary (struct gdbarch *gdbarch); |
2584 | extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary); | |
83905903 AC |
2585 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY) |
2586 | #error "Non multi-arch definition of PARM_BOUNDARY" | |
2587 | #endif | |
58d5518e ND |
2588 | #if GDB_MULTI_ARCH |
2589 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY) | |
2590 | #define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch)) | |
2591 | #endif | |
2592 | #endif | |
2593 | ||
f0d4cc9e | 2594 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 2595 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT) |
f0d4cc9e AC |
2596 | #define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch)) |
2597 | #endif | |
2598 | ||
2599 | extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch); | |
2600 | extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format); | |
83905903 AC |
2601 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT) |
2602 | #error "Non multi-arch definition of TARGET_FLOAT_FORMAT" | |
2603 | #endif | |
f0d4cc9e | 2604 | #if GDB_MULTI_ARCH |
6166d547 | 2605 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT) |
f0d4cc9e AC |
2606 | #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) |
2607 | #endif | |
2608 | #endif | |
2609 | ||
2610 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 2611 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT) |
f0d4cc9e AC |
2612 | #define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch)) |
2613 | #endif | |
2614 | ||
2615 | extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch); | |
2616 | extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format); | |
83905903 AC |
2617 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT) |
2618 | #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT" | |
2619 | #endif | |
f0d4cc9e | 2620 | #if GDB_MULTI_ARCH |
6166d547 | 2621 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT) |
f0d4cc9e AC |
2622 | #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) |
2623 | #endif | |
2624 | #endif | |
2625 | ||
2626 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 2627 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT) |
2fa5c1e0 | 2628 | #define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch)) |
f0d4cc9e AC |
2629 | #endif |
2630 | ||
2631 | extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch); | |
2632 | extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format); | |
83905903 AC |
2633 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT) |
2634 | #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT" | |
2635 | #endif | |
f0d4cc9e | 2636 | #if GDB_MULTI_ARCH |
6166d547 | 2637 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT) |
f0d4cc9e AC |
2638 | #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) |
2639 | #endif | |
2640 | #endif | |
2641 | ||
f517ea4e PS |
2642 | /* Default (function) for non- multi-arch platforms. */ |
2643 | #if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR) | |
875e1767 | 2644 | #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr)) |
f517ea4e PS |
2645 | #endif |
2646 | ||
2647 | typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr); | |
2648 | extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2649 | extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr); | |
83905903 AC |
2650 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR) |
2651 | #error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR" | |
2652 | #endif | |
f517ea4e PS |
2653 | #if GDB_MULTI_ARCH |
2654 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR) | |
2655 | #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr)) | |
2656 | #endif | |
2657 | #endif | |
2658 | ||
875e1767 AC |
2659 | /* On some machines there are bits in addresses which are not really |
2660 | part of the address, but are used by the kernel, the hardware, etc. | |
2661 | for special purposes. ADDR_BITS_REMOVE takes out any such bits so | |
2662 | we get a "real" address such as one would find in a symbol table. | |
2663 | This is used only for addresses of instructions, and even then I'm | |
2664 | not sure it's used in all contexts. It exists to deal with there | |
2665 | being a few stray bits in the PC which would mislead us, not as some | |
2666 | sort of generic thing to handle alignment or segmentation (it's | |
2667 | possible it should be in TARGET_READ_PC instead). */ | |
2668 | ||
2669 | /* Default (function) for non- multi-arch platforms. */ | |
2670 | #if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE) | |
2671 | #define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr)) | |
2672 | #endif | |
2673 | ||
2674 | typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr); | |
2675 | extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2676 | extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove); | |
83905903 AC |
2677 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE) |
2678 | #error "Non multi-arch definition of ADDR_BITS_REMOVE" | |
2679 | #endif | |
875e1767 AC |
2680 | #if GDB_MULTI_ARCH |
2681 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE) | |
2682 | #define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr)) | |
2683 | #endif | |
2684 | #endif | |
2685 | ||
5720643c | 2686 | /* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into |
181c1381 RE |
2687 | ADDR_BITS_REMOVE. */ |
2688 | ||
2689 | /* Default (function) for non- multi-arch platforms. */ | |
2690 | #if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS) | |
2691 | #define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr)) | |
2692 | #endif | |
2693 | ||
2694 | typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr); | |
2695 | extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2696 | extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address); | |
2697 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS) | |
2698 | #error "Non multi-arch definition of SMASH_TEXT_ADDRESS" | |
2699 | #endif | |
2700 | #if GDB_MULTI_ARCH | |
2701 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS) | |
2702 | #define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr)) | |
2703 | #endif | |
2704 | #endif | |
2705 | ||
64c4637f AC |
2706 | /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if |
2707 | the target needs software single step. An ISA method to implement it. | |
2708 | ||
2709 | FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints | |
2710 | using the breakpoint system instead of blatting memory directly (as with rs6000). | |
2711 | ||
2712 | FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can | |
2713 | single step. If not, then implement single step using breakpoints. */ | |
2714 | ||
2715 | #if defined (SOFTWARE_SINGLE_STEP) | |
2716 | /* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */ | |
2717 | #if !defined (SOFTWARE_SINGLE_STEP_P) | |
2718 | #define SOFTWARE_SINGLE_STEP_P() (1) | |
2719 | #endif | |
2720 | #endif | |
2721 | ||
2722 | /* Default predicate for non- multi-arch targets. */ | |
2723 | #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P) | |
2724 | #define SOFTWARE_SINGLE_STEP_P() (0) | |
2725 | #endif | |
2726 | ||
2727 | extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch); | |
83905903 AC |
2728 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P) |
2729 | #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" | |
2730 | #endif | |
64c4637f AC |
2731 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P) |
2732 | #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch)) | |
2733 | #endif | |
2734 | ||
2735 | /* Default (function) for non- multi-arch platforms. */ | |
2736 | #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP) | |
2737 | #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0) | |
2738 | #endif | |
2739 | ||
2740 | typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p); | |
2741 | extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p); | |
2742 | extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step); | |
83905903 AC |
2743 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP) |
2744 | #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" | |
2745 | #endif | |
64c4637f AC |
2746 | #if GDB_MULTI_ARCH |
2747 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP) | |
2748 | #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p)) | |
2749 | #endif | |
2750 | #endif | |
2751 | ||
2bf0cb65 EZ |
2752 | /* Default (function) for non- multi-arch platforms. */ |
2753 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN) | |
2754 | #define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info)) | |
2755 | #endif | |
2756 | ||
2757 | typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info); | |
2758 | extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info); | |
2759 | extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn); | |
2760 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN) | |
2761 | #error "Non multi-arch definition of TARGET_PRINT_INSN" | |
2762 | #endif | |
2763 | #if GDB_MULTI_ARCH | |
2764 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN) | |
2765 | #define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info)) | |
2766 | #endif | |
2767 | #endif | |
2768 | ||
bdcd319a CV |
2769 | /* Default (function) for non- multi-arch platforms. */ |
2770 | #if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE) | |
2771 | #define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc)) | |
2772 | #endif | |
2773 | ||
2774 | typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc); | |
2775 | extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc); | |
2776 | extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code); | |
2777 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE) | |
2778 | #error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE" | |
2779 | #endif | |
2780 | #if GDB_MULTI_ARCH | |
2781 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE) | |
2782 | #define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc)) | |
2783 | #endif | |
2784 | #endif | |
2785 | ||
68e9cc94 CV |
2786 | /* For SVR4 shared libraries, each call goes through a small piece of |
2787 | trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates | |
d50355b6 | 2788 | to nonzero if we are currently stopped in one of these. */ |
68e9cc94 CV |
2789 | |
2790 | /* Default (function) for non- multi-arch platforms. */ | |
2791 | #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE) | |
2792 | #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name)) | |
2793 | #endif | |
2794 | ||
2795 | typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name); | |
2796 | extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); | |
2797 | extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline); | |
2798 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE) | |
2799 | #error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE" | |
2800 | #endif | |
2801 | #if GDB_MULTI_ARCH | |
2802 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE) | |
2803 | #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name)) | |
2804 | #endif | |
2805 | #endif | |
2806 | ||
d50355b6 MS |
2807 | /* Some systems also have trampoline code for returning from shared libs. */ |
2808 | ||
2809 | /* Default (function) for non- multi-arch platforms. */ | |
2810 | #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE) | |
2811 | #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name)) | |
2812 | #endif | |
2813 | ||
2814 | typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name); | |
2815 | extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); | |
2816 | extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline); | |
2817 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE) | |
2818 | #error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE" | |
2819 | #endif | |
2820 | #if GDB_MULTI_ARCH | |
2821 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE) | |
2822 | #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name)) | |
2823 | #endif | |
2824 | #endif | |
2825 | ||
d7bd68ca AC |
2826 | /* Sigtramp is a routine that the kernel calls (which then calls the |
2827 | signal handler). On most machines it is a library routine that is | |
2828 | linked into the executable. | |
2829 | ||
2830 | This macro, given a program counter value and the name of the | |
2831 | function in which that PC resides (which can be null if the name is | |
2832 | not known), returns nonzero if the PC and name show that we are in | |
2833 | sigtramp. | |
2834 | ||
2835 | On most machines just see if the name is sigtramp (and if we have | |
2836 | no name, assume we are not in sigtramp). | |
2837 | ||
2838 | FIXME: cagney/2002-04-21: The function find_pc_partial_function | |
2839 | calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP. | |
2840 | This means PC_IN_SIGTRAMP function can't be implemented by doing its | |
2841 | own local NAME lookup. | |
2842 | ||
2843 | FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess. | |
2844 | Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other | |
2845 | does not. */ | |
2846 | ||
2847 | /* Default (function) for non- multi-arch platforms. */ | |
2848 | #if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP) | |
2849 | #define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name)) | |
2850 | #endif | |
2851 | ||
2852 | typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name); | |
2853 | extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); | |
2854 | extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp); | |
2855 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP) | |
2856 | #error "Non multi-arch definition of PC_IN_SIGTRAMP" | |
2857 | #endif | |
2858 | #if GDB_MULTI_ARCH | |
2859 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP) | |
2860 | #define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name)) | |
2861 | #endif | |
2862 | #endif | |
2863 | ||
43156d82 MK |
2864 | #if defined (SIGTRAMP_START) |
2865 | /* Legacy for systems yet to multi-arch SIGTRAMP_START */ | |
2866 | #if !defined (SIGTRAMP_START_P) | |
2867 | #define SIGTRAMP_START_P() (1) | |
2868 | #endif | |
2869 | #endif | |
2870 | ||
2871 | /* Default predicate for non- multi-arch targets. */ | |
2872 | #if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START_P) | |
2873 | #define SIGTRAMP_START_P() (0) | |
2874 | #endif | |
2875 | ||
2876 | extern int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch); | |
2877 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START_P) | |
2878 | #error "Non multi-arch definition of SIGTRAMP_START" | |
2879 | #endif | |
2880 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START_P) | |
2881 | #define SIGTRAMP_START_P() (gdbarch_sigtramp_start_p (current_gdbarch)) | |
2882 | #endif | |
2883 | ||
2884 | /* Default (function) for non- multi-arch platforms. */ | |
2885 | #if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START) | |
2886 | #define SIGTRAMP_START(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_START"), 0) | |
2887 | #endif | |
2888 | ||
2889 | typedef CORE_ADDR (gdbarch_sigtramp_start_ftype) (CORE_ADDR pc); | |
2890 | extern CORE_ADDR gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc); | |
2891 | extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtramp_start_ftype *sigtramp_start); | |
2892 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START) | |
2893 | #error "Non multi-arch definition of SIGTRAMP_START" | |
2894 | #endif | |
2895 | #if GDB_MULTI_ARCH | |
2896 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START) | |
2897 | #define SIGTRAMP_START(pc) (gdbarch_sigtramp_start (current_gdbarch, pc)) | |
2898 | #endif | |
2899 | #endif | |
2900 | ||
e76cff22 AC |
2901 | #if defined (SIGTRAMP_END) |
2902 | /* Legacy for systems yet to multi-arch SIGTRAMP_END */ | |
2903 | #if !defined (SIGTRAMP_END_P) | |
2904 | #define SIGTRAMP_END_P() (1) | |
2905 | #endif | |
2906 | #endif | |
2907 | ||
2908 | /* Default predicate for non- multi-arch targets. */ | |
2909 | #if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END_P) | |
2910 | #define SIGTRAMP_END_P() (0) | |
2911 | #endif | |
2912 | ||
2913 | extern int gdbarch_sigtramp_end_p (struct gdbarch *gdbarch); | |
2914 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END_P) | |
2915 | #error "Non multi-arch definition of SIGTRAMP_END" | |
2916 | #endif | |
2917 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END_P) | |
2918 | #define SIGTRAMP_END_P() (gdbarch_sigtramp_end_p (current_gdbarch)) | |
2919 | #endif | |
2920 | ||
2921 | /* Default (function) for non- multi-arch platforms. */ | |
2922 | #if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END) | |
2923 | #define SIGTRAMP_END(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_END"), 0) | |
2924 | #endif | |
2925 | ||
43156d82 MK |
2926 | typedef CORE_ADDR (gdbarch_sigtramp_end_ftype) (CORE_ADDR pc); |
2927 | extern CORE_ADDR gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc); | |
2928 | extern void set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, gdbarch_sigtramp_end_ftype *sigtramp_end); | |
2929 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END) | |
2930 | #error "Non multi-arch definition of SIGTRAMP_END" | |
2931 | #endif | |
2932 | #if GDB_MULTI_ARCH | |
2933 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END) | |
2934 | #define SIGTRAMP_END(pc) (gdbarch_sigtramp_end (current_gdbarch, pc)) | |
2935 | #endif | |
2936 | #endif | |
2937 | ||
c12260ac CV |
2938 | /* A target might have problems with watchpoints as soon as the stack |
2939 | frame of the current function has been destroyed. This mostly happens | |
2940 | as the first action in a funtion's epilogue. in_function_epilogue_p() | |
2941 | is defined to return a non-zero value if either the given addr is one | |
2942 | instruction after the stack destroying instruction up to the trailing | |
2943 | return instruction or if we can figure out that the stack frame has | |
2944 | already been invalidated regardless of the value of addr. Targets | |
2945 | which don't suffer from that problem could just let this functionality | |
2946 | untouched. */ | |
2947 | ||
2948 | typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2949 | extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2950 | extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p); | |
2951 | ||
552c04a7 TT |
2952 | /* Given a vector of command-line arguments, return a newly allocated |
2953 | string which, when passed to the create_inferior function, will be | |
2954 | parsed (on Unix systems, by the shell) to yield the same vector. | |
2955 | This function should call error() if the argument vector is not | |
2956 | representable for this target or if this target does not support | |
2957 | command-line arguments. | |
2958 | ARGC is the number of elements in the vector. | |
2959 | ARGV is an array of strings, one per argument. */ | |
2960 | ||
2961 | typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv); | |
2962 | extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv); | |
2963 | extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments); | |
2964 | ||
b6af0555 JS |
2965 | #if defined (DWARF2_BUILD_FRAME_INFO) |
2966 | /* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */ | |
2967 | #if !defined (DWARF2_BUILD_FRAME_INFO_P) | |
2968 | #define DWARF2_BUILD_FRAME_INFO_P() (1) | |
2969 | #endif | |
2970 | #endif | |
2971 | ||
2972 | /* Default predicate for non- multi-arch targets. */ | |
2973 | #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P) | |
2974 | #define DWARF2_BUILD_FRAME_INFO_P() (0) | |
2975 | #endif | |
2976 | ||
2977 | extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch); | |
2978 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P) | |
2979 | #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO" | |
2980 | #endif | |
2981 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P) | |
2982 | #define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch)) | |
2983 | #endif | |
2984 | ||
2985 | /* Default (function) for non- multi-arch platforms. */ | |
2986 | #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO) | |
2987 | #define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0) | |
2988 | #endif | |
2989 | ||
2990 | typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile); | |
2991 | extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile); | |
2992 | extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info); | |
2993 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO) | |
2994 | #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO" | |
2995 | #endif | |
2996 | #if GDB_MULTI_ARCH | |
2997 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO) | |
2998 | #define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile)) | |
2999 | #endif | |
3000 | #endif | |
3001 | ||
a2cf933a EZ |
3002 | /* Default (function) for non- multi-arch platforms. */ |
3003 | #if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL) | |
3004 | #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym)) | |
3005 | #endif | |
3006 | ||
3007 | typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym); | |
3008 | extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym); | |
3009 | extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special); | |
3010 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL) | |
3011 | #error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL" | |
3012 | #endif | |
3013 | #if GDB_MULTI_ARCH | |
3014 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL) | |
3015 | #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym)) | |
3016 | #endif | |
3017 | #endif | |
3018 | ||
3019 | /* Default (function) for non- multi-arch platforms. */ | |
3020 | #if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL) | |
3021 | #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym)) | |
3022 | #endif | |
3023 | ||
3024 | typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym); | |
3025 | extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym); | |
3026 | extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special); | |
3027 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL) | |
3028 | #error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL" | |
3029 | #endif | |
3030 | #if GDB_MULTI_ARCH | |
3031 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL) | |
3032 | #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym)) | |
3033 | #endif | |
3034 | #endif | |
3035 | ||
5720643c JB |
3036 | /* Default (value) for non- multi-arch platforms. */ |
3037 | #if (!GDB_MULTI_ARCH) && !defined (NAME_OF_MALLOC) | |
3038 | #define NAME_OF_MALLOC ("malloc") | |
3039 | #endif | |
3040 | ||
3041 | extern const char * gdbarch_name_of_malloc (struct gdbarch *gdbarch); | |
3042 | extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * name_of_malloc); | |
3043 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NAME_OF_MALLOC) | |
3044 | #error "Non multi-arch definition of NAME_OF_MALLOC" | |
3045 | #endif | |
3046 | #if GDB_MULTI_ARCH | |
3047 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NAME_OF_MALLOC) | |
3048 | #define NAME_OF_MALLOC (gdbarch_name_of_malloc (current_gdbarch)) | |
3049 | #endif | |
3050 | #endif | |
3051 | ||
c4ed33b9 AC |
3052 | /* Default (value) for non- multi-arch platforms. */ |
3053 | #if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT) | |
3054 | #define CANNOT_STEP_BREAKPOINT (0) | |
3055 | #endif | |
3056 | ||
3057 | extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch); | |
3058 | extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint); | |
3059 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT) | |
3060 | #error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT" | |
3061 | #endif | |
3062 | #if GDB_MULTI_ARCH | |
3063 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT) | |
3064 | #define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch)) | |
3065 | #endif | |
3066 | #endif | |
3067 | ||
f74fa174 MM |
3068 | /* Default (value) for non- multi-arch platforms. */ |
3069 | #if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT) | |
3070 | #define HAVE_NONSTEPPABLE_WATCHPOINT (0) | |
3071 | #endif | |
3072 | ||
3073 | extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch); | |
3074 | extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint); | |
3075 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT) | |
3076 | #error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT" | |
3077 | #endif | |
3078 | #if GDB_MULTI_ARCH | |
3079 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT) | |
3080 | #define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch)) | |
3081 | #endif | |
3082 | #endif | |
3083 | ||
8b2dbe47 KB |
3084 | #if defined (ADDRESS_CLASS_TYPE_FLAGS) |
3085 | /* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */ | |
3086 | #if !defined (ADDRESS_CLASS_TYPE_FLAGS_P) | |
3087 | #define ADDRESS_CLASS_TYPE_FLAGS_P() (1) | |
3088 | #endif | |
3089 | #endif | |
3090 | ||
3091 | /* Default predicate for non- multi-arch targets. */ | |
3092 | #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_P) | |
3093 | #define ADDRESS_CLASS_TYPE_FLAGS_P() (0) | |
3094 | #endif | |
3095 | ||
3096 | extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch); | |
3097 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P) | |
3098 | #error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS" | |
3099 | #endif | |
3100 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_P) | |
3101 | #define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch)) | |
3102 | #endif | |
3103 | ||
3104 | /* Default (function) for non- multi-arch platforms. */ | |
3105 | #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS) | |
3106 | #define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_TYPE_FLAGS"), 0) | |
3107 | #endif | |
3108 | ||
3109 | typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class); | |
3110 | extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class); | |
3111 | extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags); | |
3112 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS) | |
3113 | #error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS" | |
3114 | #endif | |
3115 | #if GDB_MULTI_ARCH | |
3116 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS) | |
3117 | #define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (gdbarch_address_class_type_flags (current_gdbarch, byte_size, dwarf2_addr_class)) | |
3118 | #endif | |
3119 | #endif | |
3120 | ||
8b2dbe47 | 3121 | extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch); |
8b2dbe47 | 3122 | |
321432c0 KB |
3123 | typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags); |
3124 | extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags); | |
8b2dbe47 | 3125 | extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name); |
8b2dbe47 KB |
3126 | |
3127 | extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch); | |
8b2dbe47 | 3128 | |
321432c0 KB |
3129 | typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr); |
3130 | extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr); | |
8b2dbe47 | 3131 | extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags); |
8b2dbe47 | 3132 | |
b59ff9d5 AC |
3133 | /* Is a register in a group */ |
3134 | ||
3135 | typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup); | |
3136 | extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup); | |
3137 | extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p); | |
3138 | ||
104c1213 | 3139 | extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); |
0f71a2f6 JM |
3140 | |
3141 | ||
3142 | /* Mechanism for co-ordinating the selection of a specific | |
3143 | architecture. | |
3144 | ||
3145 | GDB targets (*-tdep.c) can register an interest in a specific | |
3146 | architecture. Other GDB components can register a need to maintain | |
3147 | per-architecture data. | |
3148 | ||
3149 | The mechanisms below ensures that there is only a loose connection | |
3150 | between the set-architecture command and the various GDB | |
99e7bb18 | 3151 | components. Each component can independently register their need |
0f71a2f6 JM |
3152 | to maintain architecture specific data with gdbarch. |
3153 | ||
3154 | Pragmatics: | |
3155 | ||
3156 | Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It | |
3157 | didn't scale. | |
3158 | ||
3159 | The more traditional mega-struct containing architecture specific | |
3160 | data for all the various GDB components was also considered. Since | |
99e7bb18 | 3161 | GDB is built from a variable number of (fairly independent) |
0f71a2f6 JM |
3162 | components it was determined that the global aproach was not |
3163 | applicable. */ | |
3164 | ||
3165 | ||
3166 | /* Register a new architectural family with GDB. | |
3167 | ||
3168 | Register support for the specified ARCHITECTURE with GDB. When | |
3169 | gdbarch determines that the specified architecture has been | |
3170 | selected, the corresponding INIT function is called. | |
3171 | ||
3172 | -- | |
3173 | ||
3174 | The INIT function takes two parameters: INFO which contains the | |
3175 | information available to gdbarch about the (possibly new) | |
3176 | architecture; ARCHES which is a list of the previously created | |
3177 | ``struct gdbarch'' for this architecture. | |
3178 | ||
0f79675b AC |
3179 | The INFO parameter is, as far as possible, be pre-initialized with |
3180 | information obtained from INFO.ABFD or the previously selected | |
3181 | architecture. | |
3182 | ||
3183 | The ARCHES parameter is a linked list (sorted most recently used) | |
3184 | of all the previously created architures for this architecture | |
3185 | family. The (possibly NULL) ARCHES->gdbarch can used to access | |
3186 | values from the previously selected architecture for this | |
3187 | architecture family. The global ``current_gdbarch'' shall not be | |
3188 | used. | |
0f71a2f6 JM |
3189 | |
3190 | The INIT function shall return any of: NULL - indicating that it | |
ec3d358c | 3191 | doesn't recognize the selected architecture; an existing ``struct |
0f71a2f6 JM |
3192 | gdbarch'' from the ARCHES list - indicating that the new |
3193 | architecture is just a synonym for an earlier architecture (see | |
3194 | gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch'' | |
4b9b3959 AC |
3195 | - that describes the selected architecture (see gdbarch_alloc()). |
3196 | ||
3197 | The DUMP_TDEP function shall print out all target specific values. | |
3198 | Care should be taken to ensure that the function works in both the | |
3199 | multi-arch and non- multi-arch cases. */ | |
0f71a2f6 | 3200 | |
adf40b2e JM |
3201 | struct gdbarch_list |
3202 | { | |
3203 | struct gdbarch *gdbarch; | |
3204 | struct gdbarch_list *next; | |
3205 | }; | |
0f71a2f6 | 3206 | |
adf40b2e JM |
3207 | struct gdbarch_info |
3208 | { | |
adf40b2e JM |
3209 | /* Use default: NULL (ZERO). */ |
3210 | const struct bfd_arch_info *bfd_arch_info; | |
0f71a2f6 | 3211 | |
428721aa | 3212 | /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */ |
adf40b2e | 3213 | int byte_order; |
0f71a2f6 | 3214 | |
adf40b2e JM |
3215 | /* Use default: NULL (ZERO). */ |
3216 | bfd *abfd; | |
0f71a2f6 | 3217 | |
adf40b2e JM |
3218 | /* Use default: NULL (ZERO). */ |
3219 | struct gdbarch_tdep_info *tdep_info; | |
4be87837 DJ |
3220 | |
3221 | /* Use default: GDB_OSABI_UNINITIALIZED (-1). */ | |
3222 | enum gdb_osabi osabi; | |
adf40b2e | 3223 | }; |
0f71a2f6 | 3224 | |
104c1213 | 3225 | typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches); |
4b9b3959 | 3226 | typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file); |
0f71a2f6 | 3227 | |
4b9b3959 | 3228 | /* DEPRECATED - use gdbarch_register() */ |
104c1213 | 3229 | extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *); |
0f71a2f6 | 3230 | |
4b9b3959 AC |
3231 | extern void gdbarch_register (enum bfd_architecture architecture, |
3232 | gdbarch_init_ftype *, | |
3233 | gdbarch_dump_tdep_ftype *); | |
3234 | ||
0f71a2f6 | 3235 | |
b4a20239 AC |
3236 | /* Return a freshly allocated, NULL terminated, array of the valid |
3237 | architecture names. Since architectures are registered during the | |
3238 | _initialize phase this function only returns useful information | |
3239 | once initialization has been completed. */ | |
3240 | ||
3241 | extern const char **gdbarch_printable_names (void); | |
3242 | ||
3243 | ||
0f71a2f6 JM |
3244 | /* Helper function. Search the list of ARCHES for a GDBARCH that |
3245 | matches the information provided by INFO. */ | |
3246 | ||
104c1213 | 3247 | extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info); |
0f71a2f6 JM |
3248 | |
3249 | ||
3250 | /* Helper function. Create a preliminary ``struct gdbarch''. Perform | |
3251 | basic initialization using values obtained from the INFO andTDEP | |
3252 | parameters. set_gdbarch_*() functions are called to complete the | |
3253 | initialization of the object. */ | |
3254 | ||
104c1213 | 3255 | extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep); |
0f71a2f6 JM |
3256 | |
3257 | ||
4b9b3959 AC |
3258 | /* Helper function. Free a partially-constructed ``struct gdbarch''. |
3259 | It is assumed that the caller freeds the ``struct | |
3260 | gdbarch_tdep''. */ | |
3261 | ||
058f20d5 JB |
3262 | extern void gdbarch_free (struct gdbarch *); |
3263 | ||
3264 | ||
b732d07d | 3265 | /* Helper function. Force an update of the current architecture. |
0f71a2f6 | 3266 | |
b732d07d AC |
3267 | The actual architecture selected is determined by INFO, ``(gdb) set |
3268 | architecture'' et.al., the existing architecture and BFD's default | |
3269 | architecture. INFO should be initialized to zero and then selected | |
3270 | fields should be updated. | |
0f71a2f6 | 3271 | |
16f33e29 AC |
3272 | Returns non-zero if the update succeeds */ |
3273 | ||
3274 | extern int gdbarch_update_p (struct gdbarch_info info); | |
0f71a2f6 JM |
3275 | |
3276 | ||
3277 | ||
3278 | /* Register per-architecture data-pointer. | |
3279 | ||
3280 | Reserve space for a per-architecture data-pointer. An identifier | |
3281 | for the reserved data-pointer is returned. That identifer should | |
95160752 | 3282 | be saved in a local static variable. |
0f71a2f6 | 3283 | |
76860b5f AC |
3284 | The per-architecture data-pointer is either initialized explicitly |
3285 | (set_gdbarch_data()) or implicitly (by INIT() via a call to | |
3286 | gdbarch_data()). FREE() is called to delete either an existing | |
2af496cb | 3287 | data-pointer overridden by set_gdbarch_data() or when the |
76860b5f | 3288 | architecture object is being deleted. |
0f71a2f6 | 3289 | |
95160752 AC |
3290 | When a previously created architecture is re-selected, the |
3291 | per-architecture data-pointer for that previous architecture is | |
76860b5f | 3292 | restored. INIT() is not re-called. |
0f71a2f6 JM |
3293 | |
3294 | Multiple registrarants for any architecture are allowed (and | |
3295 | strongly encouraged). */ | |
3296 | ||
95160752 | 3297 | struct gdbarch_data; |
0f71a2f6 | 3298 | |
95160752 AC |
3299 | typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch); |
3300 | typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch, | |
3301 | void *pointer); | |
3302 | extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init, | |
3303 | gdbarch_data_free_ftype *free); | |
3304 | extern void set_gdbarch_data (struct gdbarch *gdbarch, | |
3305 | struct gdbarch_data *data, | |
3306 | void *pointer); | |
0f71a2f6 | 3307 | |
451fbdda | 3308 | extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *); |
0f71a2f6 JM |
3309 | |
3310 | ||
0f71a2f6 JM |
3311 | /* Register per-architecture memory region. |
3312 | ||
3313 | Provide a memory-region swap mechanism. Per-architecture memory | |
3314 | region are created. These memory regions are swapped whenever the | |
3315 | architecture is changed. For a new architecture, the memory region | |
3316 | is initialized with zero (0) and the INIT function is called. | |
3317 | ||
3318 | Memory regions are swapped / initialized in the order that they are | |
3319 | registered. NULL DATA and/or INIT values can be specified. | |
3320 | ||
3321 | New code should use register_gdbarch_data(). */ | |
3322 | ||
104c1213 JM |
3323 | typedef void (gdbarch_swap_ftype) (void); |
3324 | extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init); | |
e514a9d6 | 3325 | #define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL) |
0f71a2f6 JM |
3326 | |
3327 | ||
3328 | ||
99e7bb18 | 3329 | /* The target-system-dependent byte order is dynamic */ |
c906108c | 3330 | |
adf40b2e | 3331 | extern int target_byte_order; |
c906108c SS |
3332 | #ifndef TARGET_BYTE_ORDER |
3333 | #define TARGET_BYTE_ORDER (target_byte_order + 0) | |
3334 | #endif | |
3335 | ||
adf40b2e | 3336 | extern int target_byte_order_auto; |
c906108c SS |
3337 | #ifndef TARGET_BYTE_ORDER_AUTO |
3338 | #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0) | |
3339 | #endif | |
3340 | ||
3341 | ||
3342 | ||
99e7bb18 | 3343 | /* The target-system-dependent BFD architecture is dynamic */ |
c906108c | 3344 | |
adf40b2e | 3345 | extern int target_architecture_auto; |
c906108c SS |
3346 | #ifndef TARGET_ARCHITECTURE_AUTO |
3347 | #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0) | |
3348 | #endif | |
3349 | ||
adf40b2e | 3350 | extern const struct bfd_arch_info *target_architecture; |
c906108c SS |
3351 | #ifndef TARGET_ARCHITECTURE |
3352 | #define TARGET_ARCHITECTURE (target_architecture + 0) | |
3353 | #endif | |
3354 | ||
c906108c | 3355 | |
99e7bb18 | 3356 | /* The target-system-dependent disassembler is semi-dynamic */ |
c906108c | 3357 | |
104c1213 | 3358 | extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, |
ff844c8d | 3359 | unsigned int len, disassemble_info *info); |
c906108c | 3360 | |
104c1213 JM |
3361 | extern void dis_asm_memory_error (int status, bfd_vma memaddr, |
3362 | disassemble_info *info); | |
c906108c | 3363 | |
104c1213 JM |
3364 | extern void dis_asm_print_address (bfd_vma addr, |
3365 | disassemble_info *info); | |
c906108c | 3366 | |
104c1213 | 3367 | extern int (*tm_print_insn) (bfd_vma, disassemble_info*); |
adf40b2e | 3368 | extern disassemble_info tm_print_insn_info; |
c906108c SS |
3369 | #ifndef TARGET_PRINT_INSN_INFO |
3370 | #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info) | |
3371 | #endif | |
3372 | ||
3373 | ||
3374 | ||
99e7bb18 | 3375 | /* Set the dynamic target-system-dependent parameters (architecture, |
c906108c SS |
3376 | byte-order, ...) using information found in the BFD */ |
3377 | ||
104c1213 | 3378 | extern void set_gdbarch_from_file (bfd *); |
c906108c SS |
3379 | |
3380 | ||
e514a9d6 JM |
3381 | /* Initialize the current architecture to the "first" one we find on |
3382 | our list. */ | |
3383 | ||
3384 | extern void initialize_current_architecture (void); | |
3385 | ||
ceaa8edf JB |
3386 | /* For non-multiarched targets, do any initialization of the default |
3387 | gdbarch object necessary after the _initialize_MODULE functions | |
3388 | have run. */ | |
5ae5f592 | 3389 | extern void initialize_non_multiarch (void); |
cce74817 | 3390 | |
c906108c | 3391 | /* gdbarch trace variable */ |
adf40b2e | 3392 | extern int gdbarch_debug; |
c906108c | 3393 | |
4b9b3959 | 3394 | extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file); |
0f71a2f6 | 3395 | |
c906108c | 3396 | #endif |