1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
4 Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* This file was created with the aid of ``gdbarch.sh''.
25 The Bourne shell script ``gdbarch.sh'' creates the files
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
30 If editing this file, please also run gdbarch.sh and merge any
31 changes into that script. Conversely, when making sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
38 #include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
40 /* Pull in function declarations refered to, indirectly, via macros. */
41 #include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
42 #include "inferior.h" /* For unsigned_address_to_pointer(). */
48 struct minimal_symbol;
50 extern struct gdbarch *current_gdbarch;
53 /* If any of the following are defined, the target wasn't correctly
57 #if defined (EXTRA_FRAME_INFO)
58 #error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info"
63 #if defined (FRAME_FIND_SAVED_REGS)
64 #error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS"
68 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
69 #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
73 /* The following are pre-initialized by GDBARCH. */
75 extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
76 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
77 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE)
78 #error "Non multi-arch definition of TARGET_ARCHITECTURE"
81 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE)
82 #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
86 extern int gdbarch_byte_order (struct gdbarch *gdbarch);
87 /* set_gdbarch_byte_order() - not applicable - pre-initialized. */
88 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER)
89 #error "Non multi-arch definition of TARGET_BYTE_ORDER"
92 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER)
93 #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
98 /* The following are initialized by the target dependent code. */
100 /* Number of bits in a char or unsigned char for the target machine.
101 Just like CHAR_BIT in <limits.h> but describes the target machine.
102 v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
104 Number of bits in a short or unsigned short for the target machine. */
106 /* Default (value) for non- multi-arch platforms. */
107 #if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT)
108 #define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT)
111 extern int gdbarch_short_bit (struct gdbarch *gdbarch);
112 extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
113 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
114 #error "Non multi-arch definition of TARGET_SHORT_BIT"
117 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT)
118 #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
122 /* Number of bits in an int or unsigned int for the target machine. */
124 /* Default (value) for non- multi-arch platforms. */
125 #if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT)
126 #define TARGET_INT_BIT (4*TARGET_CHAR_BIT)
129 extern int gdbarch_int_bit (struct gdbarch *gdbarch);
130 extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
131 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
132 #error "Non multi-arch definition of TARGET_INT_BIT"
135 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT)
136 #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
140 /* Number of bits in a long or unsigned long for the target machine. */
142 /* Default (value) for non- multi-arch platforms. */
143 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT)
144 #define TARGET_LONG_BIT (4*TARGET_CHAR_BIT)
147 extern int gdbarch_long_bit (struct gdbarch *gdbarch);
148 extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
149 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
150 #error "Non multi-arch definition of TARGET_LONG_BIT"
153 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT)
154 #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
158 /* Number of bits in a long long or unsigned long long for the target
161 /* Default (value) for non- multi-arch platforms. */
162 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT)
163 #define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT)
166 extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
167 extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
168 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
169 #error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
172 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT)
173 #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
177 /* Number of bits in a float for the target machine. */
179 /* Default (value) for non- multi-arch platforms. */
180 #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT)
181 #define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT)
184 extern int gdbarch_float_bit (struct gdbarch *gdbarch);
185 extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
186 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
187 #error "Non multi-arch definition of TARGET_FLOAT_BIT"
190 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT)
191 #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
195 /* Number of bits in a double for the target machine. */
197 /* Default (value) for non- multi-arch platforms. */
198 #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT)
199 #define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT)
202 extern int gdbarch_double_bit (struct gdbarch *gdbarch);
203 extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
204 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
205 #error "Non multi-arch definition of TARGET_DOUBLE_BIT"
208 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT)
209 #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
213 /* Number of bits in a long double for the target machine. */
215 /* Default (value) for non- multi-arch platforms. */
216 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT)
217 #define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT)
220 extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
221 extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
222 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
223 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT"
226 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT)
227 #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
231 /* For most targets, a pointer on the target and its representation as an
232 address in GDB have the same size and "look the same". For such a
233 target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
234 / addr_bit will be set from it.
236 If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
237 also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
239 ptr_bit is the size of a pointer on the target */
241 /* Default (value) for non- multi-arch platforms. */
242 #if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
243 #define TARGET_PTR_BIT (TARGET_INT_BIT)
246 extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
247 extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
248 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
249 #error "Non multi-arch definition of TARGET_PTR_BIT"
252 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT)
253 #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
257 /* addr_bit is the size of a target address as represented in gdb */
259 /* Default (value) for non- multi-arch platforms. */
260 #if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
261 #define TARGET_ADDR_BIT (TARGET_PTR_BIT)
264 extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
265 extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
266 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
267 #error "Non multi-arch definition of TARGET_ADDR_BIT"
270 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
271 #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
275 /* Number of bits in a BFD_VMA for the target object file format. */
277 /* Default (value) for non- multi-arch platforms. */
278 #if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT)
279 #define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address)
282 extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
283 extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
284 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
285 #error "Non multi-arch definition of TARGET_BFD_VMA_BIT"
288 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT)
289 #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
293 /* One if `char' acts like `signed char', zero if `unsigned char'. */
295 /* Default (value) for non- multi-arch platforms. */
296 #if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED)
297 #define TARGET_CHAR_SIGNED (1)
300 extern int gdbarch_char_signed (struct gdbarch *gdbarch);
301 extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
302 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
303 #error "Non multi-arch definition of TARGET_CHAR_SIGNED"
306 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED)
307 #define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch))
311 /* Default (function) for non- multi-arch platforms. */
312 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
313 #define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
316 typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
317 extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
318 extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
319 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC)
320 #error "Non multi-arch definition of TARGET_READ_PC"
323 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC)
324 #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
328 /* Default (function) for non- multi-arch platforms. */
329 #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
330 #define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
333 typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
334 extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
335 extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
336 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC)
337 #error "Non multi-arch definition of TARGET_WRITE_PC"
340 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC)
341 #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
345 /* Default (function) for non- multi-arch platforms. */
346 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP)
347 #define TARGET_READ_FP() (generic_target_read_fp ())
350 typedef CORE_ADDR (gdbarch_read_fp_ftype) (void);
351 extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch);
352 extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp);
353 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP)
354 #error "Non multi-arch definition of TARGET_READ_FP"
357 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP)
358 #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
362 /* Default (function) for non- multi-arch platforms. */
363 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
364 #define TARGET_READ_SP() (generic_target_read_sp ())
367 typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
368 extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
369 extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
370 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP)
371 #error "Non multi-arch definition of TARGET_READ_SP"
374 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP)
375 #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
379 /* Default (function) for non- multi-arch platforms. */
380 #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP)
381 #define TARGET_WRITE_SP(val) (generic_target_write_sp (val))
384 typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val);
385 extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
386 extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp);
387 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP)
388 #error "Non multi-arch definition of TARGET_WRITE_SP"
391 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP)
392 #define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val))
396 /* Function for getting target's idea of a frame pointer. FIXME: GDB's
397 whole scheme for dealing with "frames" and "frame pointers" needs a
398 serious shakedown. */
400 /* Default (function) for non- multi-arch platforms. */
401 #if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER)
402 #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset))
405 typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
406 extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
407 extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
408 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER)
409 #error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER"
412 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER)
413 #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset))
417 extern int gdbarch_register_read_p (struct gdbarch *gdbarch);
419 typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
420 extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf);
421 extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read);
423 extern int gdbarch_register_write_p (struct gdbarch *gdbarch);
425 typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
426 extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf);
427 extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write);
429 extern int gdbarch_num_regs (struct gdbarch *gdbarch);
430 extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
431 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS)
432 #error "Non multi-arch definition of NUM_REGS"
435 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS)
436 #define NUM_REGS (gdbarch_num_regs (current_gdbarch))
440 /* This macro gives the number of pseudo-registers that live in the
441 register namespace but do not get fetched or stored on the target.
442 These pseudo-registers may be aliases for other registers,
443 combinations of other registers, or they may be computed by GDB. */
445 /* Default (value) for non- multi-arch platforms. */
446 #if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
447 #define NUM_PSEUDO_REGS (0)
450 extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
451 extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
452 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
453 #error "Non multi-arch definition of NUM_PSEUDO_REGS"
456 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS)
457 #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch))
461 /* GDB's standard (or well known) register numbers. These can map onto
462 a real register or a pseudo (computed) register or not be defined at
465 /* Default (value) for non- multi-arch platforms. */
466 #if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM)
467 #define SP_REGNUM (-1)
470 extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
471 extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
472 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
473 #error "Non multi-arch definition of SP_REGNUM"
476 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM)
477 #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
481 /* Default (value) for non- multi-arch platforms. */
482 #if (!GDB_MULTI_ARCH) && !defined (FP_REGNUM)
483 #define FP_REGNUM (-1)
486 extern int gdbarch_fp_regnum (struct gdbarch *gdbarch);
487 extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum);
488 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM)
489 #error "Non multi-arch definition of FP_REGNUM"
492 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM)
493 #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
497 /* Default (value) for non- multi-arch platforms. */
498 #if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM)
499 #define PC_REGNUM (-1)
502 extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
503 extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
504 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
505 #error "Non multi-arch definition of PC_REGNUM"
508 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM)
509 #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
513 /* Default (value) for non- multi-arch platforms. */
514 #if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM)
515 #define PS_REGNUM (-1)
518 extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
519 extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
520 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM)
521 #error "Non multi-arch definition of PS_REGNUM"
524 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM)
525 #define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
529 /* Default (value) for non- multi-arch platforms. */
530 #if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
531 #define FP0_REGNUM (-1)
534 extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
535 extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
536 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
537 #error "Non multi-arch definition of FP0_REGNUM"
540 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM)
541 #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
545 /* Default (value) for non- multi-arch platforms. */
546 #if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM)
547 #define NPC_REGNUM (-1)
550 extern int gdbarch_npc_regnum (struct gdbarch *gdbarch);
551 extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
552 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
553 #error "Non multi-arch definition of NPC_REGNUM"
556 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM)
557 #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
561 /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
563 /* Default (function) for non- multi-arch platforms. */
564 #if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
565 #define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
568 typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
569 extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
570 extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
571 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM)
572 #error "Non multi-arch definition of STAB_REG_TO_REGNUM"
575 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM)
576 #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
580 /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
582 /* Default (function) for non- multi-arch platforms. */
583 #if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
584 #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
587 typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
588 extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
589 extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
590 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM)
591 #error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
594 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM)
595 #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
599 /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
601 /* Default (function) for non- multi-arch platforms. */
602 #if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
603 #define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
606 typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
607 extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
608 extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
609 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM)
610 #error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
613 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM)
614 #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
618 /* Convert from an sdb register number to an internal gdb register number.
619 This should be defined in tm.h, if REGISTER_NAMES is not set up
620 to map one to one onto the sdb register numbers. */
622 /* Default (function) for non- multi-arch platforms. */
623 #if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
624 #define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
627 typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
628 extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
629 extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
630 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM)
631 #error "Non multi-arch definition of SDB_REG_TO_REGNUM"
634 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM)
635 #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
639 /* Default (function) for non- multi-arch platforms. */
640 #if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
641 #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
644 typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
645 extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
646 extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
647 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM)
648 #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
651 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM)
652 #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
656 /* Default (function) for non- multi-arch platforms. */
657 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
658 #define REGISTER_NAME(regnr) (legacy_register_name (regnr))
661 typedef char * (gdbarch_register_name_ftype) (int regnr);
662 extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
663 extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
664 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
665 #error "Non multi-arch definition of REGISTER_NAME"
668 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME)
669 #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
673 extern int gdbarch_register_size (struct gdbarch *gdbarch);
674 extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size);
675 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE)
676 #error "Non multi-arch definition of REGISTER_SIZE"
679 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE)
680 #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
684 extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
685 extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes);
686 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
687 #error "Non multi-arch definition of REGISTER_BYTES"
690 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES)
691 #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
695 typedef int (gdbarch_register_byte_ftype) (int reg_nr);
696 extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr);
697 extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte);
698 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE)
699 #error "Non multi-arch definition of REGISTER_BYTE"
702 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE)
703 #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
707 /* Default (function) for non- multi-arch platforms. */
708 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE)
709 #define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr))
712 typedef int (gdbarch_register_raw_size_ftype) (int reg_nr);
713 extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr);
714 extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size);
715 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE)
716 #error "Non multi-arch definition of REGISTER_RAW_SIZE"
719 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE)
720 #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr))
724 extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch);
725 extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size);
726 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE)
727 #error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE"
730 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE)
731 #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch))
735 /* Default (function) for non- multi-arch platforms. */
736 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE)
737 #define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr))
740 typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr);
741 extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr);
742 extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size);
743 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE)
744 #error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE"
747 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE)
748 #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr))
752 extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch);
753 extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size);
754 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE)
755 #error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE"
758 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE)
759 #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch))
763 typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr);
764 extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr);
765 extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type);
766 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE)
767 #error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
770 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE)
771 #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
775 /* Default (function) for non- multi-arch platforms. */
776 #if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
777 #define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs))
780 typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs);
781 extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
782 extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info);
783 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO)
784 #error "Non multi-arch definition of DO_REGISTERS_INFO"
787 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO)
788 #define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs))
792 /* Default (function) for non- multi-arch platforms. */
793 #if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO)
794 #define PRINT_FLOAT_INFO() (default_print_float_info ())
797 typedef void (gdbarch_print_float_info_ftype) (void);
798 extern void gdbarch_print_float_info (struct gdbarch *gdbarch);
799 extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
800 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO)
801 #error "Non multi-arch definition of PRINT_FLOAT_INFO"
804 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO)
805 #define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch))
809 /* MAP a GDB RAW register number onto a simulator register number. See
810 also include/...-sim.h. */
812 /* Default (function) for non- multi-arch platforms. */
813 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
814 #define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr))
817 typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
818 extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
819 extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
820 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO)
821 #error "Non multi-arch definition of REGISTER_SIM_REGNO"
824 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO)
825 #define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
829 #if defined (REGISTER_BYTES_OK)
830 /* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
831 #if !defined (REGISTER_BYTES_OK_P)
832 #define REGISTER_BYTES_OK_P() (1)
836 /* Default predicate for non- multi-arch targets. */
837 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
838 #define REGISTER_BYTES_OK_P() (0)
841 extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
842 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
843 #error "Non multi-arch definition of REGISTER_BYTES_OK"
845 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
846 #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
849 /* Default (function) for non- multi-arch platforms. */
850 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
851 #define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
854 typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
855 extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
856 extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
857 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK)
858 #error "Non multi-arch definition of REGISTER_BYTES_OK"
861 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
862 #define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
866 /* Default (function) for non- multi-arch platforms. */
867 #if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
868 #define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
871 typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
872 extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
873 extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
874 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER)
875 #error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
878 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER)
879 #define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
883 /* Default (function) for non- multi-arch platforms. */
884 #if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
885 #define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
888 typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
889 extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
890 extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
891 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER)
892 #error "Non multi-arch definition of CANNOT_STORE_REGISTER"
895 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER)
896 #define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
900 /* setjmp/longjmp support. */
902 #if defined (GET_LONGJMP_TARGET)
903 /* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */
904 #if !defined (GET_LONGJMP_TARGET_P)
905 #define GET_LONGJMP_TARGET_P() (1)
909 /* Default predicate for non- multi-arch targets. */
910 #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P)
911 #define GET_LONGJMP_TARGET_P() (0)
914 extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
915 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
916 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
918 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P)
919 #define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
922 /* Default (function) for non- multi-arch platforms. */
923 #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET)
924 #define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0)
927 typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc);
928 extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc);
929 extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
930 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET)
931 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
934 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET)
935 #define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
939 /* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that
940 much better but at least they are vaguely consistent). The headers
941 and body contain convoluted #if/#else sequences for determine how
942 things should be compiled. Instead of trying to mimic that
943 behaviour here (and hence entrench it further) gdbarch simply
944 reqires that these methods be set up from the word go. This also
945 avoids any potential problems with moving beyond multi-arch partial. */
947 extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
948 extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
949 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES)
950 #error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES"
953 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES)
954 #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch))
958 extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
959 extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
960 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
961 #error "Non multi-arch definition of CALL_DUMMY_LOCATION"
964 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION)
965 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
969 typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
970 extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch);
971 extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address);
972 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
973 #error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
976 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS)
977 #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
981 extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch);
982 extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset);
983 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET)
984 #error "Non multi-arch definition of CALL_DUMMY_START_OFFSET"
987 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_START_OFFSET)
988 #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
992 extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
993 extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset);
994 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET)
995 #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET"
998 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
999 #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
1003 extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch);
1004 extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p);
1005 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
1006 #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET_P"
1009 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
1010 #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch))
1014 extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch);
1015 extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length);
1016 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH)
1017 #error "Non multi-arch definition of CALL_DUMMY_LENGTH"
1020 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH)
1021 #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
1025 typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
1026 extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
1027 extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy);
1028 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY)
1029 #error "Non multi-arch definition of PC_IN_CALL_DUMMY"
1032 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY)
1033 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
1037 extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch);
1038 extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p);
1039 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_P)
1040 #error "Non multi-arch definition of CALL_DUMMY_P"
1043 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P)
1044 #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch))
1048 /* Default (value) for non- multi-arch platforms. */
1049 #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS)
1050 #define CALL_DUMMY_WORDS (legacy_call_dummy_words)
1053 extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
1054 extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words);
1055 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS)
1056 #error "Non multi-arch definition of CALL_DUMMY_WORDS"
1059 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS)
1060 #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
1064 /* Default (value) for non- multi-arch platforms. */
1065 #if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS)
1066 #define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
1069 extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch);
1070 extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words);
1071 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS)
1072 #error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS"
1075 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIZEOF_CALL_DUMMY_WORDS)
1076 #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
1080 extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch);
1081 extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p);
1082 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P)
1083 #error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P"
1086 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P)
1087 #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch))
1091 extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch);
1092 extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust);
1093 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST)
1094 #error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST"
1097 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST)
1098 #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch))
1102 typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
1103 extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
1104 extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy);
1105 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY)
1106 #error "Non multi-arch definition of FIX_CALL_DUMMY"
1109 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY)
1110 #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
1114 /* Default (function) for non- multi-arch platforms. */
1115 #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST)
1116 #define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
1119 typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
1120 extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
1121 extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first);
1122 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST)
1123 #error "Non multi-arch definition of INIT_FRAME_PC_FIRST"
1126 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST)
1127 #define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev))
1131 /* Default (function) for non- multi-arch platforms. */
1132 #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC)
1133 #define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev))
1136 typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
1137 extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
1138 extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc);
1139 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC)
1140 #error "Non multi-arch definition of INIT_FRAME_PC"
1143 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC)
1144 #define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev))
1148 extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
1149 extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
1150 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION)
1151 #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION"
1154 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION)
1155 #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
1159 extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch);
1160 extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type);
1161 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE)
1162 #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE"
1165 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE)
1166 #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
1170 /* Default (function) for non- multi-arch platforms. */
1171 #if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE)
1172 #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual))
1175 typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual);
1176 extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual);
1177 extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double);
1178 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE)
1179 #error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE"
1182 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE)
1183 #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual))
1187 /* Default (function) for non- multi-arch platforms. */
1188 #if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER)
1189 #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval))
1192 typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1193 extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1194 extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register);
1195 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
1196 #error "Non multi-arch definition of GET_SAVED_REGISTER"
1199 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
1200 #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
1204 /* Default (function) for non- multi-arch platforms. */
1205 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE)
1206 #define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr))
1209 typedef int (gdbarch_register_convertible_ftype) (int nr);
1210 extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr);
1211 extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible);
1212 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE)
1213 #error "Non multi-arch definition of REGISTER_CONVERTIBLE"
1216 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE)
1217 #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
1221 /* Default (function) for non- multi-arch platforms. */
1222 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL)
1223 #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0)
1226 typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
1227 extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
1228 extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual);
1229 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL)
1230 #error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL"
1233 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL)
1234 #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
1238 /* Default (function) for non- multi-arch platforms. */
1239 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW)
1240 #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0)
1243 typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to);
1244 extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to);
1245 extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw);
1246 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW)
1247 #error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW"
1250 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW)
1251 #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
1255 /* Default (function) for non- multi-arch platforms. */
1256 #if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P)
1257 #define CONVERT_REGISTER_P(regnum) (legacy_convert_register_p (regnum))
1260 typedef int (gdbarch_convert_register_p_ftype) (int regnum);
1261 extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum);
1262 extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
1263 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P)
1264 #error "Non multi-arch definition of CONVERT_REGISTER_P"
1267 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_REGISTER_P)
1268 #define CONVERT_REGISTER_P(regnum) (gdbarch_convert_register_p (current_gdbarch, regnum))
1272 /* Default (function) for non- multi-arch platforms. */
1273 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE)
1274 #define REGISTER_TO_VALUE(regnum, type, from, to) (legacy_register_to_value (regnum, type, from, to))
1277 typedef void (gdbarch_register_to_value_ftype) (int regnum, struct type *type, char *from, char *to);
1278 extern void gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
1279 extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
1280 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE)
1281 #error "Non multi-arch definition of REGISTER_TO_VALUE"
1284 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_TO_VALUE)
1285 #define REGISTER_TO_VALUE(regnum, type, from, to) (gdbarch_register_to_value (current_gdbarch, regnum, type, from, to))
1289 /* Default (function) for non- multi-arch platforms. */
1290 #if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER)
1291 #define VALUE_TO_REGISTER(type, regnum, from, to) (legacy_value_to_register (type, regnum, from, to))
1294 typedef void (gdbarch_value_to_register_ftype) (struct type *type, int regnum, char *from, char *to);
1295 extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to);
1296 extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
1297 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER)
1298 #error "Non multi-arch definition of VALUE_TO_REGISTER"
1301 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (VALUE_TO_REGISTER)
1302 #define VALUE_TO_REGISTER(type, regnum, from, to) (gdbarch_value_to_register (current_gdbarch, type, regnum, from, to))
1306 /* This function is called when the value of a pseudo-register needs to
1307 be updated. Typically it will be defined on a per-architecture
1310 #if defined (FETCH_PSEUDO_REGISTER)
1311 /* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */
1312 #if !defined (FETCH_PSEUDO_REGISTER_P)
1313 #define FETCH_PSEUDO_REGISTER_P() (1)
1317 /* Default predicate for non- multi-arch targets. */
1318 #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P)
1319 #define FETCH_PSEUDO_REGISTER_P() (0)
1322 extern int gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch);
1323 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P)
1324 #error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
1326 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P)
1327 #define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch))
1330 /* Default (function) for non- multi-arch platforms. */
1331 #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
1332 #define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
1335 typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum);
1336 extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum);
1337 extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register);
1338 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER)
1339 #error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
1342 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER)
1343 #define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum))
1347 /* This function is called when the value of a pseudo-register needs to
1348 be set or stored. Typically it will be defined on a
1349 per-architecture basis. */
1351 #if defined (STORE_PSEUDO_REGISTER)
1352 /* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */
1353 #if !defined (STORE_PSEUDO_REGISTER_P)
1354 #define STORE_PSEUDO_REGISTER_P() (1)
1358 /* Default predicate for non- multi-arch targets. */
1359 #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P)
1360 #define STORE_PSEUDO_REGISTER_P() (0)
1363 extern int gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch);
1364 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P)
1365 #error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
1367 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P)
1368 #define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch))
1371 /* Default (function) for non- multi-arch platforms. */
1372 #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
1373 #define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
1376 typedef void (gdbarch_store_pseudo_register_ftype) (int regnum);
1377 extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum);
1378 extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register);
1379 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER)
1380 #error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
1383 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER)
1384 #define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum))
1388 /* Default (function) for non- multi-arch platforms. */
1389 #if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
1390 #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
1393 typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf);
1394 extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
1395 extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
1396 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS)
1397 #error "Non multi-arch definition of POINTER_TO_ADDRESS"
1400 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS)
1401 #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
1405 /* Default (function) for non- multi-arch platforms. */
1406 #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER)
1407 #define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr))
1410 typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
1411 extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
1412 extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
1413 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER)
1414 #error "Non multi-arch definition of ADDRESS_TO_POINTER"
1417 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER)
1418 #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
1422 #if defined (INTEGER_TO_ADDRESS)
1423 /* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */
1424 #if !defined (INTEGER_TO_ADDRESS_P)
1425 #define INTEGER_TO_ADDRESS_P() (1)
1429 /* Default predicate for non- multi-arch targets. */
1430 #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P)
1431 #define INTEGER_TO_ADDRESS_P() (0)
1434 extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
1435 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
1436 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1438 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P)
1439 #define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
1442 /* Default (function) for non- multi-arch platforms. */
1443 #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS)
1444 #define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0)
1447 typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf);
1448 extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
1449 extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
1450 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS)
1451 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1454 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS)
1455 #define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf))
1459 /* Default (function) for non- multi-arch platforms. */
1460 #if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK)
1461 #define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type))
1464 typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
1465 extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
1466 extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
1467 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
1468 #error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
1471 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK)
1472 #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
1476 typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
1477 extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
1478 extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
1479 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
1480 #error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
1483 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
1484 #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
1488 /* Default (function) for non- multi-arch platforms. */
1489 #if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS)
1490 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr))
1493 typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1494 extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1495 extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments);
1496 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS)
1497 #error "Non multi-arch definition of PUSH_ARGUMENTS"
1500 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS)
1501 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
1505 typedef void (gdbarch_push_dummy_frame_ftype) (void);
1506 extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch);
1507 extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame);
1508 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME)
1509 #error "Non multi-arch definition of PUSH_DUMMY_FRAME"
1512 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME)
1513 #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch))
1517 #if defined (PUSH_RETURN_ADDRESS)
1518 /* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */
1519 #if !defined (PUSH_RETURN_ADDRESS_P)
1520 #define PUSH_RETURN_ADDRESS_P() (1)
1524 /* Default predicate for non- multi-arch targets. */
1525 #if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P)
1526 #define PUSH_RETURN_ADDRESS_P() (0)
1529 extern int gdbarch_push_return_address_p (struct gdbarch *gdbarch);
1530 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P)
1531 #error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
1533 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P)
1534 #define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch))
1537 /* Default (function) for non- multi-arch platforms. */
1538 #if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS)
1539 #define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0)
1542 typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
1543 extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
1544 extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address);
1545 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS)
1546 #error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
1549 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS)
1550 #define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp))
1554 typedef void (gdbarch_pop_frame_ftype) (void);
1555 extern void gdbarch_pop_frame (struct gdbarch *gdbarch);
1556 extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame);
1557 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME)
1558 #error "Non multi-arch definition of POP_FRAME"
1561 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME)
1562 #define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
1566 typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp);
1567 extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp);
1568 extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return);
1569 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN)
1570 #error "Non multi-arch definition of STORE_STRUCT_RETURN"
1573 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN)
1574 #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp))
1578 typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf);
1579 extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
1580 extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
1581 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
1582 #error "Non multi-arch definition of STORE_RETURN_VALUE"
1585 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE)
1586 #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
1590 #if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1591 /* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
1592 #if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1593 #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
1597 /* Default predicate for non- multi-arch targets. */
1598 #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1599 #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
1602 extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
1603 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1604 #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1606 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1607 #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
1610 /* Default (function) for non- multi-arch platforms. */
1611 #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1612 #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
1615 typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf);
1616 extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
1617 extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
1618 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1619 #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1622 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1623 #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
1627 /* Default (function) for non- multi-arch platforms. */
1628 #if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION)
1629 #define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type))
1632 typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
1633 extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
1634 extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
1635 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
1636 #error "Non multi-arch definition of USE_STRUCT_CONVENTION"
1639 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION)
1640 #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
1644 typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame);
1645 extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame);
1646 extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs);
1647 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS)
1648 #error "Non multi-arch definition of FRAME_INIT_SAVED_REGS"
1651 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS)
1652 #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame))
1656 #if defined (INIT_EXTRA_FRAME_INFO)
1657 /* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */
1658 #if !defined (INIT_EXTRA_FRAME_INFO_P)
1659 #define INIT_EXTRA_FRAME_INFO_P() (1)
1663 /* Default predicate for non- multi-arch targets. */
1664 #if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P)
1665 #define INIT_EXTRA_FRAME_INFO_P() (0)
1668 extern int gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch);
1669 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P)
1670 #error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
1672 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P)
1673 #define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch))
1676 /* Default (function) for non- multi-arch platforms. */
1677 #if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO)
1678 #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0)
1681 typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
1682 extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
1683 extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info);
1684 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO)
1685 #error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
1688 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO)
1689 #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame))
1693 typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
1694 extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
1695 extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
1696 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE)
1697 #error "Non multi-arch definition of SKIP_PROLOGUE"
1700 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE)
1701 #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
1705 /* Default (function) for non- multi-arch platforms. */
1706 #if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P)
1707 #define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip))
1710 typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip);
1711 extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip);
1712 extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p);
1713 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P)
1714 #error "Non multi-arch definition of PROLOGUE_FRAMELESS_P"
1717 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P)
1718 #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip))
1722 typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
1723 extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
1724 extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
1725 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN)
1726 #error "Non multi-arch definition of INNER_THAN"
1729 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN)
1730 #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
1734 /* Default (function) for non- multi-arch platforms. */
1735 #if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC)
1736 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
1739 typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
1740 extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
1741 extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
1742 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
1743 #error "Non multi-arch definition of BREAKPOINT_FROM_PC"
1746 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC)
1747 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
1751 /* Default (function) for non- multi-arch platforms. */
1752 #if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
1753 #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
1756 typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
1757 extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
1758 extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
1759 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
1760 #error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
1763 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT)
1764 #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
1768 /* Default (function) for non- multi-arch platforms. */
1769 #if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
1770 #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
1773 typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
1774 extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
1775 extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
1776 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
1777 #error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
1780 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT)
1781 #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
1785 extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
1786 extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
1787 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
1788 #error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
1791 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK)
1792 #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
1796 /* Default (function) for non- multi-arch platforms. */
1797 #if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
1798 #define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
1801 typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it);
1802 extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it);
1803 extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed);
1804 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED)
1805 #error "Non multi-arch definition of PREPARE_TO_PROCEED"
1808 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
1809 #define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
1813 extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
1814 extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
1815 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
1816 #error "Non multi-arch definition of FUNCTION_START_OFFSET"
1819 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET)
1820 #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
1824 /* Default (function) for non- multi-arch platforms. */
1825 #if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1826 #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len))
1829 typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
1830 extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
1831 extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
1832 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1833 #error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS"
1836 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1837 #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len))
1841 extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
1842 extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
1843 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
1844 #error "Non multi-arch definition of FRAME_ARGS_SKIP"
1847 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP)
1848 #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
1852 /* Default (function) for non- multi-arch platforms. */
1853 #if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
1854 #define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
1857 typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi);
1858 extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
1859 extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation);
1860 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION)
1861 #error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION"
1864 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION)
1865 #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
1869 typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame);
1870 extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
1871 extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain);
1872 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN)
1873 #error "Non multi-arch definition of FRAME_CHAIN"
1876 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN)
1877 #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame))
1881 /* Define a default FRAME_CHAIN_VALID, in the form that is suitable for
1882 most targets. If FRAME_CHAIN_VALID returns zero it means that the
1883 given frame is the outermost one and has no caller.
1885 XXXX - both default and alternate frame_chain_valid functions are
1886 deprecated. New code should use dummy frames and one of the generic
1889 /* Default (function) for non- multi-arch platforms. */
1890 #if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID)
1891 #define FRAME_CHAIN_VALID(chain, thisframe) (generic_func_frame_chain_valid (chain, thisframe))
1894 typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
1895 extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
1896 extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid);
1897 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID)
1898 #error "Non multi-arch definition of FRAME_CHAIN_VALID"
1901 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID)
1902 #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe))
1906 typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi);
1907 extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
1908 extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc);
1909 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC)
1910 #error "Non multi-arch definition of FRAME_SAVED_PC"
1913 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC)
1914 #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi))
1918 typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi);
1919 extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
1920 extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address);
1921 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS)
1922 #error "Non multi-arch definition of FRAME_ARGS_ADDRESS"
1925 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS)
1926 #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
1930 typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi);
1931 extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
1932 extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address);
1933 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS)
1934 #error "Non multi-arch definition of FRAME_LOCALS_ADDRESS"
1937 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS)
1938 #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
1942 typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) (struct frame_info *frame);
1943 extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
1944 extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call);
1945 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVED_PC_AFTER_CALL)
1946 #error "Non multi-arch definition of SAVED_PC_AFTER_CALL"
1949 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVED_PC_AFTER_CALL)
1950 #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame))
1954 typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
1955 extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
1956 extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
1957 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
1958 #error "Non multi-arch definition of FRAME_NUM_ARGS"
1961 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS)
1962 #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
1966 #if defined (STACK_ALIGN)
1967 /* Legacy for systems yet to multi-arch STACK_ALIGN */
1968 #if !defined (STACK_ALIGN_P)
1969 #define STACK_ALIGN_P() (1)
1973 /* Default predicate for non- multi-arch targets. */
1974 #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
1975 #define STACK_ALIGN_P() (0)
1978 extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
1979 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
1980 #error "Non multi-arch definition of STACK_ALIGN"
1982 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
1983 #define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
1986 /* Default (function) for non- multi-arch platforms. */
1987 #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
1988 #define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
1991 typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
1992 extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
1993 extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align);
1994 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
1995 #error "Non multi-arch definition of STACK_ALIGN"
1998 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN)
1999 #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
2003 /* Default (value) for non- multi-arch platforms. */
2004 #if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
2005 #define EXTRA_STACK_ALIGNMENT_NEEDED (1)
2008 extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch);
2009 extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed);
2010 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED)
2011 #error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED"
2014 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
2015 #define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch))
2019 #if defined (REG_STRUCT_HAS_ADDR)
2020 /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
2021 #if !defined (REG_STRUCT_HAS_ADDR_P)
2022 #define REG_STRUCT_HAS_ADDR_P() (1)
2026 /* Default predicate for non- multi-arch targets. */
2027 #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
2028 #define REG_STRUCT_HAS_ADDR_P() (0)
2031 extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
2032 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
2033 #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
2035 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
2036 #define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
2039 /* Default (function) for non- multi-arch platforms. */
2040 #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
2041 #define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
2044 typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
2045 extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
2046 extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr);
2047 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
2048 #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
2051 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR)
2052 #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
2056 #if defined (SAVE_DUMMY_FRAME_TOS)
2057 /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
2058 #if !defined (SAVE_DUMMY_FRAME_TOS_P)
2059 #define SAVE_DUMMY_FRAME_TOS_P() (1)
2063 /* Default predicate for non- multi-arch targets. */
2064 #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
2065 #define SAVE_DUMMY_FRAME_TOS_P() (0)
2068 extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
2069 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P)
2070 #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2072 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P)
2073 #define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
2076 /* Default (function) for non- multi-arch platforms. */
2077 #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
2078 #define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
2081 typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
2082 extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
2083 extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos);
2084 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS)
2085 #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2088 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS)
2089 #define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
2093 extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
2094 extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
2095 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
2096 #error "Non multi-arch definition of PARM_BOUNDARY"
2099 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
2100 #define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
2104 /* Default (value) for non- multi-arch platforms. */
2105 #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
2106 #define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
2109 extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
2110 extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
2111 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
2112 #error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
2115 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT)
2116 #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
2120 /* Default (value) for non- multi-arch platforms. */
2121 #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
2122 #define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
2125 extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
2126 extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
2127 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
2128 #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
2131 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT)
2132 #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
2136 /* Default (value) for non- multi-arch platforms. */
2137 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
2138 #define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch))
2141 extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
2142 extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
2143 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
2144 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
2147 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT)
2148 #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
2152 /* Default (function) for non- multi-arch platforms. */
2153 #if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
2154 #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
2157 typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
2158 extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
2159 extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
2160 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR)
2161 #error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR"
2164 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
2165 #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
2169 /* On some machines there are bits in addresses which are not really
2170 part of the address, but are used by the kernel, the hardware, etc.
2171 for special purposes. ADDR_BITS_REMOVE takes out any such bits so
2172 we get a "real" address such as one would find in a symbol table.
2173 This is used only for addresses of instructions, and even then I'm
2174 not sure it's used in all contexts. It exists to deal with there
2175 being a few stray bits in the PC which would mislead us, not as some
2176 sort of generic thing to handle alignment or segmentation (it's
2177 possible it should be in TARGET_READ_PC instead). */
2179 /* Default (function) for non- multi-arch platforms. */
2180 #if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
2181 #define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
2184 typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
2185 extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
2186 extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
2187 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
2188 #error "Non multi-arch definition of ADDR_BITS_REMOVE"
2191 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
2192 #define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
2196 /* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
2197 ADDR_BITS_REMOVE. */
2199 /* Default (function) for non- multi-arch platforms. */
2200 #if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
2201 #define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
2204 typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
2205 extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
2206 extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
2207 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
2208 #error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
2211 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS)
2212 #define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
2216 /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
2217 the target needs software single step. An ISA method to implement it.
2219 FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
2220 using the breakpoint system instead of blatting memory directly (as with rs6000).
2222 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
2223 single step. If not, then implement single step using breakpoints. */
2225 #if defined (SOFTWARE_SINGLE_STEP)
2226 /* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
2227 #if !defined (SOFTWARE_SINGLE_STEP_P)
2228 #define SOFTWARE_SINGLE_STEP_P() (1)
2232 /* Default predicate for non- multi-arch targets. */
2233 #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
2234 #define SOFTWARE_SINGLE_STEP_P() (0)
2237 extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
2238 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
2239 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2241 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
2242 #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
2245 /* Default (function) for non- multi-arch platforms. */
2246 #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
2247 #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
2250 typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
2251 extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
2252 extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
2253 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
2254 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2257 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
2258 #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
2262 /* Default (function) for non- multi-arch platforms. */
2263 #if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN)
2264 #define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info))
2267 typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info);
2268 extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info);
2269 extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
2270 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
2271 #error "Non multi-arch definition of TARGET_PRINT_INSN"
2274 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN)
2275 #define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
2279 /* Default (function) for non- multi-arch platforms. */
2280 #if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
2281 #define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
2284 typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
2285 extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
2286 extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
2287 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
2288 #error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
2291 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE)
2292 #define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
2296 /* For SVR4 shared libraries, each call goes through a small piece of
2297 trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
2298 to nonzero if we are current stopped in one of these. */
2300 /* Default (function) for non- multi-arch platforms. */
2301 #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
2302 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
2305 typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
2306 extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2307 extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
2308 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
2309 #error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
2312 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
2313 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
2317 /* Sigtramp is a routine that the kernel calls (which then calls the
2318 signal handler). On most machines it is a library routine that is
2319 linked into the executable.
2321 This macro, given a program counter value and the name of the
2322 function in which that PC resides (which can be null if the name is
2323 not known), returns nonzero if the PC and name show that we are in
2326 On most machines just see if the name is sigtramp (and if we have
2327 no name, assume we are not in sigtramp).
2329 FIXME: cagney/2002-04-21: The function find_pc_partial_function
2330 calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
2331 This means PC_IN_SIGTRAMP function can't be implemented by doing its
2332 own local NAME lookup.
2334 FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
2335 Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
2338 /* Default (function) for non- multi-arch platforms. */
2339 #if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP)
2340 #define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name))
2343 typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name);
2344 extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2345 extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp);
2346 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP)
2347 #error "Non multi-arch definition of PC_IN_SIGTRAMP"
2350 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP)
2351 #define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name))
2355 /* A target might have problems with watchpoints as soon as the stack
2356 frame of the current function has been destroyed. This mostly happens
2357 as the first action in a funtion's epilogue. in_function_epilogue_p()
2358 is defined to return a non-zero value if either the given addr is one
2359 instruction after the stack destroying instruction up to the trailing
2360 return instruction or if we can figure out that the stack frame has
2361 already been invalidated regardless of the value of addr. Targets
2362 which don't suffer from that problem could just let this functionality
2365 typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
2366 extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
2367 extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
2369 /* Given a vector of command-line arguments, return a newly allocated
2370 string which, when passed to the create_inferior function, will be
2371 parsed (on Unix systems, by the shell) to yield the same vector.
2372 This function should call error() if the argument vector is not
2373 representable for this target or if this target does not support
2374 command-line arguments.
2375 ARGC is the number of elements in the vector.
2376 ARGV is an array of strings, one per argument. */
2378 typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv);
2379 extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
2380 extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
2382 #if defined (DWARF2_BUILD_FRAME_INFO)
2383 /* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */
2384 #if !defined (DWARF2_BUILD_FRAME_INFO_P)
2385 #define DWARF2_BUILD_FRAME_INFO_P() (1)
2389 /* Default predicate for non- multi-arch targets. */
2390 #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P)
2391 #define DWARF2_BUILD_FRAME_INFO_P() (0)
2394 extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch);
2395 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P)
2396 #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
2398 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P)
2399 #define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch))
2402 /* Default (function) for non- multi-arch platforms. */
2403 #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO)
2404 #define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0)
2407 typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile);
2408 extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile);
2409 extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info);
2410 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO)
2411 #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
2414 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO)
2415 #define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile))
2419 /* Default (function) for non- multi-arch platforms. */
2420 #if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL)
2421 #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym))
2424 typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
2425 extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
2426 extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
2427 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL)
2428 #error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL"
2431 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL)
2432 #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
2436 /* Default (function) for non- multi-arch platforms. */
2437 #if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL)
2438 #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym))
2441 typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
2442 extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
2443 extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
2444 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL)
2445 #error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL"
2448 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL)
2449 #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
2453 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
2456 /* Mechanism for co-ordinating the selection of a specific
2459 GDB targets (*-tdep.c) can register an interest in a specific
2460 architecture. Other GDB components can register a need to maintain
2461 per-architecture data.
2463 The mechanisms below ensures that there is only a loose connection
2464 between the set-architecture command and the various GDB
2465 components. Each component can independently register their need
2466 to maintain architecture specific data with gdbarch.
2470 Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
2473 The more traditional mega-struct containing architecture specific
2474 data for all the various GDB components was also considered. Since
2475 GDB is built from a variable number of (fairly independent)
2476 components it was determined that the global aproach was not
2480 /* Register a new architectural family with GDB.
2482 Register support for the specified ARCHITECTURE with GDB. When
2483 gdbarch determines that the specified architecture has been
2484 selected, the corresponding INIT function is called.
2488 The INIT function takes two parameters: INFO which contains the
2489 information available to gdbarch about the (possibly new)
2490 architecture; ARCHES which is a list of the previously created
2491 ``struct gdbarch'' for this architecture.
2493 The INFO parameter is, as far as possible, be pre-initialized with
2494 information obtained from INFO.ABFD or the previously selected
2497 The ARCHES parameter is a linked list (sorted most recently used)
2498 of all the previously created architures for this architecture
2499 family. The (possibly NULL) ARCHES->gdbarch can used to access
2500 values from the previously selected architecture for this
2501 architecture family. The global ``current_gdbarch'' shall not be
2504 The INIT function shall return any of: NULL - indicating that it
2505 doesn't recognize the selected architecture; an existing ``struct
2506 gdbarch'' from the ARCHES list - indicating that the new
2507 architecture is just a synonym for an earlier architecture (see
2508 gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
2509 - that describes the selected architecture (see gdbarch_alloc()).
2511 The DUMP_TDEP function shall print out all target specific values.
2512 Care should be taken to ensure that the function works in both the
2513 multi-arch and non- multi-arch cases. */
2517 struct gdbarch *gdbarch;
2518 struct gdbarch_list *next;
2523 /* Use default: NULL (ZERO). */
2524 const struct bfd_arch_info *bfd_arch_info;
2526 /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
2529 /* Use default: NULL (ZERO). */
2532 /* Use default: NULL (ZERO). */
2533 struct gdbarch_tdep_info *tdep_info;
2536 typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
2537 typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
2539 /* DEPRECATED - use gdbarch_register() */
2540 extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
2542 extern void gdbarch_register (enum bfd_architecture architecture,
2543 gdbarch_init_ftype *,
2544 gdbarch_dump_tdep_ftype *);
2547 /* Return a freshly allocated, NULL terminated, array of the valid
2548 architecture names. Since architectures are registered during the
2549 _initialize phase this function only returns useful information
2550 once initialization has been completed. */
2552 extern const char **gdbarch_printable_names (void);
2555 /* Helper function. Search the list of ARCHES for a GDBARCH that
2556 matches the information provided by INFO. */
2558 extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
2561 /* Helper function. Create a preliminary ``struct gdbarch''. Perform
2562 basic initialization using values obtained from the INFO andTDEP
2563 parameters. set_gdbarch_*() functions are called to complete the
2564 initialization of the object. */
2566 extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
2569 /* Helper function. Free a partially-constructed ``struct gdbarch''.
2570 It is assumed that the caller freeds the ``struct
2573 extern void gdbarch_free (struct gdbarch *);
2576 /* Helper function. Force an update of the current architecture.
2578 The actual architecture selected is determined by INFO, ``(gdb) set
2579 architecture'' et.al., the existing architecture and BFD's default
2580 architecture. INFO should be initialized to zero and then selected
2581 fields should be updated.
2583 Returns non-zero if the update succeeds */
2585 extern int gdbarch_update_p (struct gdbarch_info info);
2589 /* Register per-architecture data-pointer.
2591 Reserve space for a per-architecture data-pointer. An identifier
2592 for the reserved data-pointer is returned. That identifer should
2593 be saved in a local static variable.
2595 The per-architecture data-pointer is either initialized explicitly
2596 (set_gdbarch_data()) or implicitly (by INIT() via a call to
2597 gdbarch_data()). FREE() is called to delete either an existing
2598 data-pointer overridden by set_gdbarch_data() or when the
2599 architecture object is being deleted.
2601 When a previously created architecture is re-selected, the
2602 per-architecture data-pointer for that previous architecture is
2603 restored. INIT() is not re-called.
2605 Multiple registrarants for any architecture are allowed (and
2606 strongly encouraged). */
2608 struct gdbarch_data;
2610 typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
2611 typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
2613 extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
2614 gdbarch_data_free_ftype *free);
2615 extern void set_gdbarch_data (struct gdbarch *gdbarch,
2616 struct gdbarch_data *data,
2619 extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
2622 /* Register per-architecture memory region.
2624 Provide a memory-region swap mechanism. Per-architecture memory
2625 region are created. These memory regions are swapped whenever the
2626 architecture is changed. For a new architecture, the memory region
2627 is initialized with zero (0) and the INIT function is called.
2629 Memory regions are swapped / initialized in the order that they are
2630 registered. NULL DATA and/or INIT values can be specified.
2632 New code should use register_gdbarch_data(). */
2634 typedef void (gdbarch_swap_ftype) (void);
2635 extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
2636 #define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
2640 /* The target-system-dependent byte order is dynamic */
2642 extern int target_byte_order;
2643 #ifndef TARGET_BYTE_ORDER
2644 #define TARGET_BYTE_ORDER (target_byte_order + 0)
2647 extern int target_byte_order_auto;
2648 #ifndef TARGET_BYTE_ORDER_AUTO
2649 #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
2654 /* The target-system-dependent BFD architecture is dynamic */
2656 extern int target_architecture_auto;
2657 #ifndef TARGET_ARCHITECTURE_AUTO
2658 #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
2661 extern const struct bfd_arch_info *target_architecture;
2662 #ifndef TARGET_ARCHITECTURE
2663 #define TARGET_ARCHITECTURE (target_architecture + 0)
2667 /* The target-system-dependent disassembler is semi-dynamic */
2669 extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
2670 unsigned int len, disassemble_info *info);
2672 extern void dis_asm_memory_error (int status, bfd_vma memaddr,
2673 disassemble_info *info);
2675 extern void dis_asm_print_address (bfd_vma addr,
2676 disassemble_info *info);
2678 extern int (*tm_print_insn) (bfd_vma, disassemble_info*);
2679 extern disassemble_info tm_print_insn_info;
2680 #ifndef TARGET_PRINT_INSN_INFO
2681 #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
2686 /* Set the dynamic target-system-dependent parameters (architecture,
2687 byte-order, ...) using information found in the BFD */
2689 extern void set_gdbarch_from_file (bfd *);
2692 /* Initialize the current architecture to the "first" one we find on
2695 extern void initialize_current_architecture (void);
2697 /* For non-multiarched targets, do any initialization of the default
2698 gdbarch object necessary after the _initialize_MODULE functions
2700 extern void initialize_non_multiarch ();
2702 /* gdbarch trace variable */
2703 extern int gdbarch_debug;
2705 extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);