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 #include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
46 struct minimal_symbol
;
48 extern struct gdbarch
*current_gdbarch
;
51 /* If any of the following are defined, the target wasn't correctly
55 #if defined (EXTRA_FRAME_INFO)
56 #error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info"
61 #if defined (FRAME_FIND_SAVED_REGS)
62 #error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS"
66 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
67 #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
71 /* The following are pre-initialized by GDBARCH. */
73 extern const struct bfd_arch_info
* gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
);
74 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
75 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE)
76 #error "Non multi-arch definition of TARGET_ARCHITECTURE"
79 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE)
80 #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
84 extern int gdbarch_byte_order (struct gdbarch
*gdbarch
);
85 /* set_gdbarch_byte_order() - not applicable - pre-initialized. */
86 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER)
87 #error "Non multi-arch definition of TARGET_BYTE_ORDER"
90 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER)
91 #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
96 /* The following are initialized by the target dependent code. */
98 /* Number of bits in a char or unsigned char for the target machine.
99 Just like CHAR_BIT in <limits.h> but describes the target machine.
100 v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
102 Number of bits in a short or unsigned short for the target machine. */
104 /* Default (value) for non- multi-arch platforms. */
105 #if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT)
106 #define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT)
109 extern int gdbarch_short_bit (struct gdbarch
*gdbarch
);
110 extern void set_gdbarch_short_bit (struct gdbarch
*gdbarch
, int short_bit
);
111 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
112 #error "Non multi-arch definition of TARGET_SHORT_BIT"
115 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT)
116 #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
120 /* Number of bits in an int or unsigned int for the target machine. */
122 /* Default (value) for non- multi-arch platforms. */
123 #if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT)
124 #define TARGET_INT_BIT (4*TARGET_CHAR_BIT)
127 extern int gdbarch_int_bit (struct gdbarch
*gdbarch
);
128 extern void set_gdbarch_int_bit (struct gdbarch
*gdbarch
, int int_bit
);
129 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
130 #error "Non multi-arch definition of TARGET_INT_BIT"
133 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT)
134 #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
138 /* Number of bits in a long or unsigned long for the target machine. */
140 /* Default (value) for non- multi-arch platforms. */
141 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT)
142 #define TARGET_LONG_BIT (4*TARGET_CHAR_BIT)
145 extern int gdbarch_long_bit (struct gdbarch
*gdbarch
);
146 extern void set_gdbarch_long_bit (struct gdbarch
*gdbarch
, int long_bit
);
147 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
148 #error "Non multi-arch definition of TARGET_LONG_BIT"
151 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT)
152 #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
156 /* Number of bits in a long long or unsigned long long for the target
159 /* Default (value) for non- multi-arch platforms. */
160 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT)
161 #define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT)
164 extern int gdbarch_long_long_bit (struct gdbarch
*gdbarch
);
165 extern void set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
, int long_long_bit
);
166 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
167 #error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
170 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT)
171 #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
175 /* Number of bits in a float for the target machine. */
177 /* Default (value) for non- multi-arch platforms. */
178 #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT)
179 #define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT)
182 extern int gdbarch_float_bit (struct gdbarch
*gdbarch
);
183 extern void set_gdbarch_float_bit (struct gdbarch
*gdbarch
, int float_bit
);
184 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
185 #error "Non multi-arch definition of TARGET_FLOAT_BIT"
188 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT)
189 #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
193 /* Number of bits in a double for the target machine. */
195 /* Default (value) for non- multi-arch platforms. */
196 #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT)
197 #define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT)
200 extern int gdbarch_double_bit (struct gdbarch
*gdbarch
);
201 extern void set_gdbarch_double_bit (struct gdbarch
*gdbarch
, int double_bit
);
202 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
203 #error "Non multi-arch definition of TARGET_DOUBLE_BIT"
206 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT)
207 #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
211 /* Number of bits in a long double for the target machine. */
213 /* Default (value) for non- multi-arch platforms. */
214 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT)
215 #define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT)
218 extern int gdbarch_long_double_bit (struct gdbarch
*gdbarch
);
219 extern void set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
, int long_double_bit
);
220 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
221 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT"
224 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT)
225 #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
229 /* For most targets, a pointer on the target and its representation as an
230 address in GDB have the same size and "look the same". For such a
231 target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
232 / addr_bit will be set from it.
234 If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
235 also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
237 ptr_bit is the size of a pointer on the target */
239 /* Default (value) for non- multi-arch platforms. */
240 #if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
241 #define TARGET_PTR_BIT (TARGET_INT_BIT)
244 extern int gdbarch_ptr_bit (struct gdbarch
*gdbarch
);
245 extern void set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
, int ptr_bit
);
246 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
247 #error "Non multi-arch definition of TARGET_PTR_BIT"
250 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT)
251 #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
255 /* addr_bit is the size of a target address as represented in gdb */
257 /* Default (value) for non- multi-arch platforms. */
258 #if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
259 #define TARGET_ADDR_BIT (TARGET_PTR_BIT)
262 extern int gdbarch_addr_bit (struct gdbarch
*gdbarch
);
263 extern void set_gdbarch_addr_bit (struct gdbarch
*gdbarch
, int addr_bit
);
264 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
265 #error "Non multi-arch definition of TARGET_ADDR_BIT"
268 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
269 #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
273 /* Number of bits in a BFD_VMA for the target object file format. */
275 /* Default (value) for non- multi-arch platforms. */
276 #if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT)
277 #define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address)
280 extern int gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
);
281 extern void set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
, int bfd_vma_bit
);
282 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
283 #error "Non multi-arch definition of TARGET_BFD_VMA_BIT"
286 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT)
287 #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
291 /* One if `char' acts like `signed char', zero if `unsigned char'. */
293 /* Default (value) for non- multi-arch platforms. */
294 #if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED)
295 #define TARGET_CHAR_SIGNED (1)
298 extern int gdbarch_char_signed (struct gdbarch
*gdbarch
);
299 extern void set_gdbarch_char_signed (struct gdbarch
*gdbarch
, int char_signed
);
300 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
301 #error "Non multi-arch definition of TARGET_CHAR_SIGNED"
304 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED)
305 #define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch))
309 /* Default (function) for non- multi-arch platforms. */
310 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
311 #define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
314 typedef CORE_ADDR (gdbarch_read_pc_ftype
) (ptid_t ptid
);
315 extern CORE_ADDR
gdbarch_read_pc (struct gdbarch
*gdbarch
, ptid_t ptid
);
316 extern void set_gdbarch_read_pc (struct gdbarch
*gdbarch
, gdbarch_read_pc_ftype
*read_pc
);
317 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC)
318 #error "Non multi-arch definition of TARGET_READ_PC"
321 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC)
322 #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
326 /* Default (function) for non- multi-arch platforms. */
327 #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
328 #define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
331 typedef void (gdbarch_write_pc_ftype
) (CORE_ADDR val
, ptid_t ptid
);
332 extern void gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, ptid_t ptid
);
333 extern void set_gdbarch_write_pc (struct gdbarch
*gdbarch
, gdbarch_write_pc_ftype
*write_pc
);
334 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC)
335 #error "Non multi-arch definition of TARGET_WRITE_PC"
338 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC)
339 #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
343 /* Default (function) for non- multi-arch platforms. */
344 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP)
345 #define TARGET_READ_FP() (generic_target_read_fp ())
348 typedef CORE_ADDR (gdbarch_read_fp_ftype
) (void);
349 extern CORE_ADDR
gdbarch_read_fp (struct gdbarch
*gdbarch
);
350 extern void set_gdbarch_read_fp (struct gdbarch
*gdbarch
, gdbarch_read_fp_ftype
*read_fp
);
351 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP)
352 #error "Non multi-arch definition of TARGET_READ_FP"
355 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP)
356 #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
360 /* Default (function) for non- multi-arch platforms. */
361 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
362 #define TARGET_READ_SP() (generic_target_read_sp ())
365 typedef CORE_ADDR (gdbarch_read_sp_ftype
) (void);
366 extern CORE_ADDR
gdbarch_read_sp (struct gdbarch
*gdbarch
);
367 extern void set_gdbarch_read_sp (struct gdbarch
*gdbarch
, gdbarch_read_sp_ftype
*read_sp
);
368 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP)
369 #error "Non multi-arch definition of TARGET_READ_SP"
372 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP)
373 #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
377 /* Default (function) for non- multi-arch platforms. */
378 #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP)
379 #define TARGET_WRITE_SP(val) (generic_target_write_sp (val))
382 typedef void (gdbarch_write_sp_ftype
) (CORE_ADDR val
);
383 extern void gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
);
384 extern void set_gdbarch_write_sp (struct gdbarch
*gdbarch
, gdbarch_write_sp_ftype
*write_sp
);
385 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP)
386 #error "Non multi-arch definition of TARGET_WRITE_SP"
389 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP)
390 #define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val))
394 /* Function for getting target's idea of a frame pointer. FIXME: GDB's
395 whole scheme for dealing with "frames" and "frame pointers" needs a
396 serious shakedown. */
398 /* Default (function) for non- multi-arch platforms. */
399 #if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER)
400 #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset))
403 typedef void (gdbarch_virtual_frame_pointer_ftype
) (CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
);
404 extern void gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
);
405 extern void set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
);
406 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER)
407 #error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER"
410 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER)
411 #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset))
415 extern int gdbarch_register_read_p (struct gdbarch
*gdbarch
);
417 typedef void (gdbarch_register_read_ftype
) (struct gdbarch
*gdbarch
, int regnum
, char *buf
);
418 extern void gdbarch_register_read (struct gdbarch
*gdbarch
, int regnum
, char *buf
);
419 extern void set_gdbarch_register_read (struct gdbarch
*gdbarch
, gdbarch_register_read_ftype
*register_read
);
421 extern int gdbarch_register_write_p (struct gdbarch
*gdbarch
);
423 typedef void (gdbarch_register_write_ftype
) (struct gdbarch
*gdbarch
, int regnum
, char *buf
);
424 extern void gdbarch_register_write (struct gdbarch
*gdbarch
, int regnum
, char *buf
);
425 extern void set_gdbarch_register_write (struct gdbarch
*gdbarch
, gdbarch_register_write_ftype
*register_write
);
427 extern int gdbarch_num_regs (struct gdbarch
*gdbarch
);
428 extern void set_gdbarch_num_regs (struct gdbarch
*gdbarch
, int num_regs
);
429 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS)
430 #error "Non multi-arch definition of NUM_REGS"
433 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS)
434 #define NUM_REGS (gdbarch_num_regs (current_gdbarch))
438 /* This macro gives the number of pseudo-registers that live in the
439 register namespace but do not get fetched or stored on the target.
440 These pseudo-registers may be aliases for other registers,
441 combinations of other registers, or they may be computed by GDB. */
443 /* Default (value) for non- multi-arch platforms. */
444 #if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
445 #define NUM_PSEUDO_REGS (0)
448 extern int gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
);
449 extern void set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
, int num_pseudo_regs
);
450 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
451 #error "Non multi-arch definition of NUM_PSEUDO_REGS"
454 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS)
455 #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch))
459 extern int gdbarch_sp_regnum (struct gdbarch
*gdbarch
);
460 extern void set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
, int sp_regnum
);
461 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
462 #error "Non multi-arch definition of SP_REGNUM"
465 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM)
466 #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
470 extern int gdbarch_fp_regnum (struct gdbarch
*gdbarch
);
471 extern void set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
, int fp_regnum
);
472 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM)
473 #error "Non multi-arch definition of FP_REGNUM"
476 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM)
477 #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
481 extern int gdbarch_pc_regnum (struct gdbarch
*gdbarch
);
482 extern void set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
, int pc_regnum
);
483 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
484 #error "Non multi-arch definition of PC_REGNUM"
487 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM)
488 #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
492 /* Default (value) for non- multi-arch platforms. */
493 #if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
494 #define FP0_REGNUM (-1)
497 extern int gdbarch_fp0_regnum (struct gdbarch
*gdbarch
);
498 extern void set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
, int fp0_regnum
);
499 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
500 #error "Non multi-arch definition of FP0_REGNUM"
503 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM)
504 #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
508 /* Default (value) for non- multi-arch platforms. */
509 #if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM)
510 #define NPC_REGNUM (-1)
513 extern int gdbarch_npc_regnum (struct gdbarch
*gdbarch
);
514 extern void set_gdbarch_npc_regnum (struct gdbarch
*gdbarch
, int npc_regnum
);
515 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
516 #error "Non multi-arch definition of NPC_REGNUM"
519 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM)
520 #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
524 /* Default (value) for non- multi-arch platforms. */
525 #if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM)
526 #define NNPC_REGNUM (-1)
529 extern int gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
);
530 extern void set_gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
, int nnpc_regnum
);
531 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM)
532 #error "Non multi-arch definition of NNPC_REGNUM"
535 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM)
536 #define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch))
540 /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
542 /* Default (function) for non- multi-arch platforms. */
543 #if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
544 #define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
547 typedef int (gdbarch_stab_reg_to_regnum_ftype
) (int stab_regnr
);
548 extern int gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
);
549 extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
);
550 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM)
551 #error "Non multi-arch definition of STAB_REG_TO_REGNUM"
554 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM)
555 #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
559 /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
561 /* Default (function) for non- multi-arch platforms. */
562 #if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
563 #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
566 typedef int (gdbarch_ecoff_reg_to_regnum_ftype
) (int ecoff_regnr
);
567 extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
);
568 extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
);
569 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM)
570 #error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
573 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM)
574 #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
578 /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
580 /* Default (function) for non- multi-arch platforms. */
581 #if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
582 #define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
585 typedef int (gdbarch_dwarf_reg_to_regnum_ftype
) (int dwarf_regnr
);
586 extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
);
587 extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
);
588 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM)
589 #error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
592 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM)
593 #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
597 /* Convert from an sdb register number to an internal gdb register number.
598 This should be defined in tm.h, if REGISTER_NAMES is not set up
599 to map one to one onto the sdb register numbers. */
601 /* Default (function) for non- multi-arch platforms. */
602 #if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
603 #define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
606 typedef int (gdbarch_sdb_reg_to_regnum_ftype
) (int sdb_regnr
);
607 extern int gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
);
608 extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
);
609 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM)
610 #error "Non multi-arch definition of SDB_REG_TO_REGNUM"
613 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM)
614 #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
618 /* Default (function) for non- multi-arch platforms. */
619 #if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
620 #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
623 typedef int (gdbarch_dwarf2_reg_to_regnum_ftype
) (int dwarf2_regnr
);
624 extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
);
625 extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
);
626 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM)
627 #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
630 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM)
631 #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
635 /* Default (function) for non- multi-arch platforms. */
636 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
637 #define REGISTER_NAME(regnr) (legacy_register_name (regnr))
640 typedef char * (gdbarch_register_name_ftype
) (int regnr
);
641 extern char * gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
);
642 extern void set_gdbarch_register_name (struct gdbarch
*gdbarch
, gdbarch_register_name_ftype
*register_name
);
643 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
644 #error "Non multi-arch definition of REGISTER_NAME"
647 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME)
648 #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
652 extern int gdbarch_register_size (struct gdbarch
*gdbarch
);
653 extern void set_gdbarch_register_size (struct gdbarch
*gdbarch
, int register_size
);
654 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE)
655 #error "Non multi-arch definition of REGISTER_SIZE"
658 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE)
659 #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
663 extern int gdbarch_register_bytes (struct gdbarch
*gdbarch
);
664 extern void set_gdbarch_register_bytes (struct gdbarch
*gdbarch
, int register_bytes
);
665 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
666 #error "Non multi-arch definition of REGISTER_BYTES"
669 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES)
670 #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
674 typedef int (gdbarch_register_byte_ftype
) (int reg_nr
);
675 extern int gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
);
676 extern void set_gdbarch_register_byte (struct gdbarch
*gdbarch
, gdbarch_register_byte_ftype
*register_byte
);
677 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE)
678 #error "Non multi-arch definition of REGISTER_BYTE"
681 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE)
682 #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
686 typedef int (gdbarch_register_raw_size_ftype
) (int reg_nr
);
687 extern int gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
);
688 extern void set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
, gdbarch_register_raw_size_ftype
*register_raw_size
);
689 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE)
690 #error "Non multi-arch definition of REGISTER_RAW_SIZE"
693 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE)
694 #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr))
698 extern int gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
);
699 extern void set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
, int max_register_raw_size
);
700 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE)
701 #error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE"
704 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE)
705 #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch))
709 typedef int (gdbarch_register_virtual_size_ftype
) (int reg_nr
);
710 extern int gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
);
711 extern void set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, gdbarch_register_virtual_size_ftype
*register_virtual_size
);
712 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE)
713 #error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE"
716 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE)
717 #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr))
721 extern int gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
);
722 extern void set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
, int max_register_virtual_size
);
723 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE)
724 #error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE"
727 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE)
728 #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch))
732 typedef struct type
* (gdbarch_register_virtual_type_ftype
) (int reg_nr
);
733 extern struct type
* gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
);
734 extern void set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, gdbarch_register_virtual_type_ftype
*register_virtual_type
);
735 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE)
736 #error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
739 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE)
740 #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
744 /* Default (function) for non- multi-arch platforms. */
745 #if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
746 #define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs))
749 typedef void (gdbarch_do_registers_info_ftype
) (int reg_nr
, int fpregs
);
750 extern void gdbarch_do_registers_info (struct gdbarch
*gdbarch
, int reg_nr
, int fpregs
);
751 extern void set_gdbarch_do_registers_info (struct gdbarch
*gdbarch
, gdbarch_do_registers_info_ftype
*do_registers_info
);
752 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO)
753 #error "Non multi-arch definition of DO_REGISTERS_INFO"
756 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO)
757 #define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs))
761 /* Default (function) for non- multi-arch platforms. */
762 #if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO)
763 #define PRINT_FLOAT_INFO() (default_print_float_info ())
766 typedef void (gdbarch_print_float_info_ftype
) (void);
767 extern void gdbarch_print_float_info (struct gdbarch
*gdbarch
);
768 extern void set_gdbarch_print_float_info (struct gdbarch
*gdbarch
, gdbarch_print_float_info_ftype
*print_float_info
);
769 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO)
770 #error "Non multi-arch definition of PRINT_FLOAT_INFO"
773 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO)
774 #define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch))
778 /* MAP a GDB RAW register number onto a simulator register number. See
779 also include/...-sim.h. */
781 /* Default (function) for non- multi-arch platforms. */
782 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
783 #define REGISTER_SIM_REGNO(reg_nr) (default_register_sim_regno (reg_nr))
786 typedef int (gdbarch_register_sim_regno_ftype
) (int reg_nr
);
787 extern int gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
);
788 extern void set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, gdbarch_register_sim_regno_ftype
*register_sim_regno
);
789 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO)
790 #error "Non multi-arch definition of REGISTER_SIM_REGNO"
793 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO)
794 #define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
798 #if defined (REGISTER_BYTES_OK)
799 /* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
800 #if !defined (REGISTER_BYTES_OK_P)
801 #define REGISTER_BYTES_OK_P() (1)
805 /* Default predicate for non- multi-arch targets. */
806 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
807 #define REGISTER_BYTES_OK_P() (0)
810 extern int gdbarch_register_bytes_ok_p (struct gdbarch
*gdbarch
);
811 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
812 #error "Non multi-arch definition of REGISTER_BYTES_OK"
814 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
815 #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
818 /* Default (function) for non- multi-arch platforms. */
819 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
820 #define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
823 typedef int (gdbarch_register_bytes_ok_ftype
) (long nr_bytes
);
824 extern int gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
, long nr_bytes
);
825 extern void set_gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
, gdbarch_register_bytes_ok_ftype
*register_bytes_ok
);
826 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK)
827 #error "Non multi-arch definition of REGISTER_BYTES_OK"
830 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
831 #define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
835 /* Default (function) for non- multi-arch platforms. */
836 #if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
837 #define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
840 typedef int (gdbarch_cannot_fetch_register_ftype
) (int regnum
);
841 extern int gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
);
842 extern void set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
);
843 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER)
844 #error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
847 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER)
848 #define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
852 /* Default (function) for non- multi-arch platforms. */
853 #if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
854 #define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
857 typedef int (gdbarch_cannot_store_register_ftype
) (int regnum
);
858 extern int gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
);
859 extern void set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, gdbarch_cannot_store_register_ftype
*cannot_store_register
);
860 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER)
861 #error "Non multi-arch definition of CANNOT_STORE_REGISTER"
864 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER)
865 #define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
869 /* setjmp/longjmp support. */
871 #if defined (GET_LONGJMP_TARGET)
872 /* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */
873 #if !defined (GET_LONGJMP_TARGET_P)
874 #define GET_LONGJMP_TARGET_P() (1)
878 /* Default predicate for non- multi-arch targets. */
879 #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P)
880 #define GET_LONGJMP_TARGET_P() (0)
883 extern int gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
);
884 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
885 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
887 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P)
888 #define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
891 /* Default (function) for non- multi-arch platforms. */
892 #if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET)
893 #define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0)
896 typedef int (gdbarch_get_longjmp_target_ftype
) (CORE_ADDR
*pc
);
897 extern int gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, CORE_ADDR
*pc
);
898 extern void set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, gdbarch_get_longjmp_target_ftype
*get_longjmp_target
);
899 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET)
900 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
903 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET)
904 #define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
908 /* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that
909 much better but at least they are vaguely consistent). The headers
910 and body contain convoluted #if/#else sequences for determine how
911 things should be compiled. Instead of trying to mimic that
912 behaviour here (and hence entrench it further) gdbarch simply
913 reqires that these methods be set up from the word go. This also
914 avoids any potential problems with moving beyond multi-arch partial. */
916 extern int gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
);
917 extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
, int use_generic_dummy_frames
);
918 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES)
919 #error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES"
922 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES)
923 #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch))
927 extern int gdbarch_call_dummy_location (struct gdbarch
*gdbarch
);
928 extern void set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
, int call_dummy_location
);
929 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
930 #error "Non multi-arch definition of CALL_DUMMY_LOCATION"
933 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION)
934 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
938 typedef CORE_ADDR (gdbarch_call_dummy_address_ftype
) (void);
939 extern CORE_ADDR
gdbarch_call_dummy_address (struct gdbarch
*gdbarch
);
940 extern void set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
, gdbarch_call_dummy_address_ftype
*call_dummy_address
);
941 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
942 #error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
945 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS)
946 #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
950 extern CORE_ADDR
gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
);
951 extern void set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
, CORE_ADDR call_dummy_start_offset
);
952 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET)
953 #error "Non multi-arch definition of CALL_DUMMY_START_OFFSET"
956 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_START_OFFSET)
957 #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
961 extern CORE_ADDR
gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
);
962 extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
, CORE_ADDR call_dummy_breakpoint_offset
);
963 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET)
964 #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET"
967 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
968 #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
972 extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
);
973 extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
, int call_dummy_breakpoint_offset_p
);
974 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
975 #error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET_P"
978 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
979 #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch))
983 extern int gdbarch_call_dummy_length (struct gdbarch
*gdbarch
);
984 extern void set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
, int call_dummy_length
);
985 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH)
986 #error "Non multi-arch definition of CALL_DUMMY_LENGTH"
989 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH)
990 #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
994 typedef int (gdbarch_pc_in_call_dummy_ftype
) (CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
);
995 extern int gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
);
996 extern void set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
);
997 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY)
998 #error "Non multi-arch definition of PC_IN_CALL_DUMMY"
1001 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY)
1002 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
1006 extern int gdbarch_call_dummy_p (struct gdbarch
*gdbarch
);
1007 extern void set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
, int call_dummy_p
);
1008 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_P)
1009 #error "Non multi-arch definition of CALL_DUMMY_P"
1012 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P)
1013 #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch))
1017 /* Default (value) for non- multi-arch platforms. */
1018 #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS)
1019 #define CALL_DUMMY_WORDS (legacy_call_dummy_words)
1022 extern LONGEST
* gdbarch_call_dummy_words (struct gdbarch
*gdbarch
);
1023 extern void set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
, LONGEST
* call_dummy_words
);
1024 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS)
1025 #error "Non multi-arch definition of CALL_DUMMY_WORDS"
1028 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS)
1029 #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
1033 /* Default (value) for non- multi-arch platforms. */
1034 #if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS)
1035 #define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
1038 extern int gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
);
1039 extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
, int sizeof_call_dummy_words
);
1040 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS)
1041 #error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS"
1044 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIZEOF_CALL_DUMMY_WORDS)
1045 #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
1049 extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
);
1050 extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
, int call_dummy_stack_adjust_p
);
1051 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P)
1052 #error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P"
1055 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P)
1056 #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch))
1060 extern int gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
);
1061 extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
, int call_dummy_stack_adjust
);
1062 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST)
1063 #error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST"
1066 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST)
1067 #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch))
1071 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
);
1072 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
);
1073 extern void set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
, gdbarch_fix_call_dummy_ftype
*fix_call_dummy
);
1074 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY)
1075 #error "Non multi-arch definition of FIX_CALL_DUMMY"
1078 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY)
1079 #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))
1083 /* Default (function) for non- multi-arch platforms. */
1084 #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST)
1085 #define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
1088 typedef void (gdbarch_init_frame_pc_first_ftype
) (int fromleaf
, struct frame_info
*prev
);
1089 extern void gdbarch_init_frame_pc_first (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*prev
);
1090 extern void set_gdbarch_init_frame_pc_first (struct gdbarch
*gdbarch
, gdbarch_init_frame_pc_first_ftype
*init_frame_pc_first
);
1091 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST)
1092 #error "Non multi-arch definition of INIT_FRAME_PC_FIRST"
1095 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST)
1096 #define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev))
1100 /* Default (function) for non- multi-arch platforms. */
1101 #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC)
1102 #define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev))
1105 typedef void (gdbarch_init_frame_pc_ftype
) (int fromleaf
, struct frame_info
*prev
);
1106 extern void gdbarch_init_frame_pc (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*prev
);
1107 extern void set_gdbarch_init_frame_pc (struct gdbarch
*gdbarch
, gdbarch_init_frame_pc_ftype
*init_frame_pc
);
1108 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC)
1109 #error "Non multi-arch definition of INIT_FRAME_PC"
1112 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC)
1113 #define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev))
1117 extern int gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
);
1118 extern void set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
, int believe_pcc_promotion
);
1119 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION)
1120 #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION"
1123 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION)
1124 #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
1128 extern int gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
);
1129 extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
, int believe_pcc_promotion_type
);
1130 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE)
1131 #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE"
1134 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE)
1135 #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
1139 /* Default (function) for non- multi-arch platforms. */
1140 #if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE)
1141 #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual))
1144 typedef int (gdbarch_coerce_float_to_double_ftype
) (struct type
*formal
, struct type
*actual
);
1145 extern int gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
);
1146 extern void set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
);
1147 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE)
1148 #error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE"
1151 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE)
1152 #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual))
1156 /* GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the
1157 old code has strange #ifdef interaction. So far no one has found
1158 that default_get_saved_register() is the default they are after. */
1160 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
);
1161 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
);
1162 extern void set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
, gdbarch_get_saved_register_ftype
*get_saved_register
);
1163 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
1164 #error "Non multi-arch definition of GET_SAVED_REGISTER"
1167 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
1168 #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
1172 /* Default (function) for non- multi-arch platforms. */
1173 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE)
1174 #define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr))
1177 typedef int (gdbarch_register_convertible_ftype
) (int nr
);
1178 extern int gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
);
1179 extern void set_gdbarch_register_convertible (struct gdbarch
*gdbarch
, gdbarch_register_convertible_ftype
*register_convertible
);
1180 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE)
1181 #error "Non multi-arch definition of REGISTER_CONVERTIBLE"
1184 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE)
1185 #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
1189 /* Default (function) for non- multi-arch platforms. */
1190 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL)
1191 #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0)
1194 typedef void (gdbarch_register_convert_to_virtual_ftype
) (int regnum
, struct type
*type
, char *from
, char *to
);
1195 extern void gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
);
1196 extern void set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
);
1197 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL)
1198 #error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL"
1201 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL)
1202 #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
1206 /* Default (function) for non- multi-arch platforms. */
1207 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW)
1208 #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0)
1211 typedef void (gdbarch_register_convert_to_raw_ftype
) (struct type
*type
, int regnum
, char *from
, char *to
);
1212 extern void gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
);
1213 extern void set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
);
1214 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW)
1215 #error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW"
1218 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW)
1219 #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
1223 /* This function is called when the value of a pseudo-register needs to
1224 be updated. Typically it will be defined on a per-architecture
1227 #if defined (FETCH_PSEUDO_REGISTER)
1228 /* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */
1229 #if !defined (FETCH_PSEUDO_REGISTER_P)
1230 #define FETCH_PSEUDO_REGISTER_P() (1)
1234 /* Default predicate for non- multi-arch targets. */
1235 #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P)
1236 #define FETCH_PSEUDO_REGISTER_P() (0)
1239 extern int gdbarch_fetch_pseudo_register_p (struct gdbarch
*gdbarch
);
1240 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P)
1241 #error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
1243 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P)
1244 #define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch))
1247 /* Default (function) for non- multi-arch platforms. */
1248 #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
1249 #define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
1252 typedef void (gdbarch_fetch_pseudo_register_ftype
) (int regnum
);
1253 extern void gdbarch_fetch_pseudo_register (struct gdbarch
*gdbarch
, int regnum
);
1254 extern void set_gdbarch_fetch_pseudo_register (struct gdbarch
*gdbarch
, gdbarch_fetch_pseudo_register_ftype
*fetch_pseudo_register
);
1255 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER)
1256 #error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
1259 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER)
1260 #define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum))
1264 /* This function is called when the value of a pseudo-register needs to
1265 be set or stored. Typically it will be defined on a
1266 per-architecture basis. */
1268 #if defined (STORE_PSEUDO_REGISTER)
1269 /* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */
1270 #if !defined (STORE_PSEUDO_REGISTER_P)
1271 #define STORE_PSEUDO_REGISTER_P() (1)
1275 /* Default predicate for non- multi-arch targets. */
1276 #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P)
1277 #define STORE_PSEUDO_REGISTER_P() (0)
1280 extern int gdbarch_store_pseudo_register_p (struct gdbarch
*gdbarch
);
1281 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P)
1282 #error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
1284 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P)
1285 #define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch))
1288 /* Default (function) for non- multi-arch platforms. */
1289 #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
1290 #define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
1293 typedef void (gdbarch_store_pseudo_register_ftype
) (int regnum
);
1294 extern void gdbarch_store_pseudo_register (struct gdbarch
*gdbarch
, int regnum
);
1295 extern void set_gdbarch_store_pseudo_register (struct gdbarch
*gdbarch
, gdbarch_store_pseudo_register_ftype
*store_pseudo_register
);
1296 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER)
1297 #error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
1300 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER)
1301 #define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum))
1305 /* Default (function) for non- multi-arch platforms. */
1306 #if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
1307 #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
1310 typedef CORE_ADDR (gdbarch_pointer_to_address_ftype
) (struct type
*type
, void *buf
);
1311 extern CORE_ADDR
gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
);
1312 extern void set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, gdbarch_pointer_to_address_ftype
*pointer_to_address
);
1313 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS)
1314 #error "Non multi-arch definition of POINTER_TO_ADDRESS"
1317 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS)
1318 #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
1322 /* Default (function) for non- multi-arch platforms. */
1323 #if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER)
1324 #define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr))
1327 typedef void (gdbarch_address_to_pointer_ftype
) (struct type
*type
, void *buf
, CORE_ADDR addr
);
1328 extern void gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
, CORE_ADDR addr
);
1329 extern void set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, gdbarch_address_to_pointer_ftype
*address_to_pointer
);
1330 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER)
1331 #error "Non multi-arch definition of ADDRESS_TO_POINTER"
1334 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER)
1335 #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
1339 #if defined (INTEGER_TO_ADDRESS)
1340 /* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */
1341 #if !defined (INTEGER_TO_ADDRESS_P)
1342 #define INTEGER_TO_ADDRESS_P() (1)
1346 /* Default predicate for non- multi-arch targets. */
1347 #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P)
1348 #define INTEGER_TO_ADDRESS_P() (0)
1351 extern int gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
);
1352 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
1353 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1355 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P)
1356 #define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
1359 /* Default (function) for non- multi-arch platforms. */
1360 #if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS)
1361 #define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0)
1364 typedef CORE_ADDR (gdbarch_integer_to_address_ftype
) (struct type
*type
, void *buf
);
1365 extern CORE_ADDR
gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
);
1366 extern void set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
, gdbarch_integer_to_address_ftype
*integer_to_address
);
1367 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS)
1368 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1371 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS)
1372 #define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf))
1376 /* Default (function) for non- multi-arch platforms. */
1377 #if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK)
1378 #define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type))
1381 typedef int (gdbarch_return_value_on_stack_ftype
) (struct type
*type
);
1382 extern int gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
);
1383 extern void set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, gdbarch_return_value_on_stack_ftype
*return_value_on_stack
);
1384 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
1385 #error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
1388 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK)
1389 #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
1393 typedef void (gdbarch_extract_return_value_ftype
) (struct type
*type
, char *regbuf
, char *valbuf
);
1394 extern void gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
);
1395 extern void set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
, gdbarch_extract_return_value_ftype
*extract_return_value
);
1396 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
1397 #error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
1400 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
1401 #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
1405 /* Default (function) for non- multi-arch platforms. */
1406 #if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS)
1407 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr))
1410 typedef CORE_ADDR (gdbarch_push_arguments_ftype
) (int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
);
1411 extern CORE_ADDR
gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
);
1412 extern void set_gdbarch_push_arguments (struct gdbarch
*gdbarch
, gdbarch_push_arguments_ftype
*push_arguments
);
1413 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS)
1414 #error "Non multi-arch definition of PUSH_ARGUMENTS"
1417 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS)
1418 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
1422 typedef void (gdbarch_push_dummy_frame_ftype
) (void);
1423 extern void gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
);
1424 extern void set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
, gdbarch_push_dummy_frame_ftype
*push_dummy_frame
);
1425 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME)
1426 #error "Non multi-arch definition of PUSH_DUMMY_FRAME"
1429 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME)
1430 #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch))
1434 #if defined (PUSH_RETURN_ADDRESS)
1435 /* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */
1436 #if !defined (PUSH_RETURN_ADDRESS_P)
1437 #define PUSH_RETURN_ADDRESS_P() (1)
1441 /* Default predicate for non- multi-arch targets. */
1442 #if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P)
1443 #define PUSH_RETURN_ADDRESS_P() (0)
1446 extern int gdbarch_push_return_address_p (struct gdbarch
*gdbarch
);
1447 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P)
1448 #error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
1450 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P)
1451 #define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch))
1454 /* Default (function) for non- multi-arch platforms. */
1455 #if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS)
1456 #define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0)
1459 typedef CORE_ADDR (gdbarch_push_return_address_ftype
) (CORE_ADDR pc
, CORE_ADDR sp
);
1460 extern CORE_ADDR
gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
);
1461 extern void set_gdbarch_push_return_address (struct gdbarch
*gdbarch
, gdbarch_push_return_address_ftype
*push_return_address
);
1462 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS)
1463 #error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
1466 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS)
1467 #define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp))
1471 typedef void (gdbarch_pop_frame_ftype
) (void);
1472 extern void gdbarch_pop_frame (struct gdbarch
*gdbarch
);
1473 extern void set_gdbarch_pop_frame (struct gdbarch
*gdbarch
, gdbarch_pop_frame_ftype
*pop_frame
);
1474 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME)
1475 #error "Non multi-arch definition of POP_FRAME"
1478 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME)
1479 #define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
1483 typedef void (gdbarch_store_struct_return_ftype
) (CORE_ADDR addr
, CORE_ADDR sp
);
1484 extern void gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
);
1485 extern void set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
, gdbarch_store_struct_return_ftype
*store_struct_return
);
1486 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN)
1487 #error "Non multi-arch definition of STORE_STRUCT_RETURN"
1490 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN)
1491 #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp))
1495 typedef void (gdbarch_store_return_value_ftype
) (struct type
*type
, char *valbuf
);
1496 extern void gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
);
1497 extern void set_gdbarch_store_return_value (struct gdbarch
*gdbarch
, gdbarch_store_return_value_ftype
*store_return_value
);
1498 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
1499 #error "Non multi-arch definition of STORE_RETURN_VALUE"
1502 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE)
1503 #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
1507 #if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1508 /* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
1509 #if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1510 #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
1514 /* Default predicate for non- multi-arch targets. */
1515 #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1516 #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
1519 extern int gdbarch_extract_struct_value_address_p (struct gdbarch
*gdbarch
);
1520 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1521 #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1523 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1524 #define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
1527 /* Default (function) for non- multi-arch platforms. */
1528 #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1529 #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
1532 typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype
) (char *regbuf
);
1533 extern CORE_ADDR
gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
);
1534 extern void set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
);
1535 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1536 #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1539 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1540 #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
1544 /* Default (function) for non- multi-arch platforms. */
1545 #if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION)
1546 #define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type))
1549 typedef int (gdbarch_use_struct_convention_ftype
) (int gcc_p
, struct type
*value_type
);
1550 extern int gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
);
1551 extern void set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, gdbarch_use_struct_convention_ftype
*use_struct_convention
);
1552 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
1553 #error "Non multi-arch definition of USE_STRUCT_CONVENTION"
1556 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION)
1557 #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
1561 typedef void (gdbarch_frame_init_saved_regs_ftype
) (struct frame_info
*frame
);
1562 extern void gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
);
1563 extern void set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
);
1564 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS)
1565 #error "Non multi-arch definition of FRAME_INIT_SAVED_REGS"
1568 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS)
1569 #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame))
1573 #if defined (INIT_EXTRA_FRAME_INFO)
1574 /* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */
1575 #if !defined (INIT_EXTRA_FRAME_INFO_P)
1576 #define INIT_EXTRA_FRAME_INFO_P() (1)
1580 /* Default predicate for non- multi-arch targets. */
1581 #if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P)
1582 #define INIT_EXTRA_FRAME_INFO_P() (0)
1585 extern int gdbarch_init_extra_frame_info_p (struct gdbarch
*gdbarch
);
1586 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P)
1587 #error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
1589 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P)
1590 #define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch))
1593 /* Default (function) for non- multi-arch platforms. */
1594 #if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO)
1595 #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0)
1598 typedef void (gdbarch_init_extra_frame_info_ftype
) (int fromleaf
, struct frame_info
*frame
);
1599 extern void gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
);
1600 extern void set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
);
1601 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO)
1602 #error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
1605 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO)
1606 #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame))
1610 typedef CORE_ADDR (gdbarch_skip_prologue_ftype
) (CORE_ADDR ip
);
1611 extern CORE_ADDR
gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
);
1612 extern void set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
, gdbarch_skip_prologue_ftype
*skip_prologue
);
1613 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE)
1614 #error "Non multi-arch definition of SKIP_PROLOGUE"
1617 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE)
1618 #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
1622 /* Default (function) for non- multi-arch platforms. */
1623 #if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P)
1624 #define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip))
1627 typedef int (gdbarch_prologue_frameless_p_ftype
) (CORE_ADDR ip
);
1628 extern int gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, CORE_ADDR ip
);
1629 extern void set_gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, gdbarch_prologue_frameless_p_ftype
*prologue_frameless_p
);
1630 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P)
1631 #error "Non multi-arch definition of PROLOGUE_FRAMELESS_P"
1634 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P)
1635 #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip))
1639 typedef int (gdbarch_inner_than_ftype
) (CORE_ADDR lhs
, CORE_ADDR rhs
);
1640 extern int gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
);
1641 extern void set_gdbarch_inner_than (struct gdbarch
*gdbarch
, gdbarch_inner_than_ftype
*inner_than
);
1642 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN)
1643 #error "Non multi-arch definition of INNER_THAN"
1646 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN)
1647 #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
1651 /* Default (function) for non- multi-arch platforms. */
1652 #if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC)
1653 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
1656 typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype
) (CORE_ADDR
*pcptr
, int *lenptr
);
1657 extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
);
1658 extern void set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
);
1659 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
1660 #error "Non multi-arch definition of BREAKPOINT_FROM_PC"
1663 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC)
1664 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
1668 /* Default (function) for non- multi-arch platforms. */
1669 #if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
1670 #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
1673 typedef int (gdbarch_memory_insert_breakpoint_ftype
) (CORE_ADDR addr
, char *contents_cache
);
1674 extern int gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
);
1675 extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
);
1676 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
1677 #error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
1680 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT)
1681 #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
1685 /* Default (function) for non- multi-arch platforms. */
1686 #if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
1687 #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
1690 typedef int (gdbarch_memory_remove_breakpoint_ftype
) (CORE_ADDR addr
, char *contents_cache
);
1691 extern int gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
);
1692 extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
);
1693 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
1694 #error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
1697 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT)
1698 #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
1702 extern CORE_ADDR
gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
);
1703 extern void set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
, CORE_ADDR decr_pc_after_break
);
1704 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
1705 #error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
1708 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK)
1709 #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
1713 /* Default (function) for non- multi-arch platforms. */
1714 #if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
1715 #define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
1718 typedef int (gdbarch_prepare_to_proceed_ftype
) (int select_it
);
1719 extern int gdbarch_prepare_to_proceed (struct gdbarch
*gdbarch
, int select_it
);
1720 extern void set_gdbarch_prepare_to_proceed (struct gdbarch
*gdbarch
, gdbarch_prepare_to_proceed_ftype
*prepare_to_proceed
);
1721 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED)
1722 #error "Non multi-arch definition of PREPARE_TO_PROCEED"
1725 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
1726 #define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
1730 extern CORE_ADDR
gdbarch_function_start_offset (struct gdbarch
*gdbarch
);
1731 extern void set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
, CORE_ADDR function_start_offset
);
1732 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
1733 #error "Non multi-arch definition of FUNCTION_START_OFFSET"
1736 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET)
1737 #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
1741 /* Default (function) for non- multi-arch platforms. */
1742 #if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1743 #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))
1746 typedef void (gdbarch_remote_translate_xfer_address_ftype
) (CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
);
1747 extern void gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
);
1748 extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
);
1749 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1750 #error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS"
1753 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1754 #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))
1758 extern CORE_ADDR
gdbarch_frame_args_skip (struct gdbarch
*gdbarch
);
1759 extern void set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
, CORE_ADDR frame_args_skip
);
1760 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
1761 #error "Non multi-arch definition of FRAME_ARGS_SKIP"
1764 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP)
1765 #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
1769 /* Default (function) for non- multi-arch platforms. */
1770 #if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
1771 #define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
1774 typedef int (gdbarch_frameless_function_invocation_ftype
) (struct frame_info
*fi
);
1775 extern int gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
);
1776 extern void set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
);
1777 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION)
1778 #error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION"
1781 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION)
1782 #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
1786 typedef CORE_ADDR (gdbarch_frame_chain_ftype
) (struct frame_info
*frame
);
1787 extern CORE_ADDR
gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
);
1788 extern void set_gdbarch_frame_chain (struct gdbarch
*gdbarch
, gdbarch_frame_chain_ftype
*frame_chain
);
1789 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN)
1790 #error "Non multi-arch definition of FRAME_CHAIN"
1793 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN)
1794 #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame))
1798 /* Define a default FRAME_CHAIN_VALID, in the form that is suitable for
1799 most targets. If FRAME_CHAIN_VALID returns zero it means that the
1800 given frame is the outermost one and has no caller.
1802 XXXX - both default and alternate frame_chain_valid functions are
1803 deprecated. New code should use dummy frames and one of the generic
1806 /* Default (function) for non- multi-arch platforms. */
1807 #if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID)
1808 #define FRAME_CHAIN_VALID(chain, thisframe) (func_frame_chain_valid (chain, thisframe))
1811 typedef int (gdbarch_frame_chain_valid_ftype
) (CORE_ADDR chain
, struct frame_info
*thisframe
);
1812 extern int gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
);
1813 extern void set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, gdbarch_frame_chain_valid_ftype
*frame_chain_valid
);
1814 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID)
1815 #error "Non multi-arch definition of FRAME_CHAIN_VALID"
1818 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID)
1819 #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe))
1823 typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype
) (struct frame_info
*fi
);
1824 extern CORE_ADDR
gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
);
1825 extern void set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, gdbarch_frame_saved_pc_ftype
*frame_saved_pc
);
1826 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC)
1827 #error "Non multi-arch definition of FRAME_SAVED_PC"
1830 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC)
1831 #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi))
1835 typedef CORE_ADDR (gdbarch_frame_args_address_ftype
) (struct frame_info
*fi
);
1836 extern CORE_ADDR
gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
);
1837 extern void set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
, gdbarch_frame_args_address_ftype
*frame_args_address
);
1838 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS)
1839 #error "Non multi-arch definition of FRAME_ARGS_ADDRESS"
1842 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS)
1843 #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
1847 typedef CORE_ADDR (gdbarch_frame_locals_address_ftype
) (struct frame_info
*fi
);
1848 extern CORE_ADDR
gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
);
1849 extern void set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, gdbarch_frame_locals_address_ftype
*frame_locals_address
);
1850 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS)
1851 #error "Non multi-arch definition of FRAME_LOCALS_ADDRESS"
1854 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS)
1855 #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
1859 typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype
) (struct frame_info
*frame
);
1860 extern CORE_ADDR
gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
);
1861 extern void set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
);
1862 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVED_PC_AFTER_CALL)
1863 #error "Non multi-arch definition of SAVED_PC_AFTER_CALL"
1866 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVED_PC_AFTER_CALL)
1867 #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame))
1871 typedef int (gdbarch_frame_num_args_ftype
) (struct frame_info
*frame
);
1872 extern int gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
);
1873 extern void set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
, gdbarch_frame_num_args_ftype
*frame_num_args
);
1874 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
1875 #error "Non multi-arch definition of FRAME_NUM_ARGS"
1878 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS)
1879 #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
1883 #if defined (STACK_ALIGN)
1884 /* Legacy for systems yet to multi-arch STACK_ALIGN */
1885 #if !defined (STACK_ALIGN_P)
1886 #define STACK_ALIGN_P() (1)
1890 /* Default predicate for non- multi-arch targets. */
1891 #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
1892 #define STACK_ALIGN_P() (0)
1895 extern int gdbarch_stack_align_p (struct gdbarch
*gdbarch
);
1896 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
1897 #error "Non multi-arch definition of STACK_ALIGN"
1899 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
1900 #define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
1903 /* Default (function) for non- multi-arch platforms. */
1904 #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
1905 #define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
1908 typedef CORE_ADDR (gdbarch_stack_align_ftype
) (CORE_ADDR sp
);
1909 extern CORE_ADDR
gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
);
1910 extern void set_gdbarch_stack_align (struct gdbarch
*gdbarch
, gdbarch_stack_align_ftype
*stack_align
);
1911 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
1912 #error "Non multi-arch definition of STACK_ALIGN"
1915 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN)
1916 #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
1920 /* Default (value) for non- multi-arch platforms. */
1921 #if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
1922 #define EXTRA_STACK_ALIGNMENT_NEEDED (1)
1925 extern int gdbarch_extra_stack_alignment_needed (struct gdbarch
*gdbarch
);
1926 extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch
*gdbarch
, int extra_stack_alignment_needed
);
1927 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED)
1928 #error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED"
1931 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
1932 #define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch))
1936 #if defined (REG_STRUCT_HAS_ADDR)
1937 /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
1938 #if !defined (REG_STRUCT_HAS_ADDR_P)
1939 #define REG_STRUCT_HAS_ADDR_P() (1)
1943 /* Default predicate for non- multi-arch targets. */
1944 #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
1945 #define REG_STRUCT_HAS_ADDR_P() (0)
1948 extern int gdbarch_reg_struct_has_addr_p (struct gdbarch
*gdbarch
);
1949 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
1950 #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
1952 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
1953 #define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
1956 /* Default (function) for non- multi-arch platforms. */
1957 #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
1958 #define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
1961 typedef int (gdbarch_reg_struct_has_addr_ftype
) (int gcc_p
, struct type
*type
);
1962 extern int gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
);
1963 extern void set_gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, gdbarch_reg_struct_has_addr_ftype
*reg_struct_has_addr
);
1964 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
1965 #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
1968 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR)
1969 #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
1973 #if defined (SAVE_DUMMY_FRAME_TOS)
1974 /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
1975 #if !defined (SAVE_DUMMY_FRAME_TOS_P)
1976 #define SAVE_DUMMY_FRAME_TOS_P() (1)
1980 /* Default predicate for non- multi-arch targets. */
1981 #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
1982 #define SAVE_DUMMY_FRAME_TOS_P() (0)
1985 extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch
*gdbarch
);
1986 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P)
1987 #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
1989 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P)
1990 #define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
1993 /* Default (function) for non- multi-arch platforms. */
1994 #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
1995 #define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
1998 typedef void (gdbarch_save_dummy_frame_tos_ftype
) (CORE_ADDR sp
);
1999 extern void gdbarch_save_dummy_frame_tos (struct gdbarch
*gdbarch
, CORE_ADDR sp
);
2000 extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch
*gdbarch
, gdbarch_save_dummy_frame_tos_ftype
*save_dummy_frame_tos
);
2001 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS)
2002 #error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2005 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS)
2006 #define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
2010 extern int gdbarch_parm_boundary (struct gdbarch
*gdbarch
);
2011 extern void set_gdbarch_parm_boundary (struct gdbarch
*gdbarch
, int parm_boundary
);
2012 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
2013 #error "Non multi-arch definition of PARM_BOUNDARY"
2016 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
2017 #define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
2021 /* Default (value) for non- multi-arch platforms. */
2022 #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
2023 #define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
2026 extern const struct floatformat
* gdbarch_float_format (struct gdbarch
*gdbarch
);
2027 extern void set_gdbarch_float_format (struct gdbarch
*gdbarch
, const struct floatformat
* float_format
);
2028 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
2029 #error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
2032 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT)
2033 #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
2037 /* Default (value) for non- multi-arch platforms. */
2038 #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
2039 #define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
2042 extern const struct floatformat
* gdbarch_double_format (struct gdbarch
*gdbarch
);
2043 extern void set_gdbarch_double_format (struct gdbarch
*gdbarch
, const struct floatformat
* double_format
);
2044 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
2045 #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
2048 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT)
2049 #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
2053 /* Default (value) for non- multi-arch platforms. */
2054 #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
2055 #define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch))
2058 extern const struct floatformat
* gdbarch_long_double_format (struct gdbarch
*gdbarch
);
2059 extern void set_gdbarch_long_double_format (struct gdbarch
*gdbarch
, const struct floatformat
* long_double_format
);
2060 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
2061 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
2064 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT)
2065 #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
2069 /* Default (function) for non- multi-arch platforms. */
2070 #if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
2071 #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
2074 typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype
) (CORE_ADDR addr
);
2075 extern CORE_ADDR
gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
);
2076 extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
);
2077 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR)
2078 #error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR"
2081 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
2082 #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
2086 /* On some machines there are bits in addresses which are not really
2087 part of the address, but are used by the kernel, the hardware, etc.
2088 for special purposes. ADDR_BITS_REMOVE takes out any such bits so
2089 we get a "real" address such as one would find in a symbol table.
2090 This is used only for addresses of instructions, and even then I'm
2091 not sure it's used in all contexts. It exists to deal with there
2092 being a few stray bits in the PC which would mislead us, not as some
2093 sort of generic thing to handle alignment or segmentation (it's
2094 possible it should be in TARGET_READ_PC instead). */
2096 /* Default (function) for non- multi-arch platforms. */
2097 #if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
2098 #define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
2101 typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype
) (CORE_ADDR addr
);
2102 extern CORE_ADDR
gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
);
2103 extern void set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, gdbarch_addr_bits_remove_ftype
*addr_bits_remove
);
2104 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
2105 #error "Non multi-arch definition of ADDR_BITS_REMOVE"
2108 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
2109 #define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
2113 /* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
2114 ADDR_BITS_REMOVE. */
2116 /* Default (function) for non- multi-arch platforms. */
2117 #if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
2118 #define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
2121 typedef CORE_ADDR (gdbarch_smash_text_address_ftype
) (CORE_ADDR addr
);
2122 extern CORE_ADDR
gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
);
2123 extern void set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
, gdbarch_smash_text_address_ftype
*smash_text_address
);
2124 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
2125 #error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
2128 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS)
2129 #define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
2133 /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
2134 the target needs software single step. An ISA method to implement it.
2136 FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
2137 using the breakpoint system instead of blatting memory directly (as with rs6000).
2139 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
2140 single step. If not, then implement single step using breakpoints. */
2142 #if defined (SOFTWARE_SINGLE_STEP)
2143 /* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
2144 #if !defined (SOFTWARE_SINGLE_STEP_P)
2145 #define SOFTWARE_SINGLE_STEP_P() (1)
2149 /* Default predicate for non- multi-arch targets. */
2150 #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
2151 #define SOFTWARE_SINGLE_STEP_P() (0)
2154 extern int gdbarch_software_single_step_p (struct gdbarch
*gdbarch
);
2155 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
2156 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2158 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
2159 #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
2162 /* Default (function) for non- multi-arch platforms. */
2163 #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
2164 #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
2167 typedef void (gdbarch_software_single_step_ftype
) (enum target_signal sig
, int insert_breakpoints_p
);
2168 extern void gdbarch_software_single_step (struct gdbarch
*gdbarch
, enum target_signal sig
, int insert_breakpoints_p
);
2169 extern void set_gdbarch_software_single_step (struct gdbarch
*gdbarch
, gdbarch_software_single_step_ftype
*software_single_step
);
2170 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
2171 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2174 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
2175 #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
2179 /* Default (function) for non- multi-arch platforms. */
2180 #if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN)
2181 #define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info))
2184 typedef int (gdbarch_print_insn_ftype
) (bfd_vma vma
, disassemble_info
*info
);
2185 extern int gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, disassemble_info
*info
);
2186 extern void set_gdbarch_print_insn (struct gdbarch
*gdbarch
, gdbarch_print_insn_ftype
*print_insn
);
2187 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
2188 #error "Non multi-arch definition of TARGET_PRINT_INSN"
2191 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN)
2192 #define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
2196 /* Default (function) for non- multi-arch platforms. */
2197 #if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
2198 #define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
2201 typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype
) (CORE_ADDR pc
);
2202 extern CORE_ADDR
gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, CORE_ADDR pc
);
2203 extern void set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
);
2204 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
2205 #error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
2208 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE)
2209 #define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
2213 /* For SVR4 shared libraries, each call goes through a small piece of
2214 trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
2215 to nonzero if we are current stopped in one of these. */
2217 /* Default (function) for non- multi-arch platforms. */
2218 #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
2219 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
2222 typedef int (gdbarch_in_solib_call_trampoline_ftype
) (CORE_ADDR pc
, char *name
);
2223 extern int gdbarch_in_solib_call_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
);
2224 extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch
*gdbarch
, gdbarch_in_solib_call_trampoline_ftype
*in_solib_call_trampoline
);
2225 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
2226 #error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
2229 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
2230 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
2234 /* A target might have problems with watchpoints as soon as the stack
2235 frame of the current function has been destroyed. This mostly happens
2236 as the first action in a funtion's epilogue. in_function_epilogue_p()
2237 is defined to return a non-zero value if either the given addr is one
2238 instruction after the stack destroying instruction up to the trailing
2239 return instruction or if we can figure out that the stack frame has
2240 already been invalidated regardless of the value of addr. Targets
2241 which don't suffer from that problem could just let this functionality
2244 typedef int (gdbarch_in_function_epilogue_p_ftype
) (struct gdbarch
*gdbarch
, CORE_ADDR addr
);
2245 extern int gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
);
2246 extern void set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
);
2248 /* Given a vector of command-line arguments, return a newly allocated
2249 string which, when passed to the create_inferior function, will be
2250 parsed (on Unix systems, by the shell) to yield the same vector.
2251 This function should call error() if the argument vector is not
2252 representable for this target or if this target does not support
2253 command-line arguments.
2254 ARGC is the number of elements in the vector.
2255 ARGV is an array of strings, one per argument. */
2257 typedef char * (gdbarch_construct_inferior_arguments_ftype
) (struct gdbarch
*gdbarch
, int argc
, char **argv
);
2258 extern char * gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
);
2259 extern void set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
);
2261 #if defined (DWARF2_BUILD_FRAME_INFO)
2262 /* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */
2263 #if !defined (DWARF2_BUILD_FRAME_INFO_P)
2264 #define DWARF2_BUILD_FRAME_INFO_P() (1)
2268 /* Default predicate for non- multi-arch targets. */
2269 #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P)
2270 #define DWARF2_BUILD_FRAME_INFO_P() (0)
2273 extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch
*gdbarch
);
2274 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P)
2275 #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
2277 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P)
2278 #define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch))
2281 /* Default (function) for non- multi-arch platforms. */
2282 #if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO)
2283 #define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0)
2286 typedef void (gdbarch_dwarf2_build_frame_info_ftype
) (struct objfile
*objfile
);
2287 extern void gdbarch_dwarf2_build_frame_info (struct gdbarch
*gdbarch
, struct objfile
*objfile
);
2288 extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch
*gdbarch
, gdbarch_dwarf2_build_frame_info_ftype
*dwarf2_build_frame_info
);
2289 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO)
2290 #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
2293 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO)
2294 #define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile))
2298 /* Default (function) for non- multi-arch platforms. */
2299 #if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL)
2300 #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym))
2303 typedef void (gdbarch_elf_make_msymbol_special_ftype
) (asymbol
*sym
, struct minimal_symbol
*msym
);
2304 extern void gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
);
2305 extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
);
2306 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL)
2307 #error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL"
2310 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL)
2311 #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
2315 /* Default (function) for non- multi-arch platforms. */
2316 #if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL)
2317 #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym))
2320 typedef void (gdbarch_coff_make_msymbol_special_ftype
) (int val
, struct minimal_symbol
*msym
);
2321 extern void gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
);
2322 extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
);
2323 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL)
2324 #error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL"
2327 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL)
2328 #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
2332 extern struct gdbarch_tdep
*gdbarch_tdep (struct gdbarch
*gdbarch
);
2335 /* Mechanism for co-ordinating the selection of a specific
2338 GDB targets (*-tdep.c) can register an interest in a specific
2339 architecture. Other GDB components can register a need to maintain
2340 per-architecture data.
2342 The mechanisms below ensures that there is only a loose connection
2343 between the set-architecture command and the various GDB
2344 components. Each component can independently register their need
2345 to maintain architecture specific data with gdbarch.
2349 Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
2352 The more traditional mega-struct containing architecture specific
2353 data for all the various GDB components was also considered. Since
2354 GDB is built from a variable number of (fairly independent)
2355 components it was determined that the global aproach was not
2359 /* Register a new architectural family with GDB.
2361 Register support for the specified ARCHITECTURE with GDB. When
2362 gdbarch determines that the specified architecture has been
2363 selected, the corresponding INIT function is called.
2367 The INIT function takes two parameters: INFO which contains the
2368 information available to gdbarch about the (possibly new)
2369 architecture; ARCHES which is a list of the previously created
2370 ``struct gdbarch'' for this architecture.
2372 The INIT function parameter INFO shall, as far as possible, be
2373 pre-initialized with information obtained from INFO.ABFD or
2374 previously selected architecture (if similar).
2376 The INIT function shall return any of: NULL - indicating that it
2377 doesn't recognize the selected architecture; an existing ``struct
2378 gdbarch'' from the ARCHES list - indicating that the new
2379 architecture is just a synonym for an earlier architecture (see
2380 gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
2381 - that describes the selected architecture (see gdbarch_alloc()).
2383 The DUMP_TDEP function shall print out all target specific values.
2384 Care should be taken to ensure that the function works in both the
2385 multi-arch and non- multi-arch cases. */
2389 struct gdbarch
*gdbarch
;
2390 struct gdbarch_list
*next
;
2395 /* Use default: NULL (ZERO). */
2396 const struct bfd_arch_info
*bfd_arch_info
;
2398 /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
2401 /* Use default: NULL (ZERO). */
2404 /* Use default: NULL (ZERO). */
2405 struct gdbarch_tdep_info
*tdep_info
;
2408 typedef struct gdbarch
*(gdbarch_init_ftype
) (struct gdbarch_info info
, struct gdbarch_list
*arches
);
2409 typedef void (gdbarch_dump_tdep_ftype
) (struct gdbarch
*gdbarch
, struct ui_file
*file
);
2411 /* DEPRECATED - use gdbarch_register() */
2412 extern void register_gdbarch_init (enum bfd_architecture architecture
, gdbarch_init_ftype
*);
2414 extern void gdbarch_register (enum bfd_architecture architecture
,
2415 gdbarch_init_ftype
*,
2416 gdbarch_dump_tdep_ftype
*);
2419 /* Return a freshly allocated, NULL terminated, array of the valid
2420 architecture names. Since architectures are registered during the
2421 _initialize phase this function only returns useful information
2422 once initialization has been completed. */
2424 extern const char **gdbarch_printable_names (void);
2427 /* Helper function. Search the list of ARCHES for a GDBARCH that
2428 matches the information provided by INFO. */
2430 extern struct gdbarch_list
*gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
, const struct gdbarch_info
*info
);
2433 /* Helper function. Create a preliminary ``struct gdbarch''. Perform
2434 basic initialization using values obtained from the INFO andTDEP
2435 parameters. set_gdbarch_*() functions are called to complete the
2436 initialization of the object. */
2438 extern struct gdbarch
*gdbarch_alloc (const struct gdbarch_info
*info
, struct gdbarch_tdep
*tdep
);
2441 /* Helper function. Free a partially-constructed ``struct gdbarch''.
2442 It is assumed that the caller freeds the ``struct
2445 extern void gdbarch_free (struct gdbarch
*);
2448 /* Helper function. Force an update of the current architecture.
2450 The actual architecture selected is determined by INFO, ``(gdb) set
2451 architecture'' et.al., the existing architecture and BFD's default
2452 architecture. INFO should be initialized to zero and then selected
2453 fields should be updated.
2455 Returns non-zero if the update succeeds */
2457 extern int gdbarch_update_p (struct gdbarch_info info
);
2461 /* Register per-architecture data-pointer.
2463 Reserve space for a per-architecture data-pointer. An identifier
2464 for the reserved data-pointer is returned. That identifer should
2465 be saved in a local static variable.
2467 The per-architecture data-pointer can be initialized in one of two
2468 ways: The value can be set explicitly using a call to
2469 set_gdbarch_data(); the value can be set implicitly using the value
2470 returned by a non-NULL INIT() callback. INIT(), when non-NULL is
2471 called after the basic architecture vector has been created.
2473 When a previously created architecture is re-selected, the
2474 per-architecture data-pointer for that previous architecture is
2475 restored. INIT() is not called.
2477 During initialization, multiple assignments of the data-pointer are
2478 allowed, non-NULL values are deleted by calling FREE(). If the
2479 architecture is deleted using gdbarch_free() all non-NULL data
2480 pointers are also deleted using FREE().
2482 Multiple registrarants for any architecture are allowed (and
2483 strongly encouraged). */
2485 struct gdbarch_data
;
2487 typedef void *(gdbarch_data_init_ftype
) (struct gdbarch
*gdbarch
);
2488 typedef void (gdbarch_data_free_ftype
) (struct gdbarch
*gdbarch
,
2490 extern struct gdbarch_data
*register_gdbarch_data (gdbarch_data_init_ftype
*init
,
2491 gdbarch_data_free_ftype
*free
);
2492 extern void set_gdbarch_data (struct gdbarch
*gdbarch
,
2493 struct gdbarch_data
*data
,
2496 extern void *gdbarch_data (struct gdbarch_data
*);
2499 /* Register per-architecture memory region.
2501 Provide a memory-region swap mechanism. Per-architecture memory
2502 region are created. These memory regions are swapped whenever the
2503 architecture is changed. For a new architecture, the memory region
2504 is initialized with zero (0) and the INIT function is called.
2506 Memory regions are swapped / initialized in the order that they are
2507 registered. NULL DATA and/or INIT values can be specified.
2509 New code should use register_gdbarch_data(). */
2511 typedef void (gdbarch_swap_ftype
) (void);
2512 extern void register_gdbarch_swap (void *data
, unsigned long size
, gdbarch_swap_ftype
*init
);
2513 #define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
2517 /* The target-system-dependent byte order is dynamic */
2519 extern int target_byte_order
;
2520 #ifndef TARGET_BYTE_ORDER
2521 #define TARGET_BYTE_ORDER (target_byte_order + 0)
2524 extern int target_byte_order_auto
;
2525 #ifndef TARGET_BYTE_ORDER_AUTO
2526 #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
2531 /* The target-system-dependent BFD architecture is dynamic */
2533 extern int target_architecture_auto
;
2534 #ifndef TARGET_ARCHITECTURE_AUTO
2535 #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
2538 extern const struct bfd_arch_info
*target_architecture
;
2539 #ifndef TARGET_ARCHITECTURE
2540 #define TARGET_ARCHITECTURE (target_architecture + 0)
2544 /* The target-system-dependent disassembler is semi-dynamic */
2546 extern int dis_asm_read_memory (bfd_vma memaddr
, bfd_byte
*myaddr
,
2547 unsigned int len
, disassemble_info
*info
);
2549 extern void dis_asm_memory_error (int status
, bfd_vma memaddr
,
2550 disassemble_info
*info
);
2552 extern void dis_asm_print_address (bfd_vma addr
,
2553 disassemble_info
*info
);
2555 extern int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
2556 extern disassemble_info tm_print_insn_info
;
2557 #ifndef TARGET_PRINT_INSN_INFO
2558 #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
2563 /* Set the dynamic target-system-dependent parameters (architecture,
2564 byte-order, ...) using information found in the BFD */
2566 extern void set_gdbarch_from_file (bfd
*);
2569 /* Initialize the current architecture to the "first" one we find on
2572 extern void initialize_current_architecture (void);
2574 /* For non-multiarched targets, do any initialization of the default
2575 gdbarch object necessary after the _initialize_MODULE functions
2577 extern void initialize_non_multiarch ();
2579 /* gdbarch trace variable */
2580 extern int gdbarch_debug
;
2582 extern void gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
);