Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C
[external/binutils.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4    Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
5
6    This file is part of GDB.
7
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.
12
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.
17
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.  */
22
23 /* This file was created with the aid of ``gdbarch.sh''.
24
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
28    being reported.
29
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
33    easier. */
34
35
36 #include "defs.h"
37 #include "arch-utils.h"
38
39 #if GDB_MULTI_ARCH
40 #include "gdbcmd.h"
41 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
42 #else
43 /* Just include everything in sight so that the every old definition
44    of macro is visible. */
45 #include "gdb_string.h"
46 #include <ctype.h>
47 #include "symtab.h"
48 #include "frame.h"
49 #include "inferior.h"
50 #include "breakpoint.h"
51 #include "gdb_wait.h"
52 #include "gdbcore.h"
53 #include "gdbcmd.h"
54 #include "target.h"
55 #include "gdbthread.h"
56 #include "annotate.h"
57 #include "symfile.h"            /* for overlay functions */
58 #include "value.h"              /* For old tm.h/nm.h macros.  */
59 #endif
60 #include "symcat.h"
61
62 #include "floatformat.h"
63
64 #include "gdb_assert.h"
65 #include "gdb_string.h"
66 #include "gdb-events.h"
67
68 /* Static function declarations */
69
70 static void verify_gdbarch (struct gdbarch *gdbarch);
71 static void alloc_gdbarch_data (struct gdbarch *);
72 static void free_gdbarch_data (struct gdbarch *);
73 static void init_gdbarch_swap (struct gdbarch *);
74 static void clear_gdbarch_swap (struct gdbarch *);
75 static void swapout_gdbarch_swap (struct gdbarch *);
76 static void swapin_gdbarch_swap (struct gdbarch *);
77
78 /* Non-zero if we want to trace architecture code.  */
79
80 #ifndef GDBARCH_DEBUG
81 #define GDBARCH_DEBUG 0
82 #endif
83 int gdbarch_debug = GDBARCH_DEBUG;
84
85
86 /* Maintain the struct gdbarch object */
87
88 struct gdbarch
89 {
90   /* Has this architecture been fully initialized?  */
91   int initialized_p;
92   /* basic architectural information */
93   const struct bfd_arch_info * bfd_arch_info;
94   int byte_order;
95
96   /* target specific vector. */
97   struct gdbarch_tdep *tdep;
98   gdbarch_dump_tdep_ftype *dump_tdep;
99
100   /* per-architecture data-pointers */
101   unsigned nr_data;
102   void **data;
103
104   /* per-architecture swap-regions */
105   struct gdbarch_swap *swap;
106
107   /* Multi-arch values.
108
109      When extending this structure you must:
110
111      Add the field below.
112
113      Declare set/get functions and define the corresponding
114      macro in gdbarch.h.
115
116      gdbarch_alloc(): If zero/NULL is not a suitable default,
117      initialize the new field.
118
119      verify_gdbarch(): Confirm that the target updated the field
120      correctly.
121
122      gdbarch_dump(): Add a fprintf_unfiltered call so that the new
123      field is dumped out
124
125      ``startup_gdbarch()'': Append an initial value to the static
126      variable (base values on the host's c-type system).
127
128      get_gdbarch(): Implement the set/get functions (probably using
129      the macro's as shortcuts).
130
131      */
132
133   int short_bit;
134   int int_bit;
135   int long_bit;
136   int long_long_bit;
137   int float_bit;
138   int double_bit;
139   int long_double_bit;
140   int ptr_bit;
141   int addr_bit;
142   int bfd_vma_bit;
143   int char_signed;
144   gdbarch_read_pc_ftype *read_pc;
145   gdbarch_write_pc_ftype *write_pc;
146   gdbarch_read_fp_ftype *read_fp;
147   gdbarch_read_sp_ftype *read_sp;
148   gdbarch_write_sp_ftype *write_sp;
149   gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
150   gdbarch_pseudo_register_read_ftype *pseudo_register_read;
151   gdbarch_pseudo_register_write_ftype *pseudo_register_write;
152   int num_regs;
153   int num_pseudo_regs;
154   int sp_regnum;
155   int fp_regnum;
156   int pc_regnum;
157   int ps_regnum;
158   int fp0_regnum;
159   int npc_regnum;
160   gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
161   gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
162   gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
163   gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
164   gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
165   gdbarch_register_name_ftype *register_name;
166   int register_size;
167   int register_bytes;
168   gdbarch_register_byte_ftype *register_byte;
169   gdbarch_register_raw_size_ftype *register_raw_size;
170   int max_register_raw_size;
171   gdbarch_register_virtual_size_ftype *register_virtual_size;
172   int max_register_virtual_size;
173   gdbarch_register_virtual_type_ftype *register_virtual_type;
174   gdbarch_do_registers_info_ftype *do_registers_info;
175   gdbarch_print_registers_info_ftype *print_registers_info;
176   gdbarch_print_float_info_ftype *print_float_info;
177   gdbarch_print_vector_info_ftype *print_vector_info;
178   gdbarch_register_sim_regno_ftype *register_sim_regno;
179   gdbarch_register_bytes_ok_ftype *register_bytes_ok;
180   gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
181   gdbarch_cannot_store_register_ftype *cannot_store_register;
182   gdbarch_get_longjmp_target_ftype *get_longjmp_target;
183   int use_generic_dummy_frames;
184   int call_dummy_location;
185   gdbarch_call_dummy_address_ftype *call_dummy_address;
186   CORE_ADDR call_dummy_start_offset;
187   CORE_ADDR call_dummy_breakpoint_offset;
188   int call_dummy_breakpoint_offset_p;
189   int call_dummy_length;
190   gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
191   int call_dummy_p;
192   LONGEST * call_dummy_words;
193   int sizeof_call_dummy_words;
194   int call_dummy_stack_adjust_p;
195   int call_dummy_stack_adjust;
196   gdbarch_fix_call_dummy_ftype *fix_call_dummy;
197   gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
198   gdbarch_init_frame_pc_ftype *init_frame_pc;
199   int believe_pcc_promotion;
200   int believe_pcc_promotion_type;
201   gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
202   gdbarch_get_saved_register_ftype *get_saved_register;
203   gdbarch_register_convertible_ftype *register_convertible;
204   gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
205   gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
206   gdbarch_convert_register_p_ftype *convert_register_p;
207   gdbarch_register_to_value_ftype *register_to_value;
208   gdbarch_value_to_register_ftype *value_to_register;
209   gdbarch_pointer_to_address_ftype *pointer_to_address;
210   gdbarch_address_to_pointer_ftype *address_to_pointer;
211   gdbarch_integer_to_address_ftype *integer_to_address;
212   gdbarch_return_value_on_stack_ftype *return_value_on_stack;
213   gdbarch_push_arguments_ftype *push_arguments;
214   gdbarch_push_dummy_frame_ftype *push_dummy_frame;
215   gdbarch_push_return_address_ftype *push_return_address;
216   gdbarch_pop_frame_ftype *pop_frame;
217   gdbarch_store_struct_return_ftype *store_struct_return;
218   gdbarch_extract_return_value_ftype *extract_return_value;
219   gdbarch_store_return_value_ftype *store_return_value;
220   gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
221   gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
222   gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
223   gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
224   gdbarch_use_struct_convention_ftype *use_struct_convention;
225   gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
226   gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
227   gdbarch_skip_prologue_ftype *skip_prologue;
228   gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
229   gdbarch_inner_than_ftype *inner_than;
230   gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
231   gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
232   gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
233   CORE_ADDR decr_pc_after_break;
234   gdbarch_prepare_to_proceed_ftype *prepare_to_proceed;
235   CORE_ADDR function_start_offset;
236   gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
237   CORE_ADDR frame_args_skip;
238   gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
239   gdbarch_frame_chain_ftype *frame_chain;
240   gdbarch_frame_chain_valid_ftype *frame_chain_valid;
241   gdbarch_frame_saved_pc_ftype *frame_saved_pc;
242   gdbarch_frame_args_address_ftype *frame_args_address;
243   gdbarch_frame_locals_address_ftype *frame_locals_address;
244   gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
245   gdbarch_frame_num_args_ftype *frame_num_args;
246   gdbarch_stack_align_ftype *stack_align;
247   gdbarch_frame_align_ftype *frame_align;
248   int extra_stack_alignment_needed;
249   gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
250   gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
251   int parm_boundary;
252   const struct floatformat * float_format;
253   const struct floatformat * double_format;
254   const struct floatformat * long_double_format;
255   gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
256   gdbarch_addr_bits_remove_ftype *addr_bits_remove;
257   gdbarch_smash_text_address_ftype *smash_text_address;
258   gdbarch_software_single_step_ftype *software_single_step;
259   gdbarch_print_insn_ftype *print_insn;
260   gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
261   gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
262   gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
263   gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
264   gdbarch_sigtramp_start_ftype *sigtramp_start;
265   gdbarch_sigtramp_end_ftype *sigtramp_end;
266   gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
267   gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
268   gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
269   gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
270   gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
271   const char * name_of_malloc;
272   int cannot_step_breakpoint;
273   int have_nonsteppable_watchpoint;
274 };
275
276
277 /* The default architecture uses host values (for want of a better
278    choice). */
279
280 extern const struct bfd_arch_info bfd_default_arch_struct;
281
282 struct gdbarch startup_gdbarch =
283 {
284   1, /* Always initialized.  */
285   /* basic architecture information */
286   &bfd_default_arch_struct,
287   BFD_ENDIAN_BIG,
288   /* target specific vector and its dump routine */
289   NULL, NULL,
290   /*per-architecture data-pointers and swap regions */
291   0, NULL, NULL,
292   /* Multi-arch values */
293   8 * sizeof (short),
294   8 * sizeof (int),
295   8 * sizeof (long),
296   8 * sizeof (LONGEST),
297   8 * sizeof (float),
298   8 * sizeof (double),
299   8 * sizeof (long double),
300   8 * sizeof (void*),
301   8 * sizeof (void*),
302   8 * sizeof (void*),
303   1,
304   0,
305   0,
306   0,
307   0,
308   0,
309   0,
310   0,
311   0,
312   0,
313   0,
314   -1,
315   -1,
316   -1,
317   -1,
318   0,
319   0,
320   0,
321   0,
322   0,
323   0,
324   0,
325   0,
326   0,
327   0,
328   generic_register_byte,
329   generic_register_size,
330   0,
331   generic_register_size,
332   0,
333   0,
334   0,
335   default_print_registers_info,
336   0,
337   0,
338   0,
339   0,
340   0,
341   0,
342   0,
343   0,
344   0,
345   0,
346   0,
347   0,
348   0,
349   0,
350   0,
351   0,
352   0,
353   0,
354   0,
355   0,
356   0,
357   0,
358   0,
359   0,
360   0,
361   0,
362   0,
363   0,
364   0,
365   0,
366   0,
367   0,
368   0,
369   0,
370   0,
371   0,
372   0,
373   0,
374   0,
375   0,
376   0,
377   0,
378   0,
379   0,
380   0,
381   0,
382   0,
383   0,
384   0,
385   0,
386   0,
387   0,
388   0,
389   0,
390   0,
391   0,
392   0,
393   0,
394   0,
395   0,
396   0,
397   0,
398   0,
399   0,
400   0,
401   0,
402   0,
403   0,
404   0,
405   0,
406   0,
407   0,
408   0,
409   0,
410   0,
411   0,
412   0,
413   0,
414   0,
415   0,
416   0,
417   0,
418   0,
419   0,
420   0,
421   0,
422   0,
423   0,
424   0,
425   0,
426   generic_in_function_epilogue_p,
427   construct_inferior_arguments,
428   0,
429   0,
430   0,
431   "malloc",
432   0,
433   /* startup_gdbarch() */
434 };
435
436 struct gdbarch *current_gdbarch = &startup_gdbarch;
437
438 /* Do any initialization needed for a non-multiarch configuration
439    after the _initialize_MODULE functions have been run.  */
440 void
441 initialize_non_multiarch (void)
442 {
443   alloc_gdbarch_data (&startup_gdbarch);
444   /* Ensure that all swap areas are zeroed so that they again think
445      they are starting from scratch.  */
446   clear_gdbarch_swap (&startup_gdbarch);
447   init_gdbarch_swap (&startup_gdbarch);
448 }
449
450
451 /* Create a new ``struct gdbarch'' based on information provided by
452    ``struct gdbarch_info''. */
453
454 struct gdbarch *
455 gdbarch_alloc (const struct gdbarch_info *info,
456                struct gdbarch_tdep *tdep)
457 {
458   /* NOTE: The new architecture variable is named ``current_gdbarch''
459      so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
460      the current local architecture and not the previous global
461      architecture.  This ensures that the new architectures initial
462      values are not influenced by the previous architecture.  Once
463      everything is parameterised with gdbarch, this will go away.  */
464   struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch);
465   memset (current_gdbarch, 0, sizeof (*current_gdbarch));
466
467   alloc_gdbarch_data (current_gdbarch);
468
469   current_gdbarch->tdep = tdep;
470
471   current_gdbarch->bfd_arch_info = info->bfd_arch_info;
472   current_gdbarch->byte_order = info->byte_order;
473
474   /* Force the explicit initialization of these. */
475   current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
476   current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
477   current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
478   current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
479   current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
480   current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
481   current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
482   current_gdbarch->ptr_bit = TARGET_INT_BIT;
483   current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
484   current_gdbarch->char_signed = -1;
485   current_gdbarch->read_pc = generic_target_read_pc;
486   current_gdbarch->write_pc = generic_target_write_pc;
487   current_gdbarch->read_fp = generic_target_read_fp;
488   current_gdbarch->read_sp = generic_target_read_sp;
489   current_gdbarch->write_sp = generic_target_write_sp;
490   current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
491   current_gdbarch->num_regs = -1;
492   current_gdbarch->sp_regnum = -1;
493   current_gdbarch->fp_regnum = -1;
494   current_gdbarch->pc_regnum = -1;
495   current_gdbarch->ps_regnum = -1;
496   current_gdbarch->fp0_regnum = -1;
497   current_gdbarch->npc_regnum = -1;
498   current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
499   current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
500   current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
501   current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
502   current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
503   current_gdbarch->register_name = legacy_register_name;
504   current_gdbarch->register_size = -1;
505   current_gdbarch->register_bytes = -1;
506   current_gdbarch->register_byte = generic_register_byte;
507   current_gdbarch->register_raw_size = generic_register_size;
508   current_gdbarch->max_register_raw_size = -1;
509   current_gdbarch->register_virtual_size = generic_register_size;
510   current_gdbarch->max_register_virtual_size = -1;
511   current_gdbarch->print_registers_info = default_print_registers_info;
512   current_gdbarch->register_sim_regno = legacy_register_sim_regno;
513   current_gdbarch->cannot_fetch_register = cannot_register_not;
514   current_gdbarch->cannot_store_register = cannot_register_not;
515   current_gdbarch->use_generic_dummy_frames = -1;
516   current_gdbarch->call_dummy_start_offset = -1;
517   current_gdbarch->call_dummy_breakpoint_offset = -1;
518   current_gdbarch->call_dummy_breakpoint_offset_p = -1;
519   current_gdbarch->call_dummy_length = -1;
520   current_gdbarch->call_dummy_p = -1;
521   current_gdbarch->call_dummy_words = legacy_call_dummy_words;
522   current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
523   current_gdbarch->call_dummy_stack_adjust_p = -1;
524   current_gdbarch->init_frame_pc_first = init_frame_pc_noop;
525   current_gdbarch->init_frame_pc = init_frame_pc_default;
526   current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
527   current_gdbarch->get_saved_register = generic_unwind_get_saved_register;
528   current_gdbarch->register_convertible = generic_register_convertible_not;
529   current_gdbarch->convert_register_p = legacy_convert_register_p;
530   current_gdbarch->register_to_value = legacy_register_to_value;
531   current_gdbarch->value_to_register = legacy_value_to_register;
532   current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
533   current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
534   current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
535   current_gdbarch->push_arguments = default_push_arguments;
536   current_gdbarch->extract_return_value = legacy_extract_return_value;
537   current_gdbarch->store_return_value = legacy_store_return_value;
538   current_gdbarch->use_struct_convention = generic_use_struct_convention;
539   current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
540   current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
541   current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
542   current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
543   current_gdbarch->decr_pc_after_break = -1;
544   current_gdbarch->prepare_to_proceed = default_prepare_to_proceed;
545   current_gdbarch->function_start_offset = -1;
546   current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
547   current_gdbarch->frame_args_skip = -1;
548   current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
549   current_gdbarch->frame_chain_valid = generic_func_frame_chain_valid;
550   current_gdbarch->extra_stack_alignment_needed = 1;
551   current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
552   current_gdbarch->addr_bits_remove = core_addr_identity;
553   current_gdbarch->smash_text_address = core_addr_identity;
554   current_gdbarch->print_insn = legacy_print_insn;
555   current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
556   current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
557   current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
558   current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
559   current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
560   current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
561   current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
562   current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
563   current_gdbarch->name_of_malloc = "malloc";
564   /* gdbarch_alloc() */
565
566   return current_gdbarch;
567 }
568
569
570 /* Free a gdbarch struct.  This should never happen in normal
571    operation --- once you've created a gdbarch, you keep it around.
572    However, if an architecture's init function encounters an error
573    building the structure, it may need to clean up a partially
574    constructed gdbarch.  */
575
576 void
577 gdbarch_free (struct gdbarch *arch)
578 {
579   gdb_assert (arch != NULL);
580   free_gdbarch_data (arch);
581   xfree (arch);
582 }
583
584
585 /* Ensure that all values in a GDBARCH are reasonable. */
586
587 static void
588 verify_gdbarch (struct gdbarch *gdbarch)
589 {
590   struct ui_file *log;
591   struct cleanup *cleanups;
592   long dummy;
593   char *buf;
594   /* Only perform sanity checks on a multi-arch target. */
595   if (!GDB_MULTI_ARCH)
596     return;
597   log = mem_fileopen ();
598   cleanups = make_cleanup_ui_file_delete (log);
599   /* fundamental */
600   if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
601     fprintf_unfiltered (log, "\n\tbyte-order");
602   if (gdbarch->bfd_arch_info == NULL)
603     fprintf_unfiltered (log, "\n\tbfd_arch_info");
604   /* Check those that need to be defined for the given multi-arch level. */
605   /* Skip verify of short_bit, invalid_p == 0 */
606   /* Skip verify of int_bit, invalid_p == 0 */
607   /* Skip verify of long_bit, invalid_p == 0 */
608   /* Skip verify of long_long_bit, invalid_p == 0 */
609   /* Skip verify of float_bit, invalid_p == 0 */
610   /* Skip verify of double_bit, invalid_p == 0 */
611   /* Skip verify of long_double_bit, invalid_p == 0 */
612   /* Skip verify of ptr_bit, invalid_p == 0 */
613   if (gdbarch->addr_bit == 0)
614     gdbarch->addr_bit = TARGET_PTR_BIT;
615   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
616   if (gdbarch->char_signed == -1)
617     gdbarch->char_signed = 1;
618   /* Skip verify of read_pc, invalid_p == 0 */
619   /* Skip verify of write_pc, invalid_p == 0 */
620   /* Skip verify of read_fp, invalid_p == 0 */
621   /* Skip verify of read_sp, invalid_p == 0 */
622   /* Skip verify of write_sp, invalid_p == 0 */
623   /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
624   /* Skip verify of pseudo_register_read, has predicate */
625   /* Skip verify of pseudo_register_write, has predicate */
626   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
627       && (gdbarch->num_regs == -1))
628     fprintf_unfiltered (log, "\n\tnum_regs");
629   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
630   /* Skip verify of sp_regnum, invalid_p == 0 */
631   /* Skip verify of fp_regnum, invalid_p == 0 */
632   /* Skip verify of pc_regnum, invalid_p == 0 */
633   /* Skip verify of ps_regnum, invalid_p == 0 */
634   /* Skip verify of fp0_regnum, invalid_p == 0 */
635   /* Skip verify of npc_regnum, invalid_p == 0 */
636   /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
637   /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
638   /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
639   /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
640   /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
641   /* Skip verify of register_name, invalid_p == 0 */
642   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
643       && (gdbarch->register_size == -1))
644     fprintf_unfiltered (log, "\n\tregister_size");
645   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
646       && (gdbarch->register_bytes == -1))
647     fprintf_unfiltered (log, "\n\tregister_bytes");
648   /* Skip verify of register_byte, invalid_p == 0 */
649   /* Skip verify of register_raw_size, invalid_p == 0 */
650   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
651       && (gdbarch->max_register_raw_size == -1))
652     fprintf_unfiltered (log, "\n\tmax_register_raw_size");
653   /* Skip verify of register_virtual_size, invalid_p == 0 */
654   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
655       && (gdbarch->max_register_virtual_size == -1))
656     fprintf_unfiltered (log, "\n\tmax_register_virtual_size");
657   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
658       && (gdbarch->register_virtual_type == 0))
659     fprintf_unfiltered (log, "\n\tregister_virtual_type");
660   /* Skip verify of do_registers_info, has predicate */
661   /* Skip verify of print_registers_info, invalid_p == 0 */
662   /* Skip verify of print_float_info, has predicate */
663   /* Skip verify of print_vector_info, has predicate */
664   /* Skip verify of register_sim_regno, invalid_p == 0 */
665   /* Skip verify of register_bytes_ok, has predicate */
666   /* Skip verify of cannot_fetch_register, invalid_p == 0 */
667   /* Skip verify of cannot_store_register, invalid_p == 0 */
668   /* Skip verify of get_longjmp_target, has predicate */
669   if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
670       && (gdbarch->use_generic_dummy_frames == -1))
671     fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames");
672   if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
673       && (gdbarch->call_dummy_location == 0))
674     fprintf_unfiltered (log, "\n\tcall_dummy_location");
675   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
676       && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
677     fprintf_unfiltered (log, "\n\tcall_dummy_address");
678   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
679       && (gdbarch->call_dummy_start_offset == -1))
680     fprintf_unfiltered (log, "\n\tcall_dummy_start_offset");
681   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
682       && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1))
683     fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset");
684   if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
685       && (gdbarch->call_dummy_breakpoint_offset_p == -1))
686     fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p");
687   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
688       && (gdbarch->call_dummy_length == -1))
689     fprintf_unfiltered (log, "\n\tcall_dummy_length");
690   if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
691       && (gdbarch->pc_in_call_dummy == 0))
692     fprintf_unfiltered (log, "\n\tpc_in_call_dummy");
693   if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
694       && (gdbarch->call_dummy_p == -1))
695     fprintf_unfiltered (log, "\n\tcall_dummy_p");
696   /* Skip verify of call_dummy_words, invalid_p == 0 */
697   /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
698   if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
699       && (gdbarch->call_dummy_stack_adjust_p == -1))
700     fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p");
701   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
702       && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
703     fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust");
704   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
705       && (gdbarch->fix_call_dummy == 0))
706     fprintf_unfiltered (log, "\n\tfix_call_dummy");
707   /* Skip verify of init_frame_pc_first, invalid_p == 0 */
708   /* Skip verify of init_frame_pc, invalid_p == 0 */
709   /* Skip verify of coerce_float_to_double, invalid_p == 0 */
710   /* Skip verify of get_saved_register, invalid_p == 0 */
711   /* Skip verify of register_convertible, invalid_p == 0 */
712   /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
713   /* Skip verify of register_convert_to_raw, invalid_p == 0 */
714   /* Skip verify of convert_register_p, invalid_p == 0 */
715   /* Skip verify of register_to_value, invalid_p == 0 */
716   /* Skip verify of value_to_register, invalid_p == 0 */
717   /* Skip verify of pointer_to_address, invalid_p == 0 */
718   /* Skip verify of address_to_pointer, invalid_p == 0 */
719   /* Skip verify of integer_to_address, has predicate */
720   /* Skip verify of return_value_on_stack, invalid_p == 0 */
721   /* Skip verify of push_arguments, invalid_p == 0 */
722   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
723       && (gdbarch->push_dummy_frame == 0))
724     fprintf_unfiltered (log, "\n\tpush_dummy_frame");
725   /* Skip verify of push_return_address, has predicate */
726   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
727       && (gdbarch->pop_frame == 0))
728     fprintf_unfiltered (log, "\n\tpop_frame");
729   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
730       && (gdbarch->store_struct_return == 0))
731     fprintf_unfiltered (log, "\n\tstore_struct_return");
732   /* Skip verify of extract_return_value, invalid_p == 0 */
733   /* Skip verify of store_return_value, invalid_p == 0 */
734   /* Skip verify of extract_struct_value_address, has predicate */
735   /* Skip verify of deprecated_extract_struct_value_address, has predicate */
736   /* Skip verify of use_struct_convention, invalid_p == 0 */
737   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
738       && (gdbarch->frame_init_saved_regs == 0))
739     fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
740   /* Skip verify of init_extra_frame_info, has predicate */
741   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
742       && (gdbarch->skip_prologue == 0))
743     fprintf_unfiltered (log, "\n\tskip_prologue");
744   /* Skip verify of prologue_frameless_p, invalid_p == 0 */
745   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
746       && (gdbarch->inner_than == 0))
747     fprintf_unfiltered (log, "\n\tinner_than");
748   /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
749   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
750   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
751   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
752       && (gdbarch->decr_pc_after_break == -1))
753     fprintf_unfiltered (log, "\n\tdecr_pc_after_break");
754   /* Skip verify of prepare_to_proceed, invalid_p == 0 */
755   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
756       && (gdbarch->function_start_offset == -1))
757     fprintf_unfiltered (log, "\n\tfunction_start_offset");
758   /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
759   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
760       && (gdbarch->frame_args_skip == -1))
761     fprintf_unfiltered (log, "\n\tframe_args_skip");
762   /* Skip verify of frameless_function_invocation, invalid_p == 0 */
763   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
764       && (gdbarch->frame_chain == 0))
765     fprintf_unfiltered (log, "\n\tframe_chain");
766   /* Skip verify of frame_chain_valid, invalid_p == 0 */
767   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
768       && (gdbarch->frame_saved_pc == 0))
769     fprintf_unfiltered (log, "\n\tframe_saved_pc");
770   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
771       && (gdbarch->frame_args_address == 0))
772     fprintf_unfiltered (log, "\n\tframe_args_address");
773   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
774       && (gdbarch->frame_locals_address == 0))
775     fprintf_unfiltered (log, "\n\tframe_locals_address");
776   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
777       && (gdbarch->saved_pc_after_call == 0))
778     fprintf_unfiltered (log, "\n\tsaved_pc_after_call");
779   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
780       && (gdbarch->frame_num_args == 0))
781     fprintf_unfiltered (log, "\n\tframe_num_args");
782   /* Skip verify of stack_align, has predicate */
783   /* Skip verify of frame_align, has predicate */
784   /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
785   /* Skip verify of reg_struct_has_addr, has predicate */
786   /* Skip verify of save_dummy_frame_tos, has predicate */
787   if (gdbarch->float_format == 0)
788     gdbarch->float_format = default_float_format (gdbarch);
789   if (gdbarch->double_format == 0)
790     gdbarch->double_format = default_double_format (gdbarch);
791   if (gdbarch->long_double_format == 0)
792     gdbarch->long_double_format = default_double_format (gdbarch);
793   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
794   /* Skip verify of addr_bits_remove, invalid_p == 0 */
795   /* Skip verify of smash_text_address, invalid_p == 0 */
796   /* Skip verify of software_single_step, has predicate */
797   /* Skip verify of print_insn, invalid_p == 0 */
798   /* Skip verify of skip_trampoline_code, invalid_p == 0 */
799   /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
800   /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
801   /* Skip verify of pc_in_sigtramp, invalid_p == 0 */
802   /* Skip verify of sigtramp_start, has predicate */
803   /* Skip verify of sigtramp_end, has predicate */
804   /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
805   /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
806   /* Skip verify of dwarf2_build_frame_info, has predicate */
807   /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
808   /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
809   /* Skip verify of name_of_malloc, invalid_p == 0 */
810   /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
811   /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
812   buf = ui_file_xstrdup (log, &dummy);
813   make_cleanup (xfree, buf);
814   if (strlen (buf) > 0)
815     internal_error (__FILE__, __LINE__,
816                     "verify_gdbarch: the following are invalid ...%s",
817                     buf);
818   do_cleanups (cleanups);
819 }
820
821
822 /* Print out the details of the current architecture. */
823
824 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
825    just happens to match the global variable ``current_gdbarch''.  That
826    way macros refering to that variable get the local and not the global
827    version - ulgh.  Once everything is parameterised with gdbarch, this
828    will go away. */
829
830 void
831 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
832 {
833   fprintf_unfiltered (file,
834                       "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
835                       GDB_MULTI_ARCH);
836   if (GDB_MULTI_ARCH)
837     fprintf_unfiltered (file,
838                         "gdbarch_dump: frame_align = 0x%08lx\n",
839                         (long) current_gdbarch->frame_align);
840   if (GDB_MULTI_ARCH)
841     fprintf_unfiltered (file,
842                         "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
843                         (long) current_gdbarch->in_function_epilogue_p);
844   if (GDB_MULTI_ARCH)
845     fprintf_unfiltered (file,
846                         "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
847                         (long) current_gdbarch->pseudo_register_read);
848   if (GDB_MULTI_ARCH)
849     fprintf_unfiltered (file,
850                         "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
851                         (long) current_gdbarch->pseudo_register_write);
852 #ifdef ADDRESS_TO_POINTER
853 #if GDB_MULTI_ARCH
854   /* Macro might contain `[{}]' when not multi-arch */
855   fprintf_unfiltered (file,
856                       "gdbarch_dump: %s # %s\n",
857                       "ADDRESS_TO_POINTER(type, buf, addr)",
858                       XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
859 #endif
860   if (GDB_MULTI_ARCH)
861     fprintf_unfiltered (file,
862                         "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
863                         (long) current_gdbarch->address_to_pointer
864                         /*ADDRESS_TO_POINTER ()*/);
865 #endif
866 #ifdef ADDR_BITS_REMOVE
867   fprintf_unfiltered (file,
868                       "gdbarch_dump: %s # %s\n",
869                       "ADDR_BITS_REMOVE(addr)",
870                       XSTRING (ADDR_BITS_REMOVE (addr)));
871   if (GDB_MULTI_ARCH)
872     fprintf_unfiltered (file,
873                         "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
874                         (long) current_gdbarch->addr_bits_remove
875                         /*ADDR_BITS_REMOVE ()*/);
876 #endif
877 #ifdef BELIEVE_PCC_PROMOTION
878   fprintf_unfiltered (file,
879                       "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
880                       XSTRING (BELIEVE_PCC_PROMOTION));
881   fprintf_unfiltered (file,
882                       "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
883                       BELIEVE_PCC_PROMOTION);
884 #endif
885 #ifdef BELIEVE_PCC_PROMOTION_TYPE
886   fprintf_unfiltered (file,
887                       "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
888                       XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
889   fprintf_unfiltered (file,
890                       "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n",
891                       BELIEVE_PCC_PROMOTION_TYPE);
892 #endif
893 #ifdef BREAKPOINT_FROM_PC
894   fprintf_unfiltered (file,
895                       "gdbarch_dump: %s # %s\n",
896                       "BREAKPOINT_FROM_PC(pcptr, lenptr)",
897                       XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
898   if (GDB_MULTI_ARCH)
899     fprintf_unfiltered (file,
900                         "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
901                         (long) current_gdbarch->breakpoint_from_pc
902                         /*BREAKPOINT_FROM_PC ()*/);
903 #endif
904 #ifdef CALL_DUMMY_ADDRESS
905   fprintf_unfiltered (file,
906                       "gdbarch_dump: %s # %s\n",
907                       "CALL_DUMMY_ADDRESS()",
908                       XSTRING (CALL_DUMMY_ADDRESS ()));
909   if (GDB_MULTI_ARCH)
910     fprintf_unfiltered (file,
911                         "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
912                         (long) current_gdbarch->call_dummy_address
913                         /*CALL_DUMMY_ADDRESS ()*/);
914 #endif
915 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
916   fprintf_unfiltered (file,
917                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
918                       XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
919   if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
920     fprintf_unfiltered (file,
921                         "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
922                         (long) CALL_DUMMY_BREAKPOINT_OFFSET);
923 #endif
924 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
925   fprintf_unfiltered (file,
926                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
927                       XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
928   fprintf_unfiltered (file,
929                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %d\n",
930                       CALL_DUMMY_BREAKPOINT_OFFSET_P);
931 #endif
932 #ifdef CALL_DUMMY_LENGTH
933   fprintf_unfiltered (file,
934                       "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
935                       XSTRING (CALL_DUMMY_LENGTH));
936   if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
937     fprintf_unfiltered (file,
938                         "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
939                         CALL_DUMMY_LENGTH);
940 #endif
941 #ifdef CALL_DUMMY_LOCATION
942   fprintf_unfiltered (file,
943                       "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
944                       XSTRING (CALL_DUMMY_LOCATION));
945   fprintf_unfiltered (file,
946                       "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
947                       CALL_DUMMY_LOCATION);
948 #endif
949 #ifdef CALL_DUMMY_P
950   fprintf_unfiltered (file,
951                       "gdbarch_dump: CALL_DUMMY_P # %s\n",
952                       XSTRING (CALL_DUMMY_P));
953   fprintf_unfiltered (file,
954                       "gdbarch_dump: CALL_DUMMY_P = %d\n",
955                       CALL_DUMMY_P);
956 #endif
957 #ifdef CALL_DUMMY_STACK_ADJUST
958   fprintf_unfiltered (file,
959                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
960                       XSTRING (CALL_DUMMY_STACK_ADJUST));
961   if (CALL_DUMMY_STACK_ADJUST_P)
962     fprintf_unfiltered (file,
963                         "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
964                         (long) CALL_DUMMY_STACK_ADJUST);
965 #endif
966 #ifdef CALL_DUMMY_STACK_ADJUST_P
967   fprintf_unfiltered (file,
968                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
969                       XSTRING (CALL_DUMMY_STACK_ADJUST_P));
970   fprintf_unfiltered (file,
971                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
972                       (long) CALL_DUMMY_STACK_ADJUST_P);
973 #endif
974 #ifdef CALL_DUMMY_START_OFFSET
975   fprintf_unfiltered (file,
976                       "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
977                       XSTRING (CALL_DUMMY_START_OFFSET));
978   fprintf_unfiltered (file,
979                       "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
980                       (long) CALL_DUMMY_START_OFFSET);
981 #endif
982 #ifdef CALL_DUMMY_WORDS
983   fprintf_unfiltered (file,
984                       "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
985                       XSTRING (CALL_DUMMY_WORDS));
986   fprintf_unfiltered (file,
987                       "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
988                       (long) CALL_DUMMY_WORDS);
989 #endif
990 #ifdef CANNOT_FETCH_REGISTER
991   fprintf_unfiltered (file,
992                       "gdbarch_dump: %s # %s\n",
993                       "CANNOT_FETCH_REGISTER(regnum)",
994                       XSTRING (CANNOT_FETCH_REGISTER (regnum)));
995   if (GDB_MULTI_ARCH)
996     fprintf_unfiltered (file,
997                         "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n",
998                         (long) current_gdbarch->cannot_fetch_register
999                         /*CANNOT_FETCH_REGISTER ()*/);
1000 #endif
1001 #ifdef CANNOT_STEP_BREAKPOINT
1002   fprintf_unfiltered (file,
1003                       "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
1004                       XSTRING (CANNOT_STEP_BREAKPOINT));
1005   fprintf_unfiltered (file,
1006                       "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
1007                       CANNOT_STEP_BREAKPOINT);
1008 #endif
1009 #ifdef CANNOT_STORE_REGISTER
1010   fprintf_unfiltered (file,
1011                       "gdbarch_dump: %s # %s\n",
1012                       "CANNOT_STORE_REGISTER(regnum)",
1013                       XSTRING (CANNOT_STORE_REGISTER (regnum)));
1014   if (GDB_MULTI_ARCH)
1015     fprintf_unfiltered (file,
1016                         "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n",
1017                         (long) current_gdbarch->cannot_store_register
1018                         /*CANNOT_STORE_REGISTER ()*/);
1019 #endif
1020 #ifdef COERCE_FLOAT_TO_DOUBLE
1021   fprintf_unfiltered (file,
1022                       "gdbarch_dump: %s # %s\n",
1023                       "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
1024                       XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
1025   if (GDB_MULTI_ARCH)
1026     fprintf_unfiltered (file,
1027                         "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
1028                         (long) current_gdbarch->coerce_float_to_double
1029                         /*COERCE_FLOAT_TO_DOUBLE ()*/);
1030 #endif
1031 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
1032 #if GDB_MULTI_ARCH
1033   /* Macro might contain `[{}]' when not multi-arch */
1034   fprintf_unfiltered (file,
1035                       "gdbarch_dump: %s # %s\n",
1036                       "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
1037                       XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
1038 #endif
1039   if (GDB_MULTI_ARCH)
1040     fprintf_unfiltered (file,
1041                         "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
1042                         (long) current_gdbarch->coff_make_msymbol_special
1043                         /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
1044 #endif
1045   if (GDB_MULTI_ARCH)
1046     fprintf_unfiltered (file,
1047                         "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
1048                         (long) current_gdbarch->construct_inferior_arguments);
1049 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
1050   fprintf_unfiltered (file,
1051                       "gdbarch_dump: %s # %s\n",
1052                       "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
1053                       XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
1054   if (GDB_MULTI_ARCH)
1055     fprintf_unfiltered (file,
1056                         "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
1057                         (long) current_gdbarch->convert_from_func_ptr_addr
1058                         /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
1059 #endif
1060 #ifdef CONVERT_REGISTER_P
1061   fprintf_unfiltered (file,
1062                       "gdbarch_dump: %s # %s\n",
1063                       "CONVERT_REGISTER_P(regnum)",
1064                       XSTRING (CONVERT_REGISTER_P (regnum)));
1065   if (GDB_MULTI_ARCH)
1066     fprintf_unfiltered (file,
1067                         "gdbarch_dump: CONVERT_REGISTER_P = 0x%08lx\n",
1068                         (long) current_gdbarch->convert_register_p
1069                         /*CONVERT_REGISTER_P ()*/);
1070 #endif
1071 #ifdef DECR_PC_AFTER_BREAK
1072   fprintf_unfiltered (file,
1073                       "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1074                       XSTRING (DECR_PC_AFTER_BREAK));
1075   fprintf_unfiltered (file,
1076                       "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1077                       (long) DECR_PC_AFTER_BREAK);
1078 #endif
1079 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
1080 #if GDB_MULTI_ARCH
1081   /* Macro might contain `[{}]' when not multi-arch */
1082   fprintf_unfiltered (file,
1083                       "gdbarch_dump: %s # %s\n",
1084                       "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
1085                       XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
1086 #endif
1087   if (GDB_MULTI_ARCH)
1088     fprintf_unfiltered (file,
1089                         "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = 0x%08lx\n",
1090                         (long) current_gdbarch->deprecated_extract_return_value
1091                         /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
1092 #endif
1093 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
1094   fprintf_unfiltered (file,
1095                       "gdbarch_dump: %s # %s\n",
1096                       "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1097                       XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1098   if (GDB_MULTI_ARCH)
1099     fprintf_unfiltered (file,
1100                         "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1101                         (long) current_gdbarch->deprecated_extract_struct_value_address
1102                         /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1103 #endif
1104 #ifdef DEPRECATED_STORE_RETURN_VALUE
1105 #if GDB_MULTI_ARCH
1106   /* Macro might contain `[{}]' when not multi-arch */
1107   fprintf_unfiltered (file,
1108                       "gdbarch_dump: %s # %s\n",
1109                       "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
1110                       XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
1111 #endif
1112   if (GDB_MULTI_ARCH)
1113     fprintf_unfiltered (file,
1114                         "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = 0x%08lx\n",
1115                         (long) current_gdbarch->deprecated_store_return_value
1116                         /*DEPRECATED_STORE_RETURN_VALUE ()*/);
1117 #endif
1118 #ifdef DO_REGISTERS_INFO
1119 #if GDB_MULTI_ARCH
1120   /* Macro might contain `[{}]' when not multi-arch */
1121   fprintf_unfiltered (file,
1122                       "gdbarch_dump: %s # %s\n",
1123                       "DO_REGISTERS_INFO(reg_nr, fpregs)",
1124                       XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
1125 #endif
1126   if (GDB_MULTI_ARCH)
1127     fprintf_unfiltered (file,
1128                         "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
1129                         (long) current_gdbarch->do_registers_info
1130                         /*DO_REGISTERS_INFO ()*/);
1131 #endif
1132 #ifdef DWARF2_BUILD_FRAME_INFO
1133 #if GDB_MULTI_ARCH
1134   /* Macro might contain `[{}]' when not multi-arch */
1135   fprintf_unfiltered (file,
1136                       "gdbarch_dump: %s # %s\n",
1137                       "DWARF2_BUILD_FRAME_INFO(objfile)",
1138                       XSTRING (DWARF2_BUILD_FRAME_INFO (objfile)));
1139 #endif
1140   if (GDB_MULTI_ARCH)
1141     fprintf_unfiltered (file,
1142                         "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = 0x%08lx\n",
1143                         (long) current_gdbarch->dwarf2_build_frame_info
1144                         /*DWARF2_BUILD_FRAME_INFO ()*/);
1145 #endif
1146 #ifdef DWARF2_REG_TO_REGNUM
1147   fprintf_unfiltered (file,
1148                       "gdbarch_dump: %s # %s\n",
1149                       "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1150                       XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1151   if (GDB_MULTI_ARCH)
1152     fprintf_unfiltered (file,
1153                         "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
1154                         (long) current_gdbarch->dwarf2_reg_to_regnum
1155                         /*DWARF2_REG_TO_REGNUM ()*/);
1156 #endif
1157 #ifdef DWARF_REG_TO_REGNUM
1158   fprintf_unfiltered (file,
1159                       "gdbarch_dump: %s # %s\n",
1160                       "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1161                       XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1162   if (GDB_MULTI_ARCH)
1163     fprintf_unfiltered (file,
1164                         "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
1165                         (long) current_gdbarch->dwarf_reg_to_regnum
1166                         /*DWARF_REG_TO_REGNUM ()*/);
1167 #endif
1168 #ifdef ECOFF_REG_TO_REGNUM
1169   fprintf_unfiltered (file,
1170                       "gdbarch_dump: %s # %s\n",
1171                       "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1172                       XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1173   if (GDB_MULTI_ARCH)
1174     fprintf_unfiltered (file,
1175                         "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
1176                         (long) current_gdbarch->ecoff_reg_to_regnum
1177                         /*ECOFF_REG_TO_REGNUM ()*/);
1178 #endif
1179 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1180 #if GDB_MULTI_ARCH
1181   /* Macro might contain `[{}]' when not multi-arch */
1182   fprintf_unfiltered (file,
1183                       "gdbarch_dump: %s # %s\n",
1184                       "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1185                       XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1186 #endif
1187   if (GDB_MULTI_ARCH)
1188     fprintf_unfiltered (file,
1189                         "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
1190                         (long) current_gdbarch->elf_make_msymbol_special
1191                         /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
1192 #endif
1193 #ifdef EXTRACT_RETURN_VALUE
1194 #if GDB_MULTI_ARCH
1195   /* Macro might contain `[{}]' when not multi-arch */
1196   fprintf_unfiltered (file,
1197                       "gdbarch_dump: %s # %s\n",
1198                       "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1199                       XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1200 #endif
1201   if (GDB_MULTI_ARCH)
1202     fprintf_unfiltered (file,
1203                         "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1204                         (long) current_gdbarch->extract_return_value
1205                         /*EXTRACT_RETURN_VALUE ()*/);
1206 #endif
1207 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1208   fprintf_unfiltered (file,
1209                       "gdbarch_dump: %s # %s\n",
1210                       "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
1211                       XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
1212   if (GDB_MULTI_ARCH)
1213     fprintf_unfiltered (file,
1214                         "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1215                         (long) current_gdbarch->extract_struct_value_address
1216                         /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1217 #endif
1218 #ifdef EXTRA_STACK_ALIGNMENT_NEEDED
1219   fprintf_unfiltered (file,
1220                       "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
1221                       XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
1222   fprintf_unfiltered (file,
1223                       "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
1224                       EXTRA_STACK_ALIGNMENT_NEEDED);
1225 #endif
1226 #ifdef FIX_CALL_DUMMY
1227 #if GDB_MULTI_ARCH
1228   /* Macro might contain `[{}]' when not multi-arch */
1229   fprintf_unfiltered (file,
1230                       "gdbarch_dump: %s # %s\n",
1231                       "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
1232                       XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
1233 #endif
1234   if (GDB_MULTI_ARCH)
1235     fprintf_unfiltered (file,
1236                         "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1237                         (long) current_gdbarch->fix_call_dummy
1238                         /*FIX_CALL_DUMMY ()*/);
1239 #endif
1240 #ifdef FP0_REGNUM
1241   fprintf_unfiltered (file,
1242                       "gdbarch_dump: FP0_REGNUM # %s\n",
1243                       XSTRING (FP0_REGNUM));
1244   fprintf_unfiltered (file,
1245                       "gdbarch_dump: FP0_REGNUM = %d\n",
1246                       FP0_REGNUM);
1247 #endif
1248 #ifdef FP_REGNUM
1249   fprintf_unfiltered (file,
1250                       "gdbarch_dump: FP_REGNUM # %s\n",
1251                       XSTRING (FP_REGNUM));
1252   fprintf_unfiltered (file,
1253                       "gdbarch_dump: FP_REGNUM = %d\n",
1254                       FP_REGNUM);
1255 #endif
1256 #ifdef FRAMELESS_FUNCTION_INVOCATION
1257   fprintf_unfiltered (file,
1258                       "gdbarch_dump: %s # %s\n",
1259                       "FRAMELESS_FUNCTION_INVOCATION(fi)",
1260                       XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1261   if (GDB_MULTI_ARCH)
1262     fprintf_unfiltered (file,
1263                         "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1264                         (long) current_gdbarch->frameless_function_invocation
1265                         /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1266 #endif
1267 #ifdef FRAME_ARGS_ADDRESS
1268   fprintf_unfiltered (file,
1269                       "gdbarch_dump: %s # %s\n",
1270                       "FRAME_ARGS_ADDRESS(fi)",
1271                       XSTRING (FRAME_ARGS_ADDRESS (fi)));
1272   if (GDB_MULTI_ARCH)
1273     fprintf_unfiltered (file,
1274                         "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1275                         (long) current_gdbarch->frame_args_address
1276                         /*FRAME_ARGS_ADDRESS ()*/);
1277 #endif
1278 #ifdef FRAME_ARGS_SKIP
1279   fprintf_unfiltered (file,
1280                       "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1281                       XSTRING (FRAME_ARGS_SKIP));
1282   fprintf_unfiltered (file,
1283                       "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1284                       (long) FRAME_ARGS_SKIP);
1285 #endif
1286 #ifdef FRAME_CHAIN
1287   fprintf_unfiltered (file,
1288                       "gdbarch_dump: %s # %s\n",
1289                       "FRAME_CHAIN(frame)",
1290                       XSTRING (FRAME_CHAIN (frame)));
1291   if (GDB_MULTI_ARCH)
1292     fprintf_unfiltered (file,
1293                         "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
1294                         (long) current_gdbarch->frame_chain
1295                         /*FRAME_CHAIN ()*/);
1296 #endif
1297 #ifdef FRAME_CHAIN_VALID
1298   fprintf_unfiltered (file,
1299                       "gdbarch_dump: %s # %s\n",
1300                       "FRAME_CHAIN_VALID(chain, thisframe)",
1301                       XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1302   if (GDB_MULTI_ARCH)
1303     fprintf_unfiltered (file,
1304                         "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
1305                         (long) current_gdbarch->frame_chain_valid
1306                         /*FRAME_CHAIN_VALID ()*/);
1307 #endif
1308 #ifdef FRAME_INIT_SAVED_REGS
1309 #if GDB_MULTI_ARCH
1310   /* Macro might contain `[{}]' when not multi-arch */
1311   fprintf_unfiltered (file,
1312                       "gdbarch_dump: %s # %s\n",
1313                       "FRAME_INIT_SAVED_REGS(frame)",
1314                       XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1315 #endif
1316   if (GDB_MULTI_ARCH)
1317     fprintf_unfiltered (file,
1318                         "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1319                         (long) current_gdbarch->frame_init_saved_regs
1320                         /*FRAME_INIT_SAVED_REGS ()*/);
1321 #endif
1322 #ifdef FRAME_LOCALS_ADDRESS
1323   fprintf_unfiltered (file,
1324                       "gdbarch_dump: %s # %s\n",
1325                       "FRAME_LOCALS_ADDRESS(fi)",
1326                       XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1327   if (GDB_MULTI_ARCH)
1328     fprintf_unfiltered (file,
1329                         "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1330                         (long) current_gdbarch->frame_locals_address
1331                         /*FRAME_LOCALS_ADDRESS ()*/);
1332 #endif
1333 #ifdef FRAME_NUM_ARGS
1334   fprintf_unfiltered (file,
1335                       "gdbarch_dump: %s # %s\n",
1336                       "FRAME_NUM_ARGS(frame)",
1337                       XSTRING (FRAME_NUM_ARGS (frame)));
1338   if (GDB_MULTI_ARCH)
1339     fprintf_unfiltered (file,
1340                         "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
1341                         (long) current_gdbarch->frame_num_args
1342                         /*FRAME_NUM_ARGS ()*/);
1343 #endif
1344 #ifdef FRAME_SAVED_PC
1345   fprintf_unfiltered (file,
1346                       "gdbarch_dump: %s # %s\n",
1347                       "FRAME_SAVED_PC(fi)",
1348                       XSTRING (FRAME_SAVED_PC (fi)));
1349   if (GDB_MULTI_ARCH)
1350     fprintf_unfiltered (file,
1351                         "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
1352                         (long) current_gdbarch->frame_saved_pc
1353                         /*FRAME_SAVED_PC ()*/);
1354 #endif
1355 #ifdef FUNCTION_START_OFFSET
1356   fprintf_unfiltered (file,
1357                       "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1358                       XSTRING (FUNCTION_START_OFFSET));
1359   fprintf_unfiltered (file,
1360                       "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1361                       (long) FUNCTION_START_OFFSET);
1362 #endif
1363 #ifdef GET_LONGJMP_TARGET
1364   fprintf_unfiltered (file,
1365                       "gdbarch_dump: %s # %s\n",
1366                       "GET_LONGJMP_TARGET(pc)",
1367                       XSTRING (GET_LONGJMP_TARGET (pc)));
1368   if (GDB_MULTI_ARCH)
1369     fprintf_unfiltered (file,
1370                         "gdbarch_dump: GET_LONGJMP_TARGET = 0x%08lx\n",
1371                         (long) current_gdbarch->get_longjmp_target
1372                         /*GET_LONGJMP_TARGET ()*/);
1373 #endif
1374 #ifdef GET_SAVED_REGISTER
1375 #if GDB_MULTI_ARCH
1376   /* Macro might contain `[{}]' when not multi-arch */
1377   fprintf_unfiltered (file,
1378                       "gdbarch_dump: %s # %s\n",
1379                       "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1380                       XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1381 #endif
1382   if (GDB_MULTI_ARCH)
1383     fprintf_unfiltered (file,
1384                         "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1385                         (long) current_gdbarch->get_saved_register
1386                         /*GET_SAVED_REGISTER ()*/);
1387 #endif
1388 #ifdef HAVE_STEPPABLE_WATCHPOINT
1389   fprintf_unfiltered (file,
1390                       "gdbarch_dump: HAVE_STEPPABLE_WATCHPOINT # %s\n",
1391                       XSTRING (HAVE_STEPPABLE_WATCHPOINT));
1392   fprintf_unfiltered (file,
1393                       "gdbarch_dump: HAVE_STEPPABLE_WATCHPOINT = %d\n",
1394                       HAVE_STEPPABLE_WATCHPOINT);
1395 #endif
1396 #ifdef INIT_EXTRA_FRAME_INFO
1397 #if GDB_MULTI_ARCH
1398   /* Macro might contain `[{}]' when not multi-arch */
1399   fprintf_unfiltered (file,
1400                       "gdbarch_dump: %s # %s\n",
1401                       "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1402                       XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1403 #endif
1404   if (GDB_MULTI_ARCH)
1405     fprintf_unfiltered (file,
1406                         "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1407                         (long) current_gdbarch->init_extra_frame_info
1408                         /*INIT_EXTRA_FRAME_INFO ()*/);
1409 #endif
1410 #ifdef INIT_FRAME_PC
1411 #if GDB_MULTI_ARCH
1412   /* Macro might contain `[{}]' when not multi-arch */
1413   fprintf_unfiltered (file,
1414                       "gdbarch_dump: %s # %s\n",
1415                       "INIT_FRAME_PC(fromleaf, prev)",
1416                       XSTRING (INIT_FRAME_PC (fromleaf, prev)));
1417 #endif
1418   if (GDB_MULTI_ARCH)
1419     fprintf_unfiltered (file,
1420                         "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
1421                         (long) current_gdbarch->init_frame_pc
1422                         /*INIT_FRAME_PC ()*/);
1423 #endif
1424 #ifdef INIT_FRAME_PC_FIRST
1425 #if GDB_MULTI_ARCH
1426   /* Macro might contain `[{}]' when not multi-arch */
1427   fprintf_unfiltered (file,
1428                       "gdbarch_dump: %s # %s\n",
1429                       "INIT_FRAME_PC_FIRST(fromleaf, prev)",
1430                       XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
1431 #endif
1432   if (GDB_MULTI_ARCH)
1433     fprintf_unfiltered (file,
1434                         "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
1435                         (long) current_gdbarch->init_frame_pc_first
1436                         /*INIT_FRAME_PC_FIRST ()*/);
1437 #endif
1438 #ifdef INNER_THAN
1439   fprintf_unfiltered (file,
1440                       "gdbarch_dump: %s # %s\n",
1441                       "INNER_THAN(lhs, rhs)",
1442                       XSTRING (INNER_THAN (lhs, rhs)));
1443   if (GDB_MULTI_ARCH)
1444     fprintf_unfiltered (file,
1445                         "gdbarch_dump: INNER_THAN = 0x%08lx\n",
1446                         (long) current_gdbarch->inner_than
1447                         /*INNER_THAN ()*/);
1448 #endif
1449 #ifdef INTEGER_TO_ADDRESS
1450   fprintf_unfiltered (file,
1451                       "gdbarch_dump: %s # %s\n",
1452                       "INTEGER_TO_ADDRESS(type, buf)",
1453                       XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1454   if (GDB_MULTI_ARCH)
1455     fprintf_unfiltered (file,
1456                         "gdbarch_dump: INTEGER_TO_ADDRESS = 0x%08lx\n",
1457                         (long) current_gdbarch->integer_to_address
1458                         /*INTEGER_TO_ADDRESS ()*/);
1459 #endif
1460 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1461   fprintf_unfiltered (file,
1462                       "gdbarch_dump: %s # %s\n",
1463                       "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1464                       XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1465   if (GDB_MULTI_ARCH)
1466     fprintf_unfiltered (file,
1467                         "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n",
1468                         (long) current_gdbarch->in_solib_call_trampoline
1469                         /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
1470 #endif
1471 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1472   fprintf_unfiltered (file,
1473                       "gdbarch_dump: %s # %s\n",
1474                       "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1475                       XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1476   if (GDB_MULTI_ARCH)
1477     fprintf_unfiltered (file,
1478                         "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = 0x%08lx\n",
1479                         (long) current_gdbarch->in_solib_return_trampoline
1480                         /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
1481 #endif
1482 #ifdef MAX_REGISTER_RAW_SIZE
1483   fprintf_unfiltered (file,
1484                       "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
1485                       XSTRING (MAX_REGISTER_RAW_SIZE));
1486   fprintf_unfiltered (file,
1487                       "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n",
1488                       MAX_REGISTER_RAW_SIZE);
1489 #endif
1490 #ifdef MAX_REGISTER_VIRTUAL_SIZE
1491   fprintf_unfiltered (file,
1492                       "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
1493                       XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
1494   fprintf_unfiltered (file,
1495                       "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n",
1496                       MAX_REGISTER_VIRTUAL_SIZE);
1497 #endif
1498 #ifdef MEMORY_INSERT_BREAKPOINT
1499   fprintf_unfiltered (file,
1500                       "gdbarch_dump: %s # %s\n",
1501                       "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1502                       XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1503   if (GDB_MULTI_ARCH)
1504     fprintf_unfiltered (file,
1505                         "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1506                         (long) current_gdbarch->memory_insert_breakpoint
1507                         /*MEMORY_INSERT_BREAKPOINT ()*/);
1508 #endif
1509 #ifdef MEMORY_REMOVE_BREAKPOINT
1510   fprintf_unfiltered (file,
1511                       "gdbarch_dump: %s # %s\n",
1512                       "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1513                       XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1514   if (GDB_MULTI_ARCH)
1515     fprintf_unfiltered (file,
1516                         "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1517                         (long) current_gdbarch->memory_remove_breakpoint
1518                         /*MEMORY_REMOVE_BREAKPOINT ()*/);
1519 #endif
1520 #ifdef NAME_OF_MALLOC
1521   fprintf_unfiltered (file,
1522                       "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1523                       XSTRING (NAME_OF_MALLOC));
1524   fprintf_unfiltered (file,
1525                       "gdbarch_dump: NAME_OF_MALLOC = %ld\n",
1526                       (long) NAME_OF_MALLOC);
1527 #endif
1528 #ifdef NPC_REGNUM
1529   fprintf_unfiltered (file,
1530                       "gdbarch_dump: NPC_REGNUM # %s\n",
1531                       XSTRING (NPC_REGNUM));
1532   fprintf_unfiltered (file,
1533                       "gdbarch_dump: NPC_REGNUM = %d\n",
1534                       NPC_REGNUM);
1535 #endif
1536 #ifdef NUM_PSEUDO_REGS
1537   fprintf_unfiltered (file,
1538                       "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1539                       XSTRING (NUM_PSEUDO_REGS));
1540   fprintf_unfiltered (file,
1541                       "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
1542                       NUM_PSEUDO_REGS);
1543 #endif
1544 #ifdef NUM_REGS
1545   fprintf_unfiltered (file,
1546                       "gdbarch_dump: NUM_REGS # %s\n",
1547                       XSTRING (NUM_REGS));
1548   fprintf_unfiltered (file,
1549                       "gdbarch_dump: NUM_REGS = %d\n",
1550                       NUM_REGS);
1551 #endif
1552 #ifdef PARM_BOUNDARY
1553   fprintf_unfiltered (file,
1554                       "gdbarch_dump: PARM_BOUNDARY # %s\n",
1555                       XSTRING (PARM_BOUNDARY));
1556   fprintf_unfiltered (file,
1557                       "gdbarch_dump: PARM_BOUNDARY = %d\n",
1558                       PARM_BOUNDARY);
1559 #endif
1560 #ifdef PC_IN_CALL_DUMMY
1561   fprintf_unfiltered (file,
1562                       "gdbarch_dump: %s # %s\n",
1563                       "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
1564                       XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
1565   if (GDB_MULTI_ARCH)
1566     fprintf_unfiltered (file,
1567                         "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
1568                         (long) current_gdbarch->pc_in_call_dummy
1569                         /*PC_IN_CALL_DUMMY ()*/);
1570 #endif
1571 #ifdef PC_IN_SIGTRAMP
1572   fprintf_unfiltered (file,
1573                       "gdbarch_dump: %s # %s\n",
1574                       "PC_IN_SIGTRAMP(pc, name)",
1575                       XSTRING (PC_IN_SIGTRAMP (pc, name)));
1576   if (GDB_MULTI_ARCH)
1577     fprintf_unfiltered (file,
1578                         "gdbarch_dump: PC_IN_SIGTRAMP = 0x%08lx\n",
1579                         (long) current_gdbarch->pc_in_sigtramp
1580                         /*PC_IN_SIGTRAMP ()*/);
1581 #endif
1582 #ifdef PC_REGNUM
1583   fprintf_unfiltered (file,
1584                       "gdbarch_dump: PC_REGNUM # %s\n",
1585                       XSTRING (PC_REGNUM));
1586   fprintf_unfiltered (file,
1587                       "gdbarch_dump: PC_REGNUM = %d\n",
1588                       PC_REGNUM);
1589 #endif
1590 #ifdef POINTER_TO_ADDRESS
1591   fprintf_unfiltered (file,
1592                       "gdbarch_dump: %s # %s\n",
1593                       "POINTER_TO_ADDRESS(type, buf)",
1594                       XSTRING (POINTER_TO_ADDRESS (type, buf)));
1595   if (GDB_MULTI_ARCH)
1596     fprintf_unfiltered (file,
1597                         "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
1598                         (long) current_gdbarch->pointer_to_address
1599                         /*POINTER_TO_ADDRESS ()*/);
1600 #endif
1601 #ifdef POP_FRAME
1602 #if GDB_MULTI_ARCH
1603   /* Macro might contain `[{}]' when not multi-arch */
1604   fprintf_unfiltered (file,
1605                       "gdbarch_dump: %s # %s\n",
1606                       "POP_FRAME(-)",
1607                       XSTRING (POP_FRAME (-)));
1608 #endif
1609   if (GDB_MULTI_ARCH)
1610     fprintf_unfiltered (file,
1611                         "gdbarch_dump: POP_FRAME = 0x%08lx\n",
1612                         (long) current_gdbarch->pop_frame
1613                         /*POP_FRAME ()*/);
1614 #endif
1615 #ifdef PREPARE_TO_PROCEED
1616   fprintf_unfiltered (file,
1617                       "gdbarch_dump: %s # %s\n",
1618                       "PREPARE_TO_PROCEED(select_it)",
1619                       XSTRING (PREPARE_TO_PROCEED (select_it)));
1620   if (GDB_MULTI_ARCH)
1621     fprintf_unfiltered (file,
1622                         "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n",
1623                         (long) current_gdbarch->prepare_to_proceed
1624                         /*PREPARE_TO_PROCEED ()*/);
1625 #endif
1626   if (GDB_MULTI_ARCH)
1627     fprintf_unfiltered (file,
1628                         "gdbarch_dump: print_float_info = 0x%08lx\n",
1629                         (long) current_gdbarch->print_float_info);
1630   if (GDB_MULTI_ARCH)
1631     fprintf_unfiltered (file,
1632                         "gdbarch_dump: print_registers_info = 0x%08lx\n",
1633                         (long) current_gdbarch->print_registers_info);
1634   if (GDB_MULTI_ARCH)
1635     fprintf_unfiltered (file,
1636                         "gdbarch_dump: print_vector_info = 0x%08lx\n",
1637                         (long) current_gdbarch->print_vector_info);
1638 #ifdef PROLOGUE_FRAMELESS_P
1639   fprintf_unfiltered (file,
1640                       "gdbarch_dump: %s # %s\n",
1641                       "PROLOGUE_FRAMELESS_P(ip)",
1642                       XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1643   if (GDB_MULTI_ARCH)
1644     fprintf_unfiltered (file,
1645                         "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1646                         (long) current_gdbarch->prologue_frameless_p
1647                         /*PROLOGUE_FRAMELESS_P ()*/);
1648 #endif
1649 #ifdef PS_REGNUM
1650   fprintf_unfiltered (file,
1651                       "gdbarch_dump: PS_REGNUM # %s\n",
1652                       XSTRING (PS_REGNUM));
1653   fprintf_unfiltered (file,
1654                       "gdbarch_dump: PS_REGNUM = %d\n",
1655                       PS_REGNUM);
1656 #endif
1657 #ifdef PUSH_ARGUMENTS
1658   fprintf_unfiltered (file,
1659                       "gdbarch_dump: %s # %s\n",
1660                       "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1661                       XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1662   if (GDB_MULTI_ARCH)
1663     fprintf_unfiltered (file,
1664                         "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
1665                         (long) current_gdbarch->push_arguments
1666                         /*PUSH_ARGUMENTS ()*/);
1667 #endif
1668 #ifdef PUSH_DUMMY_FRAME
1669 #if GDB_MULTI_ARCH
1670   /* Macro might contain `[{}]' when not multi-arch */
1671   fprintf_unfiltered (file,
1672                       "gdbarch_dump: %s # %s\n",
1673                       "PUSH_DUMMY_FRAME(-)",
1674                       XSTRING (PUSH_DUMMY_FRAME (-)));
1675 #endif
1676   if (GDB_MULTI_ARCH)
1677     fprintf_unfiltered (file,
1678                         "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
1679                         (long) current_gdbarch->push_dummy_frame
1680                         /*PUSH_DUMMY_FRAME ()*/);
1681 #endif
1682 #ifdef PUSH_RETURN_ADDRESS
1683   fprintf_unfiltered (file,
1684                       "gdbarch_dump: %s # %s\n",
1685                       "PUSH_RETURN_ADDRESS(pc, sp)",
1686                       XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1687   if (GDB_MULTI_ARCH)
1688     fprintf_unfiltered (file,
1689                         "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
1690                         (long) current_gdbarch->push_return_address
1691                         /*PUSH_RETURN_ADDRESS ()*/);
1692 #endif
1693 #ifdef REGISTER_BYTE
1694   fprintf_unfiltered (file,
1695                       "gdbarch_dump: %s # %s\n",
1696                       "REGISTER_BYTE(reg_nr)",
1697                       XSTRING (REGISTER_BYTE (reg_nr)));
1698   if (GDB_MULTI_ARCH)
1699     fprintf_unfiltered (file,
1700                         "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
1701                         (long) current_gdbarch->register_byte
1702                         /*REGISTER_BYTE ()*/);
1703 #endif
1704 #ifdef REGISTER_BYTES
1705   fprintf_unfiltered (file,
1706                       "gdbarch_dump: REGISTER_BYTES # %s\n",
1707                       XSTRING (REGISTER_BYTES));
1708   fprintf_unfiltered (file,
1709                       "gdbarch_dump: REGISTER_BYTES = %d\n",
1710                       REGISTER_BYTES);
1711 #endif
1712 #ifdef REGISTER_BYTES_OK
1713   fprintf_unfiltered (file,
1714                       "gdbarch_dump: %s # %s\n",
1715                       "REGISTER_BYTES_OK(nr_bytes)",
1716                       XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1717   if (GDB_MULTI_ARCH)
1718     fprintf_unfiltered (file,
1719                         "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n",
1720                         (long) current_gdbarch->register_bytes_ok
1721                         /*REGISTER_BYTES_OK ()*/);
1722 #endif
1723 #ifdef REGISTER_CONVERTIBLE
1724   fprintf_unfiltered (file,
1725                       "gdbarch_dump: %s # %s\n",
1726                       "REGISTER_CONVERTIBLE(nr)",
1727                       XSTRING (REGISTER_CONVERTIBLE (nr)));
1728   if (GDB_MULTI_ARCH)
1729     fprintf_unfiltered (file,
1730                         "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n",
1731                         (long) current_gdbarch->register_convertible
1732                         /*REGISTER_CONVERTIBLE ()*/);
1733 #endif
1734 #ifdef REGISTER_CONVERT_TO_RAW
1735 #if GDB_MULTI_ARCH
1736   /* Macro might contain `[{}]' when not multi-arch */
1737   fprintf_unfiltered (file,
1738                       "gdbarch_dump: %s # %s\n",
1739                       "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
1740                       XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
1741 #endif
1742   if (GDB_MULTI_ARCH)
1743     fprintf_unfiltered (file,
1744                         "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
1745                         (long) current_gdbarch->register_convert_to_raw
1746                         /*REGISTER_CONVERT_TO_RAW ()*/);
1747 #endif
1748 #ifdef REGISTER_CONVERT_TO_VIRTUAL
1749 #if GDB_MULTI_ARCH
1750   /* Macro might contain `[{}]' when not multi-arch */
1751   fprintf_unfiltered (file,
1752                       "gdbarch_dump: %s # %s\n",
1753                       "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
1754                       XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
1755 #endif
1756   if (GDB_MULTI_ARCH)
1757     fprintf_unfiltered (file,
1758                         "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
1759                         (long) current_gdbarch->register_convert_to_virtual
1760                         /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
1761 #endif
1762 #ifdef REGISTER_NAME
1763   fprintf_unfiltered (file,
1764                       "gdbarch_dump: %s # %s\n",
1765                       "REGISTER_NAME(regnr)",
1766                       XSTRING (REGISTER_NAME (regnr)));
1767   if (GDB_MULTI_ARCH)
1768     fprintf_unfiltered (file,
1769                         "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
1770                         (long) current_gdbarch->register_name
1771                         /*REGISTER_NAME ()*/);
1772 #endif
1773 #ifdef REGISTER_RAW_SIZE
1774   fprintf_unfiltered (file,
1775                       "gdbarch_dump: %s # %s\n",
1776                       "REGISTER_RAW_SIZE(reg_nr)",
1777                       XSTRING (REGISTER_RAW_SIZE (reg_nr)));
1778   if (GDB_MULTI_ARCH)
1779     fprintf_unfiltered (file,
1780                         "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
1781                         (long) current_gdbarch->register_raw_size
1782                         /*REGISTER_RAW_SIZE ()*/);
1783 #endif
1784 #ifdef REGISTER_SIM_REGNO
1785   fprintf_unfiltered (file,
1786                       "gdbarch_dump: %s # %s\n",
1787                       "REGISTER_SIM_REGNO(reg_nr)",
1788                       XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1789   if (GDB_MULTI_ARCH)
1790     fprintf_unfiltered (file,
1791                         "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n",
1792                         (long) current_gdbarch->register_sim_regno
1793                         /*REGISTER_SIM_REGNO ()*/);
1794 #endif
1795 #ifdef REGISTER_SIZE
1796   fprintf_unfiltered (file,
1797                       "gdbarch_dump: REGISTER_SIZE # %s\n",
1798                       XSTRING (REGISTER_SIZE));
1799   fprintf_unfiltered (file,
1800                       "gdbarch_dump: REGISTER_SIZE = %d\n",
1801                       REGISTER_SIZE);
1802 #endif
1803 #ifdef REGISTER_TO_VALUE
1804 #if GDB_MULTI_ARCH
1805   /* Macro might contain `[{}]' when not multi-arch */
1806   fprintf_unfiltered (file,
1807                       "gdbarch_dump: %s # %s\n",
1808                       "REGISTER_TO_VALUE(regnum, type, from, to)",
1809                       XSTRING (REGISTER_TO_VALUE (regnum, type, from, to)));
1810 #endif
1811   if (GDB_MULTI_ARCH)
1812     fprintf_unfiltered (file,
1813                         "gdbarch_dump: REGISTER_TO_VALUE = 0x%08lx\n",
1814                         (long) current_gdbarch->register_to_value
1815                         /*REGISTER_TO_VALUE ()*/);
1816 #endif
1817 #ifdef REGISTER_VIRTUAL_SIZE
1818   fprintf_unfiltered (file,
1819                       "gdbarch_dump: %s # %s\n",
1820                       "REGISTER_VIRTUAL_SIZE(reg_nr)",
1821                       XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
1822   if (GDB_MULTI_ARCH)
1823     fprintf_unfiltered (file,
1824                         "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
1825                         (long) current_gdbarch->register_virtual_size
1826                         /*REGISTER_VIRTUAL_SIZE ()*/);
1827 #endif
1828 #ifdef REGISTER_VIRTUAL_TYPE
1829   fprintf_unfiltered (file,
1830                       "gdbarch_dump: %s # %s\n",
1831                       "REGISTER_VIRTUAL_TYPE(reg_nr)",
1832                       XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
1833   if (GDB_MULTI_ARCH)
1834     fprintf_unfiltered (file,
1835                         "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
1836                         (long) current_gdbarch->register_virtual_type
1837                         /*REGISTER_VIRTUAL_TYPE ()*/);
1838 #endif
1839 #ifdef REG_STRUCT_HAS_ADDR
1840   fprintf_unfiltered (file,
1841                       "gdbarch_dump: %s # %s\n",
1842                       "REG_STRUCT_HAS_ADDR(gcc_p, type)",
1843                       XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
1844   if (GDB_MULTI_ARCH)
1845     fprintf_unfiltered (file,
1846                         "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1847                         (long) current_gdbarch->reg_struct_has_addr
1848                         /*REG_STRUCT_HAS_ADDR ()*/);
1849 #endif
1850 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1851 #if GDB_MULTI_ARCH
1852   /* Macro might contain `[{}]' when not multi-arch */
1853   fprintf_unfiltered (file,
1854                       "gdbarch_dump: %s # %s\n",
1855                       "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
1856                       XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
1857 #endif
1858   if (GDB_MULTI_ARCH)
1859     fprintf_unfiltered (file,
1860                         "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1861                         (long) current_gdbarch->remote_translate_xfer_address
1862                         /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1863 #endif
1864 #ifdef RETURN_VALUE_ON_STACK
1865   fprintf_unfiltered (file,
1866                       "gdbarch_dump: %s # %s\n",
1867                       "RETURN_VALUE_ON_STACK(type)",
1868                       XSTRING (RETURN_VALUE_ON_STACK (type)));
1869   if (GDB_MULTI_ARCH)
1870     fprintf_unfiltered (file,
1871                         "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
1872                         (long) current_gdbarch->return_value_on_stack
1873                         /*RETURN_VALUE_ON_STACK ()*/);
1874 #endif
1875 #ifdef SAVED_PC_AFTER_CALL
1876   fprintf_unfiltered (file,
1877                       "gdbarch_dump: %s # %s\n",
1878                       "SAVED_PC_AFTER_CALL(frame)",
1879                       XSTRING (SAVED_PC_AFTER_CALL (frame)));
1880   if (GDB_MULTI_ARCH)
1881     fprintf_unfiltered (file,
1882                         "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1883                         (long) current_gdbarch->saved_pc_after_call
1884                         /*SAVED_PC_AFTER_CALL ()*/);
1885 #endif
1886 #ifdef SAVE_DUMMY_FRAME_TOS
1887 #if GDB_MULTI_ARCH
1888   /* Macro might contain `[{}]' when not multi-arch */
1889   fprintf_unfiltered (file,
1890                       "gdbarch_dump: %s # %s\n",
1891                       "SAVE_DUMMY_FRAME_TOS(sp)",
1892                       XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
1893 #endif
1894   if (GDB_MULTI_ARCH)
1895     fprintf_unfiltered (file,
1896                         "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
1897                         (long) current_gdbarch->save_dummy_frame_tos
1898                         /*SAVE_DUMMY_FRAME_TOS ()*/);
1899 #endif
1900 #ifdef SDB_REG_TO_REGNUM
1901   fprintf_unfiltered (file,
1902                       "gdbarch_dump: %s # %s\n",
1903                       "SDB_REG_TO_REGNUM(sdb_regnr)",
1904                       XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1905   if (GDB_MULTI_ARCH)
1906     fprintf_unfiltered (file,
1907                         "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n",
1908                         (long) current_gdbarch->sdb_reg_to_regnum
1909                         /*SDB_REG_TO_REGNUM ()*/);
1910 #endif
1911 #ifdef SIGTRAMP_END
1912   fprintf_unfiltered (file,
1913                       "gdbarch_dump: %s # %s\n",
1914                       "SIGTRAMP_END(pc)",
1915                       XSTRING (SIGTRAMP_END (pc)));
1916   if (GDB_MULTI_ARCH)
1917     fprintf_unfiltered (file,
1918                         "gdbarch_dump: SIGTRAMP_END = 0x%08lx\n",
1919                         (long) current_gdbarch->sigtramp_end
1920                         /*SIGTRAMP_END ()*/);
1921 #endif
1922 #ifdef SIGTRAMP_START
1923   fprintf_unfiltered (file,
1924                       "gdbarch_dump: %s # %s\n",
1925                       "SIGTRAMP_START(pc)",
1926                       XSTRING (SIGTRAMP_START (pc)));
1927   if (GDB_MULTI_ARCH)
1928     fprintf_unfiltered (file,
1929                         "gdbarch_dump: SIGTRAMP_START = 0x%08lx\n",
1930                         (long) current_gdbarch->sigtramp_start
1931                         /*SIGTRAMP_START ()*/);
1932 #endif
1933 #ifdef SIZEOF_CALL_DUMMY_WORDS
1934   fprintf_unfiltered (file,
1935                       "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
1936                       XSTRING (SIZEOF_CALL_DUMMY_WORDS));
1937   fprintf_unfiltered (file,
1938                       "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
1939                       (long) SIZEOF_CALL_DUMMY_WORDS);
1940 #endif
1941 #ifdef SKIP_PROLOGUE
1942   fprintf_unfiltered (file,
1943                       "gdbarch_dump: %s # %s\n",
1944                       "SKIP_PROLOGUE(ip)",
1945                       XSTRING (SKIP_PROLOGUE (ip)));
1946   if (GDB_MULTI_ARCH)
1947     fprintf_unfiltered (file,
1948                         "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
1949                         (long) current_gdbarch->skip_prologue
1950                         /*SKIP_PROLOGUE ()*/);
1951 #endif
1952 #ifdef SKIP_TRAMPOLINE_CODE
1953   fprintf_unfiltered (file,
1954                       "gdbarch_dump: %s # %s\n",
1955                       "SKIP_TRAMPOLINE_CODE(pc)",
1956                       XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1957   if (GDB_MULTI_ARCH)
1958     fprintf_unfiltered (file,
1959                         "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n",
1960                         (long) current_gdbarch->skip_trampoline_code
1961                         /*SKIP_TRAMPOLINE_CODE ()*/);
1962 #endif
1963 #ifdef SMASH_TEXT_ADDRESS
1964   fprintf_unfiltered (file,
1965                       "gdbarch_dump: %s # %s\n",
1966                       "SMASH_TEXT_ADDRESS(addr)",
1967                       XSTRING (SMASH_TEXT_ADDRESS (addr)));
1968   if (GDB_MULTI_ARCH)
1969     fprintf_unfiltered (file,
1970                         "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n",
1971                         (long) current_gdbarch->smash_text_address
1972                         /*SMASH_TEXT_ADDRESS ()*/);
1973 #endif
1974 #ifdef SOFTWARE_SINGLE_STEP
1975 #if GDB_MULTI_ARCH
1976   /* Macro might contain `[{}]' when not multi-arch */
1977   fprintf_unfiltered (file,
1978                       "gdbarch_dump: %s # %s\n",
1979                       "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1980                       XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1981 #endif
1982   if (GDB_MULTI_ARCH)
1983     fprintf_unfiltered (file,
1984                         "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
1985                         (long) current_gdbarch->software_single_step
1986                         /*SOFTWARE_SINGLE_STEP ()*/);
1987 #endif
1988 #ifdef SP_REGNUM
1989   fprintf_unfiltered (file,
1990                       "gdbarch_dump: SP_REGNUM # %s\n",
1991                       XSTRING (SP_REGNUM));
1992   fprintf_unfiltered (file,
1993                       "gdbarch_dump: SP_REGNUM = %d\n",
1994                       SP_REGNUM);
1995 #endif
1996 #ifdef STAB_REG_TO_REGNUM
1997   fprintf_unfiltered (file,
1998                       "gdbarch_dump: %s # %s\n",
1999                       "STAB_REG_TO_REGNUM(stab_regnr)",
2000                       XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
2001   if (GDB_MULTI_ARCH)
2002     fprintf_unfiltered (file,
2003                         "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n",
2004                         (long) current_gdbarch->stab_reg_to_regnum
2005                         /*STAB_REG_TO_REGNUM ()*/);
2006 #endif
2007 #ifdef STACK_ALIGN
2008   fprintf_unfiltered (file,
2009                       "gdbarch_dump: %s # %s\n",
2010                       "STACK_ALIGN(sp)",
2011                       XSTRING (STACK_ALIGN (sp)));
2012   if (GDB_MULTI_ARCH)
2013     fprintf_unfiltered (file,
2014                         "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
2015                         (long) current_gdbarch->stack_align
2016                         /*STACK_ALIGN ()*/);
2017 #endif
2018 #ifdef STORE_RETURN_VALUE
2019 #if GDB_MULTI_ARCH
2020   /* Macro might contain `[{}]' when not multi-arch */
2021   fprintf_unfiltered (file,
2022                       "gdbarch_dump: %s # %s\n",
2023                       "STORE_RETURN_VALUE(type, regcache, valbuf)",
2024                       XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
2025 #endif
2026   if (GDB_MULTI_ARCH)
2027     fprintf_unfiltered (file,
2028                         "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
2029                         (long) current_gdbarch->store_return_value
2030                         /*STORE_RETURN_VALUE ()*/);
2031 #endif
2032 #ifdef STORE_STRUCT_RETURN
2033 #if GDB_MULTI_ARCH
2034   /* Macro might contain `[{}]' when not multi-arch */
2035   fprintf_unfiltered (file,
2036                       "gdbarch_dump: %s # %s\n",
2037                       "STORE_STRUCT_RETURN(addr, sp)",
2038                       XSTRING (STORE_STRUCT_RETURN (addr, sp)));
2039 #endif
2040   if (GDB_MULTI_ARCH)
2041     fprintf_unfiltered (file,
2042                         "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
2043                         (long) current_gdbarch->store_struct_return
2044                         /*STORE_STRUCT_RETURN ()*/);
2045 #endif
2046 #ifdef TARGET_ADDR_BIT
2047   fprintf_unfiltered (file,
2048                       "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
2049                       XSTRING (TARGET_ADDR_BIT));
2050   fprintf_unfiltered (file,
2051                       "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
2052                       TARGET_ADDR_BIT);
2053 #endif
2054 #ifdef TARGET_ARCHITECTURE
2055   fprintf_unfiltered (file,
2056                       "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
2057                       XSTRING (TARGET_ARCHITECTURE));
2058   if (TARGET_ARCHITECTURE != NULL)
2059     fprintf_unfiltered (file,
2060                         "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
2061                         TARGET_ARCHITECTURE->printable_name);
2062 #endif
2063 #ifdef TARGET_BFD_VMA_BIT
2064   fprintf_unfiltered (file,
2065                       "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
2066                       XSTRING (TARGET_BFD_VMA_BIT));
2067   fprintf_unfiltered (file,
2068                       "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
2069                       TARGET_BFD_VMA_BIT);
2070 #endif
2071 #ifdef TARGET_BYTE_ORDER
2072   fprintf_unfiltered (file,
2073                       "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
2074                       XSTRING (TARGET_BYTE_ORDER));
2075   fprintf_unfiltered (file,
2076                       "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
2077                       (long) TARGET_BYTE_ORDER);
2078 #endif
2079 #ifdef TARGET_CHAR_SIGNED
2080   fprintf_unfiltered (file,
2081                       "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
2082                       XSTRING (TARGET_CHAR_SIGNED));
2083   fprintf_unfiltered (file,
2084                       "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
2085                       TARGET_CHAR_SIGNED);
2086 #endif
2087 #ifdef TARGET_DOUBLE_BIT
2088   fprintf_unfiltered (file,
2089                       "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
2090                       XSTRING (TARGET_DOUBLE_BIT));
2091   fprintf_unfiltered (file,
2092                       "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
2093                       TARGET_DOUBLE_BIT);
2094 #endif
2095 #ifdef TARGET_DOUBLE_FORMAT
2096   fprintf_unfiltered (file,
2097                       "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
2098                       XSTRING (TARGET_DOUBLE_FORMAT));
2099   fprintf_unfiltered (file,
2100                       "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
2101                       (long) TARGET_DOUBLE_FORMAT);
2102 #endif
2103 #ifdef TARGET_FLOAT_BIT
2104   fprintf_unfiltered (file,
2105                       "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
2106                       XSTRING (TARGET_FLOAT_BIT));
2107   fprintf_unfiltered (file,
2108                       "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
2109                       TARGET_FLOAT_BIT);
2110 #endif
2111 #ifdef TARGET_FLOAT_FORMAT
2112   fprintf_unfiltered (file,
2113                       "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
2114                       XSTRING (TARGET_FLOAT_FORMAT));
2115   fprintf_unfiltered (file,
2116                       "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
2117                       (long) TARGET_FLOAT_FORMAT);
2118 #endif
2119 #ifdef TARGET_INT_BIT
2120   fprintf_unfiltered (file,
2121                       "gdbarch_dump: TARGET_INT_BIT # %s\n",
2122                       XSTRING (TARGET_INT_BIT));
2123   fprintf_unfiltered (file,
2124                       "gdbarch_dump: TARGET_INT_BIT = %d\n",
2125                       TARGET_INT_BIT);
2126 #endif
2127 #ifdef TARGET_LONG_BIT
2128   fprintf_unfiltered (file,
2129                       "gdbarch_dump: TARGET_LONG_BIT # %s\n",
2130                       XSTRING (TARGET_LONG_BIT));
2131   fprintf_unfiltered (file,
2132                       "gdbarch_dump: TARGET_LONG_BIT = %d\n",
2133                       TARGET_LONG_BIT);
2134 #endif
2135 #ifdef TARGET_LONG_DOUBLE_BIT
2136   fprintf_unfiltered (file,
2137                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
2138                       XSTRING (TARGET_LONG_DOUBLE_BIT));
2139   fprintf_unfiltered (file,
2140                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
2141                       TARGET_LONG_DOUBLE_BIT);
2142 #endif
2143 #ifdef TARGET_LONG_DOUBLE_FORMAT
2144   fprintf_unfiltered (file,
2145                       "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
2146                       XSTRING (TARGET_LONG_DOUBLE_FORMAT));
2147   fprintf_unfiltered (file,
2148                       "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
2149                       (long) TARGET_LONG_DOUBLE_FORMAT);
2150 #endif
2151 #ifdef TARGET_LONG_LONG_BIT
2152   fprintf_unfiltered (file,
2153                       "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
2154                       XSTRING (TARGET_LONG_LONG_BIT));
2155   fprintf_unfiltered (file,
2156                       "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
2157                       TARGET_LONG_LONG_BIT);
2158 #endif
2159 #ifdef TARGET_PRINT_INSN
2160   fprintf_unfiltered (file,
2161                       "gdbarch_dump: %s # %s\n",
2162                       "TARGET_PRINT_INSN(vma, info)",
2163                       XSTRING (TARGET_PRINT_INSN (vma, info)));
2164   if (GDB_MULTI_ARCH)
2165     fprintf_unfiltered (file,
2166                         "gdbarch_dump: TARGET_PRINT_INSN = 0x%08lx\n",
2167                         (long) current_gdbarch->print_insn
2168                         /*TARGET_PRINT_INSN ()*/);
2169 #endif
2170 #ifdef TARGET_PTR_BIT
2171   fprintf_unfiltered (file,
2172                       "gdbarch_dump: TARGET_PTR_BIT # %s\n",
2173                       XSTRING (TARGET_PTR_BIT));
2174   fprintf_unfiltered (file,
2175                       "gdbarch_dump: TARGET_PTR_BIT = %d\n",
2176                       TARGET_PTR_BIT);
2177 #endif
2178 #ifdef TARGET_READ_FP
2179   fprintf_unfiltered (file,
2180                       "gdbarch_dump: %s # %s\n",
2181                       "TARGET_READ_FP()",
2182                       XSTRING (TARGET_READ_FP ()));
2183   if (GDB_MULTI_ARCH)
2184     fprintf_unfiltered (file,
2185                         "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
2186                         (long) current_gdbarch->read_fp
2187                         /*TARGET_READ_FP ()*/);
2188 #endif
2189 #ifdef TARGET_READ_PC
2190   fprintf_unfiltered (file,
2191                       "gdbarch_dump: %s # %s\n",
2192                       "TARGET_READ_PC(ptid)",
2193                       XSTRING (TARGET_READ_PC (ptid)));
2194   if (GDB_MULTI_ARCH)
2195     fprintf_unfiltered (file,
2196                         "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
2197                         (long) current_gdbarch->read_pc
2198                         /*TARGET_READ_PC ()*/);
2199 #endif
2200 #ifdef TARGET_READ_SP
2201   fprintf_unfiltered (file,
2202                       "gdbarch_dump: %s # %s\n",
2203                       "TARGET_READ_SP()",
2204                       XSTRING (TARGET_READ_SP ()));
2205   if (GDB_MULTI_ARCH)
2206     fprintf_unfiltered (file,
2207                         "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
2208                         (long) current_gdbarch->read_sp
2209                         /*TARGET_READ_SP ()*/);
2210 #endif
2211 #ifdef TARGET_SHORT_BIT
2212   fprintf_unfiltered (file,
2213                       "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
2214                       XSTRING (TARGET_SHORT_BIT));
2215   fprintf_unfiltered (file,
2216                       "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
2217                       TARGET_SHORT_BIT);
2218 #endif
2219 #ifdef TARGET_VIRTUAL_FRAME_POINTER
2220 #if GDB_MULTI_ARCH
2221   /* Macro might contain `[{}]' when not multi-arch */
2222   fprintf_unfiltered (file,
2223                       "gdbarch_dump: %s # %s\n",
2224                       "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
2225                       XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
2226 #endif
2227   if (GDB_MULTI_ARCH)
2228     fprintf_unfiltered (file,
2229                         "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n",
2230                         (long) current_gdbarch->virtual_frame_pointer
2231                         /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
2232 #endif
2233 #ifdef TARGET_WRITE_PC
2234 #if GDB_MULTI_ARCH
2235   /* Macro might contain `[{}]' when not multi-arch */
2236   fprintf_unfiltered (file,
2237                       "gdbarch_dump: %s # %s\n",
2238                       "TARGET_WRITE_PC(val, ptid)",
2239                       XSTRING (TARGET_WRITE_PC (val, ptid)));
2240 #endif
2241   if (GDB_MULTI_ARCH)
2242     fprintf_unfiltered (file,
2243                         "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
2244                         (long) current_gdbarch->write_pc
2245                         /*TARGET_WRITE_PC ()*/);
2246 #endif
2247 #ifdef TARGET_WRITE_SP
2248 #if GDB_MULTI_ARCH
2249   /* Macro might contain `[{}]' when not multi-arch */
2250   fprintf_unfiltered (file,
2251                       "gdbarch_dump: %s # %s\n",
2252                       "TARGET_WRITE_SP(val)",
2253                       XSTRING (TARGET_WRITE_SP (val)));
2254 #endif
2255   if (GDB_MULTI_ARCH)
2256     fprintf_unfiltered (file,
2257                         "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
2258                         (long) current_gdbarch->write_sp
2259                         /*TARGET_WRITE_SP ()*/);
2260 #endif
2261 #ifdef USE_GENERIC_DUMMY_FRAMES
2262   fprintf_unfiltered (file,
2263                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
2264                       XSTRING (USE_GENERIC_DUMMY_FRAMES));
2265   fprintf_unfiltered (file,
2266                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %d\n",
2267                       USE_GENERIC_DUMMY_FRAMES);
2268 #endif
2269 #ifdef USE_STRUCT_CONVENTION
2270   fprintf_unfiltered (file,
2271                       "gdbarch_dump: %s # %s\n",
2272                       "USE_STRUCT_CONVENTION(gcc_p, value_type)",
2273                       XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
2274   if (GDB_MULTI_ARCH)
2275     fprintf_unfiltered (file,
2276                         "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
2277                         (long) current_gdbarch->use_struct_convention
2278                         /*USE_STRUCT_CONVENTION ()*/);
2279 #endif
2280 #ifdef VALUE_TO_REGISTER
2281 #if GDB_MULTI_ARCH
2282   /* Macro might contain `[{}]' when not multi-arch */
2283   fprintf_unfiltered (file,
2284                       "gdbarch_dump: %s # %s\n",
2285                       "VALUE_TO_REGISTER(type, regnum, from, to)",
2286                       XSTRING (VALUE_TO_REGISTER (type, regnum, from, to)));
2287 #endif
2288   if (GDB_MULTI_ARCH)
2289     fprintf_unfiltered (file,
2290                         "gdbarch_dump: VALUE_TO_REGISTER = 0x%08lx\n",
2291                         (long) current_gdbarch->value_to_register
2292                         /*VALUE_TO_REGISTER ()*/);
2293 #endif
2294   if (current_gdbarch->dump_tdep != NULL)
2295     current_gdbarch->dump_tdep (current_gdbarch, file);
2296 }
2297
2298 struct gdbarch_tdep *
2299 gdbarch_tdep (struct gdbarch *gdbarch)
2300 {
2301   if (gdbarch_debug >= 2)
2302     fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
2303   return gdbarch->tdep;
2304 }
2305
2306
2307 const struct bfd_arch_info *
2308 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
2309 {
2310   gdb_assert (gdbarch != NULL);
2311   if (gdbarch_debug >= 2)
2312     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
2313   return gdbarch->bfd_arch_info;
2314 }
2315
2316 int
2317 gdbarch_byte_order (struct gdbarch *gdbarch)
2318 {
2319   gdb_assert (gdbarch != NULL);
2320   if (gdbarch_debug >= 2)
2321     fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
2322   return gdbarch->byte_order;
2323 }
2324
2325 int
2326 gdbarch_short_bit (struct gdbarch *gdbarch)
2327 {
2328   gdb_assert (gdbarch != NULL);
2329   /* Skip verify of short_bit, invalid_p == 0 */
2330   if (gdbarch_debug >= 2)
2331     fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
2332   return gdbarch->short_bit;
2333 }
2334
2335 void
2336 set_gdbarch_short_bit (struct gdbarch *gdbarch,
2337                        int short_bit)
2338 {
2339   gdbarch->short_bit = short_bit;
2340 }
2341
2342 int
2343 gdbarch_int_bit (struct gdbarch *gdbarch)
2344 {
2345   gdb_assert (gdbarch != NULL);
2346   /* Skip verify of int_bit, invalid_p == 0 */
2347   if (gdbarch_debug >= 2)
2348     fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
2349   return gdbarch->int_bit;
2350 }
2351
2352 void
2353 set_gdbarch_int_bit (struct gdbarch *gdbarch,
2354                      int int_bit)
2355 {
2356   gdbarch->int_bit = int_bit;
2357 }
2358
2359 int
2360 gdbarch_long_bit (struct gdbarch *gdbarch)
2361 {
2362   gdb_assert (gdbarch != NULL);
2363   /* Skip verify of long_bit, invalid_p == 0 */
2364   if (gdbarch_debug >= 2)
2365     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
2366   return gdbarch->long_bit;
2367 }
2368
2369 void
2370 set_gdbarch_long_bit (struct gdbarch *gdbarch,
2371                       int long_bit)
2372 {
2373   gdbarch->long_bit = long_bit;
2374 }
2375
2376 int
2377 gdbarch_long_long_bit (struct gdbarch *gdbarch)
2378 {
2379   gdb_assert (gdbarch != NULL);
2380   /* Skip verify of long_long_bit, invalid_p == 0 */
2381   if (gdbarch_debug >= 2)
2382     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
2383   return gdbarch->long_long_bit;
2384 }
2385
2386 void
2387 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
2388                            int long_long_bit)
2389 {
2390   gdbarch->long_long_bit = long_long_bit;
2391 }
2392
2393 int
2394 gdbarch_float_bit (struct gdbarch *gdbarch)
2395 {
2396   gdb_assert (gdbarch != NULL);
2397   /* Skip verify of float_bit, invalid_p == 0 */
2398   if (gdbarch_debug >= 2)
2399     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
2400   return gdbarch->float_bit;
2401 }
2402
2403 void
2404 set_gdbarch_float_bit (struct gdbarch *gdbarch,
2405                        int float_bit)
2406 {
2407   gdbarch->float_bit = float_bit;
2408 }
2409
2410 int
2411 gdbarch_double_bit (struct gdbarch *gdbarch)
2412 {
2413   gdb_assert (gdbarch != NULL);
2414   /* Skip verify of double_bit, invalid_p == 0 */
2415   if (gdbarch_debug >= 2)
2416     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2417   return gdbarch->double_bit;
2418 }
2419
2420 void
2421 set_gdbarch_double_bit (struct gdbarch *gdbarch,
2422                         int double_bit)
2423 {
2424   gdbarch->double_bit = double_bit;
2425 }
2426
2427 int
2428 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2429 {
2430   gdb_assert (gdbarch != NULL);
2431   /* Skip verify of long_double_bit, invalid_p == 0 */
2432   if (gdbarch_debug >= 2)
2433     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2434   return gdbarch->long_double_bit;
2435 }
2436
2437 void
2438 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2439                              int long_double_bit)
2440 {
2441   gdbarch->long_double_bit = long_double_bit;
2442 }
2443
2444 int
2445 gdbarch_ptr_bit (struct gdbarch *gdbarch)
2446 {
2447   gdb_assert (gdbarch != NULL);
2448   /* Skip verify of ptr_bit, invalid_p == 0 */
2449   if (gdbarch_debug >= 2)
2450     fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2451   return gdbarch->ptr_bit;
2452 }
2453
2454 void
2455 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2456                      int ptr_bit)
2457 {
2458   gdbarch->ptr_bit = ptr_bit;
2459 }
2460
2461 int
2462 gdbarch_addr_bit (struct gdbarch *gdbarch)
2463 {
2464   gdb_assert (gdbarch != NULL);
2465   if (gdbarch->addr_bit == 0)
2466     internal_error (__FILE__, __LINE__,
2467                     "gdbarch: gdbarch_addr_bit invalid");
2468   if (gdbarch_debug >= 2)
2469     fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2470   return gdbarch->addr_bit;
2471 }
2472
2473 void
2474 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2475                       int addr_bit)
2476 {
2477   gdbarch->addr_bit = addr_bit;
2478 }
2479
2480 int
2481 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2482 {
2483   gdb_assert (gdbarch != NULL);
2484   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2485   if (gdbarch_debug >= 2)
2486     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2487   return gdbarch->bfd_vma_bit;
2488 }
2489
2490 void
2491 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2492                          int bfd_vma_bit)
2493 {
2494   gdbarch->bfd_vma_bit = bfd_vma_bit;
2495 }
2496
2497 int
2498 gdbarch_char_signed (struct gdbarch *gdbarch)
2499 {
2500   gdb_assert (gdbarch != NULL);
2501   if (gdbarch->char_signed == -1)
2502     internal_error (__FILE__, __LINE__,
2503                     "gdbarch: gdbarch_char_signed invalid");
2504   if (gdbarch_debug >= 2)
2505     fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
2506   return gdbarch->char_signed;
2507 }
2508
2509 void
2510 set_gdbarch_char_signed (struct gdbarch *gdbarch,
2511                          int char_signed)
2512 {
2513   gdbarch->char_signed = char_signed;
2514 }
2515
2516 CORE_ADDR
2517 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
2518 {
2519   gdb_assert (gdbarch != NULL);
2520   if (gdbarch->read_pc == 0)
2521     internal_error (__FILE__, __LINE__,
2522                     "gdbarch: gdbarch_read_pc invalid");
2523   if (gdbarch_debug >= 2)
2524     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2525   return gdbarch->read_pc (ptid);
2526 }
2527
2528 void
2529 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2530                      gdbarch_read_pc_ftype read_pc)
2531 {
2532   gdbarch->read_pc = read_pc;
2533 }
2534
2535 void
2536 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
2537 {
2538   gdb_assert (gdbarch != NULL);
2539   if (gdbarch->write_pc == 0)
2540     internal_error (__FILE__, __LINE__,
2541                     "gdbarch: gdbarch_write_pc invalid");
2542   if (gdbarch_debug >= 2)
2543     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2544   gdbarch->write_pc (val, ptid);
2545 }
2546
2547 void
2548 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2549                       gdbarch_write_pc_ftype write_pc)
2550 {
2551   gdbarch->write_pc = write_pc;
2552 }
2553
2554 CORE_ADDR
2555 gdbarch_read_fp (struct gdbarch *gdbarch)
2556 {
2557   gdb_assert (gdbarch != NULL);
2558   if (gdbarch->read_fp == 0)
2559     internal_error (__FILE__, __LINE__,
2560                     "gdbarch: gdbarch_read_fp invalid");
2561   if (gdbarch_debug >= 2)
2562     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2563   return gdbarch->read_fp ();
2564 }
2565
2566 void
2567 set_gdbarch_read_fp (struct gdbarch *gdbarch,
2568                      gdbarch_read_fp_ftype read_fp)
2569 {
2570   gdbarch->read_fp = read_fp;
2571 }
2572
2573 CORE_ADDR
2574 gdbarch_read_sp (struct gdbarch *gdbarch)
2575 {
2576   gdb_assert (gdbarch != NULL);
2577   if (gdbarch->read_sp == 0)
2578     internal_error (__FILE__, __LINE__,
2579                     "gdbarch: gdbarch_read_sp invalid");
2580   if (gdbarch_debug >= 2)
2581     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2582   return gdbarch->read_sp ();
2583 }
2584
2585 void
2586 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2587                      gdbarch_read_sp_ftype read_sp)
2588 {
2589   gdbarch->read_sp = read_sp;
2590 }
2591
2592 void
2593 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2594 {
2595   gdb_assert (gdbarch != NULL);
2596   if (gdbarch->write_sp == 0)
2597     internal_error (__FILE__, __LINE__,
2598                     "gdbarch: gdbarch_write_sp invalid");
2599   if (gdbarch_debug >= 2)
2600     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2601   gdbarch->write_sp (val);
2602 }
2603
2604 void
2605 set_gdbarch_write_sp (struct gdbarch *gdbarch,
2606                       gdbarch_write_sp_ftype write_sp)
2607 {
2608   gdbarch->write_sp = write_sp;
2609 }
2610
2611 void
2612 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
2613 {
2614   gdb_assert (gdbarch != NULL);
2615   if (gdbarch->virtual_frame_pointer == 0)
2616     internal_error (__FILE__, __LINE__,
2617                     "gdbarch: gdbarch_virtual_frame_pointer invalid");
2618   if (gdbarch_debug >= 2)
2619     fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
2620   gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
2621 }
2622
2623 void
2624 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
2625                                    gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
2626 {
2627   gdbarch->virtual_frame_pointer = virtual_frame_pointer;
2628 }
2629
2630 int
2631 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
2632 {
2633   gdb_assert (gdbarch != NULL);
2634   return gdbarch->pseudo_register_read != 0;
2635 }
2636
2637 void
2638 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
2639 {
2640   gdb_assert (gdbarch != NULL);
2641   if (gdbarch->pseudo_register_read == 0)
2642     internal_error (__FILE__, __LINE__,
2643                     "gdbarch: gdbarch_pseudo_register_read invalid");
2644   if (gdbarch_debug >= 2)
2645     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
2646   gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
2647 }
2648
2649 void
2650 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
2651                                   gdbarch_pseudo_register_read_ftype pseudo_register_read)
2652 {
2653   gdbarch->pseudo_register_read = pseudo_register_read;
2654 }
2655
2656 int
2657 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
2658 {
2659   gdb_assert (gdbarch != NULL);
2660   return gdbarch->pseudo_register_write != 0;
2661 }
2662
2663 void
2664 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
2665 {
2666   gdb_assert (gdbarch != NULL);
2667   if (gdbarch->pseudo_register_write == 0)
2668     internal_error (__FILE__, __LINE__,
2669                     "gdbarch: gdbarch_pseudo_register_write invalid");
2670   if (gdbarch_debug >= 2)
2671     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2672   gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
2673 }
2674
2675 void
2676 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2677                                    gdbarch_pseudo_register_write_ftype pseudo_register_write)
2678 {
2679   gdbarch->pseudo_register_write = pseudo_register_write;
2680 }
2681
2682 int
2683 gdbarch_num_regs (struct gdbarch *gdbarch)
2684 {
2685   gdb_assert (gdbarch != NULL);
2686   if (gdbarch->num_regs == -1)
2687     internal_error (__FILE__, __LINE__,
2688                     "gdbarch: gdbarch_num_regs invalid");
2689   if (gdbarch_debug >= 2)
2690     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2691   return gdbarch->num_regs;
2692 }
2693
2694 void
2695 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2696                       int num_regs)
2697 {
2698   gdbarch->num_regs = num_regs;
2699 }
2700
2701 int
2702 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2703 {
2704   gdb_assert (gdbarch != NULL);
2705   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2706   if (gdbarch_debug >= 2)
2707     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2708   return gdbarch->num_pseudo_regs;
2709 }
2710
2711 void
2712 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2713                              int num_pseudo_regs)
2714 {
2715   gdbarch->num_pseudo_regs = num_pseudo_regs;
2716 }
2717
2718 int
2719 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2720 {
2721   gdb_assert (gdbarch != NULL);
2722   /* Skip verify of sp_regnum, invalid_p == 0 */
2723   if (gdbarch_debug >= 2)
2724     fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2725   return gdbarch->sp_regnum;
2726 }
2727
2728 void
2729 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2730                        int sp_regnum)
2731 {
2732   gdbarch->sp_regnum = sp_regnum;
2733 }
2734
2735 int
2736 gdbarch_fp_regnum (struct gdbarch *gdbarch)
2737 {
2738   gdb_assert (gdbarch != NULL);
2739   /* Skip verify of fp_regnum, invalid_p == 0 */
2740   if (gdbarch_debug >= 2)
2741     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
2742   return gdbarch->fp_regnum;
2743 }
2744
2745 void
2746 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
2747                        int fp_regnum)
2748 {
2749   gdbarch->fp_regnum = fp_regnum;
2750 }
2751
2752 int
2753 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2754 {
2755   gdb_assert (gdbarch != NULL);
2756   /* Skip verify of pc_regnum, invalid_p == 0 */
2757   if (gdbarch_debug >= 2)
2758     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2759   return gdbarch->pc_regnum;
2760 }
2761
2762 void
2763 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2764                        int pc_regnum)
2765 {
2766   gdbarch->pc_regnum = pc_regnum;
2767 }
2768
2769 int
2770 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2771 {
2772   gdb_assert (gdbarch != NULL);
2773   /* Skip verify of ps_regnum, invalid_p == 0 */
2774   if (gdbarch_debug >= 2)
2775     fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2776   return gdbarch->ps_regnum;
2777 }
2778
2779 void
2780 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2781                        int ps_regnum)
2782 {
2783   gdbarch->ps_regnum = ps_regnum;
2784 }
2785
2786 int
2787 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2788 {
2789   gdb_assert (gdbarch != NULL);
2790   /* Skip verify of fp0_regnum, invalid_p == 0 */
2791   if (gdbarch_debug >= 2)
2792     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2793   return gdbarch->fp0_regnum;
2794 }
2795
2796 void
2797 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2798                         int fp0_regnum)
2799 {
2800   gdbarch->fp0_regnum = fp0_regnum;
2801 }
2802
2803 int
2804 gdbarch_npc_regnum (struct gdbarch *gdbarch)
2805 {
2806   gdb_assert (gdbarch != NULL);
2807   /* Skip verify of npc_regnum, invalid_p == 0 */
2808   if (gdbarch_debug >= 2)
2809     fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
2810   return gdbarch->npc_regnum;
2811 }
2812
2813 void
2814 set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
2815                         int npc_regnum)
2816 {
2817   gdbarch->npc_regnum = npc_regnum;
2818 }
2819
2820 int
2821 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2822 {
2823   gdb_assert (gdbarch != NULL);
2824   if (gdbarch->stab_reg_to_regnum == 0)
2825     internal_error (__FILE__, __LINE__,
2826                     "gdbarch: gdbarch_stab_reg_to_regnum invalid");
2827   if (gdbarch_debug >= 2)
2828     fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2829   return gdbarch->stab_reg_to_regnum (stab_regnr);
2830 }
2831
2832 void
2833 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2834                                 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2835 {
2836   gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2837 }
2838
2839 int
2840 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2841 {
2842   gdb_assert (gdbarch != NULL);
2843   if (gdbarch->ecoff_reg_to_regnum == 0)
2844     internal_error (__FILE__, __LINE__,
2845                     "gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
2846   if (gdbarch_debug >= 2)
2847     fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2848   return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2849 }
2850
2851 void
2852 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2853                                  gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2854 {
2855   gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2856 }
2857
2858 int
2859 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2860 {
2861   gdb_assert (gdbarch != NULL);
2862   if (gdbarch->dwarf_reg_to_regnum == 0)
2863     internal_error (__FILE__, __LINE__,
2864                     "gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
2865   if (gdbarch_debug >= 2)
2866     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2867   return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2868 }
2869
2870 void
2871 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2872                                  gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2873 {
2874   gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2875 }
2876
2877 int
2878 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2879 {
2880   gdb_assert (gdbarch != NULL);
2881   if (gdbarch->sdb_reg_to_regnum == 0)
2882     internal_error (__FILE__, __LINE__,
2883                     "gdbarch: gdbarch_sdb_reg_to_regnum invalid");
2884   if (gdbarch_debug >= 2)
2885     fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2886   return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2887 }
2888
2889 void
2890 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2891                                gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2892 {
2893   gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2894 }
2895
2896 int
2897 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2898 {
2899   gdb_assert (gdbarch != NULL);
2900   if (gdbarch->dwarf2_reg_to_regnum == 0)
2901     internal_error (__FILE__, __LINE__,
2902                     "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
2903   if (gdbarch_debug >= 2)
2904     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2905   return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2906 }
2907
2908 void
2909 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2910                                   gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2911 {
2912   gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2913 }
2914
2915 const char *
2916 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2917 {
2918   gdb_assert (gdbarch != NULL);
2919   if (gdbarch->register_name == 0)
2920     internal_error (__FILE__, __LINE__,
2921                     "gdbarch: gdbarch_register_name invalid");
2922   if (gdbarch_debug >= 2)
2923     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2924   return gdbarch->register_name (regnr);
2925 }
2926
2927 void
2928 set_gdbarch_register_name (struct gdbarch *gdbarch,
2929                            gdbarch_register_name_ftype register_name)
2930 {
2931   gdbarch->register_name = register_name;
2932 }
2933
2934 int
2935 gdbarch_register_size (struct gdbarch *gdbarch)
2936 {
2937   gdb_assert (gdbarch != NULL);
2938   if (gdbarch->register_size == -1)
2939     internal_error (__FILE__, __LINE__,
2940                     "gdbarch: gdbarch_register_size invalid");
2941   if (gdbarch_debug >= 2)
2942     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
2943   return gdbarch->register_size;
2944 }
2945
2946 void
2947 set_gdbarch_register_size (struct gdbarch *gdbarch,
2948                            int register_size)
2949 {
2950   gdbarch->register_size = register_size;
2951 }
2952
2953 int
2954 gdbarch_register_bytes (struct gdbarch *gdbarch)
2955 {
2956   gdb_assert (gdbarch != NULL);
2957   if (gdbarch->register_bytes == -1)
2958     internal_error (__FILE__, __LINE__,
2959                     "gdbarch: gdbarch_register_bytes invalid");
2960   if (gdbarch_debug >= 2)
2961     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
2962   return gdbarch->register_bytes;
2963 }
2964
2965 void
2966 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
2967                             int register_bytes)
2968 {
2969   gdbarch->register_bytes = register_bytes;
2970 }
2971
2972 int
2973 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
2974 {
2975   gdb_assert (gdbarch != NULL);
2976   if (gdbarch->register_byte == 0)
2977     internal_error (__FILE__, __LINE__,
2978                     "gdbarch: gdbarch_register_byte invalid");
2979   if (gdbarch_debug >= 2)
2980     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
2981   return gdbarch->register_byte (reg_nr);
2982 }
2983
2984 void
2985 set_gdbarch_register_byte (struct gdbarch *gdbarch,
2986                            gdbarch_register_byte_ftype register_byte)
2987 {
2988   gdbarch->register_byte = register_byte;
2989 }
2990
2991 int
2992 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
2993 {
2994   gdb_assert (gdbarch != NULL);
2995   if (gdbarch->register_raw_size == 0)
2996     internal_error (__FILE__, __LINE__,
2997                     "gdbarch: gdbarch_register_raw_size invalid");
2998   if (gdbarch_debug >= 2)
2999     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
3000   return gdbarch->register_raw_size (reg_nr);
3001 }
3002
3003 void
3004 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
3005                                gdbarch_register_raw_size_ftype register_raw_size)
3006 {
3007   gdbarch->register_raw_size = register_raw_size;
3008 }
3009
3010 int
3011 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
3012 {
3013   gdb_assert (gdbarch != NULL);
3014   if (gdbarch->max_register_raw_size == -1)
3015     internal_error (__FILE__, __LINE__,
3016                     "gdbarch: gdbarch_max_register_raw_size invalid");
3017   if (gdbarch_debug >= 2)
3018     fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
3019   return gdbarch->max_register_raw_size;
3020 }
3021
3022 void
3023 set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
3024                                    int max_register_raw_size)
3025 {
3026   gdbarch->max_register_raw_size = max_register_raw_size;
3027 }
3028
3029 int
3030 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
3031 {
3032   gdb_assert (gdbarch != NULL);
3033   if (gdbarch->register_virtual_size == 0)
3034     internal_error (__FILE__, __LINE__,
3035                     "gdbarch: gdbarch_register_virtual_size invalid");
3036   if (gdbarch_debug >= 2)
3037     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
3038   return gdbarch->register_virtual_size (reg_nr);
3039 }
3040
3041 void
3042 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
3043                                    gdbarch_register_virtual_size_ftype register_virtual_size)
3044 {
3045   gdbarch->register_virtual_size = register_virtual_size;
3046 }
3047
3048 int
3049 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
3050 {
3051   gdb_assert (gdbarch != NULL);
3052   if (gdbarch->max_register_virtual_size == -1)
3053     internal_error (__FILE__, __LINE__,
3054                     "gdbarch: gdbarch_max_register_virtual_size invalid");
3055   if (gdbarch_debug >= 2)
3056     fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
3057   return gdbarch->max_register_virtual_size;
3058 }
3059
3060 void
3061 set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
3062                                        int max_register_virtual_size)
3063 {
3064   gdbarch->max_register_virtual_size = max_register_virtual_size;
3065 }
3066
3067 struct type *
3068 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
3069 {
3070   gdb_assert (gdbarch != NULL);
3071   if (gdbarch->register_virtual_type == 0)
3072     internal_error (__FILE__, __LINE__,
3073                     "gdbarch: gdbarch_register_virtual_type invalid");
3074   if (gdbarch_debug >= 2)
3075     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
3076   return gdbarch->register_virtual_type (reg_nr);
3077 }
3078
3079 void
3080 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
3081                                    gdbarch_register_virtual_type_ftype register_virtual_type)
3082 {
3083   gdbarch->register_virtual_type = register_virtual_type;
3084 }
3085
3086 int
3087 gdbarch_do_registers_info_p (struct gdbarch *gdbarch)
3088 {
3089   gdb_assert (gdbarch != NULL);
3090   return gdbarch->do_registers_info != 0;
3091 }
3092
3093 void
3094 gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
3095 {
3096   gdb_assert (gdbarch != NULL);
3097   if (gdbarch->do_registers_info == 0)
3098     internal_error (__FILE__, __LINE__,
3099                     "gdbarch: gdbarch_do_registers_info invalid");
3100   if (gdbarch_debug >= 2)
3101     fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
3102   gdbarch->do_registers_info (reg_nr, fpregs);
3103 }
3104
3105 void
3106 set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
3107                                gdbarch_do_registers_info_ftype do_registers_info)
3108 {
3109   gdbarch->do_registers_info = do_registers_info;
3110 }
3111
3112 void
3113 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
3114 {
3115   gdb_assert (gdbarch != NULL);
3116   if (gdbarch->print_registers_info == 0)
3117     internal_error (__FILE__, __LINE__,
3118                     "gdbarch: gdbarch_print_registers_info invalid");
3119   if (gdbarch_debug >= 2)
3120     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
3121   gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
3122 }
3123
3124 void
3125 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
3126                                   gdbarch_print_registers_info_ftype print_registers_info)
3127 {
3128   gdbarch->print_registers_info = print_registers_info;
3129 }
3130
3131 int
3132 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
3133 {
3134   gdb_assert (gdbarch != NULL);
3135   return gdbarch->print_float_info != 0;
3136 }
3137
3138 void
3139 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
3140 {
3141   gdb_assert (gdbarch != NULL);
3142   if (gdbarch->print_float_info == 0)
3143     internal_error (__FILE__, __LINE__,
3144                     "gdbarch: gdbarch_print_float_info invalid");
3145   if (gdbarch_debug >= 2)
3146     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
3147   gdbarch->print_float_info (gdbarch, file, frame, args);
3148 }
3149
3150 void
3151 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
3152                               gdbarch_print_float_info_ftype print_float_info)
3153 {
3154   gdbarch->print_float_info = print_float_info;
3155 }
3156
3157 int
3158 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
3159 {
3160   gdb_assert (gdbarch != NULL);
3161   return gdbarch->print_vector_info != 0;
3162 }
3163
3164 void
3165 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
3166 {
3167   gdb_assert (gdbarch != NULL);
3168   if (gdbarch->print_vector_info == 0)
3169     internal_error (__FILE__, __LINE__,
3170                     "gdbarch: gdbarch_print_vector_info invalid");
3171   if (gdbarch_debug >= 2)
3172     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
3173   gdbarch->print_vector_info (gdbarch, file, frame, args);
3174 }
3175
3176 void
3177 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
3178                                gdbarch_print_vector_info_ftype print_vector_info)
3179 {
3180   gdbarch->print_vector_info = print_vector_info;
3181 }
3182
3183 int
3184 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
3185 {
3186   gdb_assert (gdbarch != NULL);
3187   if (gdbarch->register_sim_regno == 0)
3188     internal_error (__FILE__, __LINE__,
3189                     "gdbarch: gdbarch_register_sim_regno invalid");
3190   if (gdbarch_debug >= 2)
3191     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
3192   return gdbarch->register_sim_regno (reg_nr);
3193 }
3194
3195 void
3196 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
3197                                 gdbarch_register_sim_regno_ftype register_sim_regno)
3198 {
3199   gdbarch->register_sim_regno = register_sim_regno;
3200 }
3201
3202 int
3203 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
3204 {
3205   gdb_assert (gdbarch != NULL);
3206   return gdbarch->register_bytes_ok != 0;
3207 }
3208
3209 int
3210 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
3211 {
3212   gdb_assert (gdbarch != NULL);
3213   if (gdbarch->register_bytes_ok == 0)
3214     internal_error (__FILE__, __LINE__,
3215                     "gdbarch: gdbarch_register_bytes_ok invalid");
3216   if (gdbarch_debug >= 2)
3217     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
3218   return gdbarch->register_bytes_ok (nr_bytes);
3219 }
3220
3221 void
3222 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
3223                                gdbarch_register_bytes_ok_ftype register_bytes_ok)
3224 {
3225   gdbarch->register_bytes_ok = register_bytes_ok;
3226 }
3227
3228 int
3229 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
3230 {
3231   gdb_assert (gdbarch != NULL);
3232   if (gdbarch->cannot_fetch_register == 0)
3233     internal_error (__FILE__, __LINE__,
3234                     "gdbarch: gdbarch_cannot_fetch_register invalid");
3235   if (gdbarch_debug >= 2)
3236     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
3237   return gdbarch->cannot_fetch_register (regnum);
3238 }
3239
3240 void
3241 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
3242                                    gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
3243 {
3244   gdbarch->cannot_fetch_register = cannot_fetch_register;
3245 }
3246
3247 int
3248 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
3249 {
3250   gdb_assert (gdbarch != NULL);
3251   if (gdbarch->cannot_store_register == 0)
3252     internal_error (__FILE__, __LINE__,
3253                     "gdbarch: gdbarch_cannot_store_register invalid");
3254   if (gdbarch_debug >= 2)
3255     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
3256   return gdbarch->cannot_store_register (regnum);
3257 }
3258
3259 void
3260 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
3261                                    gdbarch_cannot_store_register_ftype cannot_store_register)
3262 {
3263   gdbarch->cannot_store_register = cannot_store_register;
3264 }
3265
3266 int
3267 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
3268 {
3269   gdb_assert (gdbarch != NULL);
3270   return gdbarch->get_longjmp_target != 0;
3271 }
3272
3273 int
3274 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
3275 {
3276   gdb_assert (gdbarch != NULL);
3277   if (gdbarch->get_longjmp_target == 0)
3278     internal_error (__FILE__, __LINE__,
3279                     "gdbarch: gdbarch_get_longjmp_target invalid");
3280   if (gdbarch_debug >= 2)
3281     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
3282   return gdbarch->get_longjmp_target (pc);
3283 }
3284
3285 void
3286 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
3287                                 gdbarch_get_longjmp_target_ftype get_longjmp_target)
3288 {
3289   gdbarch->get_longjmp_target = get_longjmp_target;
3290 }
3291
3292 int
3293 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
3294 {
3295   gdb_assert (gdbarch != NULL);
3296   if (gdbarch->use_generic_dummy_frames == -1)
3297     internal_error (__FILE__, __LINE__,
3298                     "gdbarch: gdbarch_use_generic_dummy_frames invalid");
3299   if (gdbarch_debug >= 2)
3300     fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
3301   return gdbarch->use_generic_dummy_frames;
3302 }
3303
3304 void
3305 set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
3306                                       int use_generic_dummy_frames)
3307 {
3308   gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
3309 }
3310
3311 int
3312 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
3313 {
3314   gdb_assert (gdbarch != NULL);
3315   if (gdbarch->call_dummy_location == 0)
3316     internal_error (__FILE__, __LINE__,
3317                     "gdbarch: gdbarch_call_dummy_location invalid");
3318   if (gdbarch_debug >= 2)
3319     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
3320   return gdbarch->call_dummy_location;
3321 }
3322
3323 void
3324 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
3325                                  int call_dummy_location)
3326 {
3327   gdbarch->call_dummy_location = call_dummy_location;
3328 }
3329
3330 CORE_ADDR
3331 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
3332 {
3333   gdb_assert (gdbarch != NULL);
3334   if (gdbarch->call_dummy_address == 0)
3335     internal_error (__FILE__, __LINE__,
3336                     "gdbarch: gdbarch_call_dummy_address invalid");
3337   if (gdbarch_debug >= 2)
3338     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
3339   return gdbarch->call_dummy_address ();
3340 }
3341
3342 void
3343 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
3344                                 gdbarch_call_dummy_address_ftype call_dummy_address)
3345 {
3346   gdbarch->call_dummy_address = call_dummy_address;
3347 }
3348
3349 CORE_ADDR
3350 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
3351 {
3352   gdb_assert (gdbarch != NULL);
3353   if (gdbarch->call_dummy_start_offset == -1)
3354     internal_error (__FILE__, __LINE__,
3355                     "gdbarch: gdbarch_call_dummy_start_offset invalid");
3356   if (gdbarch_debug >= 2)
3357     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
3358   return gdbarch->call_dummy_start_offset;
3359 }
3360
3361 void
3362 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
3363                                      CORE_ADDR call_dummy_start_offset)
3364 {
3365   gdbarch->call_dummy_start_offset = call_dummy_start_offset;
3366 }
3367
3368 CORE_ADDR
3369 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
3370 {
3371   gdb_assert (gdbarch != NULL);
3372   if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
3373     internal_error (__FILE__, __LINE__,
3374                     "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
3375   if (gdbarch_debug >= 2)
3376     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
3377   return gdbarch->call_dummy_breakpoint_offset;
3378 }
3379
3380 void
3381 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
3382                                           CORE_ADDR call_dummy_breakpoint_offset)
3383 {
3384   gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
3385 }
3386
3387 int
3388 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
3389 {
3390   gdb_assert (gdbarch != NULL);
3391   if (gdbarch->call_dummy_breakpoint_offset_p == -1)
3392     internal_error (__FILE__, __LINE__,
3393                     "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
3394   if (gdbarch_debug >= 2)
3395     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
3396   return gdbarch->call_dummy_breakpoint_offset_p;
3397 }
3398
3399 void
3400 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
3401                                             int call_dummy_breakpoint_offset_p)
3402 {
3403   gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
3404 }
3405
3406 int
3407 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
3408 {
3409   gdb_assert (gdbarch != NULL);
3410   if (gdbarch->call_dummy_length == -1)
3411     internal_error (__FILE__, __LINE__,
3412                     "gdbarch: gdbarch_call_dummy_length invalid");
3413   if (gdbarch_debug >= 2)
3414     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
3415   return gdbarch->call_dummy_length;
3416 }
3417
3418 void
3419 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
3420                                int call_dummy_length)
3421 {
3422   gdbarch->call_dummy_length = call_dummy_length;
3423 }
3424
3425 int
3426 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
3427 {
3428   gdb_assert (gdbarch != NULL);
3429   if (gdbarch->pc_in_call_dummy == 0)
3430     internal_error (__FILE__, __LINE__,
3431                     "gdbarch: gdbarch_pc_in_call_dummy invalid");
3432   if (gdbarch_debug >= 2)
3433     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
3434   return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
3435 }
3436
3437 void
3438 set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
3439                               gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
3440 {
3441   gdbarch->pc_in_call_dummy = pc_in_call_dummy;
3442 }
3443
3444 int
3445 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
3446 {
3447   gdb_assert (gdbarch != NULL);
3448   if (gdbarch->call_dummy_p == -1)
3449     internal_error (__FILE__, __LINE__,
3450                     "gdbarch: gdbarch_call_dummy_p invalid");
3451   if (gdbarch_debug >= 2)
3452     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
3453   return gdbarch->call_dummy_p;
3454 }
3455
3456 void
3457 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
3458                           int call_dummy_p)
3459 {
3460   gdbarch->call_dummy_p = call_dummy_p;
3461 }
3462
3463 LONGEST *
3464 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
3465 {
3466   gdb_assert (gdbarch != NULL);
3467   /* Skip verify of call_dummy_words, invalid_p == 0 */
3468   if (gdbarch_debug >= 2)
3469     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
3470   return gdbarch->call_dummy_words;
3471 }
3472
3473 void
3474 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
3475                               LONGEST * call_dummy_words)
3476 {
3477   gdbarch->call_dummy_words = call_dummy_words;
3478 }
3479
3480 int
3481 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
3482 {
3483   gdb_assert (gdbarch != NULL);
3484   /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
3485   if (gdbarch_debug >= 2)
3486     fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
3487   return gdbarch->sizeof_call_dummy_words;
3488 }
3489
3490 void
3491 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
3492                                      int sizeof_call_dummy_words)
3493 {
3494   gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
3495 }
3496
3497 int
3498 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
3499 {
3500   gdb_assert (gdbarch != NULL);
3501   if (gdbarch->call_dummy_stack_adjust_p == -1)
3502     internal_error (__FILE__, __LINE__,
3503                     "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
3504   if (gdbarch_debug >= 2)
3505     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
3506   return gdbarch->call_dummy_stack_adjust_p;
3507 }
3508
3509 void
3510 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
3511                                        int call_dummy_stack_adjust_p)
3512 {
3513   gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
3514 }
3515
3516 int
3517 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
3518 {
3519   gdb_assert (gdbarch != NULL);
3520   if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
3521     internal_error (__FILE__, __LINE__,
3522                     "gdbarch: gdbarch_call_dummy_stack_adjust invalid");
3523   if (gdbarch_debug >= 2)
3524     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
3525   return gdbarch->call_dummy_stack_adjust;
3526 }
3527
3528 void
3529 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
3530                                      int call_dummy_stack_adjust)
3531 {
3532   gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
3533 }
3534
3535 void
3536 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)
3537 {
3538   gdb_assert (gdbarch != NULL);
3539   if (gdbarch->fix_call_dummy == 0)
3540     internal_error (__FILE__, __LINE__,
3541                     "gdbarch: gdbarch_fix_call_dummy invalid");
3542   if (gdbarch_debug >= 2)
3543     fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
3544   gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
3545 }
3546
3547 void
3548 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
3549                             gdbarch_fix_call_dummy_ftype fix_call_dummy)
3550 {
3551   gdbarch->fix_call_dummy = fix_call_dummy;
3552 }
3553
3554 void
3555 gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
3556 {
3557   gdb_assert (gdbarch != NULL);
3558   if (gdbarch->init_frame_pc_first == 0)
3559     internal_error (__FILE__, __LINE__,
3560                     "gdbarch: gdbarch_init_frame_pc_first invalid");
3561   if (gdbarch_debug >= 2)
3562     fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n");
3563   gdbarch->init_frame_pc_first (fromleaf, prev);
3564 }
3565
3566 void
3567 set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
3568                                  gdbarch_init_frame_pc_first_ftype init_frame_pc_first)
3569 {
3570   gdbarch->init_frame_pc_first = init_frame_pc_first;
3571 }
3572
3573 void
3574 gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
3575 {
3576   gdb_assert (gdbarch != NULL);
3577   if (gdbarch->init_frame_pc == 0)
3578     internal_error (__FILE__, __LINE__,
3579                     "gdbarch: gdbarch_init_frame_pc invalid");
3580   if (gdbarch_debug >= 2)
3581     fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n");
3582   gdbarch->init_frame_pc (fromleaf, prev);
3583 }
3584
3585 void
3586 set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
3587                            gdbarch_init_frame_pc_ftype init_frame_pc)
3588 {
3589   gdbarch->init_frame_pc = init_frame_pc;
3590 }
3591
3592 int
3593 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
3594 {
3595   gdb_assert (gdbarch != NULL);
3596   if (gdbarch_debug >= 2)
3597     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
3598   return gdbarch->believe_pcc_promotion;
3599 }
3600
3601 void
3602 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
3603                                    int believe_pcc_promotion)
3604 {
3605   gdbarch->believe_pcc_promotion = believe_pcc_promotion;
3606 }
3607
3608 int
3609 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
3610 {
3611   gdb_assert (gdbarch != NULL);
3612   if (gdbarch_debug >= 2)
3613     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
3614   return gdbarch->believe_pcc_promotion_type;
3615 }
3616
3617 void
3618 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
3619                                         int believe_pcc_promotion_type)
3620 {
3621   gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
3622 }
3623
3624 int
3625 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
3626 {
3627   gdb_assert (gdbarch != NULL);
3628   if (gdbarch->coerce_float_to_double == 0)
3629     internal_error (__FILE__, __LINE__,
3630                     "gdbarch: gdbarch_coerce_float_to_double invalid");
3631   if (gdbarch_debug >= 2)
3632     fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
3633   return gdbarch->coerce_float_to_double (formal, actual);
3634 }
3635
3636 void
3637 set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
3638                                     gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
3639 {
3640   gdbarch->coerce_float_to_double = coerce_float_to_double;
3641 }
3642
3643 void
3644 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)
3645 {
3646   gdb_assert (gdbarch != NULL);
3647   if (gdbarch->get_saved_register == 0)
3648     internal_error (__FILE__, __LINE__,
3649                     "gdbarch: gdbarch_get_saved_register invalid");
3650   if (gdbarch_debug >= 2)
3651     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
3652   gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
3653 }
3654
3655 void
3656 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
3657                                 gdbarch_get_saved_register_ftype get_saved_register)
3658 {
3659   gdbarch->get_saved_register = get_saved_register;
3660 }
3661
3662 int
3663 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
3664 {
3665   gdb_assert (gdbarch != NULL);
3666   if (gdbarch->register_convertible == 0)
3667     internal_error (__FILE__, __LINE__,
3668                     "gdbarch: gdbarch_register_convertible invalid");
3669   if (gdbarch_debug >= 2)
3670     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
3671   return gdbarch->register_convertible (nr);
3672 }
3673
3674 void
3675 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
3676                                   gdbarch_register_convertible_ftype register_convertible)
3677 {
3678   gdbarch->register_convertible = register_convertible;
3679 }
3680
3681 void
3682 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
3683 {
3684   gdb_assert (gdbarch != NULL);
3685   if (gdbarch->register_convert_to_virtual == 0)
3686     internal_error (__FILE__, __LINE__,
3687                     "gdbarch: gdbarch_register_convert_to_virtual invalid");
3688   if (gdbarch_debug >= 2)
3689     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
3690   gdbarch->register_convert_to_virtual (regnum, type, from, to);
3691 }
3692
3693 void
3694 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
3695                                          gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
3696 {
3697   gdbarch->register_convert_to_virtual = register_convert_to_virtual;
3698 }
3699
3700 void
3701 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
3702 {
3703   gdb_assert (gdbarch != NULL);
3704   if (gdbarch->register_convert_to_raw == 0)
3705     internal_error (__FILE__, __LINE__,
3706                     "gdbarch: gdbarch_register_convert_to_raw invalid");
3707   if (gdbarch_debug >= 2)
3708     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
3709   gdbarch->register_convert_to_raw (type, regnum, from, to);
3710 }
3711
3712 void
3713 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
3714                                      gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
3715 {
3716   gdbarch->register_convert_to_raw = register_convert_to_raw;
3717 }
3718
3719 int
3720 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum)
3721 {
3722   gdb_assert (gdbarch != NULL);
3723   if (gdbarch->convert_register_p == 0)
3724     internal_error (__FILE__, __LINE__,
3725                     "gdbarch: gdbarch_convert_register_p invalid");
3726   if (gdbarch_debug >= 2)
3727     fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
3728   return gdbarch->convert_register_p (regnum);
3729 }
3730
3731 void
3732 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
3733                                 gdbarch_convert_register_p_ftype convert_register_p)
3734 {
3735   gdbarch->convert_register_p = convert_register_p;
3736 }
3737
3738 void
3739 gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
3740 {
3741   gdb_assert (gdbarch != NULL);
3742   if (gdbarch->register_to_value == 0)
3743     internal_error (__FILE__, __LINE__,
3744                     "gdbarch: gdbarch_register_to_value invalid");
3745   if (gdbarch_debug >= 2)
3746     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
3747   gdbarch->register_to_value (regnum, type, from, to);
3748 }
3749
3750 void
3751 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
3752                                gdbarch_register_to_value_ftype register_to_value)
3753 {
3754   gdbarch->register_to_value = register_to_value;
3755 }
3756
3757 void
3758 gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
3759 {
3760   gdb_assert (gdbarch != NULL);
3761   if (gdbarch->value_to_register == 0)
3762     internal_error (__FILE__, __LINE__,
3763                     "gdbarch: gdbarch_value_to_register invalid");
3764   if (gdbarch_debug >= 2)
3765     fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
3766   gdbarch->value_to_register (type, regnum, from, to);
3767 }
3768
3769 void
3770 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
3771                                gdbarch_value_to_register_ftype value_to_register)
3772 {
3773   gdbarch->value_to_register = value_to_register;
3774 }
3775
3776 CORE_ADDR
3777 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3778 {
3779   gdb_assert (gdbarch != NULL);
3780   if (gdbarch->pointer_to_address == 0)
3781     internal_error (__FILE__, __LINE__,
3782                     "gdbarch: gdbarch_pointer_to_address invalid");
3783   if (gdbarch_debug >= 2)
3784     fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
3785   return gdbarch->pointer_to_address (type, buf);
3786 }
3787
3788 void
3789 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
3790                                 gdbarch_pointer_to_address_ftype pointer_to_address)
3791 {
3792   gdbarch->pointer_to_address = pointer_to_address;
3793 }
3794
3795 void
3796 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
3797 {
3798   gdb_assert (gdbarch != NULL);
3799   if (gdbarch->address_to_pointer == 0)
3800     internal_error (__FILE__, __LINE__,
3801                     "gdbarch: gdbarch_address_to_pointer invalid");
3802   if (gdbarch_debug >= 2)
3803     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
3804   gdbarch->address_to_pointer (type, buf, addr);
3805 }
3806
3807 void
3808 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
3809                                 gdbarch_address_to_pointer_ftype address_to_pointer)
3810 {
3811   gdbarch->address_to_pointer = address_to_pointer;
3812 }
3813
3814 int
3815 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
3816 {
3817   gdb_assert (gdbarch != NULL);
3818   return gdbarch->integer_to_address != 0;
3819 }
3820
3821 CORE_ADDR
3822 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3823 {
3824   gdb_assert (gdbarch != NULL);
3825   if (gdbarch->integer_to_address == 0)
3826     internal_error (__FILE__, __LINE__,
3827                     "gdbarch: gdbarch_integer_to_address invalid");
3828   if (gdbarch_debug >= 2)
3829     fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
3830   return gdbarch->integer_to_address (type, buf);
3831 }
3832
3833 void
3834 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
3835                                 gdbarch_integer_to_address_ftype integer_to_address)
3836 {
3837   gdbarch->integer_to_address = integer_to_address;
3838 }
3839
3840 int
3841 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
3842 {
3843   gdb_assert (gdbarch != NULL);
3844   if (gdbarch->return_value_on_stack == 0)
3845     internal_error (__FILE__, __LINE__,
3846                     "gdbarch: gdbarch_return_value_on_stack invalid");
3847   if (gdbarch_debug >= 2)
3848     fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
3849   return gdbarch->return_value_on_stack (type);
3850 }
3851
3852 void
3853 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
3854                                    gdbarch_return_value_on_stack_ftype return_value_on_stack)
3855 {
3856   gdbarch->return_value_on_stack = return_value_on_stack;
3857 }
3858
3859 CORE_ADDR
3860 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
3861 {
3862   gdb_assert (gdbarch != NULL);
3863   if (gdbarch->push_arguments == 0)
3864     internal_error (__FILE__, __LINE__,
3865                     "gdbarch: gdbarch_push_arguments invalid");
3866   if (gdbarch_debug >= 2)
3867     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
3868   return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
3869 }
3870
3871 void
3872 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
3873                             gdbarch_push_arguments_ftype push_arguments)
3874 {
3875   gdbarch->push_arguments = push_arguments;
3876 }
3877
3878 void
3879 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
3880 {
3881   gdb_assert (gdbarch != NULL);
3882   if (gdbarch->push_dummy_frame == 0)
3883     internal_error (__FILE__, __LINE__,
3884                     "gdbarch: gdbarch_push_dummy_frame invalid");
3885   if (gdbarch_debug >= 2)
3886     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
3887   gdbarch->push_dummy_frame ();
3888 }
3889
3890 void
3891 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
3892                               gdbarch_push_dummy_frame_ftype push_dummy_frame)
3893 {
3894   gdbarch->push_dummy_frame = push_dummy_frame;
3895 }
3896
3897 int
3898 gdbarch_push_return_address_p (struct gdbarch *gdbarch)
3899 {
3900   gdb_assert (gdbarch != NULL);
3901   return gdbarch->push_return_address != 0;
3902 }
3903
3904 CORE_ADDR
3905 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
3906 {
3907   gdb_assert (gdbarch != NULL);
3908   if (gdbarch->push_return_address == 0)
3909     internal_error (__FILE__, __LINE__,
3910                     "gdbarch: gdbarch_push_return_address invalid");
3911   if (gdbarch_debug >= 2)
3912     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
3913   return gdbarch->push_return_address (pc, sp);
3914 }
3915
3916 void
3917 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
3918                                  gdbarch_push_return_address_ftype push_return_address)
3919 {
3920   gdbarch->push_return_address = push_return_address;
3921 }
3922
3923 void
3924 gdbarch_pop_frame (struct gdbarch *gdbarch)
3925 {
3926   gdb_assert (gdbarch != NULL);
3927   if (gdbarch->pop_frame == 0)
3928     internal_error (__FILE__, __LINE__,
3929                     "gdbarch: gdbarch_pop_frame invalid");
3930   if (gdbarch_debug >= 2)
3931     fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
3932   gdbarch->pop_frame ();
3933 }
3934
3935 void
3936 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
3937                        gdbarch_pop_frame_ftype pop_frame)
3938 {
3939   gdbarch->pop_frame = pop_frame;
3940 }
3941
3942 void
3943 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
3944 {
3945   gdb_assert (gdbarch != NULL);
3946   if (gdbarch->store_struct_return == 0)
3947     internal_error (__FILE__, __LINE__,
3948                     "gdbarch: gdbarch_store_struct_return invalid");
3949   if (gdbarch_debug >= 2)
3950     fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3951   gdbarch->store_struct_return (addr, sp);
3952 }
3953
3954 void
3955 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3956                                  gdbarch_store_struct_return_ftype store_struct_return)
3957 {
3958   gdbarch->store_struct_return = store_struct_return;
3959 }
3960
3961 void
3962 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
3963 {
3964   gdb_assert (gdbarch != NULL);
3965   if (gdbarch->extract_return_value == 0)
3966     internal_error (__FILE__, __LINE__,
3967                     "gdbarch: gdbarch_extract_return_value invalid");
3968   if (gdbarch_debug >= 2)
3969     fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3970   gdbarch->extract_return_value (type, regcache, valbuf);
3971 }
3972
3973 void
3974 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3975                                   gdbarch_extract_return_value_ftype extract_return_value)
3976 {
3977   gdbarch->extract_return_value = extract_return_value;
3978 }
3979
3980 void
3981 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
3982 {
3983   gdb_assert (gdbarch != NULL);
3984   if (gdbarch->store_return_value == 0)
3985     internal_error (__FILE__, __LINE__,
3986                     "gdbarch: gdbarch_store_return_value invalid");
3987   if (gdbarch_debug >= 2)
3988     fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3989   gdbarch->store_return_value (type, regcache, valbuf);
3990 }
3991
3992 void
3993 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3994                                 gdbarch_store_return_value_ftype store_return_value)
3995 {
3996   gdbarch->store_return_value = store_return_value;
3997 }
3998
3999 void
4000 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
4001 {
4002   gdb_assert (gdbarch != NULL);
4003   if (gdbarch->deprecated_extract_return_value == 0)
4004     internal_error (__FILE__, __LINE__,
4005                     "gdbarch: gdbarch_deprecated_extract_return_value invalid");
4006   if (gdbarch_debug >= 2)
4007     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
4008   gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
4009 }
4010
4011 void
4012 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
4013                                              gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
4014 {
4015   gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
4016 }
4017
4018 void
4019 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
4020 {
4021   gdb_assert (gdbarch != NULL);
4022   if (gdbarch->deprecated_store_return_value == 0)
4023     internal_error (__FILE__, __LINE__,
4024                     "gdbarch: gdbarch_deprecated_store_return_value invalid");
4025   if (gdbarch_debug >= 2)
4026     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
4027   gdbarch->deprecated_store_return_value (type, valbuf);
4028 }
4029
4030 void
4031 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
4032                                            gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
4033 {
4034   gdbarch->deprecated_store_return_value = deprecated_store_return_value;
4035 }
4036
4037 int
4038 gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
4039 {
4040   gdb_assert (gdbarch != NULL);
4041   return gdbarch->extract_struct_value_address != 0;
4042 }
4043
4044 CORE_ADDR
4045 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
4046 {
4047   gdb_assert (gdbarch != NULL);
4048   if (gdbarch->extract_struct_value_address == 0)
4049     internal_error (__FILE__, __LINE__,
4050                     "gdbarch: gdbarch_extract_struct_value_address invalid");
4051   if (gdbarch_debug >= 2)
4052     fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
4053   return gdbarch->extract_struct_value_address (regcache);
4054 }
4055
4056 void
4057 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
4058                                           gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
4059 {
4060   gdbarch->extract_struct_value_address = extract_struct_value_address;
4061 }
4062
4063 int
4064 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
4065 {
4066   gdb_assert (gdbarch != NULL);
4067   return gdbarch->deprecated_extract_struct_value_address != 0;
4068 }
4069
4070 CORE_ADDR
4071 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
4072 {
4073   gdb_assert (gdbarch != NULL);
4074   if (gdbarch->deprecated_extract_struct_value_address == 0)
4075     internal_error (__FILE__, __LINE__,
4076                     "gdbarch: gdbarch_deprecated_extract_struct_value_address invalid");
4077   if (gdbarch_debug >= 2)
4078     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
4079   return gdbarch->deprecated_extract_struct_value_address (regbuf);
4080 }
4081
4082 void
4083 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
4084                                                      gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
4085 {
4086   gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
4087 }
4088
4089 int
4090 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
4091 {
4092   gdb_assert (gdbarch != NULL);
4093   if (gdbarch->use_struct_convention == 0)
4094     internal_error (__FILE__, __LINE__,
4095                     "gdbarch: gdbarch_use_struct_convention invalid");
4096   if (gdbarch_debug >= 2)
4097     fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
4098   return gdbarch->use_struct_convention (gcc_p, value_type);
4099 }
4100
4101 void
4102 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
4103                                    gdbarch_use_struct_convention_ftype use_struct_convention)
4104 {
4105   gdbarch->use_struct_convention = use_struct_convention;
4106 }
4107
4108 void
4109 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
4110 {
4111   gdb_assert (gdbarch != NULL);
4112   if (gdbarch->frame_init_saved_regs == 0)
4113     internal_error (__FILE__, __LINE__,
4114                     "gdbarch: gdbarch_frame_init_saved_regs invalid");
4115   if (gdbarch_debug >= 2)
4116     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
4117   gdbarch->frame_init_saved_regs (frame);
4118 }
4119
4120 void
4121 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
4122                                    gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
4123 {
4124   gdbarch->frame_init_saved_regs = frame_init_saved_regs;
4125 }
4126
4127 int
4128 gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
4129 {
4130   gdb_assert (gdbarch != NULL);
4131   return gdbarch->init_extra_frame_info != 0;
4132 }
4133
4134 void
4135 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
4136 {
4137   gdb_assert (gdbarch != NULL);
4138   if (gdbarch->init_extra_frame_info == 0)
4139     internal_error (__FILE__, __LINE__,
4140                     "gdbarch: gdbarch_init_extra_frame_info invalid");
4141   if (gdbarch_debug >= 2)
4142     fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
4143   gdbarch->init_extra_frame_info (fromleaf, frame);
4144 }
4145
4146 void
4147 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
4148                                    gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
4149 {
4150   gdbarch->init_extra_frame_info = init_extra_frame_info;
4151 }
4152
4153 CORE_ADDR
4154 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
4155 {
4156   gdb_assert (gdbarch != NULL);
4157   if (gdbarch->skip_prologue == 0)
4158     internal_error (__FILE__, __LINE__,
4159                     "gdbarch: gdbarch_skip_prologue invalid");
4160   if (gdbarch_debug >= 2)
4161     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
4162   return gdbarch->skip_prologue (ip);
4163 }
4164
4165 void
4166 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
4167                            gdbarch_skip_prologue_ftype skip_prologue)
4168 {
4169   gdbarch->skip_prologue = skip_prologue;
4170 }
4171
4172 int
4173 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
4174 {
4175   gdb_assert (gdbarch != NULL);
4176   if (gdbarch->prologue_frameless_p == 0)
4177     internal_error (__FILE__, __LINE__,
4178                     "gdbarch: gdbarch_prologue_frameless_p invalid");
4179   if (gdbarch_debug >= 2)
4180     fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
4181   return gdbarch->prologue_frameless_p (ip);
4182 }
4183
4184 void
4185 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
4186                                   gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
4187 {
4188   gdbarch->prologue_frameless_p = prologue_frameless_p;
4189 }
4190
4191 int
4192 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
4193 {
4194   gdb_assert (gdbarch != NULL);
4195   if (gdbarch->inner_than == 0)
4196     internal_error (__FILE__, __LINE__,
4197                     "gdbarch: gdbarch_inner_than invalid");
4198   if (gdbarch_debug >= 2)
4199     fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
4200   return gdbarch->inner_than (lhs, rhs);
4201 }
4202
4203 void
4204 set_gdbarch_inner_than (struct gdbarch *gdbarch,
4205                         gdbarch_inner_than_ftype inner_than)
4206 {
4207   gdbarch->inner_than = inner_than;
4208 }
4209
4210 const unsigned char *
4211 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
4212 {
4213   gdb_assert (gdbarch != NULL);
4214   if (gdbarch->breakpoint_from_pc == 0)
4215     internal_error (__FILE__, __LINE__,
4216                     "gdbarch: gdbarch_breakpoint_from_pc invalid");
4217   if (gdbarch_debug >= 2)
4218     fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
4219   return gdbarch->breakpoint_from_pc (pcptr, lenptr);
4220 }
4221
4222 void
4223 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
4224                                 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
4225 {
4226   gdbarch->breakpoint_from_pc = breakpoint_from_pc;
4227 }
4228
4229 int
4230 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
4231 {
4232   gdb_assert (gdbarch != NULL);
4233   if (gdbarch->memory_insert_breakpoint == 0)
4234     internal_error (__FILE__, __LINE__,
4235                     "gdbarch: gdbarch_memory_insert_breakpoint invalid");
4236   if (gdbarch_debug >= 2)
4237     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
4238   return gdbarch->memory_insert_breakpoint (addr, contents_cache);
4239 }
4240
4241 void
4242 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
4243                                       gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
4244 {
4245   gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
4246 }
4247
4248 int
4249 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
4250 {
4251   gdb_assert (gdbarch != NULL);
4252   if (gdbarch->memory_remove_breakpoint == 0)
4253     internal_error (__FILE__, __LINE__,
4254                     "gdbarch: gdbarch_memory_remove_breakpoint invalid");
4255   if (gdbarch_debug >= 2)
4256     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
4257   return gdbarch->memory_remove_breakpoint (addr, contents_cache);
4258 }
4259
4260 void
4261 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
4262                                       gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
4263 {
4264   gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
4265 }
4266
4267 CORE_ADDR
4268 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
4269 {
4270   gdb_assert (gdbarch != NULL);
4271   if (gdbarch->decr_pc_after_break == -1)
4272     internal_error (__FILE__, __LINE__,
4273                     "gdbarch: gdbarch_decr_pc_after_break invalid");
4274   if (gdbarch_debug >= 2)
4275     fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
4276   return gdbarch->decr_pc_after_break;
4277 }
4278
4279 void
4280 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
4281                                  CORE_ADDR decr_pc_after_break)
4282 {
4283   gdbarch->decr_pc_after_break = decr_pc_after_break;
4284 }
4285
4286 int
4287 gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
4288 {
4289   gdb_assert (gdbarch != NULL);
4290   if (gdbarch->prepare_to_proceed == 0)
4291     internal_error (__FILE__, __LINE__,
4292                     "gdbarch: gdbarch_prepare_to_proceed invalid");
4293   if (gdbarch_debug >= 2)
4294     fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n");
4295   return gdbarch->prepare_to_proceed (select_it);
4296 }
4297
4298 void
4299 set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
4300                                 gdbarch_prepare_to_proceed_ftype prepare_to_proceed)
4301 {
4302   gdbarch->prepare_to_proceed = prepare_to_proceed;
4303 }
4304
4305 CORE_ADDR
4306 gdbarch_function_start_offset (struct gdbarch *gdbarch)
4307 {
4308   gdb_assert (gdbarch != NULL);
4309   if (gdbarch->function_start_offset == -1)
4310     internal_error (__FILE__, __LINE__,
4311                     "gdbarch: gdbarch_function_start_offset invalid");
4312   if (gdbarch_debug >= 2)
4313     fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
4314   return gdbarch->function_start_offset;
4315 }
4316
4317 void
4318 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
4319                                    CORE_ADDR function_start_offset)
4320 {
4321   gdbarch->function_start_offset = function_start_offset;
4322 }
4323
4324 void
4325 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
4326 {
4327   gdb_assert (gdbarch != NULL);
4328   if (gdbarch->remote_translate_xfer_address == 0)
4329     internal_error (__FILE__, __LINE__,
4330                     "gdbarch: gdbarch_remote_translate_xfer_address invalid");
4331   if (gdbarch_debug >= 2)
4332     fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
4333   gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
4334 }
4335
4336 void
4337 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
4338                                            gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
4339 {
4340   gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
4341 }
4342
4343 CORE_ADDR
4344 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
4345 {
4346   gdb_assert (gdbarch != NULL);
4347   if (gdbarch->frame_args_skip == -1)
4348     internal_error (__FILE__, __LINE__,
4349                     "gdbarch: gdbarch_frame_args_skip invalid");
4350   if (gdbarch_debug >= 2)
4351     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
4352   return gdbarch->frame_args_skip;
4353 }
4354
4355 void
4356 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
4357                              CORE_ADDR frame_args_skip)
4358 {
4359   gdbarch->frame_args_skip = frame_args_skip;
4360 }
4361
4362 int
4363 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
4364 {
4365   gdb_assert (gdbarch != NULL);
4366   if (gdbarch->frameless_function_invocation == 0)
4367     internal_error (__FILE__, __LINE__,
4368                     "gdbarch: gdbarch_frameless_function_invocation invalid");
4369   if (gdbarch_debug >= 2)
4370     fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
4371   return gdbarch->frameless_function_invocation (fi);
4372 }
4373
4374 void
4375 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
4376                                            gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
4377 {
4378   gdbarch->frameless_function_invocation = frameless_function_invocation;
4379 }
4380
4381 CORE_ADDR
4382 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
4383 {
4384   gdb_assert (gdbarch != NULL);
4385   if (gdbarch->frame_chain == 0)
4386     internal_error (__FILE__, __LINE__,
4387                     "gdbarch: gdbarch_frame_chain invalid");
4388   if (gdbarch_debug >= 2)
4389     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
4390   return gdbarch->frame_chain (frame);
4391 }
4392
4393 void
4394 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
4395                          gdbarch_frame_chain_ftype frame_chain)
4396 {
4397   gdbarch->frame_chain = frame_chain;
4398 }
4399
4400 int
4401 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
4402 {
4403   gdb_assert (gdbarch != NULL);
4404   if (gdbarch->frame_chain_valid == 0)
4405     internal_error (__FILE__, __LINE__,
4406                     "gdbarch: gdbarch_frame_chain_valid invalid");
4407   if (gdbarch_debug >= 2)
4408     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
4409   return gdbarch->frame_chain_valid (chain, thisframe);
4410 }
4411
4412 void
4413 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
4414                                gdbarch_frame_chain_valid_ftype frame_chain_valid)
4415 {
4416   gdbarch->frame_chain_valid = frame_chain_valid;
4417 }
4418
4419 CORE_ADDR
4420 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
4421 {
4422   gdb_assert (gdbarch != NULL);
4423   if (gdbarch->frame_saved_pc == 0)
4424     internal_error (__FILE__, __LINE__,
4425                     "gdbarch: gdbarch_frame_saved_pc invalid");
4426   if (gdbarch_debug >= 2)
4427     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
4428   return gdbarch->frame_saved_pc (fi);
4429 }
4430
4431 void
4432 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
4433                             gdbarch_frame_saved_pc_ftype frame_saved_pc)
4434 {
4435   gdbarch->frame_saved_pc = frame_saved_pc;
4436 }
4437
4438 CORE_ADDR
4439 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
4440 {
4441   gdb_assert (gdbarch != NULL);
4442   if (gdbarch->frame_args_address == 0)
4443     internal_error (__FILE__, __LINE__,
4444                     "gdbarch: gdbarch_frame_args_address invalid");
4445   if (gdbarch_debug >= 2)
4446     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
4447   return gdbarch->frame_args_address (fi);
4448 }
4449
4450 void
4451 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
4452                                 gdbarch_frame_args_address_ftype frame_args_address)
4453 {
4454   gdbarch->frame_args_address = frame_args_address;
4455 }
4456
4457 CORE_ADDR
4458 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
4459 {
4460   gdb_assert (gdbarch != NULL);
4461   if (gdbarch->frame_locals_address == 0)
4462     internal_error (__FILE__, __LINE__,
4463                     "gdbarch: gdbarch_frame_locals_address invalid");
4464   if (gdbarch_debug >= 2)
4465     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
4466   return gdbarch->frame_locals_address (fi);
4467 }
4468
4469 void
4470 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
4471                                   gdbarch_frame_locals_address_ftype frame_locals_address)
4472 {
4473   gdbarch->frame_locals_address = frame_locals_address;
4474 }
4475
4476 CORE_ADDR
4477 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
4478 {
4479   gdb_assert (gdbarch != NULL);
4480   if (gdbarch->saved_pc_after_call == 0)
4481     internal_error (__FILE__, __LINE__,
4482                     "gdbarch: gdbarch_saved_pc_after_call invalid");
4483   if (gdbarch_debug >= 2)
4484     fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
4485   return gdbarch->saved_pc_after_call (frame);
4486 }
4487
4488 void
4489 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
4490                                  gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
4491 {
4492   gdbarch->saved_pc_after_call = saved_pc_after_call;
4493 }
4494
4495 int
4496 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
4497 {
4498   gdb_assert (gdbarch != NULL);
4499   if (gdbarch->frame_num_args == 0)
4500     internal_error (__FILE__, __LINE__,
4501                     "gdbarch: gdbarch_frame_num_args invalid");
4502   if (gdbarch_debug >= 2)
4503     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
4504   return gdbarch->frame_num_args (frame);
4505 }
4506
4507 void
4508 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
4509                             gdbarch_frame_num_args_ftype frame_num_args)
4510 {
4511   gdbarch->frame_num_args = frame_num_args;
4512 }
4513
4514 int
4515 gdbarch_stack_align_p (struct gdbarch *gdbarch)
4516 {
4517   gdb_assert (gdbarch != NULL);
4518   return gdbarch->stack_align != 0;
4519 }
4520
4521 CORE_ADDR
4522 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
4523 {
4524   gdb_assert (gdbarch != NULL);
4525   if (gdbarch->stack_align == 0)
4526     internal_error (__FILE__, __LINE__,
4527                     "gdbarch: gdbarch_stack_align invalid");
4528   if (gdbarch_debug >= 2)
4529     fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
4530   return gdbarch->stack_align (sp);
4531 }
4532
4533 void
4534 set_gdbarch_stack_align (struct gdbarch *gdbarch,
4535                          gdbarch_stack_align_ftype stack_align)
4536 {
4537   gdbarch->stack_align = stack_align;
4538 }
4539
4540 int
4541 gdbarch_frame_align_p (struct gdbarch *gdbarch)
4542 {
4543   gdb_assert (gdbarch != NULL);
4544   return gdbarch->frame_align != 0;
4545 }
4546
4547 CORE_ADDR
4548 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
4549 {
4550   gdb_assert (gdbarch != NULL);
4551   if (gdbarch->frame_align == 0)
4552     internal_error (__FILE__, __LINE__,
4553                     "gdbarch: gdbarch_frame_align invalid");
4554   if (gdbarch_debug >= 2)
4555     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
4556   return gdbarch->frame_align (gdbarch, address);
4557 }
4558
4559 void
4560 set_gdbarch_frame_align (struct gdbarch *gdbarch,
4561                          gdbarch_frame_align_ftype frame_align)
4562 {
4563   gdbarch->frame_align = frame_align;
4564 }
4565
4566 int
4567 gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
4568 {
4569   gdb_assert (gdbarch != NULL);
4570   /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
4571   if (gdbarch_debug >= 2)
4572     fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
4573   return gdbarch->extra_stack_alignment_needed;
4574 }
4575
4576 void
4577 set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
4578                                           int extra_stack_alignment_needed)
4579 {
4580   gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
4581 }
4582
4583 int
4584 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
4585 {
4586   gdb_assert (gdbarch != NULL);
4587   return gdbarch->reg_struct_has_addr != 0;
4588 }
4589
4590 int
4591 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
4592 {
4593   gdb_assert (gdbarch != NULL);
4594   if (gdbarch->reg_struct_has_addr == 0)
4595     internal_error (__FILE__, __LINE__,
4596                     "gdbarch: gdbarch_reg_struct_has_addr invalid");
4597   if (gdbarch_debug >= 2)
4598     fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
4599   return gdbarch->reg_struct_has_addr (gcc_p, type);
4600 }
4601
4602 void
4603 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
4604                                  gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
4605 {
4606   gdbarch->reg_struct_has_addr = reg_struct_has_addr;
4607 }
4608
4609 int
4610 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
4611 {
4612   gdb_assert (gdbarch != NULL);
4613   return gdbarch->save_dummy_frame_tos != 0;
4614 }
4615
4616 void
4617 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
4618 {
4619   gdb_assert (gdbarch != NULL);
4620   if (gdbarch->save_dummy_frame_tos == 0)
4621     internal_error (__FILE__, __LINE__,
4622                     "gdbarch: gdbarch_save_dummy_frame_tos invalid");
4623   if (gdbarch_debug >= 2)
4624     fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
4625   gdbarch->save_dummy_frame_tos (sp);
4626 }
4627
4628 void
4629 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
4630                                   gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
4631 {
4632   gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
4633 }
4634
4635 int
4636 gdbarch_parm_boundary (struct gdbarch *gdbarch)
4637 {
4638   gdb_assert (gdbarch != NULL);
4639   if (gdbarch_debug >= 2)
4640     fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
4641   return gdbarch->parm_boundary;
4642 }
4643
4644 void
4645 set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
4646                            int parm_boundary)
4647 {
4648   gdbarch->parm_boundary = parm_boundary;
4649 }
4650
4651 const struct floatformat *
4652 gdbarch_float_format (struct gdbarch *gdbarch)
4653 {
4654   gdb_assert (gdbarch != NULL);
4655   if (gdbarch_debug >= 2)
4656     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
4657   return gdbarch->float_format;
4658 }
4659
4660 void
4661 set_gdbarch_float_format (struct gdbarch *gdbarch,
4662                           const struct floatformat * float_format)
4663 {
4664   gdbarch->float_format = float_format;
4665 }
4666
4667 const struct floatformat *
4668 gdbarch_double_format (struct gdbarch *gdbarch)
4669 {
4670   gdb_assert (gdbarch != NULL);
4671   if (gdbarch_debug >= 2)
4672     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
4673   return gdbarch->double_format;
4674 }
4675
4676 void
4677 set_gdbarch_double_format (struct gdbarch *gdbarch,
4678                            const struct floatformat * double_format)
4679 {
4680   gdbarch->double_format = double_format;
4681 }
4682
4683 const struct floatformat *
4684 gdbarch_long_double_format (struct gdbarch *gdbarch)
4685 {
4686   gdb_assert (gdbarch != NULL);
4687   if (gdbarch_debug >= 2)
4688     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
4689   return gdbarch->long_double_format;
4690 }
4691
4692 void
4693 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
4694                                 const struct floatformat * long_double_format)
4695 {
4696   gdbarch->long_double_format = long_double_format;
4697 }
4698
4699 CORE_ADDR
4700 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
4701 {
4702   gdb_assert (gdbarch != NULL);
4703   if (gdbarch->convert_from_func_ptr_addr == 0)
4704     internal_error (__FILE__, __LINE__,
4705                     "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
4706   if (gdbarch_debug >= 2)
4707     fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
4708   return gdbarch->convert_from_func_ptr_addr (addr);
4709 }
4710
4711 void
4712 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
4713                                         gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
4714 {
4715   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
4716 }
4717
4718 CORE_ADDR
4719 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
4720 {
4721   gdb_assert (gdbarch != NULL);
4722   if (gdbarch->addr_bits_remove == 0)
4723     internal_error (__FILE__, __LINE__,
4724                     "gdbarch: gdbarch_addr_bits_remove invalid");
4725   if (gdbarch_debug >= 2)
4726     fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
4727   return gdbarch->addr_bits_remove (addr);
4728 }
4729
4730 void
4731 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
4732                               gdbarch_addr_bits_remove_ftype addr_bits_remove)
4733 {
4734   gdbarch->addr_bits_remove = addr_bits_remove;
4735 }
4736
4737 CORE_ADDR
4738 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
4739 {
4740   gdb_assert (gdbarch != NULL);
4741   if (gdbarch->smash_text_address == 0)
4742     internal_error (__FILE__, __LINE__,
4743                     "gdbarch: gdbarch_smash_text_address invalid");
4744   if (gdbarch_debug >= 2)
4745     fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
4746   return gdbarch->smash_text_address (addr);
4747 }
4748
4749 void
4750 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
4751                                 gdbarch_smash_text_address_ftype smash_text_address)
4752 {
4753   gdbarch->smash_text_address = smash_text_address;
4754 }
4755
4756 int
4757 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
4758 {
4759   gdb_assert (gdbarch != NULL);
4760   return gdbarch->software_single_step != 0;
4761 }
4762
4763 void
4764 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
4765 {
4766   gdb_assert (gdbarch != NULL);
4767   if (gdbarch->software_single_step == 0)
4768     internal_error (__FILE__, __LINE__,
4769                     "gdbarch: gdbarch_software_single_step invalid");
4770   if (gdbarch_debug >= 2)
4771     fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
4772   gdbarch->software_single_step (sig, insert_breakpoints_p);
4773 }
4774
4775 void
4776 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
4777                                   gdbarch_software_single_step_ftype software_single_step)
4778 {
4779   gdbarch->software_single_step = software_single_step;
4780 }
4781
4782 int
4783 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
4784 {
4785   gdb_assert (gdbarch != NULL);
4786   if (gdbarch->print_insn == 0)
4787     internal_error (__FILE__, __LINE__,
4788                     "gdbarch: gdbarch_print_insn invalid");
4789   if (gdbarch_debug >= 2)
4790     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
4791   return gdbarch->print_insn (vma, info);
4792 }
4793
4794 void
4795 set_gdbarch_print_insn (struct gdbarch *gdbarch,
4796                         gdbarch_print_insn_ftype print_insn)
4797 {
4798   gdbarch->print_insn = print_insn;
4799 }
4800
4801 CORE_ADDR
4802 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
4803 {
4804   gdb_assert (gdbarch != NULL);
4805   if (gdbarch->skip_trampoline_code == 0)
4806     internal_error (__FILE__, __LINE__,
4807                     "gdbarch: gdbarch_skip_trampoline_code invalid");
4808   if (gdbarch_debug >= 2)
4809     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
4810   return gdbarch->skip_trampoline_code (pc);
4811 }
4812
4813 void
4814 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
4815                                   gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
4816 {
4817   gdbarch->skip_trampoline_code = skip_trampoline_code;
4818 }
4819
4820 int
4821 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4822 {
4823   gdb_assert (gdbarch != NULL);
4824   if (gdbarch->in_solib_call_trampoline == 0)
4825     internal_error (__FILE__, __LINE__,
4826                     "gdbarch: gdbarch_in_solib_call_trampoline invalid");
4827   if (gdbarch_debug >= 2)
4828     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
4829   return gdbarch->in_solib_call_trampoline (pc, name);
4830 }
4831
4832 void
4833 set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
4834                                       gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
4835 {
4836   gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
4837 }
4838
4839 int
4840 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4841 {
4842   gdb_assert (gdbarch != NULL);
4843   if (gdbarch->in_solib_return_trampoline == 0)
4844     internal_error (__FILE__, __LINE__,
4845                     "gdbarch: gdbarch_in_solib_return_trampoline invalid");
4846   if (gdbarch_debug >= 2)
4847     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
4848   return gdbarch->in_solib_return_trampoline (pc, name);
4849 }
4850
4851 void
4852 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
4853                                         gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
4854 {
4855   gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
4856 }
4857
4858 int
4859 gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4860 {
4861   gdb_assert (gdbarch != NULL);
4862   if (gdbarch->pc_in_sigtramp == 0)
4863     internal_error (__FILE__, __LINE__,
4864                     "gdbarch: gdbarch_pc_in_sigtramp invalid");
4865   if (gdbarch_debug >= 2)
4866     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n");
4867   return gdbarch->pc_in_sigtramp (pc, name);
4868 }
4869
4870 void
4871 set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch,
4872                             gdbarch_pc_in_sigtramp_ftype pc_in_sigtramp)
4873 {
4874   gdbarch->pc_in_sigtramp = pc_in_sigtramp;
4875 }
4876
4877 int
4878 gdbarch_sigtramp_start_p (struct gdbarch *gdbarch)
4879 {
4880   gdb_assert (gdbarch != NULL);
4881   return gdbarch->sigtramp_start != 0;
4882 }
4883
4884 CORE_ADDR
4885 gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc)
4886 {
4887   gdb_assert (gdbarch != NULL);
4888   if (gdbarch->sigtramp_start == 0)
4889     internal_error (__FILE__, __LINE__,
4890                     "gdbarch: gdbarch_sigtramp_start invalid");
4891   if (gdbarch_debug >= 2)
4892     fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_start called\n");
4893   return gdbarch->sigtramp_start (pc);
4894 }
4895
4896 void
4897 set_gdbarch_sigtramp_start (struct gdbarch *gdbarch,
4898                             gdbarch_sigtramp_start_ftype sigtramp_start)
4899 {
4900   gdbarch->sigtramp_start = sigtramp_start;
4901 }
4902
4903 int
4904 gdbarch_sigtramp_end_p (struct gdbarch *gdbarch)
4905 {
4906   gdb_assert (gdbarch != NULL);
4907   return gdbarch->sigtramp_end != 0;
4908 }
4909
4910 CORE_ADDR
4911 gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc)
4912 {
4913   gdb_assert (gdbarch != NULL);
4914   if (gdbarch->sigtramp_end == 0)
4915     internal_error (__FILE__, __LINE__,
4916                     "gdbarch: gdbarch_sigtramp_end invalid");
4917   if (gdbarch_debug >= 2)
4918     fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_end called\n");
4919   return gdbarch->sigtramp_end (pc);
4920 }
4921
4922 void
4923 set_gdbarch_sigtramp_end (struct gdbarch *gdbarch,
4924                           gdbarch_sigtramp_end_ftype sigtramp_end)
4925 {
4926   gdbarch->sigtramp_end = sigtramp_end;
4927 }
4928
4929 int
4930 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
4931 {
4932   gdb_assert (gdbarch != NULL);
4933   if (gdbarch->in_function_epilogue_p == 0)
4934     internal_error (__FILE__, __LINE__,
4935                     "gdbarch: gdbarch_in_function_epilogue_p invalid");
4936   if (gdbarch_debug >= 2)
4937     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
4938   return gdbarch->in_function_epilogue_p (gdbarch, addr);
4939 }
4940
4941 void
4942 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
4943                                     gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
4944 {
4945   gdbarch->in_function_epilogue_p = in_function_epilogue_p;
4946 }
4947
4948 char *
4949 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
4950 {
4951   gdb_assert (gdbarch != NULL);
4952   if (gdbarch->construct_inferior_arguments == 0)
4953     internal_error (__FILE__, __LINE__,
4954                     "gdbarch: gdbarch_construct_inferior_arguments invalid");
4955   if (gdbarch_debug >= 2)
4956     fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
4957   return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
4958 }
4959
4960 void
4961 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
4962                                           gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
4963 {
4964   gdbarch->construct_inferior_arguments = construct_inferior_arguments;
4965 }
4966
4967 int
4968 gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
4969 {
4970   gdb_assert (gdbarch != NULL);
4971   return gdbarch->dwarf2_build_frame_info != 0;
4972 }
4973
4974 void
4975 gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
4976 {
4977   gdb_assert (gdbarch != NULL);
4978   if (gdbarch->dwarf2_build_frame_info == 0)
4979     internal_error (__FILE__, __LINE__,
4980                     "gdbarch: gdbarch_dwarf2_build_frame_info invalid");
4981   if (gdbarch_debug >= 2)
4982     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n");
4983   gdbarch->dwarf2_build_frame_info (objfile);
4984 }
4985
4986 void
4987 set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
4988                                      gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info)
4989 {
4990   gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
4991 }
4992
4993 void
4994 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
4995 {
4996   gdb_assert (gdbarch != NULL);
4997   if (gdbarch->elf_make_msymbol_special == 0)
4998     internal_error (__FILE__, __LINE__,
4999                     "gdbarch: gdbarch_elf_make_msymbol_special invalid");
5000   if (gdbarch_debug >= 2)
5001     fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
5002   gdbarch->elf_make_msymbol_special (sym, msym);
5003 }
5004
5005 void
5006 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
5007                                       gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
5008 {
5009   gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
5010 }
5011
5012 void
5013 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
5014 {
5015   gdb_assert (gdbarch != NULL);
5016   if (gdbarch->coff_make_msymbol_special == 0)
5017     internal_error (__FILE__, __LINE__,
5018                     "gdbarch: gdbarch_coff_make_msymbol_special invalid");
5019   if (gdbarch_debug >= 2)
5020     fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
5021   gdbarch->coff_make_msymbol_special (val, msym);
5022 }
5023
5024 void
5025 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
5026                                        gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
5027 {
5028   gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
5029 }
5030
5031 const char *
5032 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
5033 {
5034   gdb_assert (gdbarch != NULL);
5035   /* Skip verify of name_of_malloc, invalid_p == 0 */
5036   if (gdbarch_debug >= 2)
5037     fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
5038   return gdbarch->name_of_malloc;
5039 }
5040
5041 void
5042 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
5043                             const char * name_of_malloc)
5044 {
5045   gdbarch->name_of_malloc = name_of_malloc;
5046 }
5047
5048 int
5049 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
5050 {
5051   gdb_assert (gdbarch != NULL);
5052   /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
5053   if (gdbarch_debug >= 2)
5054     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
5055   return gdbarch->cannot_step_breakpoint;
5056 }
5057
5058 void
5059 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
5060                                     int cannot_step_breakpoint)
5061 {
5062   gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
5063 }
5064
5065 int
5066 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
5067 {
5068   gdb_assert (gdbarch != NULL);
5069   /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
5070   if (gdbarch_debug >= 2)
5071     fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
5072   return gdbarch->have_nonsteppable_watchpoint;
5073 }
5074
5075 void
5076 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
5077                                     int have_nonsteppable_watchpoint)
5078 {
5079   gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
5080 }
5081
5082
5083 /* Keep a registry of per-architecture data-pointers required by GDB
5084    modules. */
5085
5086 struct gdbarch_data
5087 {
5088   unsigned index;
5089   int init_p;
5090   gdbarch_data_init_ftype *init;
5091   gdbarch_data_free_ftype *free;
5092 };
5093
5094 struct gdbarch_data_registration
5095 {
5096   struct gdbarch_data *data;
5097   struct gdbarch_data_registration *next;
5098 };
5099
5100 struct gdbarch_data_registry
5101 {
5102   unsigned nr;
5103   struct gdbarch_data_registration *registrations;
5104 };
5105
5106 struct gdbarch_data_registry gdbarch_data_registry =
5107 {
5108   0, NULL,
5109 };
5110
5111 struct gdbarch_data *
5112 register_gdbarch_data (gdbarch_data_init_ftype *init,
5113                        gdbarch_data_free_ftype *free)
5114 {
5115   struct gdbarch_data_registration **curr;
5116   /* Append the new registraration.  */
5117   for (curr = &gdbarch_data_registry.registrations;
5118        (*curr) != NULL;
5119        curr = &(*curr)->next);
5120   (*curr) = XMALLOC (struct gdbarch_data_registration);
5121   (*curr)->next = NULL;
5122   (*curr)->data = XMALLOC (struct gdbarch_data);
5123   (*curr)->data->index = gdbarch_data_registry.nr++;
5124   (*curr)->data->init = init;
5125   (*curr)->data->init_p = 1;
5126   (*curr)->data->free = free;
5127   return (*curr)->data;
5128 }
5129
5130
5131 /* Create/delete the gdbarch data vector. */
5132
5133 static void
5134 alloc_gdbarch_data (struct gdbarch *gdbarch)
5135 {
5136   gdb_assert (gdbarch->data == NULL);
5137   gdbarch->nr_data = gdbarch_data_registry.nr;
5138   gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
5139 }
5140
5141 static void
5142 free_gdbarch_data (struct gdbarch *gdbarch)
5143 {
5144   struct gdbarch_data_registration *rego;
5145   gdb_assert (gdbarch->data != NULL);
5146   for (rego = gdbarch_data_registry.registrations;
5147        rego != NULL;
5148        rego = rego->next)
5149     {
5150       struct gdbarch_data *data = rego->data;
5151       gdb_assert (data->index < gdbarch->nr_data);
5152       if (data->free != NULL && gdbarch->data[data->index] != NULL)
5153         {
5154           data->free (gdbarch, gdbarch->data[data->index]);
5155           gdbarch->data[data->index] = NULL;
5156         }
5157     }
5158   xfree (gdbarch->data);
5159   gdbarch->data = NULL;
5160 }
5161
5162
5163 /* Initialize the current value of the specified per-architecture
5164    data-pointer. */
5165
5166 void
5167 set_gdbarch_data (struct gdbarch *gdbarch,
5168                   struct gdbarch_data *data,
5169                   void *pointer)
5170 {
5171   gdb_assert (data->index < gdbarch->nr_data);
5172   if (gdbarch->data[data->index] != NULL)
5173     {
5174       gdb_assert (data->free != NULL);
5175       data->free (gdbarch, gdbarch->data[data->index]);
5176     }
5177   gdbarch->data[data->index] = pointer;
5178 }
5179
5180 /* Return the current value of the specified per-architecture
5181    data-pointer. */
5182
5183 void *
5184 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
5185 {
5186   gdb_assert (data->index < gdbarch->nr_data);
5187   /* The data-pointer isn't initialized, call init() to get a value but
5188      only if the architecture initializaiton has completed.  Otherwise
5189      punt - hope that the caller knows what they are doing.  */
5190   if (gdbarch->data[data->index] == NULL
5191       && gdbarch->initialized_p)
5192     {
5193       /* Be careful to detect an initialization cycle.  */
5194       gdb_assert (data->init_p);
5195       data->init_p = 0;
5196       gdb_assert (data->init != NULL);
5197       gdbarch->data[data->index] = data->init (gdbarch);
5198       data->init_p = 1;
5199       gdb_assert (gdbarch->data[data->index] != NULL);
5200     }
5201   return gdbarch->data[data->index];
5202 }
5203
5204
5205
5206 /* Keep a registry of swapped data required by GDB modules. */
5207
5208 struct gdbarch_swap
5209 {
5210   void *swap;
5211   struct gdbarch_swap_registration *source;
5212   struct gdbarch_swap *next;
5213 };
5214
5215 struct gdbarch_swap_registration
5216 {
5217   void *data;
5218   unsigned long sizeof_data;
5219   gdbarch_swap_ftype *init;
5220   struct gdbarch_swap_registration *next;
5221 };
5222
5223 struct gdbarch_swap_registry
5224 {
5225   int nr;
5226   struct gdbarch_swap_registration *registrations;
5227 };
5228
5229 struct gdbarch_swap_registry gdbarch_swap_registry = 
5230 {
5231   0, NULL,
5232 };
5233
5234 void
5235 register_gdbarch_swap (void *data,
5236                        unsigned long sizeof_data,
5237                        gdbarch_swap_ftype *init)
5238 {
5239   struct gdbarch_swap_registration **rego;
5240   for (rego = &gdbarch_swap_registry.registrations;
5241        (*rego) != NULL;
5242        rego = &(*rego)->next);
5243   (*rego) = XMALLOC (struct gdbarch_swap_registration);
5244   (*rego)->next = NULL;
5245   (*rego)->init = init;
5246   (*rego)->data = data;
5247   (*rego)->sizeof_data = sizeof_data;
5248 }
5249
5250 static void
5251 clear_gdbarch_swap (struct gdbarch *gdbarch)
5252 {
5253   struct gdbarch_swap *curr;
5254   for (curr = gdbarch->swap;
5255        curr != NULL;
5256        curr = curr->next)
5257     {
5258       memset (curr->source->data, 0, curr->source->sizeof_data);
5259     }
5260 }
5261
5262 static void
5263 init_gdbarch_swap (struct gdbarch *gdbarch)
5264 {
5265   struct gdbarch_swap_registration *rego;
5266   struct gdbarch_swap **curr = &gdbarch->swap;
5267   for (rego = gdbarch_swap_registry.registrations;
5268        rego != NULL;
5269        rego = rego->next)
5270     {
5271       if (rego->data != NULL)
5272         {
5273           (*curr) = XMALLOC (struct gdbarch_swap);
5274           (*curr)->source = rego;
5275           (*curr)->swap = xmalloc (rego->sizeof_data);
5276           (*curr)->next = NULL;
5277           curr = &(*curr)->next;
5278         }
5279       if (rego->init != NULL)
5280         rego->init ();
5281     }
5282 }
5283
5284 static void
5285 swapout_gdbarch_swap (struct gdbarch *gdbarch)
5286 {
5287   struct gdbarch_swap *curr;
5288   for (curr = gdbarch->swap;
5289        curr != NULL;
5290        curr = curr->next)
5291     memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
5292 }
5293
5294 static void
5295 swapin_gdbarch_swap (struct gdbarch *gdbarch)
5296 {
5297   struct gdbarch_swap *curr;
5298   for (curr = gdbarch->swap;
5299        curr != NULL;
5300        curr = curr->next)
5301     memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
5302 }
5303
5304
5305 /* Keep a registry of the architectures known by GDB. */
5306
5307 struct gdbarch_registration
5308 {
5309   enum bfd_architecture bfd_architecture;
5310   gdbarch_init_ftype *init;
5311   gdbarch_dump_tdep_ftype *dump_tdep;
5312   struct gdbarch_list *arches;
5313   struct gdbarch_registration *next;
5314 };
5315
5316 static struct gdbarch_registration *gdbarch_registry = NULL;
5317
5318 static void
5319 append_name (const char ***buf, int *nr, const char *name)
5320 {
5321   *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
5322   (*buf)[*nr] = name;
5323   *nr += 1;
5324 }
5325
5326 const char **
5327 gdbarch_printable_names (void)
5328 {
5329   if (GDB_MULTI_ARCH)
5330     {
5331       /* Accumulate a list of names based on the registed list of
5332          architectures. */
5333       enum bfd_architecture a;
5334       int nr_arches = 0;
5335       const char **arches = NULL;
5336       struct gdbarch_registration *rego;
5337       for (rego = gdbarch_registry;
5338            rego != NULL;
5339            rego = rego->next)
5340         {
5341           const struct bfd_arch_info *ap;
5342           ap = bfd_lookup_arch (rego->bfd_architecture, 0);
5343           if (ap == NULL)
5344             internal_error (__FILE__, __LINE__,
5345                             "gdbarch_architecture_names: multi-arch unknown");
5346           do
5347             {
5348               append_name (&arches, &nr_arches, ap->printable_name);
5349               ap = ap->next;
5350             }
5351           while (ap != NULL);
5352         }
5353       append_name (&arches, &nr_arches, NULL);
5354       return arches;
5355     }
5356   else
5357     /* Just return all the architectures that BFD knows.  Assume that
5358        the legacy architecture framework supports them. */
5359     return bfd_arch_list ();
5360 }
5361
5362
5363 void
5364 gdbarch_register (enum bfd_architecture bfd_architecture,
5365                   gdbarch_init_ftype *init,
5366                   gdbarch_dump_tdep_ftype *dump_tdep)
5367 {
5368   struct gdbarch_registration **curr;
5369   const struct bfd_arch_info *bfd_arch_info;
5370   /* Check that BFD recognizes this architecture */
5371   bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
5372   if (bfd_arch_info == NULL)
5373     {
5374       internal_error (__FILE__, __LINE__,
5375                       "gdbarch: Attempt to register unknown architecture (%d)",
5376                       bfd_architecture);
5377     }
5378   /* Check that we haven't seen this architecture before */
5379   for (curr = &gdbarch_registry;
5380        (*curr) != NULL;
5381        curr = &(*curr)->next)
5382     {
5383       if (bfd_architecture == (*curr)->bfd_architecture)
5384         internal_error (__FILE__, __LINE__,
5385                         "gdbarch: Duplicate registraration of architecture (%s)",
5386                         bfd_arch_info->printable_name);
5387     }
5388   /* log it */
5389   if (gdbarch_debug)
5390     fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
5391                         bfd_arch_info->printable_name,
5392                         (long) init);
5393   /* Append it */
5394   (*curr) = XMALLOC (struct gdbarch_registration);
5395   (*curr)->bfd_architecture = bfd_architecture;
5396   (*curr)->init = init;
5397   (*curr)->dump_tdep = dump_tdep;
5398   (*curr)->arches = NULL;
5399   (*curr)->next = NULL;
5400   /* When non- multi-arch, install whatever target dump routine we've
5401      been provided - hopefully that routine has been written correctly
5402      and works regardless of multi-arch. */
5403   if (!GDB_MULTI_ARCH && dump_tdep != NULL
5404       && startup_gdbarch.dump_tdep == NULL)
5405     startup_gdbarch.dump_tdep = dump_tdep;
5406 }
5407
5408 void
5409 register_gdbarch_init (enum bfd_architecture bfd_architecture,
5410                        gdbarch_init_ftype *init)
5411 {
5412   gdbarch_register (bfd_architecture, init, NULL);
5413 }
5414
5415
5416 /* Look for an architecture using gdbarch_info.  Base search on only
5417    BFD_ARCH_INFO and BYTE_ORDER. */
5418
5419 struct gdbarch_list *
5420 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
5421                              const struct gdbarch_info *info)
5422 {
5423   for (; arches != NULL; arches = arches->next)
5424     {
5425       if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
5426         continue;
5427       if (info->byte_order != arches->gdbarch->byte_order)
5428         continue;
5429       return arches;
5430     }
5431   return NULL;
5432 }
5433
5434
5435 /* Update the current architecture. Return ZERO if the update request
5436    failed. */
5437
5438 int
5439 gdbarch_update_p (struct gdbarch_info info)
5440 {
5441   struct gdbarch *new_gdbarch;
5442   struct gdbarch *old_gdbarch;
5443   struct gdbarch_registration *rego;
5444
5445   /* Fill in missing parts of the INFO struct using a number of
5446      sources: ``set ...''; INFOabfd supplied; existing target.  */
5447
5448   /* ``(gdb) set architecture ...'' */
5449   if (info.bfd_arch_info == NULL
5450       && !TARGET_ARCHITECTURE_AUTO)
5451     info.bfd_arch_info = TARGET_ARCHITECTURE;
5452   if (info.bfd_arch_info == NULL
5453       && info.abfd != NULL
5454       && bfd_get_arch (info.abfd) != bfd_arch_unknown
5455       && bfd_get_arch (info.abfd) != bfd_arch_obscure)
5456     info.bfd_arch_info = bfd_get_arch_info (info.abfd);
5457   if (info.bfd_arch_info == NULL)
5458     info.bfd_arch_info = TARGET_ARCHITECTURE;
5459
5460   /* ``(gdb) set byte-order ...'' */
5461   if (info.byte_order == BFD_ENDIAN_UNKNOWN
5462       && !TARGET_BYTE_ORDER_AUTO)
5463     info.byte_order = TARGET_BYTE_ORDER;
5464   /* From the INFO struct. */
5465   if (info.byte_order == BFD_ENDIAN_UNKNOWN
5466       && info.abfd != NULL)
5467     info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
5468                        : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
5469                        : BFD_ENDIAN_UNKNOWN);
5470   /* From the current target. */
5471   if (info.byte_order == BFD_ENDIAN_UNKNOWN)
5472     info.byte_order = TARGET_BYTE_ORDER;
5473
5474   /* Must have found some sort of architecture. */
5475   gdb_assert (info.bfd_arch_info != NULL);
5476
5477   if (gdbarch_debug)
5478     {
5479       fprintf_unfiltered (gdb_stdlog,
5480                           "gdbarch_update: info.bfd_arch_info %s\n",
5481                           (info.bfd_arch_info != NULL
5482                            ? info.bfd_arch_info->printable_name
5483                            : "(null)"));
5484       fprintf_unfiltered (gdb_stdlog,
5485                           "gdbarch_update: info.byte_order %d (%s)\n",
5486                           info.byte_order,
5487                           (info.byte_order == BFD_ENDIAN_BIG ? "big"
5488                            : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
5489                            : "default"));
5490       fprintf_unfiltered (gdb_stdlog,
5491                           "gdbarch_update: info.abfd 0x%lx\n",
5492                           (long) info.abfd);
5493       fprintf_unfiltered (gdb_stdlog,
5494                           "gdbarch_update: info.tdep_info 0x%lx\n",
5495                           (long) info.tdep_info);
5496     }
5497
5498   /* Find the target that knows about this architecture. */
5499   for (rego = gdbarch_registry;
5500        rego != NULL;
5501        rego = rego->next)
5502     if (rego->bfd_architecture == info.bfd_arch_info->arch)
5503       break;
5504   if (rego == NULL)
5505     {
5506       if (gdbarch_debug)
5507         fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
5508       return 0;
5509     }
5510
5511   /* Swap the data belonging to the old target out setting the
5512      installed data to zero.  This stops the ->init() function trying
5513      to refer to the previous architecture's global data structures.  */
5514   swapout_gdbarch_swap (current_gdbarch);
5515   clear_gdbarch_swap (current_gdbarch);
5516
5517   /* Save the previously selected architecture, setting the global to
5518      NULL.  This stops ->init() trying to use the previous
5519      architecture's configuration.  The previous architecture may not
5520      even be of the same architecture family.  The most recent
5521      architecture of the same family is found at the head of the
5522      rego->arches list.  */
5523   old_gdbarch = current_gdbarch;
5524   current_gdbarch = NULL;
5525
5526   /* Ask the target for a replacement architecture. */
5527   new_gdbarch = rego->init (info, rego->arches);
5528
5529   /* Did the target like it?  No. Reject the change and revert to the
5530      old architecture.  */
5531   if (new_gdbarch == NULL)
5532     {
5533       if (gdbarch_debug)
5534         fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
5535       swapin_gdbarch_swap (old_gdbarch);
5536       current_gdbarch = old_gdbarch;
5537       return 0;
5538     }
5539
5540   /* Did the architecture change?  No.  Oops, put the old architecture
5541      back.  */
5542   if (old_gdbarch == new_gdbarch)
5543     {
5544       if (gdbarch_debug)
5545         fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
5546                             (long) new_gdbarch,
5547                             new_gdbarch->bfd_arch_info->printable_name);
5548       swapin_gdbarch_swap (old_gdbarch);
5549       current_gdbarch = old_gdbarch;
5550       return 1;
5551     }
5552
5553   /* Is this a pre-existing architecture?  Yes. Move it to the front
5554      of the list of architectures (keeping the list sorted Most
5555      Recently Used) and then copy it in.  */
5556   {
5557     struct gdbarch_list **list;
5558     for (list = &rego->arches;
5559          (*list) != NULL;
5560          list = &(*list)->next)
5561       {
5562         if ((*list)->gdbarch == new_gdbarch)
5563           {
5564             struct gdbarch_list *this;
5565             if (gdbarch_debug)
5566               fprintf_unfiltered (gdb_stdlog,
5567                                   "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
5568                                   (long) new_gdbarch,
5569                                   new_gdbarch->bfd_arch_info->printable_name);
5570             /* Unlink this.  */
5571             this = (*list);
5572             (*list) = this->next;
5573             /* Insert in the front.  */
5574             this->next = rego->arches;
5575             rego->arches = this;
5576             /* Copy the new architecture in.  */
5577             current_gdbarch = new_gdbarch;
5578             swapin_gdbarch_swap (new_gdbarch);
5579             architecture_changed_event ();
5580             return 1;
5581           }
5582       }
5583   }
5584
5585   /* Prepend this new architecture to the architecture list (keep the
5586      list sorted Most Recently Used).  */
5587   {
5588     struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
5589     this->next = rego->arches;
5590     this->gdbarch = new_gdbarch;
5591     rego->arches = this;
5592   }    
5593
5594   /* Switch to this new architecture marking it initialized.  */
5595   current_gdbarch = new_gdbarch;
5596   current_gdbarch->initialized_p = 1;
5597   if (gdbarch_debug)
5598     {
5599       fprintf_unfiltered (gdb_stdlog,
5600                           "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
5601                           (long) new_gdbarch,
5602                           new_gdbarch->bfd_arch_info->printable_name);
5603     }
5604   
5605   /* Check that the newly installed architecture is valid.  Plug in
5606      any post init values.  */
5607   new_gdbarch->dump_tdep = rego->dump_tdep;
5608   verify_gdbarch (new_gdbarch);
5609
5610   /* Initialize the per-architecture memory (swap) areas.
5611      CURRENT_GDBARCH must be update before these modules are
5612      called. */
5613   init_gdbarch_swap (new_gdbarch);
5614   
5615   /* Initialize the per-architecture data.  CURRENT_GDBARCH
5616      must be updated before these modules are called. */
5617   architecture_changed_event ();
5618
5619   if (gdbarch_debug)
5620     gdbarch_dump (current_gdbarch, gdb_stdlog);
5621
5622   return 1;
5623 }
5624
5625
5626 /* Disassembler */
5627
5628 /* Pointer to the target-dependent disassembly function.  */
5629 int (*tm_print_insn) (bfd_vma, disassemble_info *);
5630 disassemble_info tm_print_insn_info;
5631
5632
5633 extern void _initialize_gdbarch (void);
5634
5635 void
5636 _initialize_gdbarch (void)
5637 {
5638   struct cmd_list_element *c;
5639
5640   INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
5641   tm_print_insn_info.flavour = bfd_target_unknown_flavour;
5642   tm_print_insn_info.read_memory_func = dis_asm_read_memory;
5643   tm_print_insn_info.memory_error_func = dis_asm_memory_error;
5644   tm_print_insn_info.print_address_func = dis_asm_print_address;
5645
5646   add_show_from_set (add_set_cmd ("arch",
5647                                   class_maintenance,
5648                                   var_zinteger,
5649                                   (char *)&gdbarch_debug,
5650                                   "Set architecture debugging.\n\
5651 When non-zero, architecture debugging is enabled.", &setdebuglist),
5652                      &showdebuglist);
5653   c = add_set_cmd ("archdebug",
5654                    class_maintenance,
5655                    var_zinteger,
5656                    (char *)&gdbarch_debug,
5657                    "Set architecture debugging.\n\
5658 When non-zero, architecture debugging is enabled.", &setlist);
5659
5660   deprecate_cmd (c, "set debug arch");
5661   deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
5662 }