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