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