OSDN Git Service

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