* ldlang.c (print_padding_statement): Cast size_t to bfd_vma
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
6 Software Foundation, Inc.
7
8 This file is part of GDB.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
24
25 /* This file was created with the aid of ``gdbarch.sh''.
26
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
30 being reported.
31
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
35 easier. */
36
37 #ifndef GDBARCH_H
38 #define GDBARCH_H
39
40 struct floatformat;
41 struct ui_file;
42 struct frame_info;
43 struct value;
44 struct objfile;
45 struct minimal_symbol;
46 struct regcache;
47 struct reggroup;
48 struct regset;
49 struct disassemble_info;
50 struct target_ops;
51 struct obstack;
52
53 extern struct gdbarch *current_gdbarch;
54
55 /* Always one, being eliminated. */
56 #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 1
57
58 /* If any of the following are defined, the target wasn't correctly
59 converted. */
60
61 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
62 #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
63 #endif
64
65
66 /* The following are pre-initialized by GDBARCH. */
67
68 extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
69 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
70 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE)
71 #error "Non multi-arch definition of TARGET_ARCHITECTURE"
72 #endif
73 #if !defined (TARGET_ARCHITECTURE)
74 #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
75 #endif
76
77 extern int gdbarch_byte_order (struct gdbarch *gdbarch);
78 /* set_gdbarch_byte_order() - not applicable - pre-initialized. */
79 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER)
80 #error "Non multi-arch definition of TARGET_BYTE_ORDER"
81 #endif
82 #if !defined (TARGET_BYTE_ORDER)
83 #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
84 #endif
85
86 extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
87 /* set_gdbarch_osabi() - not applicable - pre-initialized. */
88 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_OSABI)
89 #error "Non multi-arch definition of TARGET_OSABI"
90 #endif
91 #if !defined (TARGET_OSABI)
92 #define TARGET_OSABI (gdbarch_osabi (current_gdbarch))
93 #endif
94
95
96 /* The following are initialized by the target dependent code. */
97
98 /* Number of bits in a char or unsigned char for the target machine.
99 Just like CHAR_BIT in <limits.h> but describes the target machine.
100 v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
101
102 Number of bits in a short or unsigned short for the target machine. */
103
104 extern int gdbarch_short_bit (struct gdbarch *gdbarch);
105 extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
106 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
107 #error "Non multi-arch definition of TARGET_SHORT_BIT"
108 #endif
109 #if !defined (TARGET_SHORT_BIT)
110 #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
111 #endif
112
113 /* Number of bits in an int or unsigned int for the target machine. */
114
115 extern int gdbarch_int_bit (struct gdbarch *gdbarch);
116 extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
117 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
118 #error "Non multi-arch definition of TARGET_INT_BIT"
119 #endif
120 #if !defined (TARGET_INT_BIT)
121 #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
122 #endif
123
124 /* Number of bits in a long or unsigned long for the target machine. */
125
126 extern int gdbarch_long_bit (struct gdbarch *gdbarch);
127 extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
128 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
129 #error "Non multi-arch definition of TARGET_LONG_BIT"
130 #endif
131 #if !defined (TARGET_LONG_BIT)
132 #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
133 #endif
134
135 /* Number of bits in a long long or unsigned long long for the target
136 machine. */
137
138 extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
139 extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
140 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
141 #error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
142 #endif
143 #if !defined (TARGET_LONG_LONG_BIT)
144 #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
145 #endif
146
147 /* Number of bits in a float for the target machine. */
148
149 extern int gdbarch_float_bit (struct gdbarch *gdbarch);
150 extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
151 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
152 #error "Non multi-arch definition of TARGET_FLOAT_BIT"
153 #endif
154 #if !defined (TARGET_FLOAT_BIT)
155 #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
156 #endif
157
158 /* Number of bits in a double for the target machine. */
159
160 extern int gdbarch_double_bit (struct gdbarch *gdbarch);
161 extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
162 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
163 #error "Non multi-arch definition of TARGET_DOUBLE_BIT"
164 #endif
165 #if !defined (TARGET_DOUBLE_BIT)
166 #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
167 #endif
168
169 /* Number of bits in a long double for the target machine. */
170
171 extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
172 extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
173 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
174 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT"
175 #endif
176 #if !defined (TARGET_LONG_DOUBLE_BIT)
177 #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
178 #endif
179
180 /* For most targets, a pointer on the target and its representation as an
181 address in GDB have the same size and "look the same". For such a
182 target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
183 / addr_bit will be set from it.
184
185 If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
186 also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
187
188 ptr_bit is the size of a pointer on the target */
189
190 extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
191 extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
192 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
193 #error "Non multi-arch definition of TARGET_PTR_BIT"
194 #endif
195 #if !defined (TARGET_PTR_BIT)
196 #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
197 #endif
198
199 /* addr_bit is the size of a target address as represented in gdb */
200
201 extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
202 extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
203 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
204 #error "Non multi-arch definition of TARGET_ADDR_BIT"
205 #endif
206 #if !defined (TARGET_ADDR_BIT)
207 #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
208 #endif
209
210 /* Number of bits in a BFD_VMA for the target object file format. */
211
212 extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
213 extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
214 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
215 #error "Non multi-arch definition of TARGET_BFD_VMA_BIT"
216 #endif
217 #if !defined (TARGET_BFD_VMA_BIT)
218 #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
219 #endif
220
221 /* One if `char' acts like `signed char', zero if `unsigned char'. */
222
223 extern int gdbarch_char_signed (struct gdbarch *gdbarch);
224 extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
225 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
226 #error "Non multi-arch definition of TARGET_CHAR_SIGNED"
227 #endif
228 #if !defined (TARGET_CHAR_SIGNED)
229 #define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch))
230 #endif
231
232 #if defined (TARGET_READ_PC)
233 /* Legacy for systems yet to multi-arch TARGET_READ_PC */
234 #if !defined (TARGET_READ_PC_P)
235 #define TARGET_READ_PC_P() (1)
236 #endif
237 #endif
238
239 extern int gdbarch_read_pc_p (struct gdbarch *gdbarch);
240 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC_P)
241 #error "Non multi-arch definition of TARGET_READ_PC"
242 #endif
243 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC_P)
244 #define TARGET_READ_PC_P() (gdbarch_read_pc_p (current_gdbarch))
245 #endif
246
247 typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
248 extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
249 extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
250 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC)
251 #error "Non multi-arch definition of TARGET_READ_PC"
252 #endif
253 #if !defined (TARGET_READ_PC)
254 #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
255 #endif
256
257 typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
258 extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
259 extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
260 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC)
261 #error "Non multi-arch definition of TARGET_WRITE_PC"
262 #endif
263 #if !defined (TARGET_WRITE_PC)
264 #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
265 #endif
266
267 /* UNWIND_SP is a direct replacement for TARGET_READ_SP. */
268
269 #if defined (TARGET_READ_SP)
270 /* Legacy for systems yet to multi-arch TARGET_READ_SP */
271 #if !defined (TARGET_READ_SP_P)
272 #define TARGET_READ_SP_P() (1)
273 #endif
274 #endif
275
276 extern int gdbarch_read_sp_p (struct gdbarch *gdbarch);
277 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP_P)
278 #error "Non multi-arch definition of TARGET_READ_SP"
279 #endif
280 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP_P)
281 #define TARGET_READ_SP_P() (gdbarch_read_sp_p (current_gdbarch))
282 #endif
283
284 typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
285 extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
286 extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
287 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP)
288 #error "Non multi-arch definition of TARGET_READ_SP"
289 #endif
290 #if !defined (TARGET_READ_SP)
291 #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
292 #endif
293
294 /* Function for getting target's idea of a frame pointer. FIXME: GDB's
295 whole scheme for dealing with "frames" and "frame pointers" needs a
296 serious shakedown. */
297
298 typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
299 extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
300 extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
301 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER)
302 #error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER"
303 #endif
304 #if !defined (TARGET_VIRTUAL_FRAME_POINTER)
305 #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset))
306 #endif
307
308 extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
309
310 typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
311 extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
312 extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
313
314 extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
315
316 typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
317 extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
318 extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
319
320 extern int gdbarch_num_regs (struct gdbarch *gdbarch);
321 extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
322 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS)
323 #error "Non multi-arch definition of NUM_REGS"
324 #endif
325 #if !defined (NUM_REGS)
326 #define NUM_REGS (gdbarch_num_regs (current_gdbarch))
327 #endif
328
329 /* This macro gives the number of pseudo-registers that live in the
330 register namespace but do not get fetched or stored on the target.
331 These pseudo-registers may be aliases for other registers,
332 combinations of other registers, or they may be computed by GDB. */
333
334 extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
335 extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
336 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
337 #error "Non multi-arch definition of NUM_PSEUDO_REGS"
338 #endif
339 #if !defined (NUM_PSEUDO_REGS)
340 #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch))
341 #endif
342
343 /* GDB's standard (or well known) register numbers. These can map onto
344 a real register or a pseudo (computed) register or not be defined at
345 all (-1).
346 SP_REGNUM will hopefully be replaced by UNWIND_SP. */
347
348 extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
349 extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
350 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
351 #error "Non multi-arch definition of SP_REGNUM"
352 #endif
353 #if !defined (SP_REGNUM)
354 #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
355 #endif
356
357 extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
358 extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
359 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
360 #error "Non multi-arch definition of PC_REGNUM"
361 #endif
362 #if !defined (PC_REGNUM)
363 #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
364 #endif
365
366 extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
367 extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
368 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM)
369 #error "Non multi-arch definition of PS_REGNUM"
370 #endif
371 #if !defined (PS_REGNUM)
372 #define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
373 #endif
374
375 extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
376 extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
377 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
378 #error "Non multi-arch definition of FP0_REGNUM"
379 #endif
380 #if !defined (FP0_REGNUM)
381 #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
382 #endif
383
384 /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
385
386 typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
387 extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
388 extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
389 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM)
390 #error "Non multi-arch definition of STAB_REG_TO_REGNUM"
391 #endif
392 #if !defined (STAB_REG_TO_REGNUM)
393 #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
394 #endif
395
396 /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
397
398 typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
399 extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
400 extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
401 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM)
402 #error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
403 #endif
404 #if !defined (ECOFF_REG_TO_REGNUM)
405 #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
406 #endif
407
408 /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
409
410 typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
411 extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
412 extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
413 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM)
414 #error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
415 #endif
416 #if !defined (DWARF_REG_TO_REGNUM)
417 #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
418 #endif
419
420 /* Convert from an sdb register number to an internal gdb register number. */
421
422 typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
423 extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
424 extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
425 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM)
426 #error "Non multi-arch definition of SDB_REG_TO_REGNUM"
427 #endif
428 #if !defined (SDB_REG_TO_REGNUM)
429 #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
430 #endif
431
432 typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
433 extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
434 extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
435 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM)
436 #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
437 #endif
438 #if !defined (DWARF2_REG_TO_REGNUM)
439 #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
440 #endif
441
442 typedef const char * (gdbarch_register_name_ftype) (int regnr);
443 extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
444 extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
445 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
446 #error "Non multi-arch definition of REGISTER_NAME"
447 #endif
448 #if !defined (REGISTER_NAME)
449 #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
450 #endif
451
452 /* REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE. */
453
454 extern int gdbarch_register_type_p (struct gdbarch *gdbarch);
455
456 typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr);
457 extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr);
458 extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type);
459
460 /* REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE. */
461
462 #if defined (DEPRECATED_REGISTER_VIRTUAL_TYPE)
463 /* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_VIRTUAL_TYPE */
464 #if !defined (DEPRECATED_REGISTER_VIRTUAL_TYPE_P)
465 #define DEPRECATED_REGISTER_VIRTUAL_TYPE_P() (1)
466 #endif
467 #endif
468
469 extern int gdbarch_deprecated_register_virtual_type_p (struct gdbarch *gdbarch);
470 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_VIRTUAL_TYPE_P)
471 #error "Non multi-arch definition of DEPRECATED_REGISTER_VIRTUAL_TYPE"
472 #endif
473 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_VIRTUAL_TYPE_P)
474 #define DEPRECATED_REGISTER_VIRTUAL_TYPE_P() (gdbarch_deprecated_register_virtual_type_p (current_gdbarch))
475 #endif
476
477 typedef struct type * (gdbarch_deprecated_register_virtual_type_ftype) (int reg_nr);
478 extern struct type * gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, int reg_nr);
479 extern void set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type);
480 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_VIRTUAL_TYPE)
481 #error "Non multi-arch definition of DEPRECATED_REGISTER_VIRTUAL_TYPE"
482 #endif
483 #if !defined (DEPRECATED_REGISTER_VIRTUAL_TYPE)
484 #define DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_deprecated_register_virtual_type (current_gdbarch, reg_nr))
485 #endif
486
487 /* DEPRECATED_REGISTER_BYTES can be deleted. The value is computed
488 from REGISTER_TYPE. */
489
490 extern int gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch);
491 extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int deprecated_register_bytes);
492 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTES)
493 #error "Non multi-arch definition of DEPRECATED_REGISTER_BYTES"
494 #endif
495 #if !defined (DEPRECATED_REGISTER_BYTES)
496 #define DEPRECATED_REGISTER_BYTES (gdbarch_deprecated_register_bytes (current_gdbarch))
497 #endif
498
499 /* If the value returned by DEPRECATED_REGISTER_BYTE agrees with the
500 register offsets computed using just REGISTER_TYPE, this can be
501 deleted. See: maint print registers. NOTE: cagney/2002-05-02: This
502 function with predicate has a valid (callable) initial value. As a
503 consequence, even when the predicate is false, the corresponding
504 function works. This simplifies the migration process - old code,
505 calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified. */
506
507 #if defined (DEPRECATED_REGISTER_BYTE)
508 /* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_BYTE */
509 #if !defined (DEPRECATED_REGISTER_BYTE_P)
510 #define DEPRECATED_REGISTER_BYTE_P() (1)
511 #endif
512 #endif
513
514 extern int gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch);
515 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTE_P)
516 #error "Non multi-arch definition of DEPRECATED_REGISTER_BYTE"
517 #endif
518 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_BYTE_P)
519 #define DEPRECATED_REGISTER_BYTE_P() (gdbarch_deprecated_register_byte_p (current_gdbarch))
520 #endif
521
522 typedef int (gdbarch_deprecated_register_byte_ftype) (int reg_nr);
523 extern int gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr);
524 extern void set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, gdbarch_deprecated_register_byte_ftype *deprecated_register_byte);
525 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTE)
526 #error "Non multi-arch definition of DEPRECATED_REGISTER_BYTE"
527 #endif
528 #if !defined (DEPRECATED_REGISTER_BYTE)
529 #define DEPRECATED_REGISTER_BYTE(reg_nr) (gdbarch_deprecated_register_byte (current_gdbarch, reg_nr))
530 #endif
531
532 /* If all registers have identical raw and virtual sizes and those
533 sizes agree with the value computed from REGISTER_TYPE,
534 DEPRECATED_REGISTER_RAW_SIZE can be deleted. See: maint print
535 registers. */
536
537 #if defined (DEPRECATED_REGISTER_RAW_SIZE)
538 /* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_RAW_SIZE */
539 #if !defined (DEPRECATED_REGISTER_RAW_SIZE_P)
540 #define DEPRECATED_REGISTER_RAW_SIZE_P() (1)
541 #endif
542 #endif
543
544 extern int gdbarch_deprecated_register_raw_size_p (struct gdbarch *gdbarch);
545 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_RAW_SIZE_P)
546 #error "Non multi-arch definition of DEPRECATED_REGISTER_RAW_SIZE"
547 #endif
548 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_RAW_SIZE_P)
549 #define DEPRECATED_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_register_raw_size_p (current_gdbarch))
550 #endif
551
552 typedef int (gdbarch_deprecated_register_raw_size_ftype) (int reg_nr);
553 extern int gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, int reg_nr);
554 extern void set_gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size);
555 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_RAW_SIZE)
556 #error "Non multi-arch definition of DEPRECATED_REGISTER_RAW_SIZE"
557 #endif
558 #if !defined (DEPRECATED_REGISTER_RAW_SIZE)
559 #define DEPRECATED_REGISTER_RAW_SIZE(reg_nr) (gdbarch_deprecated_register_raw_size (current_gdbarch, reg_nr))
560 #endif
561
562 /* If all registers have identical raw and virtual sizes and those
563 sizes agree with the value computed from REGISTER_TYPE,
564 DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted. See: maint print
565 registers. */
566
567 #if defined (DEPRECATED_REGISTER_VIRTUAL_SIZE)
568 /* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_VIRTUAL_SIZE */
569 #if !defined (DEPRECATED_REGISTER_VIRTUAL_SIZE_P)
570 #define DEPRECATED_REGISTER_VIRTUAL_SIZE_P() (1)
571 #endif
572 #endif
573
574 extern int gdbarch_deprecated_register_virtual_size_p (struct gdbarch *gdbarch);
575 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_VIRTUAL_SIZE_P)
576 #error "Non multi-arch definition of DEPRECATED_REGISTER_VIRTUAL_SIZE"
577 #endif
578 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_VIRTUAL_SIZE_P)
579 #define DEPRECATED_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_register_virtual_size_p (current_gdbarch))
580 #endif
581
582 typedef int (gdbarch_deprecated_register_virtual_size_ftype) (int reg_nr);
583 extern int gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, int reg_nr);
584 extern void set_gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size);
585 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_VIRTUAL_SIZE)
586 #error "Non multi-arch definition of DEPRECATED_REGISTER_VIRTUAL_SIZE"
587 #endif
588 #if !defined (DEPRECATED_REGISTER_VIRTUAL_SIZE)
589 #define DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_deprecated_register_virtual_size (current_gdbarch, reg_nr))
590 #endif
591
592 /* DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted. It has been
593 replaced by the constant MAX_REGISTER_SIZE. */
594
595 #if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
596 /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
597 #if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
598 #define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (1)
599 #endif
600 #endif
601
602 extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch);
603 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
604 #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
605 #endif
606 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
607 #define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch))
608 #endif
609
610 extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch);
611 extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size);
612 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
613 #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
614 #endif
615 #if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
616 #define DEPRECATED_MAX_REGISTER_RAW_SIZE (gdbarch_deprecated_max_register_raw_size (current_gdbarch))
617 #endif
618
619 /* DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE can be deleted. It has been
620 replaced by the constant MAX_REGISTER_SIZE. */
621
622 #if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
623 /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
624 #if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
625 #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (1)
626 #endif
627 #endif
628
629 extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch);
630 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
631 #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
632 #endif
633 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
634 #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch))
635 #endif
636
637 extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch);
638 extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size);
639 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
640 #error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
641 #endif
642 #if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
643 #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (gdbarch_deprecated_max_register_virtual_size (current_gdbarch))
644 #endif
645
646 /* See gdbint.texinfo, and PUSH_DUMMY_CALL. */
647
648 extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch);
649
650 typedef struct frame_id (gdbarch_unwind_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *info);
651 extern struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info);
652 extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind_dummy_id_ftype *unwind_dummy_id);
653
654 /* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
655 SAVE_DUMMY_FRAME_TOS. */
656
657 #if defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS)
658 /* Legacy for systems yet to multi-arch DEPRECATED_SAVE_DUMMY_FRAME_TOS */
659 #if !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
660 #define DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() (1)
661 #endif
662 #endif
663
664 extern int gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
665 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
666 #error "Non multi-arch definition of DEPRECATED_SAVE_DUMMY_FRAME_TOS"
667 #endif
668 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
669 #define DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() (gdbarch_deprecated_save_dummy_frame_tos_p (current_gdbarch))
670 #endif
671
672 typedef void (gdbarch_deprecated_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
673 extern void gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
674 extern void set_gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_deprecated_save_dummy_frame_tos_ftype *deprecated_save_dummy_frame_tos);
675 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS)
676 #error "Non multi-arch definition of DEPRECATED_SAVE_DUMMY_FRAME_TOS"
677 #endif
678 #if !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS)
679 #define DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_deprecated_save_dummy_frame_tos (current_gdbarch, sp))
680 #endif
681
682 /* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
683 DEPRECATED_FP_REGNUM. */
684
685 extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
686 extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
687 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FP_REGNUM)
688 #error "Non multi-arch definition of DEPRECATED_FP_REGNUM"
689 #endif
690 #if !defined (DEPRECATED_FP_REGNUM)
691 #define DEPRECATED_FP_REGNUM (gdbarch_deprecated_fp_regnum (current_gdbarch))
692 #endif
693
694 /* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
695 DEPRECATED_TARGET_READ_FP. */
696
697 #if defined (DEPRECATED_TARGET_READ_FP)
698 /* Legacy for systems yet to multi-arch DEPRECATED_TARGET_READ_FP */
699 #if !defined (DEPRECATED_TARGET_READ_FP_P)
700 #define DEPRECATED_TARGET_READ_FP_P() (1)
701 #endif
702 #endif
703
704 extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch);
705 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P)
706 #error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
707 #endif
708 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP_P)
709 #define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch))
710 #endif
711
712 typedef CORE_ADDR (gdbarch_deprecated_target_read_fp_ftype) (void);
713 extern CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch);
714 extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp);
715 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP)
716 #error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
717 #endif
718 #if !defined (DEPRECATED_TARGET_READ_FP)
719 #define DEPRECATED_TARGET_READ_FP() (gdbarch_deprecated_target_read_fp (current_gdbarch))
720 #endif
721
722 /* See gdbint.texinfo. See infcall.c. New, all singing all dancing,
723 replacement for DEPRECATED_PUSH_ARGUMENTS. */
724
725 extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
726
727 typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
728 extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
729 extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
730
731 /* PUSH_DUMMY_CALL is a direct replacement for DEPRECATED_PUSH_ARGUMENTS. */
732
733 #if defined (DEPRECATED_PUSH_ARGUMENTS)
734 /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_ARGUMENTS */
735 #if !defined (DEPRECATED_PUSH_ARGUMENTS_P)
736 #define DEPRECATED_PUSH_ARGUMENTS_P() (1)
737 #endif
738 #endif
739
740 extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch);
741 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P)
742 #error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS"
743 #endif
744 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P)
745 #define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch))
746 #endif
747
748 typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
749 extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
750 extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments);
751 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS)
752 #error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS"
753 #endif
754 #if !defined (DEPRECATED_PUSH_ARGUMENTS)
755 #define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
756 #endif
757
758 /* Implement PUSH_RETURN_ADDRESS, and then merge in
759 DEPRECATED_PUSH_RETURN_ADDRESS. */
760
761 #if defined (DEPRECATED_PUSH_RETURN_ADDRESS)
762 /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_RETURN_ADDRESS */
763 #if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
764 #define DEPRECATED_PUSH_RETURN_ADDRESS_P() (1)
765 #endif
766 #endif
767
768 extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch);
769 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
770 #error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS"
771 #endif
772 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
773 #define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch))
774 #endif
775
776 typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
777 extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
778 extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address);
779 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS)
780 #error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS"
781 #endif
782 #if !defined (DEPRECATED_PUSH_RETURN_ADDRESS)
783 #define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_deprecated_push_return_address (current_gdbarch, pc, sp))
784 #endif
785
786 /* Implement PUSH_DUMMY_CALL, then merge in DEPRECATED_DUMMY_WRITE_SP. */
787
788 #if defined (DEPRECATED_DUMMY_WRITE_SP)
789 /* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */
790 #if !defined (DEPRECATED_DUMMY_WRITE_SP_P)
791 #define DEPRECATED_DUMMY_WRITE_SP_P() (1)
792 #endif
793 #endif
794
795 extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch);
796 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P)
797 #error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP"
798 #endif
799 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P)
800 #define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch))
801 #endif
802
803 typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val);
804 extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
805 extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp);
806 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP)
807 #error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP"
808 #endif
809 #if !defined (DEPRECATED_DUMMY_WRITE_SP)
810 #define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val))
811 #endif
812
813 /* DEPRECATED_REGISTER_SIZE can be deleted. */
814
815 extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch);
816 extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size);
817 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_SIZE)
818 #error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE"
819 #endif
820 #if !defined (DEPRECATED_REGISTER_SIZE)
821 #define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
822 #endif
823
824 extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
825 extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
826 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
827 #error "Non multi-arch definition of CALL_DUMMY_LOCATION"
828 #endif
829 #if !defined (CALL_DUMMY_LOCATION)
830 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
831 #endif
832
833 /* DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted. */
834
835 extern CORE_ADDR gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch);
836 extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_start_offset);
837 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
838 #error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_START_OFFSET"
839 #endif
840 #if !defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
841 #define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch))
842 #endif
843
844 /* DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted. */
845
846 extern CORE_ADDR gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
847 extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_breakpoint_offset);
848 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
849 #error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET"
850 #endif
851 #if !defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
852 #define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch))
853 #endif
854
855 /* DEPRECATED_CALL_DUMMY_WORDS can be deleted. */
856
857 extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch);
858 extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words);
859 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS)
860 #error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_WORDS"
861 #endif
862 #if !defined (DEPRECATED_CALL_DUMMY_WORDS)
863 #define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch))
864 #endif
865
866 /* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS. */
867
868 extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch);
869 extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words);
870 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
871 #error "Non multi-arch definition of DEPRECATED_SIZEOF_CALL_DUMMY_WORDS"
872 #endif
873 #if !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
874 #define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch))
875 #endif
876
877 /* DEPRECATED_FIX_CALL_DUMMY can be deleted. For the SPARC, implement
878 PUSH_DUMMY_CODE and set CALL_DUMMY_LOCATION to ON_STACK. */
879
880 #if defined (DEPRECATED_FIX_CALL_DUMMY)
881 /* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */
882 #if !defined (DEPRECATED_FIX_CALL_DUMMY_P)
883 #define DEPRECATED_FIX_CALL_DUMMY_P() (1)
884 #endif
885 #endif
886
887 extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
888 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P)
889 #error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
890 #endif
891 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY_P)
892 #define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch))
893 #endif
894
895 typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
896 extern void gdbarch_deprecated_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);
897 extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy);
898 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY)
899 #error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
900 #endif
901 #if !defined (DEPRECATED_FIX_CALL_DUMMY)
902 #define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_deprecated_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
903 #endif
904
905 /* This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. */
906
907 extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
908
909 typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
910 extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
911 extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
912
913 /* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_PUSH_DUMMY_FRAME. */
914
915 #if defined (DEPRECATED_PUSH_DUMMY_FRAME)
916 /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_DUMMY_FRAME */
917 #if !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
918 #define DEPRECATED_PUSH_DUMMY_FRAME_P() (1)
919 #endif
920 #endif
921
922 extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch);
923 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
924 #error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
925 #endif
926 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
927 #define DEPRECATED_PUSH_DUMMY_FRAME_P() (gdbarch_deprecated_push_dummy_frame_p (current_gdbarch))
928 #endif
929
930 typedef void (gdbarch_deprecated_push_dummy_frame_ftype) (void);
931 extern void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch);
932 extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame);
933 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME)
934 #error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
935 #endif
936 #if !defined (DEPRECATED_PUSH_DUMMY_FRAME)
937 #define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch))
938 #endif
939
940 #if defined (DEPRECATED_DO_REGISTERS_INFO)
941 /* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */
942 #if !defined (DEPRECATED_DO_REGISTERS_INFO_P)
943 #define DEPRECATED_DO_REGISTERS_INFO_P() (1)
944 #endif
945 #endif
946
947 extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch);
948 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P)
949 #error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
950 #endif
951 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P)
952 #define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch))
953 #endif
954
955 typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs);
956 extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
957 extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info);
958 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO)
959 #error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
960 #endif
961 #if !defined (DEPRECATED_DO_REGISTERS_INFO)
962 #define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_deprecated_do_registers_info (current_gdbarch, reg_nr, fpregs))
963 #endif
964
965 typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
966 extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
967 extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
968
969 extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch);
970
971 typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
972 extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
973 extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
974
975 extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
976
977 typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
978 extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
979 extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
980
981 /* MAP a GDB RAW register number onto a simulator register number. See
982 also include/...-sim.h. */
983
984 typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
985 extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
986 extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
987 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO)
988 #error "Non multi-arch definition of REGISTER_SIM_REGNO"
989 #endif
990 #if !defined (REGISTER_SIM_REGNO)
991 #define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
992 #endif
993
994 #if defined (REGISTER_BYTES_OK)
995 /* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
996 #if !defined (REGISTER_BYTES_OK_P)
997 #define REGISTER_BYTES_OK_P() (1)
998 #endif
999 #endif
1000
1001 extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
1002 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
1003 #error "Non multi-arch definition of REGISTER_BYTES_OK"
1004 #endif
1005 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
1006 #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
1007 #endif
1008
1009 typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
1010 extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
1011 extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
1012 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK)
1013 #error "Non multi-arch definition of REGISTER_BYTES_OK"
1014 #endif
1015 #if !defined (REGISTER_BYTES_OK)
1016 #define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
1017 #endif
1018
1019 typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
1020 extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
1021 extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
1022 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER)
1023 #error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
1024 #endif
1025 #if !defined (CANNOT_FETCH_REGISTER)
1026 #define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
1027 #endif
1028
1029 typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
1030 extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
1031 extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
1032 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER)
1033 #error "Non multi-arch definition of CANNOT_STORE_REGISTER"
1034 #endif
1035 #if !defined (CANNOT_STORE_REGISTER)
1036 #define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
1037 #endif
1038
1039 /* setjmp/longjmp support. */
1040
1041 #if defined (GET_LONGJMP_TARGET)
1042 /* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */
1043 #if !defined (GET_LONGJMP_TARGET_P)
1044 #define GET_LONGJMP_TARGET_P() (1)
1045 #endif
1046 #endif
1047
1048 extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
1049 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
1050 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
1051 #endif
1052 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P)
1053 #define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
1054 #endif
1055
1056 typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc);
1057 extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc);
1058 extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
1059 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET)
1060 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
1061 #endif
1062 #if !defined (GET_LONGJMP_TARGET)
1063 #define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
1064 #endif
1065
1066 /* NOTE: cagney/2002-11-24: This function with predicate has a valid
1067 (callable) initial value. As a consequence, even when the predicate
1068 is false, the corresponding function works. This simplifies the
1069 migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
1070 doesn't need to be modified. */
1071
1072 #if defined (DEPRECATED_PC_IN_CALL_DUMMY)
1073 /* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */
1074 #if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
1075 #define DEPRECATED_PC_IN_CALL_DUMMY_P() (1)
1076 #endif
1077 #endif
1078
1079 extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch);
1080 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
1081 #error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
1082 #endif
1083 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
1084 #define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch))
1085 #endif
1086
1087 typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
1088 extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
1089 extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy);
1090 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY)
1091 #error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
1092 #endif
1093 #if !defined (DEPRECATED_PC_IN_CALL_DUMMY)
1094 #define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
1095 #endif
1096
1097 #if defined (DEPRECATED_INIT_FRAME_PC)
1098 /* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */
1099 #if !defined (DEPRECATED_INIT_FRAME_PC_P)
1100 #define DEPRECATED_INIT_FRAME_PC_P() (1)
1101 #endif
1102 #endif
1103
1104 extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch);
1105 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P)
1106 #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC"
1107 #endif
1108 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P)
1109 #define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch))
1110 #endif
1111
1112 typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
1113 extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
1114 extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc);
1115 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC)
1116 #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC"
1117 #endif
1118 #if !defined (DEPRECATED_INIT_FRAME_PC)
1119 #define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (gdbarch_deprecated_init_frame_pc (current_gdbarch, fromleaf, prev))
1120 #endif
1121
1122 extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
1123 extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
1124 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION)
1125 #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION"
1126 #endif
1127 #if !defined (BELIEVE_PCC_PROMOTION)
1128 #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
1129 #endif
1130
1131 #if defined (DEPRECATED_GET_SAVED_REGISTER)
1132 /* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */
1133 #if !defined (DEPRECATED_GET_SAVED_REGISTER_P)
1134 #define DEPRECATED_GET_SAVED_REGISTER_P() (1)
1135 #endif
1136 #endif
1137
1138 extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch);
1139 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P)
1140 #error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
1141 #endif
1142 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P)
1143 #define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch))
1144 #endif
1145
1146 typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1147 extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1148 extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register);
1149 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER)
1150 #error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
1151 #endif
1152 #if !defined (DEPRECATED_GET_SAVED_REGISTER)
1153 #define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
1154 #endif
1155
1156 /* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
1157 For raw <-> cooked register conversions, replaced by pseudo registers. */
1158
1159 #if defined (DEPRECATED_REGISTER_CONVERTIBLE)
1160 /* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_CONVERTIBLE */
1161 #if !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
1162 #define DEPRECATED_REGISTER_CONVERTIBLE_P() (1)
1163 #endif
1164 #endif
1165
1166 extern int gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch);
1167 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
1168 #error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
1169 #endif
1170 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
1171 #define DEPRECATED_REGISTER_CONVERTIBLE_P() (gdbarch_deprecated_register_convertible_p (current_gdbarch))
1172 #endif
1173
1174 typedef int (gdbarch_deprecated_register_convertible_ftype) (int nr);
1175 extern int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr);
1176 extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible);
1177 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE)
1178 #error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
1179 #endif
1180 #if !defined (DEPRECATED_REGISTER_CONVERTIBLE)
1181 #define DEPRECATED_REGISTER_CONVERTIBLE(nr) (gdbarch_deprecated_register_convertible (current_gdbarch, nr))
1182 #endif
1183
1184 /* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
1185 For raw <-> cooked register conversions, replaced by pseudo registers. */
1186
1187 typedef void (gdbarch_deprecated_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
1188 extern void gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
1189 extern void set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual);
1190 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
1191 #error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL"
1192 #endif
1193 #if !defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
1194 #define DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_deprecated_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
1195 #endif
1196
1197 /* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
1198 For raw <-> cooked register conversions, replaced by pseudo registers. */
1199
1200 typedef void (gdbarch_deprecated_register_convert_to_raw_ftype) (struct type *type, int regnum, const char *from, char *to);
1201 extern void gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to);
1202 extern void set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw);
1203 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
1204 #error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_RAW"
1205 #endif
1206 #if !defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
1207 #define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_deprecated_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
1208 #endif
1209
1210 typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type);
1211 extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
1212 extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
1213 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P)
1214 #error "Non multi-arch definition of CONVERT_REGISTER_P"
1215 #endif
1216 #if !defined (CONVERT_REGISTER_P)
1217 #define CONVERT_REGISTER_P(regnum, type) (gdbarch_convert_register_p (current_gdbarch, regnum, type))
1218 #endif
1219
1220 typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, void *buf);
1221 extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf);
1222 extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
1223 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE)
1224 #error "Non multi-arch definition of REGISTER_TO_VALUE"
1225 #endif
1226 #if !defined (REGISTER_TO_VALUE)
1227 #define REGISTER_TO_VALUE(frame, regnum, type, buf) (gdbarch_register_to_value (current_gdbarch, frame, regnum, type, buf))
1228 #endif
1229
1230 typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const void *buf);
1231 extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf);
1232 extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
1233 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER)
1234 #error "Non multi-arch definition of VALUE_TO_REGISTER"
1235 #endif
1236 #if !defined (VALUE_TO_REGISTER)
1237 #define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf))
1238 #endif
1239
1240 typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf);
1241 extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf);
1242 extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
1243 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS)
1244 #error "Non multi-arch definition of POINTER_TO_ADDRESS"
1245 #endif
1246 #if !defined (POINTER_TO_ADDRESS)
1247 #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
1248 #endif
1249
1250 typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
1251 extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
1252 extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
1253 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER)
1254 #error "Non multi-arch definition of ADDRESS_TO_POINTER"
1255 #endif
1256 #if !defined (ADDRESS_TO_POINTER)
1257 #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
1258 #endif
1259
1260 #if defined (INTEGER_TO_ADDRESS)
1261 /* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */
1262 #if !defined (INTEGER_TO_ADDRESS_P)
1263 #define INTEGER_TO_ADDRESS_P() (1)
1264 #endif
1265 #endif
1266
1267 extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
1268 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
1269 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1270 #endif
1271 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P)
1272 #define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
1273 #endif
1274
1275 typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf);
1276 extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
1277 extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
1278 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS)
1279 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1280 #endif
1281 #if !defined (INTEGER_TO_ADDRESS)
1282 #define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf))
1283 #endif
1284
1285 #if defined (DEPRECATED_POP_FRAME)
1286 /* Legacy for systems yet to multi-arch DEPRECATED_POP_FRAME */
1287 #if !defined (DEPRECATED_POP_FRAME_P)
1288 #define DEPRECATED_POP_FRAME_P() (1)
1289 #endif
1290 #endif
1291
1292 extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch);
1293 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P)
1294 #error "Non multi-arch definition of DEPRECATED_POP_FRAME"
1295 #endif
1296 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME_P)
1297 #define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch))
1298 #endif
1299
1300 typedef void (gdbarch_deprecated_pop_frame_ftype) (void);
1301 extern void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch);
1302 extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame);
1303 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME)
1304 #error "Non multi-arch definition of DEPRECATED_POP_FRAME"
1305 #endif
1306 #if !defined (DEPRECATED_POP_FRAME)
1307 #define DEPRECATED_POP_FRAME (gdbarch_deprecated_pop_frame (current_gdbarch))
1308 #endif
1309
1310 /* NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. */
1311
1312 #if defined (DEPRECATED_STORE_STRUCT_RETURN)
1313 /* Legacy for systems yet to multi-arch DEPRECATED_STORE_STRUCT_RETURN */
1314 #if !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1315 #define DEPRECATED_STORE_STRUCT_RETURN_P() (1)
1316 #endif
1317 #endif
1318
1319 extern int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch);
1320 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1321 #error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN"
1322 #endif
1323 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1324 #define DEPRECATED_STORE_STRUCT_RETURN_P() (gdbarch_deprecated_store_struct_return_p (current_gdbarch))
1325 #endif
1326
1327 typedef void (gdbarch_deprecated_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp);
1328 extern void gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp);
1329 extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return);
1330 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN)
1331 #error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN"
1332 #endif
1333 #if !defined (DEPRECATED_STORE_STRUCT_RETURN)
1334 #define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (gdbarch_deprecated_store_struct_return (current_gdbarch, addr, sp))
1335 #endif
1336
1337 /* It has been suggested that this, well actually its predecessor,
1338 should take the type/value of the function to be called and not the
1339 return type. This is left as an exercise for the reader. */
1340
1341 extern int gdbarch_return_value_p (struct gdbarch *gdbarch);
1342
1343 typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf);
1344 extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf);
1345 extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
1346
1347 /* The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
1348 STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
1349 into RETURN_VALUE. */
1350
1351 typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
1352 extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
1353 extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
1354 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
1355 #error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
1356 #endif
1357 #if !defined (RETURN_VALUE_ON_STACK)
1358 #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
1359 #endif
1360
1361 typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf);
1362 extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf);
1363 extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
1364 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
1365 #error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
1366 #endif
1367 #if !defined (EXTRACT_RETURN_VALUE)
1368 #define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
1369 #endif
1370
1371 typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf);
1372 extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf);
1373 extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
1374 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
1375 #error "Non multi-arch definition of STORE_RETURN_VALUE"
1376 #endif
1377 #if !defined (STORE_RETURN_VALUE)
1378 #define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf))
1379 #endif
1380
1381 typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
1382 extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
1383 extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value);
1384 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE)
1385 #error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE"
1386 #endif
1387 #if !defined (DEPRECATED_EXTRACT_RETURN_VALUE)
1388 #define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf))
1389 #endif
1390
1391 typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf);
1392 extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
1393 extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value);
1394 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE)
1395 #error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE"
1396 #endif
1397 #if !defined (DEPRECATED_STORE_RETURN_VALUE)
1398 #define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf))
1399 #endif
1400
1401 typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
1402 extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
1403 extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
1404 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
1405 #error "Non multi-arch definition of USE_STRUCT_CONVENTION"
1406 #endif
1407 #if !defined (USE_STRUCT_CONVENTION)
1408 #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
1409 #endif
1410
1411 /* As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
1412 ABI suitable for the implementation of a robust extract
1413 struct-convention return-value address method (the sparc saves the
1414 address in the callers frame). All the other cases so far examined,
1415 the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been
1416 erreneous - the code was incorrectly assuming that the return-value
1417 address, stored in a register, was preserved across the entire
1418 function call.
1419 For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of
1420 the ABIs that are still to be analyzed - perhaps this should simply
1421 be deleted. The commented out extract_returned_value_address method
1422 is provided as a starting point for the 32-bit SPARC. It, or
1423 something like it, along with changes to both infcmd.c and stack.c
1424 will be needed for that case to work. NB: It is passed the callers
1425 frame since it is only after the callee has returned that this
1426 function is used.
1427 M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */
1428
1429 #if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
1430 /* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
1431 #if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
1432 #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
1433 #endif
1434 #endif
1435
1436 extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch);
1437 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
1438 #error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
1439 #endif
1440 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
1441 #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
1442 #endif
1443
1444 typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (struct regcache *regcache);
1445 extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
1446 extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
1447 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
1448 #error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
1449 #endif
1450 #if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
1451 #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regcache))
1452 #endif
1453
1454 #if defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
1455 /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_INIT_SAVED_REGS */
1456 #if !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
1457 #define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (1)
1458 #endif
1459 #endif
1460
1461 extern int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch);
1462 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
1463 #error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS"
1464 #endif
1465 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
1466 #define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch))
1467 #endif
1468
1469 typedef void (gdbarch_deprecated_frame_init_saved_regs_ftype) (struct frame_info *frame);
1470 extern void gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame);
1471 extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs);
1472 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
1473 #error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS"
1474 #endif
1475 #if !defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
1476 #define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (gdbarch_deprecated_frame_init_saved_regs (current_gdbarch, frame))
1477 #endif
1478
1479 #if defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
1480 /* Legacy for systems yet to multi-arch DEPRECATED_INIT_EXTRA_FRAME_INFO */
1481 #if !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
1482 #define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (1)
1483 #endif
1484 #endif
1485
1486 extern int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch);
1487 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
1488 #error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO"
1489 #endif
1490 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
1491 #define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch))
1492 #endif
1493
1494 typedef void (gdbarch_deprecated_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
1495 extern void gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
1496 extern void set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info);
1497 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
1498 #error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO"
1499 #endif
1500 #if !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
1501 #define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_deprecated_init_extra_frame_info (current_gdbarch, fromleaf, frame))
1502 #endif
1503
1504 typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
1505 extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
1506 extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
1507 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE)
1508 #error "Non multi-arch definition of SKIP_PROLOGUE"
1509 #endif
1510 #if !defined (SKIP_PROLOGUE)
1511 #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
1512 #endif
1513
1514 typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
1515 extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
1516 extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
1517 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN)
1518 #error "Non multi-arch definition of INNER_THAN"
1519 #endif
1520 #if !defined (INNER_THAN)
1521 #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
1522 #endif
1523
1524 typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
1525 extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
1526 extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
1527 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
1528 #error "Non multi-arch definition of BREAKPOINT_FROM_PC"
1529 #endif
1530 #if !defined (BREAKPOINT_FROM_PC)
1531 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
1532 #endif
1533
1534 extern int gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch);
1535
1536 typedef CORE_ADDR (gdbarch_adjust_breakpoint_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
1537 extern CORE_ADDR gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
1538 extern void set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address);
1539
1540 typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
1541 extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
1542 extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
1543 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
1544 #error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
1545 #endif
1546 #if !defined (MEMORY_INSERT_BREAKPOINT)
1547 #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
1548 #endif
1549
1550 typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
1551 extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
1552 extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
1553 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
1554 #error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
1555 #endif
1556 #if !defined (MEMORY_REMOVE_BREAKPOINT)
1557 #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
1558 #endif
1559
1560 extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
1561 extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
1562 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
1563 #error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
1564 #endif
1565 #if !defined (DECR_PC_AFTER_BREAK)
1566 #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
1567 #endif
1568
1569 extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
1570 extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
1571 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
1572 #error "Non multi-arch definition of FUNCTION_START_OFFSET"
1573 #endif
1574 #if !defined (FUNCTION_START_OFFSET)
1575 #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
1576 #endif
1577
1578 typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
1579 extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
1580 extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
1581
1582 extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
1583 extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
1584 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
1585 #error "Non multi-arch definition of FRAME_ARGS_SKIP"
1586 #endif
1587 #if !defined (FRAME_ARGS_SKIP)
1588 #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
1589 #endif
1590
1591 /* DEPRECATED_FRAMELESS_FUNCTION_INVOCATION is not needed. The new
1592 frame code works regardless of the type of frame - frameless,
1593 stackless, or normal. */
1594
1595 #if defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION)
1596 /* Legacy for systems yet to multi-arch DEPRECATED_FRAMELESS_FUNCTION_INVOCATION */
1597 #if !defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P)
1598 #define DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() (1)
1599 #endif
1600 #endif
1601
1602 extern int gdbarch_deprecated_frameless_function_invocation_p (struct gdbarch *gdbarch);
1603 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P)
1604 #error "Non multi-arch definition of DEPRECATED_FRAMELESS_FUNCTION_INVOCATION"
1605 #endif
1606 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P)
1607 #define DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() (gdbarch_deprecated_frameless_function_invocation_p (current_gdbarch))
1608 #endif
1609
1610 typedef int (gdbarch_deprecated_frameless_function_invocation_ftype) (struct frame_info *fi);
1611 extern int gdbarch_deprecated_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
1612 extern void set_gdbarch_deprecated_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_deprecated_frameless_function_invocation_ftype *deprecated_frameless_function_invocation);
1613 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION)
1614 #error "Non multi-arch definition of DEPRECATED_FRAMELESS_FUNCTION_INVOCATION"
1615 #endif
1616 #if !defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION)
1617 #define DEPRECATED_FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_deprecated_frameless_function_invocation (current_gdbarch, fi))
1618 #endif
1619
1620 #if defined (DEPRECATED_FRAME_CHAIN)
1621 /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN */
1622 #if !defined (DEPRECATED_FRAME_CHAIN_P)
1623 #define DEPRECATED_FRAME_CHAIN_P() (1)
1624 #endif
1625 #endif
1626
1627 extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch);
1628 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P)
1629 #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
1630 #endif
1631 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_P)
1632 #define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch))
1633 #endif
1634
1635 typedef CORE_ADDR (gdbarch_deprecated_frame_chain_ftype) (struct frame_info *frame);
1636 extern CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
1637 extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain);
1638 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN)
1639 #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
1640 #endif
1641 #if !defined (DEPRECATED_FRAME_CHAIN)
1642 #define DEPRECATED_FRAME_CHAIN(frame) (gdbarch_deprecated_frame_chain (current_gdbarch, frame))
1643 #endif
1644
1645 #if defined (DEPRECATED_FRAME_CHAIN_VALID)
1646 /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN_VALID */
1647 #if !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
1648 #define DEPRECATED_FRAME_CHAIN_VALID_P() (1)
1649 #endif
1650 #endif
1651
1652 extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch);
1653 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P)
1654 #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
1655 #endif
1656 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
1657 #define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch))
1658 #endif
1659
1660 typedef int (gdbarch_deprecated_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
1661 extern int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
1662 extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid);
1663 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID)
1664 #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
1665 #endif
1666 #if !defined (DEPRECATED_FRAME_CHAIN_VALID)
1667 #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_deprecated_frame_chain_valid (current_gdbarch, chain, thisframe))
1668 #endif
1669
1670 /* DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please
1671 note, per UNWIND_PC's doco, that while the two have similar
1672 interfaces they have very different underlying implementations. */
1673
1674 #if defined (DEPRECATED_FRAME_SAVED_PC)
1675 /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_SAVED_PC */
1676 #if !defined (DEPRECATED_FRAME_SAVED_PC_P)
1677 #define DEPRECATED_FRAME_SAVED_PC_P() (1)
1678 #endif
1679 #endif
1680
1681 extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch);
1682 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P)
1683 #error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
1684 #endif
1685 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC_P)
1686 #define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch))
1687 #endif
1688
1689 typedef CORE_ADDR (gdbarch_deprecated_frame_saved_pc_ftype) (struct frame_info *fi);
1690 extern CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
1691 extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc);
1692 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC)
1693 #error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
1694 #endif
1695 #if !defined (DEPRECATED_FRAME_SAVED_PC)
1696 #define DEPRECATED_FRAME_SAVED_PC(fi) (gdbarch_deprecated_frame_saved_pc (current_gdbarch, fi))
1697 #endif
1698
1699 extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch);
1700
1701 typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
1702 extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
1703 extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
1704
1705 extern int gdbarch_unwind_sp_p (struct gdbarch *gdbarch);
1706
1707 typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
1708 extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame);
1709 extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp);
1710
1711 /* DEPRECATED_FRAME_ARGS_ADDRESS as been replaced by the per-frame
1712 frame-base. Enable frame-base before frame-unwind. */
1713
1714 #if defined (DEPRECATED_FRAME_ARGS_ADDRESS)
1715 /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_ARGS_ADDRESS */
1716 #if !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
1717 #define DEPRECATED_FRAME_ARGS_ADDRESS_P() (1)
1718 #endif
1719 #endif
1720
1721 extern int gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch);
1722 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
1723 #error "Non multi-arch definition of DEPRECATED_FRAME_ARGS_ADDRESS"
1724 #endif
1725 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
1726 #define DEPRECATED_FRAME_ARGS_ADDRESS_P() (gdbarch_deprecated_frame_args_address_p (current_gdbarch))
1727 #endif
1728
1729 typedef CORE_ADDR (gdbarch_deprecated_frame_args_address_ftype) (struct frame_info *fi);
1730 extern CORE_ADDR gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
1731 extern void set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, gdbarch_deprecated_frame_args_address_ftype *deprecated_frame_args_address);
1732 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_ARGS_ADDRESS)
1733 #error "Non multi-arch definition of DEPRECATED_FRAME_ARGS_ADDRESS"
1734 #endif
1735 #if !defined (DEPRECATED_FRAME_ARGS_ADDRESS)
1736 #define DEPRECATED_FRAME_ARGS_ADDRESS(fi) (gdbarch_deprecated_frame_args_address (current_gdbarch, fi))
1737 #endif
1738
1739 /* DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
1740 frame-base. Enable frame-base before frame-unwind. */
1741
1742 #if defined (DEPRECATED_FRAME_LOCALS_ADDRESS)
1743 /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_LOCALS_ADDRESS */
1744 #if !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
1745 #define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (1)
1746 #endif
1747 #endif
1748
1749 extern int gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch);
1750 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
1751 #error "Non multi-arch definition of DEPRECATED_FRAME_LOCALS_ADDRESS"
1752 #endif
1753 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
1754 #define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (gdbarch_deprecated_frame_locals_address_p (current_gdbarch))
1755 #endif
1756
1757 typedef CORE_ADDR (gdbarch_deprecated_frame_locals_address_ftype) (struct frame_info *fi);
1758 extern CORE_ADDR gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
1759 extern void set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address);
1760 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_LOCALS_ADDRESS)
1761 #error "Non multi-arch definition of DEPRECATED_FRAME_LOCALS_ADDRESS"
1762 #endif
1763 #if !defined (DEPRECATED_FRAME_LOCALS_ADDRESS)
1764 #define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) (gdbarch_deprecated_frame_locals_address (current_gdbarch, fi))
1765 #endif
1766
1767 #if defined (DEPRECATED_SAVED_PC_AFTER_CALL)
1768 /* Legacy for systems yet to multi-arch DEPRECATED_SAVED_PC_AFTER_CALL */
1769 #if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
1770 #define DEPRECATED_SAVED_PC_AFTER_CALL_P() (1)
1771 #endif
1772 #endif
1773
1774 extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch);
1775 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
1776 #error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
1777 #endif
1778 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
1779 #define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch))
1780 #endif
1781
1782 typedef CORE_ADDR (gdbarch_deprecated_saved_pc_after_call_ftype) (struct frame_info *frame);
1783 extern CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
1784 extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call);
1785 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL)
1786 #error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
1787 #endif
1788 #if !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
1789 #define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (gdbarch_deprecated_saved_pc_after_call (current_gdbarch, frame))
1790 #endif
1791
1792 #if defined (FRAME_NUM_ARGS)
1793 /* Legacy for systems yet to multi-arch FRAME_NUM_ARGS */
1794 #if !defined (FRAME_NUM_ARGS_P)
1795 #define FRAME_NUM_ARGS_P() (1)
1796 #endif
1797 #endif
1798
1799 extern int gdbarch_frame_num_args_p (struct gdbarch *gdbarch);
1800 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS_P)
1801 #error "Non multi-arch definition of FRAME_NUM_ARGS"
1802 #endif
1803 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS_P)
1804 #define FRAME_NUM_ARGS_P() (gdbarch_frame_num_args_p (current_gdbarch))
1805 #endif
1806
1807 typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
1808 extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
1809 extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
1810 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
1811 #error "Non multi-arch definition of FRAME_NUM_ARGS"
1812 #endif
1813 #if !defined (FRAME_NUM_ARGS)
1814 #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
1815 #endif
1816
1817 /* DEPRECATED_STACK_ALIGN has been replaced by an initial aligning call
1818 to frame_align and the requirement that methods such as
1819 push_dummy_call and frame_red_zone_size maintain correct stack/frame
1820 alignment. */
1821
1822 #if defined (DEPRECATED_STACK_ALIGN)
1823 /* Legacy for systems yet to multi-arch DEPRECATED_STACK_ALIGN */
1824 #if !defined (DEPRECATED_STACK_ALIGN_P)
1825 #define DEPRECATED_STACK_ALIGN_P() (1)
1826 #endif
1827 #endif
1828
1829 extern int gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch);
1830 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STACK_ALIGN_P)
1831 #error "Non multi-arch definition of DEPRECATED_STACK_ALIGN"
1832 #endif
1833 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STACK_ALIGN_P)
1834 #define DEPRECATED_STACK_ALIGN_P() (gdbarch_deprecated_stack_align_p (current_gdbarch))
1835 #endif
1836
1837 typedef CORE_ADDR (gdbarch_deprecated_stack_align_ftype) (CORE_ADDR sp);
1838 extern CORE_ADDR gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
1839 extern void set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, gdbarch_deprecated_stack_align_ftype *deprecated_stack_align);
1840 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STACK_ALIGN)
1841 #error "Non multi-arch definition of DEPRECATED_STACK_ALIGN"
1842 #endif
1843 #if !defined (DEPRECATED_STACK_ALIGN)
1844 #define DEPRECATED_STACK_ALIGN(sp) (gdbarch_deprecated_stack_align (current_gdbarch, sp))
1845 #endif
1846
1847 extern int gdbarch_frame_align_p (struct gdbarch *gdbarch);
1848
1849 typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
1850 extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
1851 extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
1852
1853 /* DEPRECATED_REG_STRUCT_HAS_ADDR has been replaced by
1854 stabs_argument_has_addr. */
1855
1856 #if defined (DEPRECATED_REG_STRUCT_HAS_ADDR)
1857 /* Legacy for systems yet to multi-arch DEPRECATED_REG_STRUCT_HAS_ADDR */
1858 #if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
1859 #define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (1)
1860 #endif
1861 #endif
1862
1863 extern int gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch);
1864 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
1865 #error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR"
1866 #endif
1867 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
1868 #define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch))
1869 #endif
1870
1871 typedef int (gdbarch_deprecated_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
1872 extern int gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
1873 extern void set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr);
1874 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR)
1875 #error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR"
1876 #endif
1877 #if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR)
1878 #define DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_deprecated_reg_struct_has_addr (current_gdbarch, gcc_p, type))
1879 #endif
1880
1881 typedef int (gdbarch_stabs_argument_has_addr_ftype) (struct gdbarch *gdbarch, struct type *type);
1882 extern int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type);
1883 extern void set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr);
1884
1885 extern int gdbarch_frame_red_zone_size (struct gdbarch *gdbarch);
1886 extern void set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, int frame_red_zone_size);
1887 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_RED_ZONE_SIZE)
1888 #error "Non multi-arch definition of FRAME_RED_ZONE_SIZE"
1889 #endif
1890 #if !defined (FRAME_RED_ZONE_SIZE)
1891 #define FRAME_RED_ZONE_SIZE (gdbarch_frame_red_zone_size (current_gdbarch))
1892 #endif
1893
1894 extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
1895 extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
1896 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
1897 #error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
1898 #endif
1899 #if !defined (TARGET_FLOAT_FORMAT)
1900 #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
1901 #endif
1902
1903 extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
1904 extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
1905 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
1906 #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
1907 #endif
1908 #if !defined (TARGET_DOUBLE_FORMAT)
1909 #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
1910 #endif
1911
1912 extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
1913 extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
1914 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
1915 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
1916 #endif
1917 #if !defined (TARGET_LONG_DOUBLE_FORMAT)
1918 #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
1919 #endif
1920
1921 typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
1922 extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
1923 extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
1924
1925 /* On some machines there are bits in addresses which are not really
1926 part of the address, but are used by the kernel, the hardware, etc.
1927 for special purposes. ADDR_BITS_REMOVE takes out any such bits so
1928 we get a "real" address such as one would find in a symbol table.
1929 This is used only for addresses of instructions, and even then I'm
1930 not sure it's used in all contexts. It exists to deal with there
1931 being a few stray bits in the PC which would mislead us, not as some
1932 sort of generic thing to handle alignment or segmentation (it's
1933 possible it should be in TARGET_READ_PC instead). */
1934
1935 typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
1936 extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
1937 extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
1938 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
1939 #error "Non multi-arch definition of ADDR_BITS_REMOVE"
1940 #endif
1941 #if !defined (ADDR_BITS_REMOVE)
1942 #define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
1943 #endif
1944
1945 /* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
1946 ADDR_BITS_REMOVE. */
1947
1948 typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
1949 extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
1950 extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
1951 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
1952 #error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
1953 #endif
1954 #if !defined (SMASH_TEXT_ADDRESS)
1955 #define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
1956 #endif
1957
1958 /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
1959 the target needs software single step. An ISA method to implement it.
1960
1961 FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
1962 using the breakpoint system instead of blatting memory directly (as with rs6000).
1963
1964 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
1965 single step. If not, then implement single step using breakpoints. */
1966
1967 #if defined (SOFTWARE_SINGLE_STEP)
1968 /* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
1969 #if !defined (SOFTWARE_SINGLE_STEP_P)
1970 #define SOFTWARE_SINGLE_STEP_P() (1)
1971 #endif
1972 #endif
1973
1974 extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
1975 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
1976 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
1977 #endif
1978 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
1979 #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
1980 #endif
1981
1982 typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
1983 extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
1984 extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
1985 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
1986 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
1987 #endif
1988 #if !defined (SOFTWARE_SINGLE_STEP)
1989 #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
1990 #endif
1991
1992 /* FIXME: cagney/2003-08-28: Need to find a better way of selecting the
1993 disassembler. Perhaphs objdump can handle it? */
1994
1995 typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, struct disassemble_info *info);
1996 extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info);
1997 extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
1998 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
1999 #error "Non multi-arch definition of TARGET_PRINT_INSN"
2000 #endif
2001 #if !defined (TARGET_PRINT_INSN)
2002 #define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
2003 #endif
2004
2005 typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
2006 extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
2007 extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
2008 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
2009 #error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
2010 #endif
2011 #if !defined (SKIP_TRAMPOLINE_CODE)
2012 #define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
2013 #endif
2014
2015 /* If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
2016 evaluates non-zero, this is the address where the debugger will place
2017 a step-resume breakpoint to get us past the dynamic linker. */
2018
2019 typedef CORE_ADDR (gdbarch_skip_solib_resolver_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc);
2020 extern CORE_ADDR gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc);
2021 extern void set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype *skip_solib_resolver);
2022
2023 /* For SVR4 shared libraries, each call goes through a small piece of
2024 trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
2025 to nonzero if we are currently stopped in one of these. */
2026
2027 typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
2028 extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2029 extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
2030 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
2031 #error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
2032 #endif
2033 #if !defined (IN_SOLIB_CALL_TRAMPOLINE)
2034 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
2035 #endif
2036
2037 /* Some systems also have trampoline code for returning from shared libs. */
2038
2039 typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name);
2040 extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2041 extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
2042 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE)
2043 #error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE"
2044 #endif
2045 #if !defined (IN_SOLIB_RETURN_TRAMPOLINE)
2046 #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
2047 #endif
2048
2049 /* A target might have problems with watchpoints as soon as the stack
2050 frame of the current function has been destroyed. This mostly happens
2051 as the first action in a funtion's epilogue. in_function_epilogue_p()
2052 is defined to return a non-zero value if either the given addr is one
2053 instruction after the stack destroying instruction up to the trailing
2054 return instruction or if we can figure out that the stack frame has
2055 already been invalidated regardless of the value of addr. Targets
2056 which don't suffer from that problem could just let this functionality
2057 untouched. */
2058
2059 typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
2060 extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
2061 extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
2062
2063 /* Given a vector of command-line arguments, return a newly allocated
2064 string which, when passed to the create_inferior function, will be
2065 parsed (on Unix systems, by the shell) to yield the same vector.
2066 This function should call error() if the argument vector is not
2067 representable for this target or if this target does not support
2068 command-line arguments.
2069 ARGC is the number of elements in the vector.
2070 ARGV is an array of strings, one per argument. */
2071
2072 typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv);
2073 extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
2074 extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
2075
2076 typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
2077 extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
2078 extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
2079 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL)
2080 #error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL"
2081 #endif
2082 #if !defined (ELF_MAKE_MSYMBOL_SPECIAL)
2083 #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
2084 #endif
2085
2086 typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
2087 extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
2088 extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
2089 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL)
2090 #error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL"
2091 #endif
2092 #if !defined (COFF_MAKE_MSYMBOL_SPECIAL)
2093 #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
2094 #endif
2095
2096 extern const char * gdbarch_name_of_malloc (struct gdbarch *gdbarch);
2097 extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * name_of_malloc);
2098 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NAME_OF_MALLOC)
2099 #error "Non multi-arch definition of NAME_OF_MALLOC"
2100 #endif
2101 #if !defined (NAME_OF_MALLOC)
2102 #define NAME_OF_MALLOC (gdbarch_name_of_malloc (current_gdbarch))
2103 #endif
2104
2105 extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
2106 extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
2107 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
2108 #error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
2109 #endif
2110 #if !defined (CANNOT_STEP_BREAKPOINT)
2111 #define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
2112 #endif
2113
2114 extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
2115 extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
2116 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
2117 #error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
2118 #endif
2119 #if !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
2120 #define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
2121 #endif
2122
2123 #if defined (ADDRESS_CLASS_TYPE_FLAGS)
2124 /* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */
2125 #if !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
2126 #define ADDRESS_CLASS_TYPE_FLAGS_P() (1)
2127 #endif
2128 #endif
2129
2130 extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
2131 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P)
2132 #error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
2133 #endif
2134 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
2135 #define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch))
2136 #endif
2137
2138 typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
2139 extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
2140 extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
2141 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS)
2142 #error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
2143 #endif
2144 #if !defined (ADDRESS_CLASS_TYPE_FLAGS)
2145 #define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (gdbarch_address_class_type_flags (current_gdbarch, byte_size, dwarf2_addr_class))
2146 #endif
2147
2148 extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
2149
2150 typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags);
2151 extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags);
2152 extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
2153
2154 extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
2155
2156 typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
2157 extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
2158 extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
2159
2160 /* Is a register in a group */
2161
2162 typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
2163 extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
2164 extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
2165
2166 /* Fetch the pointer to the ith function argument. */
2167
2168 #if defined (FETCH_POINTER_ARGUMENT)
2169 /* Legacy for systems yet to multi-arch FETCH_POINTER_ARGUMENT */
2170 #if !defined (FETCH_POINTER_ARGUMENT_P)
2171 #define FETCH_POINTER_ARGUMENT_P() (1)
2172 #endif
2173 #endif
2174
2175 extern int gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch);
2176 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_POINTER_ARGUMENT_P)
2177 #error "Non multi-arch definition of FETCH_POINTER_ARGUMENT"
2178 #endif
2179 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_POINTER_ARGUMENT_P)
2180 #define FETCH_POINTER_ARGUMENT_P() (gdbarch_fetch_pointer_argument_p (current_gdbarch))
2181 #endif
2182
2183 typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *frame, int argi, struct type *type);
2184 extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type);
2185 extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument);
2186 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_POINTER_ARGUMENT)
2187 #error "Non multi-arch definition of FETCH_POINTER_ARGUMENT"
2188 #endif
2189 #if !defined (FETCH_POINTER_ARGUMENT)
2190 #define FETCH_POINTER_ARGUMENT(frame, argi, type) (gdbarch_fetch_pointer_argument (current_gdbarch, frame, argi, type))
2191 #endif
2192
2193 /* Return the appropriate register set for a core file section with
2194 name SECT_NAME and size SECT_SIZE. */
2195
2196 extern int gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch);
2197
2198 typedef const struct regset * (gdbarch_regset_from_core_section_ftype) (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size);
2199 extern const struct regset * gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size);
2200 extern void set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, gdbarch_regset_from_core_section_ftype *regset_from_core_section);
2201
2202 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
2203
2204
2205 /* Mechanism for co-ordinating the selection of a specific
2206 architecture.
2207
2208 GDB targets (*-tdep.c) can register an interest in a specific
2209 architecture. Other GDB components can register a need to maintain
2210 per-architecture data.
2211
2212 The mechanisms below ensures that there is only a loose connection
2213 between the set-architecture command and the various GDB
2214 components. Each component can independently register their need
2215 to maintain architecture specific data with gdbarch.
2216
2217 Pragmatics:
2218
2219 Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
2220 didn't scale.
2221
2222 The more traditional mega-struct containing architecture specific
2223 data for all the various GDB components was also considered. Since
2224 GDB is built from a variable number of (fairly independent)
2225 components it was determined that the global aproach was not
2226 applicable. */
2227
2228
2229 /* Register a new architectural family with GDB.
2230
2231 Register support for the specified ARCHITECTURE with GDB. When
2232 gdbarch determines that the specified architecture has been
2233 selected, the corresponding INIT function is called.
2234
2235 --
2236
2237 The INIT function takes two parameters: INFO which contains the
2238 information available to gdbarch about the (possibly new)
2239 architecture; ARCHES which is a list of the previously created
2240 ``struct gdbarch'' for this architecture.
2241
2242 The INFO parameter is, as far as possible, be pre-initialized with
2243 information obtained from INFO.ABFD or the previously selected
2244 architecture.
2245
2246 The ARCHES parameter is a linked list (sorted most recently used)
2247 of all the previously created architures for this architecture
2248 family. The (possibly NULL) ARCHES->gdbarch can used to access
2249 values from the previously selected architecture for this
2250 architecture family. The global ``current_gdbarch'' shall not be
2251 used.
2252
2253 The INIT function shall return any of: NULL - indicating that it
2254 doesn't recognize the selected architecture; an existing ``struct
2255 gdbarch'' from the ARCHES list - indicating that the new
2256 architecture is just a synonym for an earlier architecture (see
2257 gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
2258 - that describes the selected architecture (see gdbarch_alloc()).
2259
2260 The DUMP_TDEP function shall print out all target specific values.
2261 Care should be taken to ensure that the function works in both the
2262 multi-arch and non- multi-arch cases. */
2263
2264 struct gdbarch_list
2265 {
2266 struct gdbarch *gdbarch;
2267 struct gdbarch_list *next;
2268 };
2269
2270 struct gdbarch_info
2271 {
2272 /* Use default: NULL (ZERO). */
2273 const struct bfd_arch_info *bfd_arch_info;
2274
2275 /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
2276 int byte_order;
2277
2278 /* Use default: NULL (ZERO). */
2279 bfd *abfd;
2280
2281 /* Use default: NULL (ZERO). */
2282 struct gdbarch_tdep_info *tdep_info;
2283
2284 /* Use default: GDB_OSABI_UNINITIALIZED (-1). */
2285 enum gdb_osabi osabi;
2286 };
2287
2288 typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
2289 typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
2290
2291 /* DEPRECATED - use gdbarch_register() */
2292 extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
2293
2294 extern void gdbarch_register (enum bfd_architecture architecture,
2295 gdbarch_init_ftype *,
2296 gdbarch_dump_tdep_ftype *);
2297
2298
2299 /* Return a freshly allocated, NULL terminated, array of the valid
2300 architecture names. Since architectures are registered during the
2301 _initialize phase this function only returns useful information
2302 once initialization has been completed. */
2303
2304 extern const char **gdbarch_printable_names (void);
2305
2306
2307 /* Helper function. Search the list of ARCHES for a GDBARCH that
2308 matches the information provided by INFO. */
2309
2310 extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
2311
2312
2313 /* Helper function. Create a preliminary ``struct gdbarch''. Perform
2314 basic initialization using values obtained from the INFO andTDEP
2315 parameters. set_gdbarch_*() functions are called to complete the
2316 initialization of the object. */
2317
2318 extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
2319
2320
2321 /* Helper function. Free a partially-constructed ``struct gdbarch''.
2322 It is assumed that the caller freeds the ``struct
2323 gdbarch_tdep''. */
2324
2325 extern void gdbarch_free (struct gdbarch *);
2326
2327
2328 /* Helper function. Allocate memory from the ``struct gdbarch''
2329 obstack. The memory is freed when the corresponding architecture
2330 is also freed. */
2331
2332 extern void *gdbarch_obstack_zalloc (struct gdbarch *gdbarch, long size);
2333 #define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), (NR) * sizeof (TYPE)))
2334 #define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), sizeof (TYPE)))
2335
2336
2337 /* Helper function. Force an update of the current architecture.
2338
2339 The actual architecture selected is determined by INFO, ``(gdb) set
2340 architecture'' et.al., the existing architecture and BFD's default
2341 architecture. INFO should be initialized to zero and then selected
2342 fields should be updated.
2343
2344 Returns non-zero if the update succeeds */
2345
2346 extern int gdbarch_update_p (struct gdbarch_info info);
2347
2348
2349 /* Helper function. Find an architecture matching info.
2350
2351 INFO should be initialized using gdbarch_info_init, relevant fields
2352 set, and then finished using gdbarch_info_fill.
2353
2354 Returns the corresponding architecture, or NULL if no matching
2355 architecture was found. "current_gdbarch" is not updated. */
2356
2357 extern struct gdbarch *gdbarch_find_by_info (struct gdbarch_info info);
2358
2359
2360 /* Helper function. Set the global "current_gdbarch" to "gdbarch".
2361
2362 FIXME: kettenis/20031124: Of the functions that follow, only
2363 gdbarch_from_bfd is supposed to survive. The others will
2364 dissappear since in the future GDB will (hopefully) be truly
2365 multi-arch. However, for now we're still stuck with the concept of
2366 a single active architecture. */
2367
2368 extern void deprecated_current_gdbarch_select_hack (struct gdbarch *gdbarch);
2369
2370
2371 /* Register per-architecture data-pointer.
2372
2373 Reserve space for a per-architecture data-pointer. An identifier
2374 for the reserved data-pointer is returned. That identifer should
2375 be saved in a local static variable.
2376
2377 Memory for the per-architecture data shall be allocated using
2378 gdbarch_obstack_zalloc. That memory will be deleted when the
2379 corresponding architecture object is deleted.
2380
2381 When a previously created architecture is re-selected, the
2382 per-architecture data-pointer for that previous architecture is
2383 restored. INIT() is not re-called.
2384
2385 Multiple registrarants for any architecture are allowed (and
2386 strongly encouraged). */
2387
2388 struct gdbarch_data;
2389
2390 typedef void *(gdbarch_data_pre_init_ftype) (struct obstack *obstack);
2391 extern struct gdbarch_data *gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *init);
2392 typedef void *(gdbarch_data_post_init_ftype) (struct gdbarch *gdbarch);
2393 extern struct gdbarch_data *gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *init);
2394 extern void deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
2395 struct gdbarch_data *data,
2396 void *pointer);
2397
2398 extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
2399
2400
2401
2402 /* Register per-architecture memory region.
2403
2404 Provide a memory-region swap mechanism. Per-architecture memory
2405 region are created. These memory regions are swapped whenever the
2406 architecture is changed. For a new architecture, the memory region
2407 is initialized with zero (0) and the INIT function is called.
2408
2409 Memory regions are swapped / initialized in the order that they are
2410 registered. NULL DATA and/or INIT values can be specified.
2411
2412 New code should use gdbarch_data_register_*(). */
2413
2414 typedef void (gdbarch_swap_ftype) (void);
2415 extern void deprecated_register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
2416 #define DEPRECATED_REGISTER_GDBARCH_SWAP(VAR) deprecated_register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
2417
2418
2419
2420 /* Set the dynamic target-system-dependent parameters (architecture,
2421 byte-order, ...) using information found in the BFD */
2422
2423 extern void set_gdbarch_from_file (bfd *);
2424
2425
2426 /* Initialize the current architecture to the "first" one we find on
2427 our list. */
2428
2429 extern void initialize_current_architecture (void);
2430
2431 /* gdbarch trace variable */
2432 extern int gdbarch_debug;
2433
2434 extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
2435
2436 #endif
This page took 0.111712 seconds and 4 git commands to generate.