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