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