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