]>
Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
b83266a0 | 4 | Copyright 1998-1999, 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 | ||
25 | The bourn shell script ``gdbarch.sh'' creates the files | |
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 | |
31 | changes into that script. Conversely, when makeing sweeping changes | |
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 | ||
60 | ||
61 | /* The following are pre-initialized by GDBARCH. */ | |
62 | ||
104c1213 | 63 | extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch); |
0f71a2f6 JM |
64 | /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */ |
65 | #if GDB_MULTI_ARCH | |
6166d547 | 66 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE) |
0f71a2f6 JM |
67 | #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch)) |
68 | #endif | |
69 | #endif | |
70 | ||
104c1213 | 71 | extern int gdbarch_byte_order (struct gdbarch *gdbarch); |
0f71a2f6 JM |
72 | /* set_gdbarch_byte_order() - not applicable - pre-initialized. */ |
73 | #if GDB_MULTI_ARCH | |
6166d547 | 74 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER) |
0f71a2f6 JM |
75 | #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch)) |
76 | #endif | |
77 | #endif | |
78 | ||
79 | ||
80 | /* The following are initialized by the target dependant code. */ | |
81 | ||
33489c5b | 82 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 83 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT) |
33489c5b AC |
84 | #define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address) |
85 | #endif | |
86 | ||
c4093a6a JM |
87 | extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch); |
88 | extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); | |
33489c5b | 89 | #if GDB_MULTI_ARCH |
6166d547 | 90 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT) |
c4093a6a JM |
91 | #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch)) |
92 | #endif | |
33489c5b | 93 | #endif |
c4093a6a | 94 | |
104c1213 JM |
95 | extern int gdbarch_ptr_bit (struct gdbarch *gdbarch); |
96 | extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); | |
0f71a2f6 | 97 | #if GDB_MULTI_ARCH |
6166d547 | 98 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT) |
0f71a2f6 JM |
99 | #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch)) |
100 | #endif | |
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); | |
0f71a2f6 | 105 | #if GDB_MULTI_ARCH |
6166d547 | 106 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT) |
0f71a2f6 JM |
107 | #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch)) |
108 | #endif | |
109 | #endif | |
110 | ||
104c1213 JM |
111 | extern int gdbarch_int_bit (struct gdbarch *gdbarch); |
112 | extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); | |
0f71a2f6 | 113 | #if GDB_MULTI_ARCH |
6166d547 | 114 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT) |
0f71a2f6 JM |
115 | #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch)) |
116 | #endif | |
117 | #endif | |
118 | ||
104c1213 JM |
119 | extern int gdbarch_long_bit (struct gdbarch *gdbarch); |
120 | extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); | |
0f71a2f6 | 121 | #if GDB_MULTI_ARCH |
6166d547 | 122 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT) |
0f71a2f6 JM |
123 | #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch)) |
124 | #endif | |
125 | #endif | |
126 | ||
104c1213 JM |
127 | extern int gdbarch_long_long_bit (struct gdbarch *gdbarch); |
128 | extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit); | |
0f71a2f6 | 129 | #if GDB_MULTI_ARCH |
6166d547 | 130 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT) |
0f71a2f6 JM |
131 | #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch)) |
132 | #endif | |
133 | #endif | |
134 | ||
104c1213 JM |
135 | extern int gdbarch_float_bit (struct gdbarch *gdbarch); |
136 | extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); | |
0f71a2f6 | 137 | #if GDB_MULTI_ARCH |
6166d547 | 138 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT) |
0f71a2f6 JM |
139 | #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) |
140 | #endif | |
141 | #endif | |
142 | ||
104c1213 JM |
143 | extern int gdbarch_double_bit (struct gdbarch *gdbarch); |
144 | extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); | |
0f71a2f6 | 145 | #if GDB_MULTI_ARCH |
6166d547 | 146 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT) |
0f71a2f6 JM |
147 | #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) |
148 | #endif | |
149 | #endif | |
150 | ||
104c1213 JM |
151 | extern int gdbarch_long_double_bit (struct gdbarch *gdbarch); |
152 | extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit); | |
0f71a2f6 | 153 | #if GDB_MULTI_ARCH |
6166d547 | 154 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT) |
0f71a2f6 JM |
155 | #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) |
156 | #endif | |
157 | #endif | |
158 | ||
33489c5b | 159 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 160 | #if (!GDB_MULTI_ARCH) && !defined (IEEE_FLOAT) |
33489c5b AC |
161 | #define IEEE_FLOAT (0) |
162 | #endif | |
163 | ||
7355ddba JB |
164 | extern int gdbarch_ieee_float (struct gdbarch *gdbarch); |
165 | extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float); | |
33489c5b | 166 | #if GDB_MULTI_ARCH |
6166d547 | 167 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IEEE_FLOAT) |
7355ddba JB |
168 | #define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch)) |
169 | #endif | |
33489c5b | 170 | #endif |
7355ddba | 171 | |
104c1213 JM |
172 | typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid); |
173 | extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid); | |
174 | extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); | |
0f71a2f6 | 175 | #if GDB_MULTI_ARCH |
6166d547 | 176 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC) |
0f71a2f6 JM |
177 | #define TARGET_READ_PC(pid) (gdbarch_read_pc (current_gdbarch, pid)) |
178 | #endif | |
179 | #endif | |
180 | ||
104c1213 JM |
181 | typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, int pid); |
182 | extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid); | |
183 | extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc); | |
0f71a2f6 | 184 | #if GDB_MULTI_ARCH |
6166d547 | 185 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC) |
0f71a2f6 JM |
186 | #define TARGET_WRITE_PC(val, pid) (gdbarch_write_pc (current_gdbarch, val, pid)) |
187 | #endif | |
188 | #endif | |
189 | ||
104c1213 JM |
190 | typedef CORE_ADDR (gdbarch_read_fp_ftype) (void); |
191 | extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch); | |
192 | extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp); | |
0f71a2f6 | 193 | #if GDB_MULTI_ARCH |
6166d547 | 194 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP) |
0f71a2f6 JM |
195 | #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch)) |
196 | #endif | |
197 | #endif | |
198 | ||
104c1213 JM |
199 | typedef void (gdbarch_write_fp_ftype) (CORE_ADDR val); |
200 | extern void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val); | |
201 | extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp); | |
0f71a2f6 | 202 | #if GDB_MULTI_ARCH |
6166d547 | 203 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_FP) |
0f71a2f6 JM |
204 | #define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val)) |
205 | #endif | |
206 | #endif | |
207 | ||
104c1213 JM |
208 | typedef CORE_ADDR (gdbarch_read_sp_ftype) (void); |
209 | extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch); | |
210 | extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp); | |
0f71a2f6 | 211 | #if GDB_MULTI_ARCH |
6166d547 | 212 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP) |
0f71a2f6 JM |
213 | #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch)) |
214 | #endif | |
215 | #endif | |
216 | ||
104c1213 JM |
217 | typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val); |
218 | extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); | |
219 | extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp); | |
0f71a2f6 | 220 | #if GDB_MULTI_ARCH |
6166d547 | 221 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP) |
0f71a2f6 JM |
222 | #define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val)) |
223 | #endif | |
224 | #endif | |
225 | ||
104c1213 JM |
226 | extern int gdbarch_num_regs (struct gdbarch *gdbarch); |
227 | extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); | |
0f71a2f6 | 228 | #if GDB_MULTI_ARCH |
6166d547 | 229 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS) |
0f71a2f6 JM |
230 | #define NUM_REGS (gdbarch_num_regs (current_gdbarch)) |
231 | #endif | |
232 | #endif | |
233 | ||
0aba1244 | 234 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 235 | #if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS) |
0aba1244 EZ |
236 | #define NUM_PSEUDO_REGS (0) |
237 | #endif | |
238 | ||
239 | extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch); | |
240 | extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs); | |
241 | #if GDB_MULTI_ARCH | |
6166d547 | 242 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS) |
0aba1244 EZ |
243 | #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) |
244 | #endif | |
245 | #endif | |
246 | ||
104c1213 JM |
247 | extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); |
248 | extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); | |
0f71a2f6 | 249 | #if GDB_MULTI_ARCH |
6166d547 | 250 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM) |
0f71a2f6 JM |
251 | #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch)) |
252 | #endif | |
253 | #endif | |
254 | ||
104c1213 JM |
255 | extern int gdbarch_fp_regnum (struct gdbarch *gdbarch); |
256 | extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); | |
0f71a2f6 | 257 | #if GDB_MULTI_ARCH |
6166d547 | 258 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM) |
0f71a2f6 JM |
259 | #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch)) |
260 | #endif | |
261 | #endif | |
262 | ||
104c1213 JM |
263 | extern int gdbarch_pc_regnum (struct gdbarch *gdbarch); |
264 | extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); | |
0f71a2f6 | 265 | #if GDB_MULTI_ARCH |
6166d547 | 266 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM) |
0f71a2f6 JM |
267 | #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) |
268 | #endif | |
269 | #endif | |
270 | ||
60054393 | 271 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 272 | #if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM) |
60054393 MS |
273 | #define FP0_REGNUM (-1) |
274 | #endif | |
275 | ||
276 | extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch); | |
277 | extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); | |
278 | #if GDB_MULTI_ARCH | |
6166d547 | 279 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM) |
60054393 MS |
280 | #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch)) |
281 | #endif | |
282 | #endif | |
283 | ||
03863182 | 284 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 285 | #if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM) |
03863182 AC |
286 | #define NPC_REGNUM (-1) |
287 | #endif | |
288 | ||
289 | extern int gdbarch_npc_regnum (struct gdbarch *gdbarch); | |
290 | extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); | |
291 | #if GDB_MULTI_ARCH | |
6166d547 | 292 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM) |
03863182 AC |
293 | #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch)) |
294 | #endif | |
295 | #endif | |
296 | ||
297 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 298 | #if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM) |
03863182 AC |
299 | #define NNPC_REGNUM (-1) |
300 | #endif | |
301 | ||
302 | extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch); | |
303 | extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum); | |
304 | #if GDB_MULTI_ARCH | |
6166d547 | 305 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM) |
03863182 AC |
306 | #define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch)) |
307 | #endif | |
308 | #endif | |
309 | ||
33489c5b | 310 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 311 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME) |
33489c5b AC |
312 | #define REGISTER_NAME(regnr) (legacy_register_name (regnr)) |
313 | #endif | |
314 | ||
104c1213 JM |
315 | typedef char * (gdbarch_register_name_ftype) (int regnr); |
316 | extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); | |
317 | extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); | |
33489c5b | 318 | #if GDB_MULTI_ARCH |
6166d547 | 319 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME) |
0f71a2f6 JM |
320 | #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr)) |
321 | #endif | |
33489c5b | 322 | #endif |
0f71a2f6 | 323 | |
104c1213 JM |
324 | extern int gdbarch_register_size (struct gdbarch *gdbarch); |
325 | extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size); | |
0f71a2f6 | 326 | #if GDB_MULTI_ARCH |
6166d547 | 327 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE) |
0f71a2f6 JM |
328 | #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch)) |
329 | #endif | |
330 | #endif | |
331 | ||
104c1213 JM |
332 | extern int gdbarch_register_bytes (struct gdbarch *gdbarch); |
333 | extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes); | |
0f71a2f6 | 334 | #if GDB_MULTI_ARCH |
6166d547 | 335 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES) |
0f71a2f6 JM |
336 | #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch)) |
337 | #endif | |
338 | #endif | |
339 | ||
104c1213 JM |
340 | typedef int (gdbarch_register_byte_ftype) (int reg_nr); |
341 | extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); | |
342 | extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); | |
0f71a2f6 | 343 | #if GDB_MULTI_ARCH |
6166d547 | 344 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE) |
0f71a2f6 JM |
345 | #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr)) |
346 | #endif | |
347 | #endif | |
348 | ||
104c1213 JM |
349 | typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); |
350 | extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); | |
351 | extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); | |
0f71a2f6 | 352 | #if GDB_MULTI_ARCH |
6166d547 | 353 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE) |
0f71a2f6 JM |
354 | #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr)) |
355 | #endif | |
356 | #endif | |
357 | ||
104c1213 JM |
358 | extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch); |
359 | extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size); | |
0f71a2f6 | 360 | #if GDB_MULTI_ARCH |
6166d547 | 361 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE) |
0f71a2f6 JM |
362 | #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch)) |
363 | #endif | |
364 | #endif | |
365 | ||
104c1213 JM |
366 | typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); |
367 | extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); | |
368 | extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); | |
0f71a2f6 | 369 | #if GDB_MULTI_ARCH |
6166d547 | 370 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE) |
0f71a2f6 JM |
371 | #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr)) |
372 | #endif | |
373 | #endif | |
374 | ||
104c1213 JM |
375 | extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch); |
376 | extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size); | |
0f71a2f6 | 377 | #if GDB_MULTI_ARCH |
6166d547 | 378 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE) |
0f71a2f6 JM |
379 | #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch)) |
380 | #endif | |
381 | #endif | |
382 | ||
104c1213 JM |
383 | typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); |
384 | extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); | |
385 | extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); | |
0f71a2f6 | 386 | #if GDB_MULTI_ARCH |
6166d547 | 387 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE) |
0f71a2f6 JM |
388 | #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr)) |
389 | #endif | |
390 | #endif | |
391 | ||
104c1213 JM |
392 | extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch); |
393 | extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames); | |
0f71a2f6 | 394 | #if GDB_MULTI_ARCH |
6166d547 | 395 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES) |
0f71a2f6 JM |
396 | #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch)) |
397 | #endif | |
398 | #endif | |
399 | ||
104c1213 JM |
400 | extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); |
401 | extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); | |
0f71a2f6 | 402 | #if GDB_MULTI_ARCH |
6166d547 | 403 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION) |
0f71a2f6 JM |
404 | #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch)) |
405 | #endif | |
406 | #endif | |
407 | ||
104c1213 JM |
408 | typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void); |
409 | extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch); | |
410 | extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address); | |
0f71a2f6 | 411 | #if GDB_MULTI_ARCH |
6166d547 | 412 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS) |
0f71a2f6 JM |
413 | #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch)) |
414 | #endif | |
415 | #endif | |
416 | ||
104c1213 JM |
417 | extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch); |
418 | extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset); | |
0f71a2f6 | 419 | #if GDB_MULTI_ARCH |
6166d547 | 420 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_START_OFFSET) |
0f71a2f6 JM |
421 | #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch)) |
422 | #endif | |
423 | #endif | |
424 | ||
104c1213 JM |
425 | extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); |
426 | extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset); | |
0f71a2f6 | 427 | #if GDB_MULTI_ARCH |
6166d547 | 428 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET) |
0f71a2f6 JM |
429 | #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch)) |
430 | #endif | |
431 | #endif | |
432 | ||
104c1213 JM |
433 | extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch); |
434 | extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p); | |
0f71a2f6 | 435 | #if GDB_MULTI_ARCH |
6166d547 | 436 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P) |
0f71a2f6 JM |
437 | #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch)) |
438 | #endif | |
439 | #endif | |
440 | ||
104c1213 JM |
441 | extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch); |
442 | extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length); | |
0f71a2f6 | 443 | #if GDB_MULTI_ARCH |
6166d547 | 444 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH) |
0f71a2f6 JM |
445 | #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch)) |
446 | #endif | |
447 | #endif | |
448 | ||
104c1213 JM |
449 | typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); |
450 | extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); | |
451 | extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy); | |
0f71a2f6 | 452 | #if GDB_MULTI_ARCH |
6166d547 | 453 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY) |
0f71a2f6 JM |
454 | #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) |
455 | #endif | |
456 | #endif | |
457 | ||
104c1213 JM |
458 | extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch); |
459 | extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p); | |
0f71a2f6 | 460 | #if GDB_MULTI_ARCH |
6166d547 | 461 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P) |
0f71a2f6 JM |
462 | #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch)) |
463 | #endif | |
464 | #endif | |
465 | ||
33489c5b | 466 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 467 | #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS) |
33489c5b AC |
468 | #define CALL_DUMMY_WORDS (legacy_call_dummy_words) |
469 | #endif | |
470 | ||
104c1213 JM |
471 | extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch); |
472 | extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); | |
33489c5b | 473 | #if GDB_MULTI_ARCH |
6166d547 | 474 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS) |
0f71a2f6 JM |
475 | #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) |
476 | #endif | |
33489c5b AC |
477 | #endif |
478 | ||
479 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 480 | #if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS) |
33489c5b AC |
481 | #define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words) |
482 | #endif | |
0f71a2f6 | 483 | |
104c1213 JM |
484 | extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); |
485 | extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words); | |
33489c5b | 486 | #if GDB_MULTI_ARCH |
6166d547 | 487 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIZEOF_CALL_DUMMY_WORDS) |
0f71a2f6 JM |
488 | #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) |
489 | #endif | |
33489c5b | 490 | #endif |
0f71a2f6 | 491 | |
104c1213 JM |
492 | extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); |
493 | extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p); | |
0f71a2f6 | 494 | #if GDB_MULTI_ARCH |
6166d547 | 495 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P) |
0f71a2f6 JM |
496 | #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch)) |
497 | #endif | |
498 | #endif | |
499 | ||
104c1213 JM |
500 | extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch); |
501 | extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust); | |
0f71a2f6 | 502 | #if GDB_MULTI_ARCH |
6166d547 | 503 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST) |
0f71a2f6 JM |
504 | #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch)) |
505 | #endif | |
506 | #endif | |
507 | ||
104c1213 JM |
508 | 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); |
509 | 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); | |
510 | extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy); | |
0f71a2f6 | 511 | #if GDB_MULTI_ARCH |
6166d547 | 512 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY) |
0f71a2f6 JM |
513 | #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)) |
514 | #endif | |
515 | #endif | |
516 | ||
104c1213 JM |
517 | extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); |
518 | extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); | |
0f71a2f6 | 519 | #if GDB_MULTI_ARCH |
6166d547 | 520 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION) |
0f71a2f6 JM |
521 | #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) |
522 | #endif | |
523 | #endif | |
524 | ||
104c1213 JM |
525 | extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); |
526 | extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); | |
0f71a2f6 | 527 | #if GDB_MULTI_ARCH |
6166d547 | 528 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE) |
0f71a2f6 JM |
529 | #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) |
530 | #endif | |
531 | #endif | |
532 | ||
33489c5b | 533 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 534 | #if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE) |
33489c5b AC |
535 | #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual)) |
536 | #endif | |
537 | ||
b9a8e3bf JB |
538 | typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual); |
539 | extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual); | |
540 | extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double); | |
33489c5b | 541 | #if GDB_MULTI_ARCH |
6166d547 | 542 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE) |
b9a8e3bf JB |
543 | #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual)) |
544 | #endif | |
33489c5b | 545 | #endif |
b9a8e3bf | 546 | |
104c1213 JM |
547 | 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); |
548 | 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); | |
549 | extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register); | |
0f71a2f6 | 550 | #if GDB_MULTI_ARCH |
6166d547 | 551 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER) |
0f71a2f6 JM |
552 | #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) |
553 | #endif | |
554 | #endif | |
555 | ||
33489c5b | 556 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 557 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE) |
33489c5b AC |
558 | #define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr)) |
559 | #endif | |
560 | ||
104c1213 JM |
561 | typedef int (gdbarch_register_convertible_ftype) (int nr); |
562 | extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); | |
563 | extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); | |
33489c5b | 564 | #if GDB_MULTI_ARCH |
6166d547 | 565 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE) |
0f71a2f6 JM |
566 | #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr)) |
567 | #endif | |
33489c5b AC |
568 | #endif |
569 | ||
570 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 571 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL) |
33489c5b AC |
572 | #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error ("REGISTER_CONVERT_TO_VIRTUAL"), 0) |
573 | #endif | |
0f71a2f6 | 574 | |
104c1213 JM |
575 | typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); |
576 | extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); | |
577 | extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); | |
33489c5b | 578 | #if GDB_MULTI_ARCH |
6166d547 | 579 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL) |
0f71a2f6 JM |
580 | #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) |
581 | #endif | |
33489c5b AC |
582 | #endif |
583 | ||
584 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 585 | #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW) |
33489c5b AC |
586 | #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error ("REGISTER_CONVERT_TO_RAW"), 0) |
587 | #endif | |
0f71a2f6 | 588 | |
104c1213 JM |
589 | typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); |
590 | extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); | |
591 | extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); | |
33489c5b | 592 | #if GDB_MULTI_ARCH |
6166d547 | 593 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW) |
0f71a2f6 JM |
594 | #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) |
595 | #endif | |
33489c5b AC |
596 | #endif |
597 | ||
7f1b2585 | 598 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 599 | #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER) |
7f1b2585 EZ |
600 | #define FETCH_PSEUDO_REGISTER(regnum) (internal_error ("FETCH_PSEUDO_REGISTER"), 0) |
601 | #endif | |
602 | ||
603 | typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum); | |
604 | extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum); | |
605 | extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register); | |
606 | #if GDB_MULTI_ARCH | |
6166d547 | 607 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER) |
7f1b2585 EZ |
608 | #define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum)) |
609 | #endif | |
610 | #endif | |
611 | ||
612 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 613 | #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER) |
7f1b2585 EZ |
614 | #define STORE_PSEUDO_REGISTER(regnum) (internal_error ("STORE_PSEUDO_REGISTER"), 0) |
615 | #endif | |
616 | ||
617 | typedef void (gdbarch_store_pseudo_register_ftype) (int regnum); | |
618 | extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum); | |
619 | extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register); | |
620 | #if GDB_MULTI_ARCH | |
6166d547 | 621 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER) |
7f1b2585 EZ |
622 | #define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum)) |
623 | #endif | |
624 | #endif | |
625 | ||
33489c5b | 626 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 627 | #if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS) |
ac2e2ef7 | 628 | #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) |
33489c5b | 629 | #endif |
4478b372 | 630 | |
ac2e2ef7 AC |
631 | typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf); |
632 | extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); | |
4478b372 | 633 | extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); |
33489c5b | 634 | #if GDB_MULTI_ARCH |
6166d547 | 635 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS) |
4478b372 JB |
636 | #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) |
637 | #endif | |
33489c5b AC |
638 | #endif |
639 | ||
640 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 641 | #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER) |
ac2e2ef7 | 642 | #define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr)) |
33489c5b | 643 | #endif |
4478b372 | 644 | |
ac2e2ef7 AC |
645 | typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); |
646 | extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); | |
4478b372 | 647 | extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); |
33489c5b | 648 | #if GDB_MULTI_ARCH |
6166d547 | 649 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER) |
4478b372 JB |
650 | #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) |
651 | #endif | |
33489c5b AC |
652 | #endif |
653 | ||
654 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 655 | #if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK) |
33489c5b AC |
656 | #define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type)) |
657 | #endif | |
0f71a2f6 | 658 | |
71a9f22e JB |
659 | typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); |
660 | extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); | |
661 | extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); | |
33489c5b | 662 | #if GDB_MULTI_ARCH |
6166d547 | 663 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK) |
71a9f22e JB |
664 | #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) |
665 | #endif | |
33489c5b | 666 | #endif |
71a9f22e | 667 | |
104c1213 JM |
668 | typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); |
669 | extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); | |
670 | extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); | |
0f71a2f6 | 671 | #if GDB_MULTI_ARCH |
6166d547 | 672 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) |
0f71a2f6 JM |
673 | #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf)) |
674 | #endif | |
675 | #endif | |
676 | ||
104c1213 JM |
677 | typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); |
678 | extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); | |
679 | extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments); | |
0f71a2f6 | 680 | #if GDB_MULTI_ARCH |
6166d547 | 681 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS) |
0f71a2f6 JM |
682 | #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) |
683 | #endif | |
684 | #endif | |
685 | ||
104c1213 JM |
686 | typedef void (gdbarch_push_dummy_frame_ftype) (void); |
687 | extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch); | |
688 | extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame); | |
0f71a2f6 | 689 | #if GDB_MULTI_ARCH |
6166d547 | 690 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME) |
0f71a2f6 JM |
691 | #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch)) |
692 | #endif | |
693 | #endif | |
694 | ||
104c1213 JM |
695 | typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); |
696 | extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); | |
697 | extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address); | |
0f71a2f6 | 698 | #if GDB_MULTI_ARCH |
6166d547 | 699 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS) |
0f71a2f6 JM |
700 | #define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp)) |
701 | #endif | |
702 | #endif | |
703 | ||
104c1213 JM |
704 | typedef void (gdbarch_pop_frame_ftype) (void); |
705 | extern void gdbarch_pop_frame (struct gdbarch *gdbarch); | |
706 | extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame); | |
0f71a2f6 | 707 | #if GDB_MULTI_ARCH |
6166d547 | 708 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME) |
0f71a2f6 JM |
709 | #define POP_FRAME (gdbarch_pop_frame (current_gdbarch)) |
710 | #endif | |
711 | #endif | |
712 | ||
33489c5b | 713 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 714 | #if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_DADDR) |
33489c5b AC |
715 | #define D10V_MAKE_DADDR(x) (internal_error ("D10V_MAKE_DADDR"), 0) |
716 | #endif | |
717 | ||
104c1213 JM |
718 | typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x); |
719 | extern CORE_ADDR gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x); | |
720 | extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr); | |
33489c5b | 721 | #if GDB_MULTI_ARCH |
6166d547 | 722 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_MAKE_DADDR) |
0f71a2f6 JM |
723 | #define D10V_MAKE_DADDR(x) (gdbarch_d10v_make_daddr (current_gdbarch, x)) |
724 | #endif | |
33489c5b AC |
725 | #endif |
726 | ||
727 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 728 | #if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_IADDR) |
33489c5b AC |
729 | #define D10V_MAKE_IADDR(x) (internal_error ("D10V_MAKE_IADDR"), 0) |
730 | #endif | |
0f71a2f6 | 731 | |
104c1213 JM |
732 | typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x); |
733 | extern CORE_ADDR gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x); | |
734 | extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr); | |
33489c5b | 735 | #if GDB_MULTI_ARCH |
6166d547 | 736 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_MAKE_IADDR) |
0f71a2f6 JM |
737 | #define D10V_MAKE_IADDR(x) (gdbarch_d10v_make_iaddr (current_gdbarch, x)) |
738 | #endif | |
33489c5b AC |
739 | #endif |
740 | ||
741 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 742 | #if (!GDB_MULTI_ARCH) && !defined (D10V_DADDR_P) |
33489c5b AC |
743 | #define D10V_DADDR_P(x) (internal_error ("D10V_DADDR_P"), 0) |
744 | #endif | |
0f71a2f6 | 745 | |
104c1213 JM |
746 | typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x); |
747 | extern int gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x); | |
748 | extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p); | |
33489c5b | 749 | #if GDB_MULTI_ARCH |
6166d547 | 750 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_DADDR_P) |
0f71a2f6 JM |
751 | #define D10V_DADDR_P(x) (gdbarch_d10v_daddr_p (current_gdbarch, x)) |
752 | #endif | |
33489c5b AC |
753 | #endif |
754 | ||
755 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 756 | #if (!GDB_MULTI_ARCH) && !defined (D10V_IADDR_P) |
33489c5b AC |
757 | #define D10V_IADDR_P(x) (internal_error ("D10V_IADDR_P"), 0) |
758 | #endif | |
0f71a2f6 | 759 | |
104c1213 JM |
760 | typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x); |
761 | extern int gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x); | |
762 | extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p); | |
33489c5b | 763 | #if GDB_MULTI_ARCH |
6166d547 | 764 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_IADDR_P) |
0f71a2f6 JM |
765 | #define D10V_IADDR_P(x) (gdbarch_d10v_iaddr_p (current_gdbarch, x)) |
766 | #endif | |
33489c5b AC |
767 | #endif |
768 | ||
769 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 770 | #if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_DADDR_TO_RAW) |
33489c5b AC |
771 | #define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_DADDR_TO_RAW"), 0) |
772 | #endif | |
0f71a2f6 | 773 | |
104c1213 JM |
774 | typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x); |
775 | extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); | |
776 | extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw); | |
33489c5b | 777 | #if GDB_MULTI_ARCH |
6166d547 | 778 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_CONVERT_DADDR_TO_RAW) |
0f71a2f6 JM |
779 | #define D10V_CONVERT_DADDR_TO_RAW(x) (gdbarch_d10v_convert_daddr_to_raw (current_gdbarch, x)) |
780 | #endif | |
33489c5b AC |
781 | #endif |
782 | ||
783 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 784 | #if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_IADDR_TO_RAW) |
33489c5b AC |
785 | #define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_IADDR_TO_RAW"), 0) |
786 | #endif | |
0f71a2f6 | 787 | |
104c1213 JM |
788 | typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x); |
789 | extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); | |
790 | extern void set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw); | |
33489c5b | 791 | #if GDB_MULTI_ARCH |
6166d547 | 792 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_CONVERT_IADDR_TO_RAW) |
0f71a2f6 JM |
793 | #define D10V_CONVERT_IADDR_TO_RAW(x) (gdbarch_d10v_convert_iaddr_to_raw (current_gdbarch, x)) |
794 | #endif | |
33489c5b | 795 | #endif |
0f71a2f6 | 796 | |
104c1213 JM |
797 | typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); |
798 | extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); | |
799 | extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return); | |
0f71a2f6 | 800 | #if GDB_MULTI_ARCH |
6166d547 | 801 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN) |
0f71a2f6 JM |
802 | #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp)) |
803 | #endif | |
804 | #endif | |
805 | ||
104c1213 JM |
806 | typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf); |
807 | extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); | |
808 | extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); | |
0f71a2f6 | 809 | #if GDB_MULTI_ARCH |
6166d547 | 810 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) |
0f71a2f6 JM |
811 | #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf)) |
812 | #endif | |
813 | #endif | |
814 | ||
104c1213 JM |
815 | typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf); |
816 | extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); | |
817 | extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address); | |
0f71a2f6 | 818 | #if GDB_MULTI_ARCH |
6166d547 | 819 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) |
0f71a2f6 JM |
820 | #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf)) |
821 | #endif | |
822 | #endif | |
823 | ||
104c1213 JM |
824 | typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type); |
825 | extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type); | |
826 | extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention); | |
0f71a2f6 | 827 | #if GDB_MULTI_ARCH |
6166d547 | 828 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION) |
0f71a2f6 JM |
829 | #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type)) |
830 | #endif | |
831 | #endif | |
832 | ||
104c1213 JM |
833 | typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame); |
834 | extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); | |
835 | extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs); | |
0f71a2f6 | 836 | #if GDB_MULTI_ARCH |
6166d547 | 837 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS) |
0f71a2f6 JM |
838 | #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame)) |
839 | #endif | |
840 | #endif | |
841 | ||
104c1213 JM |
842 | typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); |
843 | extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); | |
844 | extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info); | |
0f71a2f6 | 845 | #if GDB_MULTI_ARCH |
6166d547 | 846 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO) |
0f71a2f6 JM |
847 | #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame)) |
848 | #endif | |
849 | #endif | |
850 | ||
104c1213 JM |
851 | typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); |
852 | extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); | |
853 | extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue); | |
0f71a2f6 | 854 | #if GDB_MULTI_ARCH |
6166d547 | 855 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE) |
0f71a2f6 JM |
856 | #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip)) |
857 | #endif | |
858 | #endif | |
859 | ||
33489c5b | 860 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 861 | #if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P) |
33489c5b AC |
862 | #define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip)) |
863 | #endif | |
864 | ||
dad41f9a AC |
865 | typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip); |
866 | extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip); | |
867 | extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p); | |
33489c5b | 868 | #if GDB_MULTI_ARCH |
6166d547 | 869 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P) |
dad41f9a AC |
870 | #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip)) |
871 | #endif | |
33489c5b | 872 | #endif |
dad41f9a | 873 | |
104c1213 JM |
874 | typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); |
875 | extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); | |
876 | extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); | |
0f71a2f6 | 877 | #if GDB_MULTI_ARCH |
6166d547 | 878 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN) |
0f71a2f6 JM |
879 | #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs)) |
880 | #endif | |
881 | #endif | |
882 | ||
33489c5b | 883 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 884 | #if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC) |
33489c5b AC |
885 | #define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) |
886 | #endif | |
887 | ||
104c1213 JM |
888 | typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); |
889 | extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); | |
890 | extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); | |
33489c5b | 891 | #if GDB_MULTI_ARCH |
6166d547 | 892 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC) |
0f71a2f6 JM |
893 | #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr)) |
894 | #endif | |
33489c5b AC |
895 | #endif |
896 | ||
897 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 898 | #if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT) |
33489c5b AC |
899 | #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache)) |
900 | #endif | |
0f71a2f6 | 901 | |
917317f4 JM |
902 | typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); |
903 | extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); | |
904 | extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint); | |
33489c5b | 905 | #if GDB_MULTI_ARCH |
6166d547 | 906 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT) |
917317f4 JM |
907 | #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache)) |
908 | #endif | |
33489c5b AC |
909 | #endif |
910 | ||
911 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 912 | #if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT) |
33489c5b AC |
913 | #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache)) |
914 | #endif | |
917317f4 JM |
915 | |
916 | typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); | |
917 | extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); | |
918 | extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint); | |
33489c5b | 919 | #if GDB_MULTI_ARCH |
6166d547 | 920 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT) |
917317f4 JM |
921 | #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache)) |
922 | #endif | |
33489c5b | 923 | #endif |
917317f4 | 924 | |
104c1213 JM |
925 | extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch); |
926 | extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break); | |
0f71a2f6 | 927 | #if GDB_MULTI_ARCH |
6166d547 | 928 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK) |
0f71a2f6 JM |
929 | #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch)) |
930 | #endif | |
931 | #endif | |
932 | ||
104c1213 JM |
933 | extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch); |
934 | extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset); | |
0f71a2f6 | 935 | #if GDB_MULTI_ARCH |
6166d547 | 936 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET) |
0f71a2f6 JM |
937 | #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch)) |
938 | #endif | |
939 | #endif | |
940 | ||
33489c5b | 941 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 942 | #if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
33489c5b AC |
943 | #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)) |
944 | #endif | |
945 | ||
104c1213 JM |
946 | typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); |
947 | extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); | |
948 | extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); | |
33489c5b | 949 | #if GDB_MULTI_ARCH |
6166d547 | 950 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS) |
0f71a2f6 JM |
951 | #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)) |
952 | #endif | |
33489c5b | 953 | #endif |
0f71a2f6 | 954 | |
104c1213 JM |
955 | extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch); |
956 | extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip); | |
0f71a2f6 | 957 | #if GDB_MULTI_ARCH |
6166d547 | 958 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP) |
0f71a2f6 JM |
959 | #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch)) |
960 | #endif | |
961 | #endif | |
962 | ||
33489c5b | 963 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 964 | #if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION) |
33489c5b AC |
965 | #define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi)) |
966 | #endif | |
967 | ||
104c1213 JM |
968 | typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi); |
969 | extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi); | |
970 | extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation); | |
33489c5b | 971 | #if GDB_MULTI_ARCH |
6166d547 | 972 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION) |
0f71a2f6 JM |
973 | #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi)) |
974 | #endif | |
33489c5b | 975 | #endif |
0f71a2f6 | 976 | |
104c1213 JM |
977 | typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame); |
978 | extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); | |
979 | extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain); | |
0f71a2f6 | 980 | #if GDB_MULTI_ARCH |
6166d547 | 981 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN) |
0f71a2f6 JM |
982 | #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame)) |
983 | #endif | |
984 | #endif | |
985 | ||
104c1213 JM |
986 | typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); |
987 | extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); | |
988 | extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid); | |
0f71a2f6 | 989 | #if GDB_MULTI_ARCH |
6166d547 | 990 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID) |
0f71a2f6 JM |
991 | #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe)) |
992 | #endif | |
993 | #endif | |
994 | ||
104c1213 JM |
995 | typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi); |
996 | extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi); | |
997 | extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc); | |
0f71a2f6 | 998 | #if GDB_MULTI_ARCH |
6166d547 | 999 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC) |
0f71a2f6 JM |
1000 | #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi)) |
1001 | #endif | |
1002 | #endif | |
1003 | ||
104c1213 JM |
1004 | typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); |
1005 | extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); | |
1006 | extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); | |
0f71a2f6 | 1007 | #if GDB_MULTI_ARCH |
6166d547 | 1008 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS) |
0f71a2f6 JM |
1009 | #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi)) |
1010 | #endif | |
1011 | #endif | |
1012 | ||
104c1213 JM |
1013 | typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); |
1014 | extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); | |
1015 | extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); | |
0f71a2f6 | 1016 | #if GDB_MULTI_ARCH |
6166d547 | 1017 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS) |
0f71a2f6 JM |
1018 | #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi)) |
1019 | #endif | |
1020 | #endif | |
1021 | ||
104c1213 JM |
1022 | typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) (struct frame_info *frame); |
1023 | extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame); | |
1024 | extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call); | |
0f71a2f6 | 1025 | #if GDB_MULTI_ARCH |
6166d547 | 1026 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVED_PC_AFTER_CALL) |
0f71a2f6 JM |
1027 | #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame)) |
1028 | #endif | |
1029 | #endif | |
1030 | ||
104c1213 JM |
1031 | typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame); |
1032 | extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame); | |
1033 | extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args); | |
0f71a2f6 | 1034 | #if GDB_MULTI_ARCH |
6166d547 | 1035 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS) |
0f71a2f6 JM |
1036 | #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame)) |
1037 | #endif | |
1038 | #endif | |
1039 | ||
2ada493a AC |
1040 | #if defined (STACK_ALIGN) |
1041 | /* Legacy for systems yet to multi-arch STACK_ALIGN */ | |
1042 | #define STACK_ALIGN_P() (1) | |
1043 | #endif | |
1044 | ||
33489c5b | 1045 | /* Default predicate for non- multi-arch targets. */ |
6166d547 | 1046 | #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P) |
33489c5b AC |
1047 | #define STACK_ALIGN_P() (0) |
1048 | #endif | |
1049 | ||
2ada493a | 1050 | extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); |
6166d547 | 1051 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P) |
2ada493a AC |
1052 | #define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch)) |
1053 | #endif | |
1054 | ||
33489c5b | 1055 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1056 | #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN) |
33489c5b AC |
1057 | #define STACK_ALIGN(sp) (internal_error ("STACK_ALIGN"), 0) |
1058 | #endif | |
1059 | ||
2ada493a AC |
1060 | typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp); |
1061 | extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp); | |
1062 | extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align); | |
33489c5b | 1063 | #if GDB_MULTI_ARCH |
6166d547 | 1064 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN) |
2ada493a AC |
1065 | #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp)) |
1066 | #endif | |
33489c5b | 1067 | #endif |
2ada493a | 1068 | |
d03e67c9 AC |
1069 | #if defined (REG_STRUCT_HAS_ADDR) |
1070 | /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */ | |
1071 | #define REG_STRUCT_HAS_ADDR_P() (1) | |
1072 | #endif | |
1073 | ||
33489c5b | 1074 | /* Default predicate for non- multi-arch targets. */ |
6166d547 | 1075 | #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P) |
33489c5b AC |
1076 | #define REG_STRUCT_HAS_ADDR_P() (0) |
1077 | #endif | |
1078 | ||
d03e67c9 | 1079 | extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); |
6166d547 | 1080 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P) |
d03e67c9 AC |
1081 | #define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch)) |
1082 | #endif | |
1083 | ||
33489c5b | 1084 | /* Default (function) for non- multi-arch platforms. */ |
6166d547 | 1085 | #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR) |
33489c5b AC |
1086 | #define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error ("REG_STRUCT_HAS_ADDR"), 0) |
1087 | #endif | |
1088 | ||
d03e67c9 AC |
1089 | typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); |
1090 | extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type); | |
1091 | extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr); | |
33489c5b | 1092 | #if GDB_MULTI_ARCH |
6166d547 | 1093 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR) |
d03e67c9 AC |
1094 | #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type)) |
1095 | #endif | |
33489c5b | 1096 | #endif |
d03e67c9 | 1097 | |
d1e3cf49 AC |
1098 | #if defined (SAVE_DUMMY_FRAME_TOS) |
1099 | /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */ | |
1100 | #define SAVE_DUMMY_FRAME_TOS_P() (1) | |
1101 | #endif | |
1102 | ||
1103 | /* Default predicate for non- multi-arch targets. */ | |
6166d547 | 1104 | #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
1105 | #define SAVE_DUMMY_FRAME_TOS_P() (0) |
1106 | #endif | |
1107 | ||
1108 | extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); | |
6166d547 | 1109 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P) |
d1e3cf49 AC |
1110 | #define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch)) |
1111 | #endif | |
1112 | ||
1113 | /* Default (function) for non- multi-arch platforms. */ | |
6166d547 | 1114 | #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS) |
d1e3cf49 AC |
1115 | #define SAVE_DUMMY_FRAME_TOS(sp) (internal_error ("SAVE_DUMMY_FRAME_TOS"), 0) |
1116 | #endif | |
1117 | ||
1118 | typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); | |
1119 | extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); | |
1120 | extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos); | |
1121 | #if GDB_MULTI_ARCH | |
6166d547 | 1122 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS) |
d1e3cf49 AC |
1123 | #define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp)) |
1124 | #endif | |
1125 | #endif | |
1126 | ||
f0d4cc9e | 1127 | /* Default (value) for non- multi-arch platforms. */ |
6166d547 | 1128 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT) |
f0d4cc9e AC |
1129 | #define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch)) |
1130 | #endif | |
1131 | ||
1132 | extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch); | |
1133 | extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format); | |
1134 | #if GDB_MULTI_ARCH | |
6166d547 | 1135 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT) |
f0d4cc9e AC |
1136 | #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) |
1137 | #endif | |
1138 | #endif | |
1139 | ||
1140 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 1141 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT) |
f0d4cc9e AC |
1142 | #define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch)) |
1143 | #endif | |
1144 | ||
1145 | extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch); | |
1146 | extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format); | |
1147 | #if GDB_MULTI_ARCH | |
6166d547 | 1148 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT) |
f0d4cc9e AC |
1149 | #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) |
1150 | #endif | |
1151 | #endif | |
1152 | ||
1153 | /* Default (value) for non- multi-arch platforms. */ | |
6166d547 | 1154 | #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT) |
f0d4cc9e AC |
1155 | #define TARGET_LONG_DOUBLE_FORMAT (&floatformat_unknown) |
1156 | #endif | |
1157 | ||
1158 | extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch); | |
1159 | extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format); | |
1160 | #if GDB_MULTI_ARCH | |
6166d547 | 1161 | #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT) |
f0d4cc9e AC |
1162 | #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) |
1163 | #endif | |
1164 | #endif | |
1165 | ||
104c1213 | 1166 | extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); |
0f71a2f6 JM |
1167 | |
1168 | ||
1169 | /* Mechanism for co-ordinating the selection of a specific | |
1170 | architecture. | |
1171 | ||
1172 | GDB targets (*-tdep.c) can register an interest in a specific | |
1173 | architecture. Other GDB components can register a need to maintain | |
1174 | per-architecture data. | |
1175 | ||
1176 | The mechanisms below ensures that there is only a loose connection | |
1177 | between the set-architecture command and the various GDB | |
1178 | components. Each component can independantly register their need | |
1179 | to maintain architecture specific data with gdbarch. | |
1180 | ||
1181 | Pragmatics: | |
1182 | ||
1183 | Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It | |
1184 | didn't scale. | |
1185 | ||
1186 | The more traditional mega-struct containing architecture specific | |
1187 | data for all the various GDB components was also considered. Since | |
1188 | GDB is built from a variable number of (fairly independant) | |
1189 | components it was determined that the global aproach was not | |
1190 | applicable. */ | |
1191 | ||
1192 | ||
1193 | /* Register a new architectural family with GDB. | |
1194 | ||
1195 | Register support for the specified ARCHITECTURE with GDB. When | |
1196 | gdbarch determines that the specified architecture has been | |
1197 | selected, the corresponding INIT function is called. | |
1198 | ||
1199 | -- | |
1200 | ||
1201 | The INIT function takes two parameters: INFO which contains the | |
1202 | information available to gdbarch about the (possibly new) | |
1203 | architecture; ARCHES which is a list of the previously created | |
1204 | ``struct gdbarch'' for this architecture. | |
1205 | ||
1206 | The INIT function parameter INFO shall, as far as possible, be | |
1207 | pre-initialized with information obtained from INFO.ABFD or | |
1208 | previously selected architecture (if similar). INIT shall ensure | |
1209 | that the INFO.BYTE_ORDER is non-zero. | |
1210 | ||
1211 | The INIT function shall return any of: NULL - indicating that it | |
1212 | doesn't reconize the selected architecture; an existing ``struct | |
1213 | gdbarch'' from the ARCHES list - indicating that the new | |
1214 | architecture is just a synonym for an earlier architecture (see | |
1215 | gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch'' | |
4b9b3959 AC |
1216 | - that describes the selected architecture (see gdbarch_alloc()). |
1217 | ||
1218 | The DUMP_TDEP function shall print out all target specific values. | |
1219 | Care should be taken to ensure that the function works in both the | |
1220 | multi-arch and non- multi-arch cases. */ | |
0f71a2f6 | 1221 | |
adf40b2e JM |
1222 | struct gdbarch_list |
1223 | { | |
1224 | struct gdbarch *gdbarch; | |
1225 | struct gdbarch_list *next; | |
1226 | }; | |
0f71a2f6 | 1227 | |
adf40b2e JM |
1228 | struct gdbarch_info |
1229 | { | |
1230 | /* Use default: bfd_arch_unknown (ZERO). */ | |
1231 | enum bfd_architecture bfd_architecture; | |
0f71a2f6 | 1232 | |
adf40b2e JM |
1233 | /* Use default: NULL (ZERO). */ |
1234 | const struct bfd_arch_info *bfd_arch_info; | |
0f71a2f6 | 1235 | |
adf40b2e JM |
1236 | /* Use default: 0 (ZERO). */ |
1237 | int byte_order; | |
0f71a2f6 | 1238 | |
adf40b2e JM |
1239 | /* Use default: NULL (ZERO). */ |
1240 | bfd *abfd; | |
0f71a2f6 | 1241 | |
adf40b2e JM |
1242 | /* Use default: NULL (ZERO). */ |
1243 | struct gdbarch_tdep_info *tdep_info; | |
1244 | }; | |
0f71a2f6 | 1245 | |
104c1213 | 1246 | typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches); |
4b9b3959 | 1247 | typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file); |
0f71a2f6 | 1248 | |
4b9b3959 | 1249 | /* DEPRECATED - use gdbarch_register() */ |
104c1213 | 1250 | extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *); |
0f71a2f6 | 1251 | |
4b9b3959 AC |
1252 | extern void gdbarch_register (enum bfd_architecture architecture, |
1253 | gdbarch_init_ftype *, | |
1254 | gdbarch_dump_tdep_ftype *); | |
1255 | ||
0f71a2f6 | 1256 | |
b4a20239 AC |
1257 | /* Return a freshly allocated, NULL terminated, array of the valid |
1258 | architecture names. Since architectures are registered during the | |
1259 | _initialize phase this function only returns useful information | |
1260 | once initialization has been completed. */ | |
1261 | ||
1262 | extern const char **gdbarch_printable_names (void); | |
1263 | ||
1264 | ||
0f71a2f6 JM |
1265 | /* Helper function. Search the list of ARCHES for a GDBARCH that |
1266 | matches the information provided by INFO. */ | |
1267 | ||
104c1213 | 1268 | extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info); |
0f71a2f6 JM |
1269 | |
1270 | ||
1271 | /* Helper function. Create a preliminary ``struct gdbarch''. Perform | |
1272 | basic initialization using values obtained from the INFO andTDEP | |
1273 | parameters. set_gdbarch_*() functions are called to complete the | |
1274 | initialization of the object. */ | |
1275 | ||
104c1213 | 1276 | extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep); |
0f71a2f6 JM |
1277 | |
1278 | ||
4b9b3959 AC |
1279 | /* Helper function. Free a partially-constructed ``struct gdbarch''. |
1280 | It is assumed that the caller freeds the ``struct | |
1281 | gdbarch_tdep''. */ | |
1282 | ||
058f20d5 JB |
1283 | extern void gdbarch_free (struct gdbarch *); |
1284 | ||
1285 | ||
0f71a2f6 JM |
1286 | /* Helper function. Force an update of the current architecture. Used |
1287 | by legacy targets that have added their own target specific | |
1288 | architecture manipulation commands. | |
1289 | ||
1290 | The INFO parameter shall be fully initialized (``memset (&INFO, | |
1291 | sizeof (info), 0)'' set relevant fields) before gdbarch_update() is | |
1292 | called. gdbarch_update() shall initialize any ``default'' fields | |
1293 | using information obtained from the previous architecture or | |
1294 | INFO.ABFD (if specified) before calling the corresponding | |
1295 | architectures INIT function. */ | |
1296 | ||
104c1213 | 1297 | extern int gdbarch_update (struct gdbarch_info info); |
0f71a2f6 JM |
1298 | |
1299 | ||
1300 | ||
1301 | /* Register per-architecture data-pointer. | |
1302 | ||
1303 | Reserve space for a per-architecture data-pointer. An identifier | |
1304 | for the reserved data-pointer is returned. That identifer should | |
1305 | be saved in a local static. | |
1306 | ||
1307 | When a new architecture is selected, INIT() is called. When a | |
1308 | previous architecture is re-selected, the per-architecture | |
1309 | data-pointer for that previous architecture is restored (INIT() is | |
1310 | not called). | |
1311 | ||
1312 | INIT() shall return the initial value for the per-architecture | |
1313 | data-pointer for the current architecture. | |
1314 | ||
1315 | Multiple registrarants for any architecture are allowed (and | |
1316 | strongly encouraged). */ | |
1317 | ||
104c1213 JM |
1318 | typedef void *(gdbarch_data_ftype) (void); |
1319 | extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_ftype *init); | |
0f71a2f6 JM |
1320 | |
1321 | /* Return the value of the per-architecture data-pointer for the | |
1322 | current architecture. */ | |
1323 | ||
104c1213 | 1324 | extern void *gdbarch_data (struct gdbarch_data*); |
0f71a2f6 JM |
1325 | |
1326 | ||
1327 | ||
1328 | /* Register per-architecture memory region. | |
1329 | ||
1330 | Provide a memory-region swap mechanism. Per-architecture memory | |
1331 | region are created. These memory regions are swapped whenever the | |
1332 | architecture is changed. For a new architecture, the memory region | |
1333 | is initialized with zero (0) and the INIT function is called. | |
1334 | ||
1335 | Memory regions are swapped / initialized in the order that they are | |
1336 | registered. NULL DATA and/or INIT values can be specified. | |
1337 | ||
1338 | New code should use register_gdbarch_data(). */ | |
1339 | ||
104c1213 JM |
1340 | typedef void (gdbarch_swap_ftype) (void); |
1341 | extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init); | |
e514a9d6 | 1342 | #define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL) |
0f71a2f6 JM |
1343 | |
1344 | ||
1345 | ||
c906108c SS |
1346 | /* The target-system-dependant byte order is dynamic */ |
1347 | ||
1348 | /* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness | |
b83266a0 | 1349 | is selectable at runtime. The user can use the ``set endian'' |
c906108c SS |
1350 | command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when |
1351 | target_byte_order should be auto-detected (from the program image | |
1352 | say). */ | |
1353 | ||
0f71a2f6 JM |
1354 | #if GDB_MULTI_ARCH |
1355 | /* Multi-arch GDB is always bi-endian. */ | |
1356 | #define TARGET_BYTE_ORDER_SELECTABLE_P 1 | |
1357 | #endif | |
1358 | ||
c906108c SS |
1359 | #ifndef TARGET_BYTE_ORDER_SELECTABLE_P |
1360 | /* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE | |
1361 | when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */ | |
1362 | #ifdef TARGET_BYTE_ORDER_SELECTABLE | |
1363 | #define TARGET_BYTE_ORDER_SELECTABLE_P 1 | |
1364 | #else | |
1365 | #define TARGET_BYTE_ORDER_SELECTABLE_P 0 | |
1366 | #endif | |
1367 | #endif | |
1368 | ||
adf40b2e | 1369 | extern int target_byte_order; |
c906108c SS |
1370 | #ifdef TARGET_BYTE_ORDER_SELECTABLE |
1371 | /* compat - Catch old targets that define TARGET_BYTE_ORDER_SELECTABLE | |
1372 | and expect defs.h to re-define TARGET_BYTE_ORDER. */ | |
1373 | #undef TARGET_BYTE_ORDER | |
1374 | #endif | |
1375 | #ifndef TARGET_BYTE_ORDER | |
1376 | #define TARGET_BYTE_ORDER (target_byte_order + 0) | |
1377 | #endif | |
1378 | ||
adf40b2e | 1379 | extern int target_byte_order_auto; |
c906108c SS |
1380 | #ifndef TARGET_BYTE_ORDER_AUTO |
1381 | #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0) | |
1382 | #endif | |
1383 | ||
1384 | ||
1385 | ||
1386 | /* The target-system-dependant BFD architecture is dynamic */ | |
1387 | ||
adf40b2e | 1388 | extern int target_architecture_auto; |
c906108c SS |
1389 | #ifndef TARGET_ARCHITECTURE_AUTO |
1390 | #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0) | |
1391 | #endif | |
1392 | ||
adf40b2e | 1393 | extern const struct bfd_arch_info *target_architecture; |
c906108c SS |
1394 | #ifndef TARGET_ARCHITECTURE |
1395 | #define TARGET_ARCHITECTURE (target_architecture + 0) | |
1396 | #endif | |
1397 | ||
c906108c SS |
1398 | |
1399 | /* The target-system-dependant disassembler is semi-dynamic */ | |
1400 | ||
1401 | #include "dis-asm.h" /* Get defs for disassemble_info */ | |
1402 | ||
104c1213 | 1403 | extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, |
ff844c8d | 1404 | unsigned int len, disassemble_info *info); |
c906108c | 1405 | |
104c1213 JM |
1406 | extern void dis_asm_memory_error (int status, bfd_vma memaddr, |
1407 | disassemble_info *info); | |
c906108c | 1408 | |
104c1213 JM |
1409 | extern void dis_asm_print_address (bfd_vma addr, |
1410 | disassemble_info *info); | |
c906108c | 1411 | |
104c1213 | 1412 | extern int (*tm_print_insn) (bfd_vma, disassemble_info*); |
adf40b2e | 1413 | extern disassemble_info tm_print_insn_info; |
c906108c SS |
1414 | #ifndef TARGET_PRINT_INSN |
1415 | #define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info) | |
1416 | #endif | |
1417 | #ifndef TARGET_PRINT_INSN_INFO | |
1418 | #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info) | |
1419 | #endif | |
1420 | ||
1421 | ||
1422 | ||
7a292a7a SS |
1423 | /* Explicit test for D10V architecture. |
1424 | USE of these macro's is *STRONGLY* discouraged. */ | |
1425 | ||
1426 | #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) | |
7a292a7a SS |
1427 | |
1428 | ||
ac9a91a7 JM |
1429 | /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ |
1430 | #ifndef EXTRACT_STRUCT_VALUE_ADDRESS | |
1431 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) | |
96baa820 | 1432 | #define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) |
ac9a91a7 JM |
1433 | #else |
1434 | #ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P | |
1435 | #define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) | |
1436 | #endif | |
1437 | #endif | |
1438 | ||
1439 | ||
c906108c SS |
1440 | /* Set the dynamic target-system-dependant parameters (architecture, |
1441 | byte-order, ...) using information found in the BFD */ | |
1442 | ||
104c1213 | 1443 | extern void set_gdbarch_from_file (bfd *); |
c906108c SS |
1444 | |
1445 | ||
e514a9d6 JM |
1446 | /* Initialize the current architecture to the "first" one we find on |
1447 | our list. */ | |
1448 | ||
1449 | extern void initialize_current_architecture (void); | |
1450 | ||
cce74817 | 1451 | |
c906108c | 1452 | /* gdbarch trace variable */ |
adf40b2e | 1453 | extern int gdbarch_debug; |
c906108c | 1454 | |
4b9b3959 | 1455 | extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file); |
0f71a2f6 | 1456 | |
c906108c | 1457 | #endif |