OSDN Git Service

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