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