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