Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
181c1381 | 4 | Copyright 1998, 1999, 2000, 2001, 2002 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 AC |
39 | #if !GDB_MULTI_ARCH |
40 | #include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */ | |
41 | #endif | |
2bf0cb65 | 42 | |
cce74817 JM |
43 | struct frame_info; |
44 | struct value; | |
b6af0555 | 45 | struct objfile; |
a2cf933a | 46 | struct minimal_symbol; |
0f71a2f6 | 47 | |
0f71a2f6 JM |
48 | extern struct gdbarch *current_gdbarch; |
49 | ||
50 | ||
0f71a2f6 JM |
51 | /* If any of the following are defined, the target wasn't correctly |
52 | converted. */ | |
53 | ||
0f71a2f6 JM |
54 | #if GDB_MULTI_ARCH |
55 | #if defined (EXTRA_FRAME_INFO) | |
56 | #error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info" | |
57 | #endif | |
58 | #endif | |
59 | ||
60 | #if GDB_MULTI_ARCH | |
61 | #if defined (FRAME_FIND_SAVED_REGS) | |
62 | #error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS" | |
63 | #endif | |
64 | #endif | |
65 | ||
83905903 AC |
66 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE) |
67 | #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file." | |
68 | #endif | |
69 | ||
0f71a2f6 JM |
70 | |
71 | /* The following are pre-initialized by GDBARCH. */ | |
72 | ||
104c1213 | 73 | extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch); |
0f71a2f6 | 74 | /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */ |
83905903 AC |
75 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE) |
76 | #error "Non multi-arch definition of TARGET_ARCHITECTURE" | |
77 | #endif | |
0f71a2f6 | 78 | #if GDB_MULTI_ARCH |
6166d547 | 79 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE) |
0f71a2f6 JM |
80 | #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch)) |
81 | #endif | |
82 | #endif | |
83 | ||
104c1213 | 84 | extern int gdbarch_byte_order (struct gdbarch *gdbarch); |
0f71a2f6 | 85 | /* set_gdbarch_byte_order() - not applicable - pre-initialized. */ |
83905903 AC |
86 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER) |
87 | #error "Non multi-arch definition of TARGET_BYTE_ORDER" | |
88 | #endif | |
0f71a2f6 | 89 | #if GDB_MULTI_ARCH |
6166d547 | 90 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER) |
0f71a2f6 JM |
91 | #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch)) |
92 | #endif | |
93 | #endif | |
94 | ||
95 | ||
99e7bb18 | 96 | /* The following are initialized by the target dependent code. */ |
0f71a2f6 | 97 | |
66b43ecb AC |
98 | /* Number of bits in a char or unsigned char for the target machine. |
99 | Just like CHAR_BIT in <limits.h> but describes the target machine. | |
100 | v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0: | |
101 | ||
102 | Number of bits in a short or unsigned short for the target machine. */ | |
c4093a6a | 103 | |
66b43ecb AC |
104 | /* Default (value) for non- multi-arch platforms. */ |
105 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT) | |
106 | #define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT) | |
0f71a2f6 JM |
107 | #endif |
108 | ||
104c1213 JM |
109 | extern int gdbarch_short_bit (struct gdbarch *gdbarch); |
110 | extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit); | |
83905903 AC |
111 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT) |
112 | #error "Non multi-arch definition of TARGET_SHORT_BIT" | |
113 | #endif | |
0f71a2f6 | 114 | #if GDB_MULTI_ARCH |
6166d547 | 115 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT) |
0f71a2f6 JM |
116 | #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch)) |
117 | #endif | |
118 | #endif | |
119 | ||
66b43ecb AC |
120 | /* Number of bits in an int or unsigned int for the target machine. */ |
121 | ||
122 | /* Default (value) for non- multi-arch platforms. */ | |
123 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT) | |
124 | #define TARGET_INT_BIT (4*TARGET_CHAR_BIT) | |
125 | #endif | |
126 | ||
104c1213 JM |
127 | extern int gdbarch_int_bit (struct gdbarch *gdbarch); |
128 | extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); | |
83905903 AC |
129 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT) |
130 | #error "Non multi-arch definition of TARGET_INT_BIT" | |
131 | #endif | |
0f71a2f6 | 132 | #if GDB_MULTI_ARCH |
6166d547 | 133 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT) |
0f71a2f6 JM |
134 | #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch)) |
135 | #endif | |
136 | #endif | |
137 | ||
66b43ecb AC |
138 | /* Number of bits in a long or unsigned long for the target machine. */ |
139 | ||
140 | /* Default (value) for non- multi-arch platforms. */ | |
141 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT) | |
142 | #define TARGET_LONG_BIT (4*TARGET_CHAR_BIT) | |
143 | #endif | |
144 | ||
104c1213 JM |
145 | extern int gdbarch_long_bit (struct gdbarch *gdbarch); |
146 | extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); | |
83905903 AC |
147 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT) |
148 | #error "Non multi-arch definition of TARGET_LONG_BIT" | |
149 | #endif | |
0f71a2f6 | 150 | #if GDB_MULTI_ARCH |
6166d547 | 151 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT) |
0f71a2f6 JM |
152 | #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch)) |
153 | #endif | |
154 | #endif | |
155 | ||
66b43ecb AC |
156 | /* Number of bits in a long long or unsigned long long for the target |
157 | machine. */ | |
158 | ||
159 | /* Default (value) for non- multi-arch platforms. */ | |
160 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT) | |
161 | #define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT) | |
162 | #endif | |
163 | ||
104c1213 JM |
164 | extern int gdbarch_long_long_bit (struct gdbarch *gdbarch); |
165 | extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit); | |
83905903 AC |
166 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT) |
167 | #error "Non multi-arch definition of TARGET_LONG_LONG_BIT" | |
168 | #endif | |
0f71a2f6 | 169 | #if GDB_MULTI_ARCH |
6166d547 | 170 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT) |
0f71a2f6 JM |
171 | #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch)) |
172 | #endif | |
173 | #endif | |
174 | ||
66b43ecb AC |
175 | /* Number of bits in a float for the target machine. */ |
176 | ||
177 | /* Default (value) for non- multi-arch platforms. */ | |
178 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT) | |
179 | #define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT) | |
180 | #endif | |
181 | ||
104c1213 JM |
182 | extern int gdbarch_float_bit (struct gdbarch *gdbarch); |
183 | extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); | |
83905903 AC |
184 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT) |
185 | #error "Non multi-arch definition of TARGET_FLOAT_BIT" | |
186 | #endif | |
0f71a2f6 | 187 | #if GDB_MULTI_ARCH |
6166d547 | 188 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT) |
0f71a2f6 JM |
189 | #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) |
190 | #endif | |
191 | #endif | |
192 | ||
66b43ecb AC |
193 | /* Number of bits in a double for the target machine. */ |
194 | ||
195 | /* Default (value) for non- multi-arch platforms. */ | |
196 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT) | |
197 | #define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT) | |
198 | #endif | |
199 | ||
104c1213 JM |
200 | extern int gdbarch_double_bit (struct gdbarch *gdbarch); |
201 | extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); | |
83905903 AC |
202 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT) |
203 | #error "Non multi-arch definition of TARGET_DOUBLE_BIT" | |
204 | #endif | |
0f71a2f6 | 205 | #if GDB_MULTI_ARCH |
6166d547 | 206 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT) |
0f71a2f6 JM |
207 | #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) |
208 | #endif | |
209 | #endif | |
210 | ||
66b43ecb AC |
211 | /* Number of bits in a long double for the target machine. */ |
212 | ||
213 | /* Default (value) for non- multi-arch platforms. */ | |
214 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT) | |
17ef5d92 | 215 | #define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT) |
66b43ecb AC |
216 | #endif |
217 | ||
104c1213 JM |
218 | extern int gdbarch_long_double_bit (struct gdbarch *gdbarch); |
219 | extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit); | |
83905903 AC |
220 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT) |
221 | #error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT" | |
222 | #endif | |
0f71a2f6 | 223 | #if GDB_MULTI_ARCH |
6166d547 | 224 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT) |
0f71a2f6 JM |
225 | #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) |
226 | #endif | |
227 | #endif | |
228 | ||
52204a0b DT |
229 | /* For most targets, a pointer on the target and its representation as an |
230 | address in GDB have the same size and "look the same". For such a | |
231 | target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT | |
232 | / addr_bit will be set from it. | |
233 | ||
234 | If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably | |
235 | also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well. | |
236 | ||
237 | ptr_bit is the size of a pointer on the target */ | |
66b43ecb AC |
238 | |
239 | /* Default (value) for non- multi-arch platforms. */ | |
240 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT) | |
241 | #define TARGET_PTR_BIT (TARGET_INT_BIT) | |
242 | #endif | |
243 | ||
244 | extern int gdbarch_ptr_bit (struct gdbarch *gdbarch); | |
245 | extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); | |
83905903 AC |
246 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT) |
247 | #error "Non multi-arch definition of TARGET_PTR_BIT" | |
248 | #endif | |
66b43ecb AC |
249 | #if GDB_MULTI_ARCH |
250 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT) | |
251 | #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch)) | |
252 | #endif | |
253 | #endif | |
254 | ||
52204a0b DT |
255 | /* addr_bit is the size of a target address as represented in gdb */ |
256 | ||
257 | /* Default (value) for non- multi-arch platforms. */ | |
258 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT) | |
259 | #define TARGET_ADDR_BIT (TARGET_PTR_BIT) | |
260 | #endif | |
261 | ||
262 | extern int gdbarch_addr_bit (struct gdbarch *gdbarch); | |
263 | extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit); | |
83905903 AC |
264 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT) |
265 | #error "Non multi-arch definition of TARGET_ADDR_BIT" | |
266 | #endif | |
52204a0b DT |
267 | #if GDB_MULTI_ARCH |
268 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT) | |
269 | #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch)) | |
270 | #endif | |
271 | #endif | |
272 | ||
66b43ecb AC |
273 | /* Number of bits in a BFD_VMA for the target object file format. */ |
274 | ||
275 | /* Default (value) for non- multi-arch platforms. */ | |
276 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT) | |
277 | #define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address) | |
278 | #endif | |
279 | ||
280 | extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch); | |
281 | extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); | |
83905903 AC |
282 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT) |
283 | #error "Non multi-arch definition of TARGET_BFD_VMA_BIT" | |
284 | #endif | |
66b43ecb AC |
285 | #if GDB_MULTI_ARCH |
286 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT) | |
287 | #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch)) | |
288 | #endif | |
289 | #endif | |
290 | ||
4e409299 JB |
291 | /* One if `char' acts like `signed char', zero if `unsigned char'. */ |
292 | ||
293 | /* Default (value) for non- multi-arch platforms. */ | |
294 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED) | |
295 | #define TARGET_CHAR_SIGNED (1) | |
296 | #endif | |
297 | ||
298 | extern int gdbarch_char_signed (struct gdbarch *gdbarch); | |
299 | extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed); | |
300 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED) | |
301 | #error "Non multi-arch definition of TARGET_CHAR_SIGNED" | |
302 | #endif | |
303 | #if GDB_MULTI_ARCH | |
304 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED) | |
305 | #define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch)) | |
306 | #endif | |
307 | #endif | |
308 | ||
be8dfb87 AC |
309 | /* Default (function) for non- multi-arch platforms. */ |
310 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC) | |
39f77062 | 311 | #define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid)) |
be8dfb87 AC |
312 | #endif |
313 | ||
39f77062 KB |
314 | typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid); |
315 | extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid); | |
104c1213 | 316 | extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); |
83905903 AC |
317 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC) |
318 | #error "Non multi-arch definition of TARGET_READ_PC" | |
319 | #endif | |
0f71a2f6 | 320 | #if GDB_MULTI_ARCH |
6166d547 | 321 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC) |
39f77062 | 322 | #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid)) |
0f71a2f6 JM |
323 | #endif |
324 | #endif | |
325 | ||
be8dfb87 AC |
326 | /* Default (function) for non- multi-arch platforms. */ |
327 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC) | |
39f77062 | 328 | #define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid)) |
be8dfb87 AC |
329 | #endif |
330 | ||
39f77062 KB |
331 | typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid); |
332 | extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid); | |
104c1213 | 333 | extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc); |
83905903 AC |
334 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC) |
335 | #error "Non multi-arch definition of TARGET_WRITE_PC" | |
336 | #endif | |
0f71a2f6 | 337 | #if GDB_MULTI_ARCH |
6166d547 | 338 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC) |
39f77062 | 339 | #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid)) |
0f71a2f6 JM |
340 | #endif |
341 | #endif | |
342 | ||
be8dfb87 AC |
343 | /* Default (function) for non- multi-arch platforms. */ |
344 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP) | |
345 | #define TARGET_READ_FP() (generic_target_read_fp ()) | |
346 | #endif | |
347 | ||
104c1213 JM |
348 | typedef CORE_ADDR (gdbarch_read_fp_ftype) (void); |
349 | extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch); | |
350 | extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp); | |
83905903 AC |
351 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP) |
352 | #error "Non multi-arch definition of TARGET_READ_FP" | |
353 | #endif | |
0f71a2f6 | 354 | #if GDB_MULTI_ARCH |
6166d547 | 355 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP) |
0f71a2f6 JM |
356 | #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch)) |
357 | #endif | |
358 | #endif | |
359 | ||
be8dfb87 AC |
360 | /* Default (function) for non- multi-arch platforms. */ |
361 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP) | |
362 | #define TARGET_READ_SP() (generic_target_read_sp ()) | |
363 | #endif | |
364 | ||
104c1213 JM |
365 | typedef CORE_ADDR (gdbarch_read_sp_ftype) (void); |
366 | extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch); | |
367 | extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp); | |
83905903 AC |
368 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP) |
369 | #error "Non multi-arch definition of TARGET_READ_SP" | |
370 | #endif | |
0f71a2f6 | 371 | #if GDB_MULTI_ARCH |
6166d547 | 372 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP) |
0f71a2f6 JM |
373 | #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch)) |
374 | #endif | |
375 | #endif | |
376 | ||
be8dfb87 AC |
377 | /* Default (function) for non- multi-arch platforms. */ |
378 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP) | |
379 | #define TARGET_WRITE_SP(val) (generic_target_write_sp (val)) | |
380 | #endif | |
381 | ||
104c1213 JM |
382 | typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val); |
383 | extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); | |
384 | extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp); | |
83905903 AC |
385 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP) |
386 | #error "Non multi-arch definition of TARGET_WRITE_SP" | |
387 | #endif | |
0f71a2f6 | 388 | #if GDB_MULTI_ARCH |
6166d547 | 389 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP) |
0f71a2f6 JM |
390 | #define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val)) |
391 | #endif | |
392 | #endif | |
393 | ||
39d4ef09 AC |
394 | /* Function for getting target's idea of a frame pointer. FIXME: GDB's |
395 | whole scheme for dealing with "frames" and "frame pointers" needs a | |
396 | serious shakedown. */ | |
397 | ||
398 | /* Default (function) for non- multi-arch platforms. */ | |
399 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER) | |
400 | #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset)) | |
401 | #endif | |
402 | ||
403 | typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset); | |
404 | extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset); | |
405 | extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer); | |
406 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER) | |
407 | #error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER" | |
408 | #endif | |
409 | #if GDB_MULTI_ARCH | |
410 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER) | |
411 | #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset)) | |
412 | #endif | |
413 | #endif | |
414 | ||
61a0eb5b AC |
415 | extern int gdbarch_register_read_p (struct gdbarch *gdbarch); |
416 | ||
417 | typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf); | |
418 | extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf); | |
419 | extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read); | |
420 | ||
421 | extern int gdbarch_register_write_p (struct gdbarch *gdbarch); | |
422 | ||
423 | typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf); | |
424 | extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf); | |
425 | extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write); | |
426 | ||
104c1213 JM |
427 | extern int gdbarch_num_regs (struct gdbarch *gdbarch); |
428 | extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); | |
83905903 AC |
429 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS) |
430 | #error "Non multi-arch definition of NUM_REGS" | |
431 | #endif | |
0f71a2f6 | 432 | #if GDB_MULTI_ARCH |
6166d547 | 433 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS) |
0f71a2f6 JM |
434 | #define NUM_REGS (gdbarch_num_regs (current_gdbarch)) |
435 | #endif | |
436 | #endif | |
437 | ||
34620563 AC |
438 | /* This macro gives the number of pseudo-registers that live in the |
439 | register namespace but do not get fetched or stored on the target. | |
440 | These pseudo-registers may be aliases for other registers, | |
441 | combinations of other registers, or they may be computed by GDB. */ | |
442 | ||
0aba1244 | 443 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 444 | #if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS) |
0aba1244 EZ |
445 | #define NUM_PSEUDO_REGS (0) |
446 | #endif | |
447 | ||
448 | extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch); | |
449 | extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs); | |
83905903 AC |
450 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS) |
451 | #error "Non multi-arch definition of NUM_PSEUDO_REGS" | |
452 | #endif | |
0aba1244 | 453 | #if GDB_MULTI_ARCH |
6166d547 | 454 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS) |
0aba1244 EZ |
455 | #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) |
456 | #endif | |
457 | #endif | |
458 | ||
c2169756 AC |
459 | /* GDB's standard (or well known) register numbers. These can map onto |
460 | a real register or a pseudo (computed) register or not be defined at | |
1200cd6e AC |
461 | all (-1). */ |
462 | ||
463 | /* Default (value) for non- multi-arch platforms. */ | |
464 | #if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM) | |
465 | #define SP_REGNUM (-1) | |
466 | #endif | |
c2169756 | 467 | |
104c1213 JM |
468 | extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); |
469 | extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); | |
83905903 AC |
470 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM) |
471 | #error "Non multi-arch definition of SP_REGNUM" | |
472 | #endif | |
0f71a2f6 | 473 | #if GDB_MULTI_ARCH |
6166d547 | 474 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM) |
0f71a2f6 JM |
475 | #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch)) |
476 | #endif | |
477 | #endif | |
478 | ||
1200cd6e AC |
479 | /* Default (value) for non- multi-arch platforms. */ |
480 | #if (!GDB_MULTI_ARCH) && !defined (FP_REGNUM) | |
481 | #define FP_REGNUM (-1) | |
482 | #endif | |
483 | ||
104c1213 JM |
484 | extern int gdbarch_fp_regnum (struct gdbarch *gdbarch); |
485 | extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); | |
83905903 AC |
486 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM) |
487 | #error "Non multi-arch definition of FP_REGNUM" | |
488 | #endif | |
0f71a2f6 | 489 | #if GDB_MULTI_ARCH |
6166d547 | 490 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM) |
0f71a2f6 JM |
491 | #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch)) |
492 | #endif | |
493 | #endif | |
494 | ||
1200cd6e AC |
495 | /* Default (value) for non- multi-arch platforms. */ |
496 | #if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM) | |
497 | #define PC_REGNUM (-1) | |
498 | #endif | |
499 | ||
104c1213 JM |
500 | extern int gdbarch_pc_regnum (struct gdbarch *gdbarch); |
501 | extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); | |
83905903 AC |
502 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM) |
503 | #error "Non multi-arch definition of PC_REGNUM" | |
504 | #endif | |
0f71a2f6 | 505 | #if GDB_MULTI_ARCH |
6166d547 | 506 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM) |
0f71a2f6 JM |
507 | #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) |
508 | #endif | |
509 | #endif | |
510 | ||
c2169756 AC |
511 | /* Default (value) for non- multi-arch platforms. */ |
512 | #if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM) | |
513 | #define PS_REGNUM (-1) | |
514 | #endif | |
515 | ||
516 | extern int gdbarch_ps_regnum (struct gdbarch *gdbarch); | |
517 | extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum); | |
518 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM) | |
519 | #error "Non multi-arch definition of PS_REGNUM" | |
520 | #endif | |
521 | #if GDB_MULTI_ARCH | |
522 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM) | |
523 | #define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch)) | |
524 | #endif | |
525 | #endif | |
526 | ||
60054393 | 527 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 528 | #if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM) |
60054393 MS |
529 | #define FP0_REGNUM (-1) |
530 | #endif | |
531 | ||
532 | extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch); | |
533 | extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); | |
83905903 AC |
534 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM) |
535 | #error "Non multi-arch definition of FP0_REGNUM" | |
536 | #endif | |
60054393 | 537 | #if GDB_MULTI_ARCH |
6166d547 | 538 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM) |
60054393 MS |
539 | #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch)) |
540 | #endif | |
541 | #endif | |
542 | ||
03863182 | 543 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 544 | #if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM) |
03863182 AC |
545 | #define NPC_REGNUM (-1) |
546 | #endif | |
547 | ||
548 | extern int gdbarch_npc_regnum (struct gdbarch *gdbarch); | |
549 | extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); | |
83905903 AC |
550 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM) |
551 | #error "Non multi-arch definition of NPC_REGNUM" | |
552 | #endif | |
03863182 | 553 | #if GDB_MULTI_ARCH |
6166d547 | 554 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM) |
03863182 AC |
555 | #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch)) |
556 | #endif | |
557 | #endif | |
558 | ||
559 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 560 | #if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM) |
03863182 AC |
561 | #define NNPC_REGNUM (-1) |
562 | #endif | |
563 | ||
564 | extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch); | |
565 | extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum); | |
83905903 AC |
566 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM) |
567 | #error "Non multi-arch definition of NNPC_REGNUM" | |
568 | #endif | |
03863182 | 569 | #if GDB_MULTI_ARCH |
6166d547 | 570 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM) |
03863182 AC |
571 | #define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch)) |
572 | #endif | |
573 | #endif | |
574 | ||
88c72b7d AC |
575 | /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */ |
576 | ||
577 | /* Default (function) for non- multi-arch platforms. */ | |
578 | #if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM) | |
579 | #define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr)) | |
580 | #endif | |
581 | ||
582 | typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr); | |
583 | extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr); | |
584 | extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum); | |
83905903 AC |
585 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM) |
586 | #error "Non multi-arch definition of STAB_REG_TO_REGNUM" | |
587 | #endif | |
88c72b7d AC |
588 | #if GDB_MULTI_ARCH |
589 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM) | |
590 | #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr)) | |
591 | #endif | |
592 | #endif | |
593 | ||
594 | /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */ | |
595 | ||
596 | /* Default (function) for non- multi-arch platforms. */ | |
597 | #if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM) | |
598 | #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr)) | |
599 | #endif | |
600 | ||
601 | typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr); | |
602 | extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr); | |
603 | extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum); | |
83905903 AC |
604 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM) |
605 | #error "Non multi-arch definition of ECOFF_REG_TO_REGNUM" | |
606 | #endif | |
88c72b7d AC |
607 | #if GDB_MULTI_ARCH |
608 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM) | |
609 | #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr)) | |
610 | #endif | |
611 | #endif | |
612 | ||
613 | /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */ | |
614 | ||
615 | /* Default (function) for non- multi-arch platforms. */ | |
616 | #if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM) | |
617 | #define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr)) | |
618 | #endif | |
619 | ||
620 | typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr); | |
621 | extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr); | |
622 | extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum); | |
83905903 AC |
623 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM) |
624 | #error "Non multi-arch definition of DWARF_REG_TO_REGNUM" | |
625 | #endif | |
88c72b7d AC |
626 | #if GDB_MULTI_ARCH |
627 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM) | |
628 | #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr)) | |
629 | #endif | |
630 | #endif | |
631 | ||
632 | /* Convert from an sdb register number to an internal gdb register number. | |
633 | This should be defined in tm.h, if REGISTER_NAMES is not set up | |
634 | to map one to one onto the sdb register numbers. */ | |
635 | ||
636 | /* Default (function) for non- multi-arch platforms. */ | |
637 | #if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM) | |
638 | #define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr)) | |
639 | #endif | |
640 | ||
641 | typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr); | |
642 | extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr); | |
643 | extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum); | |
83905903 AC |
644 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM) |
645 | #error "Non multi-arch definition of SDB_REG_TO_REGNUM" | |
646 | #endif | |
88c72b7d AC |
647 | #if GDB_MULTI_ARCH |
648 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM) | |
649 | #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr)) | |
650 | #endif | |
651 | #endif | |
652 | ||
653 | /* Default (function) for non- multi-arch platforms. */ | |
654 | #if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM) | |
655 | #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr)) | |
656 | #endif | |
657 | ||
658 | typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr); | |
659 | extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr); | |
660 | extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum); | |
83905903 AC |
661 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM) |
662 | #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM" | |
663 | #endif | |
88c72b7d AC |
664 | #if GDB_MULTI_ARCH |
665 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM) | |
666 | #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr)) | |
667 | #endif | |
668 | #endif | |
669 | ||
33489c5b | 670 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 671 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME) |
33489c5b AC |
672 | #define REGISTER_NAME(regnr) (legacy_register_name (regnr)) |
673 | #endif | |
674 | ||
104c1213 JM |
675 | typedef char * (gdbarch_register_name_ftype) (int regnr); |
676 | extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); | |
677 | extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); | |
83905903 AC |
678 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME) |
679 | #error "Non multi-arch definition of REGISTER_NAME" | |
680 | #endif | |
33489c5b | 681 | #if GDB_MULTI_ARCH |
6166d547 | 682 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME) |
0f71a2f6 JM |
683 | #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr)) |
684 | #endif | |
33489c5b | 685 | #endif |
0f71a2f6 | 686 | |
104c1213 JM |
687 | extern int gdbarch_register_size (struct gdbarch *gdbarch); |
688 | extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size); | |
83905903 AC |
689 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE) |
690 | #error "Non multi-arch definition of REGISTER_SIZE" | |
691 | #endif | |
0f71a2f6 | 692 | #if GDB_MULTI_ARCH |
6166d547 | 693 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE) |
0f71a2f6 JM |
694 | #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch)) |
695 | #endif | |
696 | #endif | |
697 | ||
104c1213 JM |
698 | extern int gdbarch_register_bytes (struct gdbarch *gdbarch); |
699 | extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes); | |
83905903 AC |
700 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES) |
701 | #error "Non multi-arch definition of REGISTER_BYTES" | |
702 | #endif | |
0f71a2f6 | 703 | #if GDB_MULTI_ARCH |
6166d547 | 704 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES) |
0f71a2f6 JM |
705 | #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch)) |
706 | #endif | |
707 | #endif | |
708 | ||
104c1213 JM |
709 | typedef int (gdbarch_register_byte_ftype) (int reg_nr); |
710 | extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); | |
711 | extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); | |
83905903 AC |
712 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE) |
713 | #error "Non multi-arch definition of REGISTER_BYTE" | |
714 | #endif | |
0f71a2f6 | 715 | #if GDB_MULTI_ARCH |
6166d547 | 716 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE) |
0f71a2f6 JM |
717 | #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr)) |
718 | #endif | |
719 | #endif | |
720 | ||
104c1213 JM |
721 | typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); |
722 | extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); | |
723 | extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); | |
83905903 AC |
724 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE) |
725 | #error "Non multi-arch definition of REGISTER_RAW_SIZE" | |
726 | #endif | |
0f71a2f6 | 727 | #if GDB_MULTI_ARCH |
6166d547 | 728 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE) |
0f71a2f6 JM |
729 | #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr)) |
730 | #endif | |
731 | #endif | |
732 | ||
104c1213 JM |
733 | extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch); |
734 | extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size); | |
83905903 AC |
735 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE) |
736 | #error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE" | |
737 | #endif | |
0f71a2f6 | 738 | #if GDB_MULTI_ARCH |
6166d547 | 739 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE) |
0f71a2f6 JM |
740 | #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch)) |
741 | #endif | |
742 | #endif | |
743 | ||
104c1213 JM |
744 | typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); |
745 | extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); | |
746 | extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); | |
83905903 AC |
747 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE) |
748 | #error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE" | |
749 | #endif | |
0f71a2f6 | 750 | #if GDB_MULTI_ARCH |
6166d547 | 751 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE) |
0f71a2f6 JM |
752 | #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr)) |
753 | #endif | |
754 | #endif | |
755 | ||
104c1213 JM |
756 | extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch); |
757 | extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size); | |
83905903 AC |
758 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE) |
759 | #error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE" | |
760 | #endif | |
0f71a2f6 | 761 | #if GDB_MULTI_ARCH |
6166d547 | 762 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE) |
0f71a2f6 JM |
763 | #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch)) |
764 | #endif | |
765 | #endif | |
766 | ||
104c1213 JM |
767 | typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); |
768 | extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); | |
769 | extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); | |
83905903 AC |
770 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE) |
771 | #error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" | |
772 | #endif | |
0f71a2f6 | 773 | #if GDB_MULTI_ARCH |
6166d547 | 774 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE) |
0f71a2f6 JM |
775 | #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr)) |
776 | #endif | |
777 | #endif | |
778 | ||
666e11c5 EZ |
779 | /* Default (function) for non- multi-arch platforms. */ |
780 | #if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO) | |
781 | #define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs)) | |
782 | #endif | |
783 | ||
784 | typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs); | |
785 | extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs); | |
786 | extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info); | |
83905903 AC |
787 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO) |
788 | #error "Non multi-arch definition of DO_REGISTERS_INFO" | |
789 | #endif | |
666e11c5 EZ |
790 | #if GDB_MULTI_ARCH |
791 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO) | |
792 | #define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs)) | |
793 | #endif | |
794 | #endif | |
795 | ||
5e74b15c RE |
796 | /* Default (function) for non- multi-arch platforms. */ |
797 | #if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO) | |
798 | #define PRINT_FLOAT_INFO() (default_print_float_info ()) | |
799 | #endif | |
800 | ||
801 | typedef void (gdbarch_print_float_info_ftype) (void); | |
802 | extern void gdbarch_print_float_info (struct gdbarch *gdbarch); | |
803 | extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); | |
804 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO) | |
805 | #error "Non multi-arch definition of PRINT_FLOAT_INFO" | |
806 | #endif | |
807 | #if GDB_MULTI_ARCH | |
808 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO) | |
809 | #define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch)) | |
810 | #endif | |
811 | #endif | |
812 | ||
7c7651b2 AC |
813 | /* MAP a GDB RAW register number onto a simulator register number. See |
814 | also include/...-sim.h. */ | |
815 | ||
816 | /* Default (function) for non- multi-arch platforms. */ | |
817 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO) | |
818 | #define REGISTER_SIM_REGNO(reg_nr) (default_register_sim_regno (reg_nr)) | |
819 | #endif | |
820 | ||
821 | typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr); | |
822 | extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr); | |
823 | extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno); | |
83905903 AC |
824 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO) |
825 | #error "Non multi-arch definition of REGISTER_SIM_REGNO" | |
826 | #endif | |
7c7651b2 AC |
827 | #if GDB_MULTI_ARCH |
828 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO) | |
829 | #define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr)) | |
830 | #endif | |
831 | #endif | |
832 | ||
2649061d AC |
833 | #if defined (REGISTER_BYTES_OK) |
834 | /* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */ | |
eee30e78 | 835 | #if !defined (REGISTER_BYTES_OK_P) |
2649061d AC |
836 | #define REGISTER_BYTES_OK_P() (1) |
837 | #endif | |
eee30e78 | 838 | #endif |
2649061d AC |
839 | |
840 | /* Default predicate for non- multi-arch targets. */ | |
841 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P) | |
842 | #define REGISTER_BYTES_OK_P() (0) | |
843 | #endif | |
844 | ||
845 | extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); | |
83905903 AC |
846 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P) |
847 | #error "Non multi-arch definition of REGISTER_BYTES_OK" | |
848 | #endif | |
2649061d AC |
849 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P) |
850 | #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch)) | |
851 | #endif | |
852 | ||
853 | /* Default (function) for non- multi-arch platforms. */ | |
854 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK) | |
8e65ff28 | 855 | #define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0) |
2649061d AC |
856 | #endif |
857 | ||
858 | typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes); | |
859 | extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes); | |
860 | extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok); | |
83905903 AC |
861 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK) |
862 | #error "Non multi-arch definition of REGISTER_BYTES_OK" | |
863 | #endif | |
2649061d AC |
864 | #if GDB_MULTI_ARCH |
865 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK) | |
866 | #define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes)) | |
867 | #endif | |
868 | #endif | |
869 | ||
01fb7433 AC |
870 | /* Default (function) for non- multi-arch platforms. */ |
871 | #if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER) | |
872 | #define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum)) | |
873 | #endif | |
874 | ||
875 | typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); | |
876 | extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum); | |
877 | extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register); | |
83905903 AC |
878 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER) |
879 | #error "Non multi-arch definition of CANNOT_FETCH_REGISTER" | |
880 | #endif | |
01fb7433 AC |
881 | #if GDB_MULTI_ARCH |
882 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER) | |
883 | #define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum)) | |
884 | #endif | |
885 | #endif | |
886 | ||
887 | /* Default (function) for non- multi-arch platforms. */ | |
888 | #if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER) | |
889 | #define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum)) | |
890 | #endif | |
891 | ||
892 | typedef int (gdbarch_cannot_store_register_ftype) (int regnum); | |
893 | extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum); | |
894 | extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register); | |
83905903 AC |
895 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER) |
896 | #error "Non multi-arch definition of CANNOT_STORE_REGISTER" | |
897 | #endif | |
01fb7433 AC |
898 | #if GDB_MULTI_ARCH |
899 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER) | |
900 | #define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum)) | |
901 | #endif | |
902 | #endif | |
903 | ||
9df628e0 RE |
904 | /* setjmp/longjmp support. */ |
905 | ||
906 | #if defined (GET_LONGJMP_TARGET) | |
907 | /* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */ | |
908 | #if !defined (GET_LONGJMP_TARGET_P) | |
909 | #define GET_LONGJMP_TARGET_P() (1) | |
910 | #endif | |
911 | #endif | |
912 | ||
913 | /* Default predicate for non- multi-arch targets. */ | |
914 | #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P) | |
915 | #define GET_LONGJMP_TARGET_P() (0) | |
916 | #endif | |
917 | ||
918 | extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch); | |
919 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P) | |
920 | #error "Non multi-arch definition of GET_LONGJMP_TARGET" | |
921 | #endif | |
922 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P) | |
923 | #define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch)) | |
924 | #endif | |
925 | ||
926 | /* Default (function) for non- multi-arch platforms. */ | |
927 | #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET) | |
928 | #define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0) | |
929 | #endif | |
930 | ||
931 | typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc); | |
932 | extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc); | |
933 | extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target); | |
934 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET) | |
935 | #error "Non multi-arch definition of GET_LONGJMP_TARGET" | |
936 | #endif | |
937 | #if GDB_MULTI_ARCH | |
938 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET) | |
939 | #define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc)) | |
940 | #endif | |
941 | #endif | |
942 | ||
028c194b AC |
943 | /* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that |
944 | much better but at least they are vaguely consistent). The headers | |
945 | and body contain convoluted #if/#else sequences for determine how | |
946 | things should be compiled. Instead of trying to mimic that | |
947 | behaviour here (and hence entrench it further) gdbarch simply | |
948 | reqires that these methods be set up from the word go. This also | |
949 | avoids any potential problems with moving beyond multi-arch partial. */ | |
950 | ||
104c1213 JM |
951 | extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch); |
952 | extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames); | |
028c194b | 953 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES) |
83905903 AC |
954 | #error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES" |
955 | #endif | |
0f71a2f6 | 956 | #if GDB_MULTI_ARCH |
028c194b | 957 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES) |
0f71a2f6 JM |
958 | #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch)) |
959 | #endif | |
960 | #endif | |
961 | ||
104c1213 JM |
962 | extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); |
963 | extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); | |
028c194b | 964 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION) |
83905903 AC |
965 | #error "Non multi-arch definition of CALL_DUMMY_LOCATION" |
966 | #endif | |
0f71a2f6 | 967 | #if GDB_MULTI_ARCH |
028c194b | 968 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION) |
0f71a2f6 JM |
969 | #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch)) |
970 | #endif | |
971 | #endif | |
972 | ||
104c1213 JM |
973 | typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void); |
974 | extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch); | |
975 | extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address); | |
83905903 AC |
976 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS) |
977 | #error "Non multi-arch definition of CALL_DUMMY_ADDRESS" | |
978 | #endif | |
0f71a2f6 | 979 | #if GDB_MULTI_ARCH |
6166d547 | 980 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS) |
0f71a2f6 JM |
981 | #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch)) |
982 | #endif | |
983 | #endif | |
984 | ||
104c1213 JM |
985 | extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch); |
986 | extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset); | |
83905903 AC |
987 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET) |
988 | #error "Non multi-arch definition of CALL_DUMMY_START_OFFSET" | |
989 | #endif | |
0f71a2f6 | 990 | #if GDB_MULTI_ARCH |
6166d547 | 991 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_START_OFFSET) |
0f71a2f6 JM |
992 | #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch)) |
993 | #endif | |
994 | #endif | |
995 | ||
104c1213 JM |
996 | extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); |
997 | extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset); | |
83905903 AC |
998 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET) |
999 | #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET" | |
1000 | #endif | |
0f71a2f6 | 1001 | #if GDB_MULTI_ARCH |
6166d547 | 1002 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET) |
0f71a2f6 JM |
1003 | #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch)) |
1004 | #endif | |
1005 | #endif | |
1006 | ||
104c1213 JM |
1007 | extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch); |
1008 | extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p); | |
028c194b | 1009 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET_P) |
83905903 AC |
1010 | #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET_P" |
1011 | #endif | |
0f71a2f6 | 1012 | #if GDB_MULTI_ARCH |
028c194b | 1013 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P) |
0f71a2f6 JM |
1014 | #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch)) |
1015 | #endif | |
1016 | #endif | |
1017 | ||
104c1213 JM |
1018 | extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch); |
1019 | extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length); | |
83905903 AC |
1020 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH) |
1021 | #error "Non multi-arch definition of CALL_DUMMY_LENGTH" | |
1022 | #endif | |
0f71a2f6 | 1023 | #if GDB_MULTI_ARCH |
6166d547 | 1024 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH) |
0f71a2f6 JM |
1025 | #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch)) |
1026 | #endif | |
1027 | #endif | |
1028 | ||
104c1213 JM |
1029 | typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); |
1030 | extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); | |
1031 | extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy); | |
028c194b | 1032 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY) |
83905903 AC |
1033 | #error "Non multi-arch definition of PC_IN_CALL_DUMMY" |
1034 | #endif | |
0f71a2f6 | 1035 | #if GDB_MULTI_ARCH |
028c194b | 1036 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY) |
0f71a2f6 JM |
1037 | #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) |
1038 | #endif | |
1039 | #endif | |
1040 | ||
104c1213 JM |
1041 | extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch); |
1042 | extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p); | |
028c194b | 1043 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_P) |
83905903 AC |
1044 | #error "Non multi-arch definition of CALL_DUMMY_P" |
1045 | #endif | |
0f71a2f6 | 1046 | #if GDB_MULTI_ARCH |
028c194b | 1047 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P) |
0f71a2f6 JM |
1048 | #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch)) |
1049 | #endif | |
1050 | #endif | |
1051 | ||
33489c5b | 1052 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 1053 | #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS) |
33489c5b AC |
1054 | #define CALL_DUMMY_WORDS (legacy_call_dummy_words) |
1055 | #endif | |
1056 | ||
104c1213 JM |
1057 | extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch); |
1058 | extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); | |
83905903 AC |
1059 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS) |
1060 | #error "Non multi-arch definition of CALL_DUMMY_WORDS" | |
1061 | #endif | |
33489c5b | 1062 | #if GDB_MULTI_ARCH |
6166d547 | 1063 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS) |
0f71a2f6 JM |
1064 | #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) |
1065 | #endif | |
33489c5b AC |
1066 | #endif |
1067 | ||
1068 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 1069 | #if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS) |
33489c5b AC |
1070 | #define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words) |
1071 | #endif | |
0f71a2f6 | 1072 | |
104c1213 JM |
1073 | extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); |
1074 | extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words); | |
83905903 AC |
1075 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS) |
1076 | #error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS" | |
1077 | #endif | |
33489c5b | 1078 | #if GDB_MULTI_ARCH |
6166d547 | 1079 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIZEOF_CALL_DUMMY_WORDS) |
0f71a2f6 JM |
1080 | #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) |
1081 | #endif | |
33489c5b | 1082 | #endif |
0f71a2f6 | 1083 | |
104c1213 JM |
1084 | extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); |
1085 | extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p); | |
028c194b | 1086 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P) |
83905903 AC |
1087 | #error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P" |
1088 | #endif | |
0f71a2f6 | 1089 | #if GDB_MULTI_ARCH |
028c194b | 1090 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P) |
0f71a2f6 JM |
1091 | #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch)) |
1092 | #endif | |
1093 | #endif | |
1094 | ||
104c1213 JM |
1095 | extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch); |
1096 | extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust); | |
83905903 AC |
1097 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST) |
1098 | #error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST" | |
1099 | #endif | |
0f71a2f6 | 1100 | #if GDB_MULTI_ARCH |
6166d547 | 1101 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST) |
0f71a2f6 JM |
1102 | #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch)) |
1103 | #endif | |
1104 | #endif | |
1105 | ||
104c1213 JM |
1106 | 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); |
1107 | 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); | |
1108 | extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy); | |
83905903 AC |
1109 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY) |
1110 | #error "Non multi-arch definition of FIX_CALL_DUMMY" | |
1111 | #endif | |
0f71a2f6 | 1112 | #if GDB_MULTI_ARCH |
6166d547 | 1113 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY) |
0f71a2f6 JM |
1114 | #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)) |
1115 | #endif | |
1116 | #endif | |
1117 | ||
10312cc4 AC |
1118 | /* Default (function) for non- multi-arch platforms. */ |
1119 | #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST) | |
1120 | #define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev)) | |
1121 | #endif | |
1122 | ||
1123 | typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); | |
1124 | extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); | |
1125 | extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first); | |
83905903 AC |
1126 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST) |
1127 | #error "Non multi-arch definition of INIT_FRAME_PC_FIRST" | |
1128 | #endif | |
10312cc4 AC |
1129 | #if GDB_MULTI_ARCH |
1130 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST) | |
1131 | #define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev)) | |
1132 | #endif | |
1133 | #endif | |
1134 | ||
1135 | /* Default (function) for non- multi-arch platforms. */ | |
1136 | #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC) | |
7824d2f2 | 1137 | #define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev)) |
10312cc4 AC |
1138 | #endif |
1139 | ||
1140 | typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); | |
1141 | extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); | |
1142 | extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc); | |
83905903 AC |
1143 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC) |
1144 | #error "Non multi-arch definition of INIT_FRAME_PC" | |
1145 | #endif | |
10312cc4 AC |
1146 | #if GDB_MULTI_ARCH |
1147 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC) | |
1148 | #define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev)) | |
1149 | #endif | |
1150 | #endif | |
1151 | ||
104c1213 JM |
1152 | extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); |
1153 | extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); | |
83905903 AC |
1154 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION) |
1155 | #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION" | |
1156 | #endif | |
0f71a2f6 | 1157 | #if GDB_MULTI_ARCH |
6166d547 | 1158 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION) |
0f71a2f6 JM |
1159 | #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) |
1160 | #endif | |
1161 | #endif | |
1162 | ||
104c1213 JM |
1163 | extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); |
1164 | extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); | |
83905903 AC |
1165 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) |
1166 | #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" | |
1167 | #endif | |
0f71a2f6 | 1168 | #if GDB_MULTI_ARCH |
6166d547 | 1169 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE) |
0f71a2f6 JM |
1170 | #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) |
1171 | #endif | |
1172 | #endif | |
1173 | ||
33489c5b | 1174 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1175 | #if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE) |
33489c5b AC |
1176 | #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual)) |
1177 | #endif | |
1178 | ||
b9a8e3bf JB |
1179 | typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual); |
1180 | extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual); | |
1181 | extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double); | |
83905903 AC |
1182 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE) |
1183 | #error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE" | |
1184 | #endif | |
33489c5b | 1185 | #if GDB_MULTI_ARCH |
6166d547 | 1186 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE) |
b9a8e3bf JB |
1187 | #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual)) |
1188 | #endif | |
33489c5b | 1189 | #endif |
b9a8e3bf | 1190 | |
028c194b AC |
1191 | /* GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the |
1192 | old code has strange #ifdef interaction. So far no one has found | |
1193 | that default_get_saved_register() is the default they are after. */ | |
1194 | ||
104c1213 JM |
1195 | typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); |
1196 | extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); | |
1197 | extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register); | |
028c194b | 1198 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER) |
83905903 AC |
1199 | #error "Non multi-arch definition of GET_SAVED_REGISTER" |
1200 | #endif | |
0f71a2f6 | 1201 | #if GDB_MULTI_ARCH |
028c194b | 1202 | #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER) |
0f71a2f6 JM |
1203 | #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) |
1204 | #endif | |
1205 | #endif | |
1206 | ||
33489c5b | 1207 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1208 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE) |
33489c5b AC |
1209 | #define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr)) |
1210 | #endif | |
1211 | ||
104c1213 JM |
1212 | typedef int (gdbarch_register_convertible_ftype) (int nr); |
1213 | extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); | |
1214 | extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); | |
83905903 AC |
1215 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE) |
1216 | #error "Non multi-arch definition of REGISTER_CONVERTIBLE" | |
1217 | #endif | |
33489c5b | 1218 | #if GDB_MULTI_ARCH |
6166d547 | 1219 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE) |
0f71a2f6 JM |
1220 | #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr)) |
1221 | #endif | |
33489c5b AC |
1222 | #endif |
1223 | ||
1224 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1225 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL) |
8e65ff28 | 1226 | #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0) |
33489c5b | 1227 | #endif |
0f71a2f6 | 1228 | |
104c1213 JM |
1229 | typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); |
1230 | extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); | |
1231 | extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); | |
83905903 AC |
1232 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL) |
1233 | #error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL" | |
1234 | #endif | |
33489c5b | 1235 | #if GDB_MULTI_ARCH |
6166d547 | 1236 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL) |
0f71a2f6 JM |
1237 | #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) |
1238 | #endif | |
33489c5b AC |
1239 | #endif |
1240 | ||
1241 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1242 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW) |
8e65ff28 | 1243 | #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0) |
33489c5b | 1244 | #endif |
0f71a2f6 | 1245 | |
104c1213 JM |
1246 | typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); |
1247 | extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); | |
1248 | extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); | |
83905903 AC |
1249 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW) |
1250 | #error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW" | |
1251 | #endif | |
33489c5b | 1252 | #if GDB_MULTI_ARCH |
6166d547 | 1253 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW) |
0f71a2f6 JM |
1254 | #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) |
1255 | #endif | |
33489c5b AC |
1256 | #endif |
1257 | ||
34620563 AC |
1258 | /* This function is called when the value of a pseudo-register needs to |
1259 | be updated. Typically it will be defined on a per-architecture | |
1260 | basis. */ | |
1261 | ||
31e9866e AC |
1262 | #if defined (FETCH_PSEUDO_REGISTER) |
1263 | /* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */ | |
1264 | #if !defined (FETCH_PSEUDO_REGISTER_P) | |
1265 | #define FETCH_PSEUDO_REGISTER_P() (1) | |
1266 | #endif | |
1267 | #endif | |
1268 | ||
1269 | /* Default predicate for non- multi-arch targets. */ | |
1270 | #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P) | |
1271 | #define FETCH_PSEUDO_REGISTER_P() (0) | |
1272 | #endif | |
1273 | ||
1274 | extern int gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch); | |
1275 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P) | |
1276 | #error "Non multi-arch definition of FETCH_PSEUDO_REGISTER" | |
1277 | #endif | |
1278 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P) | |
1279 | #define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch)) | |
1280 | #endif | |
1281 | ||
7f1b2585 | 1282 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1283 | #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER) |
8e65ff28 | 1284 | #define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0) |
7f1b2585 EZ |
1285 | #endif |
1286 | ||
1287 | typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum); | |
1288 | extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum); | |
1289 | extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register); | |
83905903 AC |
1290 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER) |
1291 | #error "Non multi-arch definition of FETCH_PSEUDO_REGISTER" | |
1292 | #endif | |
7f1b2585 | 1293 | #if GDB_MULTI_ARCH |
6166d547 | 1294 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER) |
7f1b2585 EZ |
1295 | #define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum)) |
1296 | #endif | |
1297 | #endif | |
1298 | ||
34620563 AC |
1299 | /* This function is called when the value of a pseudo-register needs to |
1300 | be set or stored. Typically it will be defined on a | |
1301 | per-architecture basis. */ | |
1302 | ||
31e9866e AC |
1303 | #if defined (STORE_PSEUDO_REGISTER) |
1304 | /* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */ | |
1305 | #if !defined (STORE_PSEUDO_REGISTER_P) | |
1306 | #define STORE_PSEUDO_REGISTER_P() (1) | |
1307 | #endif | |
1308 | #endif | |
1309 | ||
1310 | /* Default predicate for non- multi-arch targets. */ | |
1311 | #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P) | |
1312 | #define STORE_PSEUDO_REGISTER_P() (0) | |
1313 | #endif | |
1314 | ||
1315 | extern int gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch); | |
1316 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P) | |
1317 | #error "Non multi-arch definition of STORE_PSEUDO_REGISTER" | |
1318 | #endif | |
1319 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P) | |
1320 | #define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch)) | |
1321 | #endif | |
1322 | ||
7f1b2585 | 1323 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1324 | #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER) |
8e65ff28 | 1325 | #define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0) |
7f1b2585 EZ |
1326 | #endif |
1327 | ||
1328 | typedef void (gdbarch_store_pseudo_register_ftype) (int regnum); | |
1329 | extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum); | |
1330 | extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register); | |
83905903 AC |
1331 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER) |
1332 | #error "Non multi-arch definition of STORE_PSEUDO_REGISTER" | |
1333 | #endif | |
7f1b2585 | 1334 | #if GDB_MULTI_ARCH |
6166d547 | 1335 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER) |
7f1b2585 EZ |
1336 | #define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum)) |
1337 | #endif | |
1338 | #endif | |
1339 | ||
33489c5b | 1340 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1341 | #if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS) |
ac2e2ef7 | 1342 | #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) |
33489c5b | 1343 | #endif |
4478b372 | 1344 | |
ac2e2ef7 AC |
1345 | typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf); |
1346 | extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); | |
4478b372 | 1347 | extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); |
83905903 AC |
1348 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS) |
1349 | #error "Non multi-arch definition of POINTER_TO_ADDRESS" | |
1350 | #endif | |
33489c5b | 1351 | #if GDB_MULTI_ARCH |
6166d547 | 1352 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS) |
4478b372 JB |
1353 | #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) |
1354 | #endif | |
33489c5b AC |
1355 | #endif |
1356 | ||
1357 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1358 | #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER) |
ac2e2ef7 | 1359 | #define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr)) |
33489c5b | 1360 | #endif |
4478b372 | 1361 | |
ac2e2ef7 AC |
1362 | typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); |
1363 | extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); | |
4478b372 | 1364 | extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); |
83905903 AC |
1365 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER) |
1366 | #error "Non multi-arch definition of ADDRESS_TO_POINTER" | |
1367 | #endif | |
33489c5b | 1368 | #if GDB_MULTI_ARCH |
6166d547 | 1369 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER) |
4478b372 JB |
1370 | #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) |
1371 | #endif | |
33489c5b AC |
1372 | #endif |
1373 | ||
fc0c74b1 AC |
1374 | #if defined (INTEGER_TO_ADDRESS) |
1375 | /* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */ | |
1376 | #if !defined (INTEGER_TO_ADDRESS_P) | |
1377 | #define INTEGER_TO_ADDRESS_P() (1) | |
1378 | #endif | |
1379 | #endif | |
1380 | ||
1381 | /* Default predicate for non- multi-arch targets. */ | |
1382 | #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P) | |
1383 | #define INTEGER_TO_ADDRESS_P() (0) | |
1384 | #endif | |
1385 | ||
1386 | extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch); | |
1387 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P) | |
1388 | #error "Non multi-arch definition of INTEGER_TO_ADDRESS" | |
1389 | #endif | |
1390 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P) | |
1391 | #define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch)) | |
1392 | #endif | |
1393 | ||
1394 | /* Default (function) for non- multi-arch platforms. */ | |
1395 | #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS) | |
73d3c16e | 1396 | #define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0) |
fc0c74b1 AC |
1397 | #endif |
1398 | ||
1399 | typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf); | |
1400 | extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); | |
1401 | extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address); | |
1402 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS) | |
1403 | #error "Non multi-arch definition of INTEGER_TO_ADDRESS" | |
1404 | #endif | |
1405 | #if GDB_MULTI_ARCH | |
1406 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS) | |
1407 | #define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf)) | |
1408 | #endif | |
1409 | #endif | |
1410 | ||
33489c5b | 1411 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1412 | #if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK) |
33489c5b AC |
1413 | #define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type)) |
1414 | #endif | |
0f71a2f6 | 1415 | |
71a9f22e JB |
1416 | typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); |
1417 | extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); | |
1418 | extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); | |
83905903 AC |
1419 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK) |
1420 | #error "Non multi-arch definition of RETURN_VALUE_ON_STACK" | |
1421 | #endif | |
33489c5b | 1422 | #if GDB_MULTI_ARCH |
6166d547 | 1423 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK) |
71a9f22e JB |
1424 | #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) |
1425 | #endif | |
33489c5b | 1426 | #endif |
71a9f22e | 1427 | |
104c1213 JM |
1428 | typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); |
1429 | extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); | |
1430 | extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); | |
83905903 AC |
1431 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) |
1432 | #error "Non multi-arch definition of EXTRACT_RETURN_VALUE" | |
1433 | #endif | |
0f71a2f6 | 1434 | #if GDB_MULTI_ARCH |
6166d547 | 1435 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) |
0f71a2f6 JM |
1436 | #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf)) |
1437 | #endif | |
1438 | #endif | |
1439 | ||
c203844d AC |
1440 | /* Default (function) for non- multi-arch platforms. */ |
1441 | #if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS) | |
1442 | #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr)) | |
1443 | #endif | |
1444 | ||
104c1213 JM |
1445 | typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); |
1446 | extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); | |
1447 | extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments); | |
83905903 AC |
1448 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS) |
1449 | #error "Non multi-arch definition of PUSH_ARGUMENTS" | |
1450 | #endif | |
0f71a2f6 | 1451 | #if GDB_MULTI_ARCH |
6166d547 | 1452 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS) |
0f71a2f6 JM |
1453 | #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) |
1454 | #endif | |
1455 | #endif | |
1456 | ||
104c1213 JM |
1457 | typedef void (gdbarch_push_dummy_frame_ftype) (void); |
1458 | extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch); | |
1459 | extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame); | |
83905903 AC |
1460 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME) |
1461 | #error "Non multi-arch definition of PUSH_DUMMY_FRAME" | |
1462 | #endif | |
0f71a2f6 | 1463 | #if GDB_MULTI_ARCH |
6166d547 | 1464 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME) |
0f71a2f6 JM |
1465 | #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch)) |
1466 | #endif | |
1467 | #endif | |
1468 | ||
69a0d5f4 AC |
1469 | #if defined (PUSH_RETURN_ADDRESS) |
1470 | /* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */ | |
1471 | #if !defined (PUSH_RETURN_ADDRESS_P) | |
1472 | #define PUSH_RETURN_ADDRESS_P() (1) | |
1473 | #endif | |
1474 | #endif | |
1475 | ||
1476 | /* Default predicate for non- multi-arch targets. */ | |
1477 | #if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P) | |
1478 | #define PUSH_RETURN_ADDRESS_P() (0) | |
1479 | #endif | |
1480 | ||
1481 | extern int gdbarch_push_return_address_p (struct gdbarch *gdbarch); | |
1482 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P) | |
1483 | #error "Non multi-arch definition of PUSH_RETURN_ADDRESS" | |
1484 | #endif | |
1485 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P) | |
1486 | #define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch)) | |
1487 | #endif | |
1488 | ||
1489 | /* Default (function) for non- multi-arch platforms. */ | |
1490 | #if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS) | |
1491 | #define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0) | |
1492 | #endif | |
1493 | ||
104c1213 JM |
1494 | typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); |
1495 | extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); | |
1496 | extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address); | |
83905903 AC |
1497 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS) |
1498 | #error "Non multi-arch definition of PUSH_RETURN_ADDRESS" | |
1499 | #endif | |
0f71a2f6 | 1500 | #if GDB_MULTI_ARCH |
6166d547 | 1501 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS) |
0f71a2f6 JM |
1502 | #define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp)) |
1503 | #endif | |
1504 | #endif | |
1505 | ||
104c1213 JM |
1506 | typedef void (gdbarch_pop_frame_ftype) (void); |
1507 | extern void gdbarch_pop_frame (struct gdbarch *gdbarch); | |
1508 | extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame); | |
83905903 AC |
1509 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME) |
1510 | #error "Non multi-arch definition of POP_FRAME" | |
1511 | #endif | |
0f71a2f6 | 1512 | #if GDB_MULTI_ARCH |
6166d547 | 1513 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME) |
0f71a2f6 JM |
1514 | #define POP_FRAME (gdbarch_pop_frame (current_gdbarch)) |
1515 | #endif | |
1516 | #endif | |
1517 | ||
104c1213 JM |
1518 | typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); |
1519 | extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); | |
1520 | extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return); | |
83905903 AC |
1521 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN) |
1522 | #error "Non multi-arch definition of STORE_STRUCT_RETURN" | |
1523 | #endif | |
0f71a2f6 | 1524 | #if GDB_MULTI_ARCH |
6166d547 | 1525 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN) |
0f71a2f6 JM |
1526 | #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp)) |
1527 | #endif | |
1528 | #endif | |
1529 | ||
104c1213 JM |
1530 | typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf); |
1531 | extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); | |
1532 | extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); | |
83905903 AC |
1533 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE) |
1534 | #error "Non multi-arch definition of STORE_RETURN_VALUE" | |
1535 | #endif | |
0f71a2f6 | 1536 | #if GDB_MULTI_ARCH |
6166d547 | 1537 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) |
0f71a2f6 JM |
1538 | #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf)) |
1539 | #endif | |
1540 | #endif | |
1541 | ||
d6dd581e AC |
1542 | #if defined (EXTRACT_STRUCT_VALUE_ADDRESS) |
1543 | /* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */ | |
1544 | #if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1545 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1) | |
1546 | #endif | |
1547 | #endif | |
1548 | ||
1549 | /* Default predicate for non- multi-arch targets. */ | |
1550 | #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) | |
1551 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0) | |
1552 | #endif | |
1553 | ||
1554 | extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch); | |
83905903 AC |
1555 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) |
1556 | #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" | |
1557 | #endif | |
d6dd581e AC |
1558 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) |
1559 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch)) | |
1560 | #endif | |
1561 | ||
1562 | /* Default (function) for non- multi-arch platforms. */ | |
1563 | #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS) | |
1564 | #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0) | |
1565 | #endif | |
1566 | ||
104c1213 JM |
1567 | typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf); |
1568 | extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); | |
1569 | extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address); | |
83905903 AC |
1570 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS) |
1571 | #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" | |
1572 | #endif | |
0f71a2f6 | 1573 | #if GDB_MULTI_ARCH |
6166d547 | 1574 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) |
0f71a2f6 JM |
1575 | #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf)) |
1576 | #endif | |
1577 | #endif | |
1578 | ||
56f12751 AC |
1579 | /* Default (function) for non- multi-arch platforms. */ |
1580 | #if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION) | |
1581 | #define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type)) | |
1582 | #endif | |
1583 | ||
104c1213 JM |
1584 | typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type); |
1585 | extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type); | |
1586 | extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention); | |
83905903 AC |
1587 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION) |
1588 | #error "Non multi-arch definition of USE_STRUCT_CONVENTION" | |
1589 | #endif | |
0f71a2f6 | 1590 | #if GDB_MULTI_ARCH |
6166d547 | 1591 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION) |
0f71a2f6 JM |
1592 | #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type)) |
1593 | #endif | |
1594 | #endif | |
1595 | ||
104c1213 JM |
1596 | typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame); |
1597 | extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); | |
1598 | extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs); | |
83905903 AC |
1599 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS) |
1600 | #error "Non multi-arch definition of FRAME_INIT_SAVED_REGS" | |
1601 | #endif | |
0f71a2f6 | 1602 | #if GDB_MULTI_ARCH |
6166d547 | 1603 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS) |
0f71a2f6 JM |
1604 | #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame)) |
1605 | #endif | |
1606 | #endif | |
1607 | ||
5fdff426 AC |
1608 | #if defined (INIT_EXTRA_FRAME_INFO) |
1609 | /* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */ | |
1610 | #if !defined (INIT_EXTRA_FRAME_INFO_P) | |
1611 | #define INIT_EXTRA_FRAME_INFO_P() (1) | |
1612 | #endif | |
1613 | #endif | |
1614 | ||
1615 | /* Default predicate for non- multi-arch targets. */ | |
1616 | #if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P) | |
1617 | #define INIT_EXTRA_FRAME_INFO_P() (0) | |
1618 | #endif | |
1619 | ||
1620 | extern int gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch); | |
1621 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P) | |
1622 | #error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO" | |
1623 | #endif | |
1624 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P) | |
1625 | #define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch)) | |
1626 | #endif | |
1627 | ||
1628 | /* Default (function) for non- multi-arch platforms. */ | |
1629 | #if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO) | |
1630 | #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0) | |
1631 | #endif | |
1632 | ||
104c1213 JM |
1633 | typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); |
1634 | extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); | |
1635 | extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info); | |
83905903 AC |
1636 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO) |
1637 | #error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO" | |
1638 | #endif | |
0f71a2f6 | 1639 | #if GDB_MULTI_ARCH |
6166d547 | 1640 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO) |
0f71a2f6 JM |
1641 | #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame)) |
1642 | #endif | |
1643 | #endif | |
1644 | ||
104c1213 JM |
1645 | typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); |
1646 | extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); | |
1647 | extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue); | |
83905903 AC |
1648 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE) |
1649 | #error "Non multi-arch definition of SKIP_PROLOGUE" | |
1650 | #endif | |
0f71a2f6 | 1651 | #if GDB_MULTI_ARCH |
6166d547 | 1652 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE) |
0f71a2f6 JM |
1653 | #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip)) |
1654 | #endif | |
1655 | #endif | |
1656 | ||
33489c5b | 1657 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1658 | #if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P) |
33489c5b AC |
1659 | #define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip)) |
1660 | #endif | |
1661 | ||
dad41f9a AC |
1662 | typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip); |
1663 | extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip); | |
1664 | extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p); | |
83905903 AC |
1665 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P) |
1666 | #error "Non multi-arch definition of PROLOGUE_FRAMELESS_P" | |
1667 | #endif | |
33489c5b | 1668 | #if GDB_MULTI_ARCH |
6166d547 | 1669 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P) |
dad41f9a AC |
1670 | #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip)) |
1671 | #endif | |
33489c5b | 1672 | #endif |
dad41f9a | 1673 | |
104c1213 JM |
1674 | typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); |
1675 | extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); | |
1676 | extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); | |
83905903 AC |
1677 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN) |
1678 | #error "Non multi-arch definition of INNER_THAN" | |
1679 | #endif | |
0f71a2f6 | 1680 | #if GDB_MULTI_ARCH |
6166d547 | 1681 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN) |
0f71a2f6 JM |
1682 | #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs)) |
1683 | #endif | |
1684 | #endif | |
1685 | ||
33489c5b | 1686 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1687 | #if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC) |
33489c5b AC |
1688 | #define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) |
1689 | #endif | |
1690 | ||
104c1213 JM |
1691 | typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); |
1692 | extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); | |
1693 | extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); | |
83905903 AC |
1694 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC) |
1695 | #error "Non multi-arch definition of BREAKPOINT_FROM_PC" | |
1696 | #endif | |
33489c5b | 1697 | #if GDB_MULTI_ARCH |
6166d547 | 1698 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC) |
0f71a2f6 JM |
1699 | #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr)) |
1700 | #endif | |
33489c5b AC |
1701 | #endif |
1702 | ||
1703 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1704 | #if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT) |
33489c5b AC |
1705 | #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache)) |
1706 | #endif | |
0f71a2f6 | 1707 | |
917317f4 JM |
1708 | typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); |
1709 | extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); | |
1710 | extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint); | |
83905903 AC |
1711 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT) |
1712 | #error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT" | |
1713 | #endif | |
33489c5b | 1714 | #if GDB_MULTI_ARCH |
6166d547 | 1715 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT) |
917317f4 JM |
1716 | #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache)) |
1717 | #endif | |
33489c5b AC |
1718 | #endif |
1719 | ||
1720 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1721 | #if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT) |
33489c5b AC |
1722 | #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache)) |
1723 | #endif | |
917317f4 JM |
1724 | |
1725 | typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); | |
1726 | extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); | |
1727 | extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint); | |
83905903 AC |
1728 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT) |
1729 | #error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT" | |
1730 | #endif | |
33489c5b | 1731 | #if GDB_MULTI_ARCH |
6166d547 | 1732 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT) |
917317f4 JM |
1733 | #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache)) |
1734 | #endif | |
33489c5b | 1735 | #endif |
917317f4 | 1736 | |
104c1213 JM |
1737 | extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch); |
1738 | extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break); | |
83905903 AC |
1739 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK) |
1740 | #error "Non multi-arch definition of DECR_PC_AFTER_BREAK" | |
1741 | #endif | |
0f71a2f6 | 1742 | #if GDB_MULTI_ARCH |
6166d547 | 1743 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK) |
0f71a2f6 JM |
1744 | #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch)) |
1745 | #endif | |
1746 | #endif | |
1747 | ||
e02bc4cc DS |
1748 | /* Default (function) for non- multi-arch platforms. */ |
1749 | #if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED) | |
1750 | #define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it)) | |
1751 | #endif | |
1752 | ||
1753 | typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it); | |
1754 | extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it); | |
1755 | extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed); | |
83905903 AC |
1756 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED) |
1757 | #error "Non multi-arch definition of PREPARE_TO_PROCEED" | |
1758 | #endif | |
e02bc4cc DS |
1759 | #if GDB_MULTI_ARCH |
1760 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED) | |
1761 | #define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it)) | |
1762 | #endif | |
1763 | #endif | |
1764 | ||
104c1213 JM |
1765 | extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch); |
1766 | extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset); | |
83905903 AC |
1767 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET) |
1768 | #error "Non multi-arch definition of FUNCTION_START_OFFSET" | |
1769 | #endif | |
0f71a2f6 | 1770 | #if GDB_MULTI_ARCH |
6166d547 | 1771 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET) |
0f71a2f6 JM |
1772 | #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch)) |
1773 | #endif | |
1774 | #endif | |
1775 | ||
33489c5b | 1776 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1777 | #if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
33489c5b AC |
1778 | #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)) |
1779 | #endif | |
1780 | ||
104c1213 JM |
1781 | typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); |
1782 | extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); | |
1783 | extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); | |
83905903 AC |
1784 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
1785 | #error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS" | |
1786 | #endif | |
33489c5b | 1787 | #if GDB_MULTI_ARCH |
6166d547 | 1788 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
0f71a2f6 JM |
1789 | #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)) |
1790 | #endif | |
33489c5b | 1791 | #endif |
0f71a2f6 | 1792 | |
104c1213 JM |
1793 | extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch); |
1794 | extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip); | |
83905903 AC |
1795 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP) |
1796 | #error "Non multi-arch definition of FRAME_ARGS_SKIP" | |
1797 | #endif | |
0f71a2f6 | 1798 | #if GDB_MULTI_ARCH |
6166d547 | 1799 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP) |
0f71a2f6 JM |
1800 | #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch)) |
1801 | #endif | |
1802 | #endif | |
1803 | ||
33489c5b | 1804 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1805 | #if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION) |
33489c5b AC |
1806 | #define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi)) |
1807 | #endif | |
1808 | ||
104c1213 JM |
1809 | typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi); |
1810 | extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi); | |
1811 | extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation); | |
83905903 AC |
1812 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION) |
1813 | #error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION" | |
1814 | #endif | |
33489c5b | 1815 | #if GDB_MULTI_ARCH |
6166d547 | 1816 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION) |
0f71a2f6 JM |
1817 | #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi)) |
1818 | #endif | |
33489c5b | 1819 | #endif |
0f71a2f6 | 1820 | |
104c1213 JM |
1821 | typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame); |
1822 | extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); | |
1823 | extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain); | |
83905903 AC |
1824 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN) |
1825 | #error "Non multi-arch definition of FRAME_CHAIN" | |
1826 | #endif | |
0f71a2f6 | 1827 | #if GDB_MULTI_ARCH |
6166d547 | 1828 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN) |
0f71a2f6 JM |
1829 | #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame)) |
1830 | #endif | |
1831 | #endif | |
1832 | ||
7f55af32 AC |
1833 | /* Define a default FRAME_CHAIN_VALID, in the form that is suitable for |
1834 | most targets. If FRAME_CHAIN_VALID returns zero it means that the | |
1835 | given frame is the outermost one and has no caller. | |
1836 | ||
1837 | XXXX - both default and alternate frame_chain_valid functions are | |
1838 | deprecated. New code should use dummy frames and one of the generic | |
1839 | functions. */ | |
1840 | ||
1841 | /* Default (function) for non- multi-arch platforms. */ | |
1842 | #if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID) | |
1843 | #define FRAME_CHAIN_VALID(chain, thisframe) (func_frame_chain_valid (chain, thisframe)) | |
1844 | #endif | |
028c194b | 1845 | |
104c1213 JM |
1846 | typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); |
1847 | extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); | |
1848 | extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid); | |
7f55af32 | 1849 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID) |
83905903 AC |
1850 | #error "Non multi-arch definition of FRAME_CHAIN_VALID" |
1851 | #endif | |
0f71a2f6 | 1852 | #if GDB_MULTI_ARCH |
7f55af32 | 1853 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID) |
0f71a2f6 JM |
1854 | #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe)) |
1855 | #endif | |
1856 | #endif | |
1857 | ||
104c1213 JM |
1858 | typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi); |
1859 | extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi); | |
1860 | extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc); | |
83905903 AC |
1861 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC) |
1862 | #error "Non multi-arch definition of FRAME_SAVED_PC" | |
1863 | #endif | |
0f71a2f6 | 1864 | #if GDB_MULTI_ARCH |
6166d547 | 1865 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC) |
0f71a2f6 JM |
1866 | #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi)) |
1867 | #endif | |
1868 | #endif | |
1869 | ||
104c1213 JM |
1870 | typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); |
1871 | extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); | |
1872 | extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); | |
83905903 AC |
1873 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS) |
1874 | #error "Non multi-arch definition of FRAME_ARGS_ADDRESS" | |
1875 | #endif | |
0f71a2f6 | 1876 | #if GDB_MULTI_ARCH |
6166d547 | 1877 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS) |
0f71a2f6 JM |
1878 | #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi)) |
1879 | #endif | |
1880 | #endif | |
1881 | ||
104c1213 JM |
1882 | typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); |
1883 | extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); | |
1884 | extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); | |
83905903 AC |
1885 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS) |
1886 | #error "Non multi-arch definition of FRAME_LOCALS_ADDRESS" | |
1887 | #endif | |
0f71a2f6 | 1888 | #if GDB_MULTI_ARCH |
6166d547 | 1889 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS) |
0f71a2f6 JM |
1890 | #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi)) |
1891 | #endif | |
1892 | #endif | |
1893 | ||
104c1213 JM |
1894 | typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) (struct frame_info *frame); |
1895 | extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame); | |
1896 | extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call); | |
83905903 AC |
1897 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVED_PC_AFTER_CALL) |
1898 | #error "Non multi-arch definition of SAVED_PC_AFTER_CALL" | |
1899 | #endif | |
0f71a2f6 | 1900 | #if GDB_MULTI_ARCH |
6166d547 | 1901 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVED_PC_AFTER_CALL) |
0f71a2f6 JM |
1902 | #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame)) |
1903 | #endif | |
1904 | #endif | |
1905 | ||
104c1213 JM |
1906 | typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame); |
1907 | extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame); | |
1908 | extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args); | |
83905903 AC |
1909 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS) |
1910 | #error "Non multi-arch definition of FRAME_NUM_ARGS" | |
1911 | #endif | |
0f71a2f6 | 1912 | #if GDB_MULTI_ARCH |
6166d547 | 1913 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS) |
0f71a2f6 JM |
1914 | #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame)) |
1915 | #endif | |
1916 | #endif | |
1917 | ||
2ada493a AC |
1918 | #if defined (STACK_ALIGN) |
1919 | /* Legacy for systems yet to multi-arch STACK_ALIGN */ | |
eee30e78 | 1920 | #if !defined (STACK_ALIGN_P) |
2ada493a AC |
1921 | #define STACK_ALIGN_P() (1) |
1922 | #endif | |
eee30e78 | 1923 | #endif |
2ada493a | 1924 | |
33489c5b | 1925 | /* Default predicate for non- multi-arch targets. */ |
6166d547 | 1926 | #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P) |
33489c5b AC |
1927 | #define STACK_ALIGN_P() (0) |
1928 | #endif | |
1929 | ||
2ada493a | 1930 | extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); |
83905903 AC |
1931 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P) |
1932 | #error "Non multi-arch definition of STACK_ALIGN" | |
1933 | #endif | |
6166d547 | 1934 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P) |
2ada493a AC |
1935 | #define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch)) |
1936 | #endif | |
1937 | ||
33489c5b | 1938 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1939 | #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN) |
8e65ff28 | 1940 | #define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0) |
33489c5b AC |
1941 | #endif |
1942 | ||
2ada493a AC |
1943 | typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp); |
1944 | extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp); | |
1945 | extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align); | |
83905903 AC |
1946 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN) |
1947 | #error "Non multi-arch definition of STACK_ALIGN" | |
1948 | #endif | |
33489c5b | 1949 | #if GDB_MULTI_ARCH |
6166d547 | 1950 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN) |
2ada493a AC |
1951 | #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp)) |
1952 | #endif | |
33489c5b | 1953 | #endif |
2ada493a | 1954 | |
0a49d05e AC |
1955 | /* Default (value) for non- multi-arch platforms. */ |
1956 | #if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED) | |
1957 | #define EXTRA_STACK_ALIGNMENT_NEEDED (1) | |
1958 | #endif | |
1959 | ||
1960 | extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch); | |
1961 | extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed); | |
83905903 AC |
1962 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED) |
1963 | #error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED" | |
1964 | #endif | |
0a49d05e AC |
1965 | #if GDB_MULTI_ARCH |
1966 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED) | |
1967 | #define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch)) | |
1968 | #endif | |
1969 | #endif | |
1970 | ||
d03e67c9 AC |
1971 | #if defined (REG_STRUCT_HAS_ADDR) |
1972 | /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */ | |
eee30e78 | 1973 | #if !defined (REG_STRUCT_HAS_ADDR_P) |
d03e67c9 AC |
1974 | #define REG_STRUCT_HAS_ADDR_P() (1) |
1975 | #endif | |
eee30e78 | 1976 | #endif |
d03e67c9 | 1977 | |
33489c5b | 1978 | /* Default predicate for non- multi-arch targets. */ |
6166d547 | 1979 | #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P) |
33489c5b AC |
1980 | #define REG_STRUCT_HAS_ADDR_P() (0) |
1981 | #endif | |
1982 | ||
d03e67c9 | 1983 | extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); |
83905903 AC |
1984 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P) |
1985 | #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" | |
1986 | #endif | |
6166d547 | 1987 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P) |
d03e67c9 AC |
1988 | #define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch)) |
1989 | #endif | |
1990 | ||
33489c5b | 1991 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1992 | #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR) |
8e65ff28 | 1993 | #define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0) |
33489c5b AC |
1994 | #endif |
1995 | ||
d03e67c9 AC |
1996 | typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); |
1997 | extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type); | |
1998 | extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr); | |
83905903 AC |
1999 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR) |
2000 | #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" | |
2001 | #endif | |
33489c5b | 2002 | #if GDB_MULTI_ARCH |
6166d547 | 2003 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR) |
d03e67c9 AC |
2004 | #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type)) |
2005 | #endif | |
33489c5b | 2006 | #endif |
d03e67c9 | 2007 | |
d1e3cf49 AC |
2008 | #if defined (SAVE_DUMMY_FRAME_TOS) |
2009 | /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */ | |
eee30e78 | 2010 | #if !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
2011 | #define SAVE_DUMMY_FRAME_TOS_P() (1) |
2012 | #endif | |
eee30e78 | 2013 | #endif |
d1e3cf49 AC |
2014 | |
2015 | /* Default predicate for non- multi-arch targets. */ | |
6166d547 | 2016 | #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
2017 | #define SAVE_DUMMY_FRAME_TOS_P() (0) |
2018 | #endif | |
2019 | ||
2020 | extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); | |
83905903 AC |
2021 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P) |
2022 | #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" | |
2023 | #endif | |
6166d547 | 2024 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
2025 | #define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch)) |
2026 | #endif | |
2027 | ||
2028 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 2029 | #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS) |
8e65ff28 | 2030 | #define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0) |
d1e3cf49 AC |
2031 | #endif |
2032 | ||
2033 | typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); | |
2034 | extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); | |
2035 | extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos); | |
83905903 AC |
2036 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS) |
2037 | #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" | |
2038 | #endif | |
d1e3cf49 | 2039 | #if GDB_MULTI_ARCH |
6166d547 | 2040 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS) |
d1e3cf49 AC |
2041 | #define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp)) |
2042 | #endif | |
2043 | #endif | |
2044 | ||
58d5518e ND |
2045 | extern int gdbarch_parm_boundary (struct gdbarch *gdbarch); |
2046 | extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary); | |
83905903 AC |
2047 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY) |
2048 | #error "Non multi-arch definition of PARM_BOUNDARY" | |
2049 | #endif | |
58d5518e ND |
2050 | #if GDB_MULTI_ARCH |
2051 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY) | |
2052 | #define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch)) | |
2053 | #endif | |
2054 | #endif | |
2055 | ||
f0d4cc9e | 2056 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 2057 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT) |
f0d4cc9e AC |
2058 | #define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch)) |
2059 | #endif | |
2060 | ||
2061 | extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch); | |
2062 | extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format); | |
83905903 AC |
2063 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT) |
2064 | #error "Non multi-arch definition of TARGET_FLOAT_FORMAT" | |
2065 | #endif | |
f0d4cc9e | 2066 | #if GDB_MULTI_ARCH |
6166d547 | 2067 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT) |
f0d4cc9e AC |
2068 | #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) |
2069 | #endif | |
2070 | #endif | |
2071 | ||
2072 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 2073 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT) |
f0d4cc9e AC |
2074 | #define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch)) |
2075 | #endif | |
2076 | ||
2077 | extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch); | |
2078 | extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format); | |
83905903 AC |
2079 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT) |
2080 | #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT" | |
2081 | #endif | |
f0d4cc9e | 2082 | #if GDB_MULTI_ARCH |
6166d547 | 2083 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT) |
f0d4cc9e AC |
2084 | #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) |
2085 | #endif | |
2086 | #endif | |
2087 | ||
2088 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 2089 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT) |
2fa5c1e0 | 2090 | #define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch)) |
f0d4cc9e AC |
2091 | #endif |
2092 | ||
2093 | extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch); | |
2094 | extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format); | |
83905903 AC |
2095 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT) |
2096 | #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT" | |
2097 | #endif | |
f0d4cc9e | 2098 | #if GDB_MULTI_ARCH |
6166d547 | 2099 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT) |
f0d4cc9e AC |
2100 | #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) |
2101 | #endif | |
2102 | #endif | |
2103 | ||
f517ea4e PS |
2104 | /* Default (function) for non- multi-arch platforms. */ |
2105 | #if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR) | |
875e1767 | 2106 | #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr)) |
f517ea4e PS |
2107 | #endif |
2108 | ||
2109 | typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr); | |
2110 | extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2111 | 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 |
2112 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR) |
2113 | #error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR" | |
2114 | #endif | |
f517ea4e PS |
2115 | #if GDB_MULTI_ARCH |
2116 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR) | |
2117 | #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr)) | |
2118 | #endif | |
2119 | #endif | |
2120 | ||
875e1767 AC |
2121 | /* On some machines there are bits in addresses which are not really |
2122 | part of the address, but are used by the kernel, the hardware, etc. | |
2123 | for special purposes. ADDR_BITS_REMOVE takes out any such bits so | |
2124 | we get a "real" address such as one would find in a symbol table. | |
2125 | This is used only for addresses of instructions, and even then I'm | |
2126 | not sure it's used in all contexts. It exists to deal with there | |
2127 | being a few stray bits in the PC which would mislead us, not as some | |
2128 | sort of generic thing to handle alignment or segmentation (it's | |
2129 | possible it should be in TARGET_READ_PC instead). */ | |
2130 | ||
2131 | /* Default (function) for non- multi-arch platforms. */ | |
2132 | #if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE) | |
2133 | #define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr)) | |
2134 | #endif | |
2135 | ||
2136 | typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr); | |
2137 | extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2138 | extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove); | |
83905903 AC |
2139 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE) |
2140 | #error "Non multi-arch definition of ADDR_BITS_REMOVE" | |
2141 | #endif | |
875e1767 AC |
2142 | #if GDB_MULTI_ARCH |
2143 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE) | |
2144 | #define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr)) | |
2145 | #endif | |
2146 | #endif | |
2147 | ||
181c1381 RE |
2148 | /* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into |
2149 | ADDR_BITS_REMOVE. */ | |
2150 | ||
2151 | /* Default (function) for non- multi-arch platforms. */ | |
2152 | #if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS) | |
2153 | #define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr)) | |
2154 | #endif | |
2155 | ||
2156 | typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr); | |
2157 | extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2158 | extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address); | |
2159 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS) | |
2160 | #error "Non multi-arch definition of SMASH_TEXT_ADDRESS" | |
2161 | #endif | |
2162 | #if GDB_MULTI_ARCH | |
2163 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS) | |
2164 | #define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr)) | |
2165 | #endif | |
2166 | #endif | |
2167 | ||
64c4637f AC |
2168 | /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if |
2169 | the target needs software single step. An ISA method to implement it. | |
2170 | ||
2171 | FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints | |
2172 | using the breakpoint system instead of blatting memory directly (as with rs6000). | |
2173 | ||
2174 | FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can | |
2175 | single step. If not, then implement single step using breakpoints. */ | |
2176 | ||
2177 | #if defined (SOFTWARE_SINGLE_STEP) | |
2178 | /* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */ | |
2179 | #if !defined (SOFTWARE_SINGLE_STEP_P) | |
2180 | #define SOFTWARE_SINGLE_STEP_P() (1) | |
2181 | #endif | |
2182 | #endif | |
2183 | ||
2184 | /* Default predicate for non- multi-arch targets. */ | |
2185 | #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P) | |
2186 | #define SOFTWARE_SINGLE_STEP_P() (0) | |
2187 | #endif | |
2188 | ||
2189 | extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch); | |
83905903 AC |
2190 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P) |
2191 | #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" | |
2192 | #endif | |
64c4637f AC |
2193 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P) |
2194 | #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch)) | |
2195 | #endif | |
2196 | ||
2197 | /* Default (function) for non- multi-arch platforms. */ | |
2198 | #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP) | |
2199 | #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0) | |
2200 | #endif | |
2201 | ||
2202 | typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p); | |
2203 | extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p); | |
2204 | extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step); | |
83905903 AC |
2205 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP) |
2206 | #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" | |
2207 | #endif | |
64c4637f AC |
2208 | #if GDB_MULTI_ARCH |
2209 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP) | |
2210 | #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p)) | |
2211 | #endif | |
2212 | #endif | |
2213 | ||
2bf0cb65 EZ |
2214 | /* Default (function) for non- multi-arch platforms. */ |
2215 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN) | |
2216 | #define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info)) | |
2217 | #endif | |
2218 | ||
2219 | typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info); | |
2220 | extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info); | |
2221 | extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn); | |
2222 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN) | |
2223 | #error "Non multi-arch definition of TARGET_PRINT_INSN" | |
2224 | #endif | |
2225 | #if GDB_MULTI_ARCH | |
2226 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN) | |
2227 | #define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info)) | |
2228 | #endif | |
2229 | #endif | |
2230 | ||
bdcd319a CV |
2231 | /* Default (function) for non- multi-arch platforms. */ |
2232 | #if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE) | |
2233 | #define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc)) | |
2234 | #endif | |
2235 | ||
2236 | typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc); | |
2237 | extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc); | |
2238 | extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code); | |
2239 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE) | |
2240 | #error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE" | |
2241 | #endif | |
2242 | #if GDB_MULTI_ARCH | |
2243 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE) | |
2244 | #define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc)) | |
2245 | #endif | |
2246 | #endif | |
2247 | ||
68e9cc94 CV |
2248 | /* For SVR4 shared libraries, each call goes through a small piece of |
2249 | trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates | |
2250 | to nonzero if we are current stopped in one of these. */ | |
2251 | ||
2252 | /* Default (function) for non- multi-arch platforms. */ | |
2253 | #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE) | |
2254 | #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name)) | |
2255 | #endif | |
2256 | ||
2257 | typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name); | |
2258 | extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); | |
2259 | extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline); | |
2260 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE) | |
2261 | #error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE" | |
2262 | #endif | |
2263 | #if GDB_MULTI_ARCH | |
2264 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE) | |
2265 | #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name)) | |
2266 | #endif | |
2267 | #endif | |
2268 | ||
c12260ac CV |
2269 | /* A target might have problems with watchpoints as soon as the stack |
2270 | frame of the current function has been destroyed. This mostly happens | |
2271 | as the first action in a funtion's epilogue. in_function_epilogue_p() | |
2272 | is defined to return a non-zero value if either the given addr is one | |
2273 | instruction after the stack destroying instruction up to the trailing | |
2274 | return instruction or if we can figure out that the stack frame has | |
2275 | already been invalidated regardless of the value of addr. Targets | |
2276 | which don't suffer from that problem could just let this functionality | |
2277 | untouched. */ | |
2278 | ||
2279 | typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2280 | extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr); | |
2281 | extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p); | |
2282 | ||
552c04a7 TT |
2283 | /* Given a vector of command-line arguments, return a newly allocated |
2284 | string which, when passed to the create_inferior function, will be | |
2285 | parsed (on Unix systems, by the shell) to yield the same vector. | |
2286 | This function should call error() if the argument vector is not | |
2287 | representable for this target or if this target does not support | |
2288 | command-line arguments. | |
2289 | ARGC is the number of elements in the vector. | |
2290 | ARGV is an array of strings, one per argument. */ | |
2291 | ||
2292 | typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv); | |
2293 | extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv); | |
2294 | extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments); | |
2295 | ||
b6af0555 JS |
2296 | #if defined (DWARF2_BUILD_FRAME_INFO) |
2297 | /* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */ | |
2298 | #if !defined (DWARF2_BUILD_FRAME_INFO_P) | |
2299 | #define DWARF2_BUILD_FRAME_INFO_P() (1) | |
2300 | #endif | |
2301 | #endif | |
2302 | ||
2303 | /* Default predicate for non- multi-arch targets. */ | |
2304 | #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P) | |
2305 | #define DWARF2_BUILD_FRAME_INFO_P() (0) | |
2306 | #endif | |
2307 | ||
2308 | extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch); | |
2309 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P) | |
2310 | #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO" | |
2311 | #endif | |
2312 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P) | |
2313 | #define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch)) | |
2314 | #endif | |
2315 | ||
2316 | /* Default (function) for non- multi-arch platforms. */ | |
2317 | #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO) | |
2318 | #define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0) | |
2319 | #endif | |
2320 | ||
2321 | typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile); | |
2322 | extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile); | |
2323 | extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info); | |
2324 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO) | |
2325 | #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO" | |
2326 | #endif | |
2327 | #if GDB_MULTI_ARCH | |
2328 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO) | |
2329 | #define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile)) | |
2330 | #endif | |
2331 | #endif | |
2332 | ||
a2cf933a EZ |
2333 | /* Default (function) for non- multi-arch platforms. */ |
2334 | #if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL) | |
2335 | #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym)) | |
2336 | #endif | |
2337 | ||
2338 | typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym); | |
2339 | extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym); | |
2340 | extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special); | |
2341 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL) | |
2342 | #error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL" | |
2343 | #endif | |
2344 | #if GDB_MULTI_ARCH | |
2345 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL) | |
2346 | #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym)) | |
2347 | #endif | |
2348 | #endif | |
2349 | ||
2350 | /* Default (function) for non- multi-arch platforms. */ | |
2351 | #if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL) | |
2352 | #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym)) | |
2353 | #endif | |
2354 | ||
2355 | typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym); | |
2356 | extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym); | |
2357 | extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special); | |
2358 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL) | |
2359 | #error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL" | |
2360 | #endif | |
2361 | #if GDB_MULTI_ARCH | |
2362 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL) | |
2363 | #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym)) | |
2364 | #endif | |
2365 | #endif | |
2366 | ||
104c1213 | 2367 | extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); |
0f71a2f6 JM |
2368 | |
2369 | ||
2370 | /* Mechanism for co-ordinating the selection of a specific | |
2371 | architecture. | |
2372 | ||
2373 | GDB targets (*-tdep.c) can register an interest in a specific | |
2374 | architecture. Other GDB components can register a need to maintain | |
2375 | per-architecture data. | |
2376 | ||
2377 | The mechanisms below ensures that there is only a loose connection | |
2378 | between the set-architecture command and the various GDB | |
99e7bb18 | 2379 | components. Each component can independently register their need |
0f71a2f6 JM |
2380 | to maintain architecture specific data with gdbarch. |
2381 | ||
2382 | Pragmatics: | |
2383 | ||
2384 | Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It | |
2385 | didn't scale. | |
2386 | ||
2387 | The more traditional mega-struct containing architecture specific | |
2388 | data for all the various GDB components was also considered. Since | |
99e7bb18 | 2389 | GDB is built from a variable number of (fairly independent) |
0f71a2f6 JM |
2390 | components it was determined that the global aproach was not |
2391 | applicable. */ | |
2392 | ||
2393 | ||
2394 | /* Register a new architectural family with GDB. | |
2395 | ||
2396 | Register support for the specified ARCHITECTURE with GDB. When | |
2397 | gdbarch determines that the specified architecture has been | |
2398 | selected, the corresponding INIT function is called. | |
2399 | ||
2400 | -- | |
2401 | ||
2402 | The INIT function takes two parameters: INFO which contains the | |
2403 | information available to gdbarch about the (possibly new) | |
2404 | architecture; ARCHES which is a list of the previously created | |
2405 | ``struct gdbarch'' for this architecture. | |
2406 | ||
2407 | The INIT function parameter INFO shall, as far as possible, be | |
2408 | pre-initialized with information obtained from INFO.ABFD or | |
428721aa | 2409 | previously selected architecture (if similar). |
0f71a2f6 JM |
2410 | |
2411 | The INIT function shall return any of: NULL - indicating that it | |
ec3d358c | 2412 | doesn't recognize the selected architecture; an existing ``struct |
0f71a2f6 JM |
2413 | gdbarch'' from the ARCHES list - indicating that the new |
2414 | architecture is just a synonym for an earlier architecture (see | |
2415 | gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch'' | |
4b9b3959 AC |
2416 | - that describes the selected architecture (see gdbarch_alloc()). |
2417 | ||
2418 | The DUMP_TDEP function shall print out all target specific values. | |
2419 | Care should be taken to ensure that the function works in both the | |
2420 | multi-arch and non- multi-arch cases. */ | |
0f71a2f6 | 2421 | |
adf40b2e JM |
2422 | struct gdbarch_list |
2423 | { | |
2424 | struct gdbarch *gdbarch; | |
2425 | struct gdbarch_list *next; | |
2426 | }; | |
0f71a2f6 | 2427 | |
adf40b2e JM |
2428 | struct gdbarch_info |
2429 | { | |
adf40b2e JM |
2430 | /* Use default: NULL (ZERO). */ |
2431 | const struct bfd_arch_info *bfd_arch_info; | |
0f71a2f6 | 2432 | |
428721aa | 2433 | /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */ |
adf40b2e | 2434 | int byte_order; |
0f71a2f6 | 2435 | |
adf40b2e JM |
2436 | /* Use default: NULL (ZERO). */ |
2437 | bfd *abfd; | |
0f71a2f6 | 2438 | |
adf40b2e JM |
2439 | /* Use default: NULL (ZERO). */ |
2440 | struct gdbarch_tdep_info *tdep_info; | |
2441 | }; | |
0f71a2f6 | 2442 | |
104c1213 | 2443 | typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches); |
4b9b3959 | 2444 | typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file); |
0f71a2f6 | 2445 | |
4b9b3959 | 2446 | /* DEPRECATED - use gdbarch_register() */ |
104c1213 | 2447 | extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *); |
0f71a2f6 | 2448 | |
4b9b3959 AC |
2449 | extern void gdbarch_register (enum bfd_architecture architecture, |
2450 | gdbarch_init_ftype *, | |
2451 | gdbarch_dump_tdep_ftype *); | |
2452 | ||
0f71a2f6 | 2453 | |
b4a20239 AC |
2454 | /* Return a freshly allocated, NULL terminated, array of the valid |
2455 | architecture names. Since architectures are registered during the | |
2456 | _initialize phase this function only returns useful information | |
2457 | once initialization has been completed. */ | |
2458 | ||
2459 | extern const char **gdbarch_printable_names (void); | |
2460 | ||
2461 | ||
0f71a2f6 JM |
2462 | /* Helper function. Search the list of ARCHES for a GDBARCH that |
2463 | matches the information provided by INFO. */ | |
2464 | ||
104c1213 | 2465 | extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info); |
0f71a2f6 JM |
2466 | |
2467 | ||
2468 | /* Helper function. Create a preliminary ``struct gdbarch''. Perform | |
2469 | basic initialization using values obtained from the INFO andTDEP | |
2470 | parameters. set_gdbarch_*() functions are called to complete the | |
2471 | initialization of the object. */ | |
2472 | ||
104c1213 | 2473 | extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep); |
0f71a2f6 JM |
2474 | |
2475 | ||
4b9b3959 AC |
2476 | /* Helper function. Free a partially-constructed ``struct gdbarch''. |
2477 | It is assumed that the caller freeds the ``struct | |
2478 | gdbarch_tdep''. */ | |
2479 | ||
058f20d5 JB |
2480 | extern void gdbarch_free (struct gdbarch *); |
2481 | ||
2482 | ||
b732d07d | 2483 | /* Helper function. Force an update of the current architecture. |
0f71a2f6 | 2484 | |
b732d07d AC |
2485 | The actual architecture selected is determined by INFO, ``(gdb) set |
2486 | architecture'' et.al., the existing architecture and BFD's default | |
2487 | architecture. INFO should be initialized to zero and then selected | |
2488 | fields should be updated. | |
0f71a2f6 | 2489 | |
16f33e29 AC |
2490 | Returns non-zero if the update succeeds */ |
2491 | ||
2492 | extern int gdbarch_update_p (struct gdbarch_info info); | |
0f71a2f6 JM |
2493 | |
2494 | ||
2495 | ||
2496 | /* Register per-architecture data-pointer. | |
2497 | ||
2498 | Reserve space for a per-architecture data-pointer. An identifier | |
2499 | for the reserved data-pointer is returned. That identifer should | |
95160752 | 2500 | be saved in a local static variable. |
0f71a2f6 | 2501 | |
95160752 AC |
2502 | The per-architecture data-pointer can be initialized in one of two |
2503 | ways: The value can be set explicitly using a call to | |
2504 | set_gdbarch_data(); the value can be set implicitly using the value | |
2505 | returned by a non-NULL INIT() callback. INIT(), when non-NULL is | |
2506 | called after the basic architecture vector has been created. | |
0f71a2f6 | 2507 | |
95160752 AC |
2508 | When a previously created architecture is re-selected, the |
2509 | per-architecture data-pointer for that previous architecture is | |
2510 | restored. INIT() is not called. | |
2511 | ||
2512 | During initialization, multiple assignments of the data-pointer are | |
2513 | allowed, non-NULL values are deleted by calling FREE(). If the | |
2514 | architecture is deleted using gdbarch_free() all non-NULL data | |
2515 | pointers are also deleted using FREE(). | |
0f71a2f6 JM |
2516 | |
2517 | Multiple registrarants for any architecture are allowed (and | |
2518 | strongly encouraged). */ | |
2519 | ||
95160752 | 2520 | struct gdbarch_data; |
0f71a2f6 | 2521 | |
95160752 AC |
2522 | typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch); |
2523 | typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch, | |
2524 | void *pointer); | |
2525 | extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init, | |
2526 | gdbarch_data_free_ftype *free); | |
2527 | extern void set_gdbarch_data (struct gdbarch *gdbarch, | |
2528 | struct gdbarch_data *data, | |
2529 | void *pointer); | |
0f71a2f6 | 2530 | |
104c1213 | 2531 | extern void *gdbarch_data (struct gdbarch_data*); |
0f71a2f6 JM |
2532 | |
2533 | ||
0f71a2f6 JM |
2534 | /* Register per-architecture memory region. |
2535 | ||
2536 | Provide a memory-region swap mechanism. Per-architecture memory | |
2537 | region are created. These memory regions are swapped whenever the | |
2538 | architecture is changed. For a new architecture, the memory region | |
2539 | is initialized with zero (0) and the INIT function is called. | |
2540 | ||
2541 | Memory regions are swapped / initialized in the order that they are | |
2542 | registered. NULL DATA and/or INIT values can be specified. | |
2543 | ||
2544 | New code should use register_gdbarch_data(). */ | |
2545 | ||
104c1213 JM |
2546 | typedef void (gdbarch_swap_ftype) (void); |
2547 | extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init); | |
e514a9d6 | 2548 | #define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL) |
0f71a2f6 JM |
2549 | |
2550 | ||
2551 | ||
99e7bb18 | 2552 | /* The target-system-dependent byte order is dynamic */ |
c906108c | 2553 | |
adf40b2e | 2554 | extern int target_byte_order; |
c906108c SS |
2555 | #ifndef TARGET_BYTE_ORDER |
2556 | #define TARGET_BYTE_ORDER (target_byte_order + 0) | |
2557 | #endif | |
2558 | ||
adf40b2e | 2559 | extern int target_byte_order_auto; |
c906108c SS |
2560 | #ifndef TARGET_BYTE_ORDER_AUTO |
2561 | #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0) | |
2562 | #endif | |
2563 | ||
2564 | ||
2565 | ||
99e7bb18 | 2566 | /* The target-system-dependent BFD architecture is dynamic */ |
c906108c | 2567 | |
adf40b2e | 2568 | extern int target_architecture_auto; |
c906108c SS |
2569 | #ifndef TARGET_ARCHITECTURE_AUTO |
2570 | #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0) | |
2571 | #endif | |
2572 | ||
adf40b2e | 2573 | extern const struct bfd_arch_info *target_architecture; |
c906108c SS |
2574 | #ifndef TARGET_ARCHITECTURE |
2575 | #define TARGET_ARCHITECTURE (target_architecture + 0) | |
2576 | #endif | |
2577 | ||
c906108c | 2578 | |
99e7bb18 | 2579 | /* The target-system-dependent disassembler is semi-dynamic */ |
c906108c | 2580 | |
104c1213 | 2581 | extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, |
ff844c8d | 2582 | unsigned int len, disassemble_info *info); |
c906108c | 2583 | |
104c1213 JM |
2584 | extern void dis_asm_memory_error (int status, bfd_vma memaddr, |
2585 | disassemble_info *info); | |
c906108c | 2586 | |
104c1213 JM |
2587 | extern void dis_asm_print_address (bfd_vma addr, |
2588 | disassemble_info *info); | |
c906108c | 2589 | |
104c1213 | 2590 | extern int (*tm_print_insn) (bfd_vma, disassemble_info*); |
adf40b2e | 2591 | extern disassemble_info tm_print_insn_info; |
c906108c SS |
2592 | #ifndef TARGET_PRINT_INSN_INFO |
2593 | #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info) | |
2594 | #endif | |
2595 | ||
2596 | ||
2597 | ||
99e7bb18 | 2598 | /* Set the dynamic target-system-dependent parameters (architecture, |
c906108c SS |
2599 | byte-order, ...) using information found in the BFD */ |
2600 | ||
104c1213 | 2601 | extern void set_gdbarch_from_file (bfd *); |
c906108c SS |
2602 | |
2603 | ||
e514a9d6 JM |
2604 | /* Initialize the current architecture to the "first" one we find on |
2605 | our list. */ | |
2606 | ||
2607 | extern void initialize_current_architecture (void); | |
2608 | ||
ceaa8edf JB |
2609 | /* For non-multiarched targets, do any initialization of the default |
2610 | gdbarch object necessary after the _initialize_MODULE functions | |
2611 | have run. */ | |
2612 | extern void initialize_non_multiarch (); | |
cce74817 | 2613 | |
c906108c | 2614 | /* gdbarch trace variable */ |
adf40b2e | 2615 | extern int gdbarch_debug; |
c906108c | 2616 | |
4b9b3959 | 2617 | extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file); |
0f71a2f6 | 2618 | |
c906108c | 2619 | #endif |