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