]> Git Repo - binutils.git/blob - gdb/gdbarch.c
Re-implement gdbach_dump() so that it prints out the macro values.
[binutils.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4    Copyright 1998-1999, 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 bourn 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 makeing 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 #endif
59 #include "symcat.h"
60
61 #include "floatformat.h"
62
63 /* Static function declarations */
64
65 static void verify_gdbarch (struct gdbarch *gdbarch);
66 static void init_gdbarch_data (struct gdbarch *);
67 static void init_gdbarch_swap (struct gdbarch *);
68 static void swapout_gdbarch_swap (struct gdbarch *);
69 static void swapin_gdbarch_swap (struct gdbarch *);
70
71 /* Convenience macro for allocting typesafe memory. */
72
73 #ifndef XMALLOC
74 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
75 #endif
76
77
78 /* Non-zero if we want to trace architecture code.  */
79
80 #ifndef GDBARCH_DEBUG
81 #define GDBARCH_DEBUG 0
82 #endif
83 int gdbarch_debug = GDBARCH_DEBUG;
84
85
86 /* Maintain the struct gdbarch object */
87
88 struct gdbarch
89 {
90   /* basic architectural information */
91   const struct bfd_arch_info * bfd_arch_info;
92   int byte_order;
93
94   /* target specific vector. */
95   struct gdbarch_tdep *tdep;
96   gdbarch_dump_tdep_ftype *dump_tdep;
97
98   /* per-architecture data-pointers */
99   int nr_data;
100   void **data;
101
102   /* per-architecture swap-regions */
103   struct gdbarch_swap *swap;
104
105   /* Multi-arch values.
106
107      When extending this structure you must:
108
109      Add the field below.
110
111      Declare set/get functions and define the corresponding
112      macro in gdbarch.h.
113
114      gdbarch_alloc(): If zero/NULL is not a suitable default,
115      initialize the new field.
116
117      verify_gdbarch(): Confirm that the target updated the field
118      correctly.
119
120      gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
121      field is dumped out
122
123      ``startup_gdbarch()'': Append an initial value to the static
124      variable (base values on the host's c-type system).
125
126      get_gdbarch(): Implement the set/get functions (probably using
127      the macro's as shortcuts).
128
129      */
130
131   int bfd_vma_bit;
132   int ptr_bit;
133   int short_bit;
134   int int_bit;
135   int long_bit;
136   int long_long_bit;
137   int float_bit;
138   int double_bit;
139   int long_double_bit;
140   int ieee_float;
141   gdbarch_read_pc_ftype *read_pc;
142   gdbarch_write_pc_ftype *write_pc;
143   gdbarch_read_fp_ftype *read_fp;
144   gdbarch_write_fp_ftype *write_fp;
145   gdbarch_read_sp_ftype *read_sp;
146   gdbarch_write_sp_ftype *write_sp;
147   int num_regs;
148   int sp_regnum;
149   int fp_regnum;
150   int pc_regnum;
151   int fp0_regnum;
152   int npc_regnum;
153   int nnpc_regnum;
154   gdbarch_register_name_ftype *register_name;
155   int register_size;
156   int register_bytes;
157   gdbarch_register_byte_ftype *register_byte;
158   gdbarch_register_raw_size_ftype *register_raw_size;
159   int max_register_raw_size;
160   gdbarch_register_virtual_size_ftype *register_virtual_size;
161   int max_register_virtual_size;
162   gdbarch_register_virtual_type_ftype *register_virtual_type;
163   int use_generic_dummy_frames;
164   int call_dummy_location;
165   gdbarch_call_dummy_address_ftype *call_dummy_address;
166   CORE_ADDR call_dummy_start_offset;
167   CORE_ADDR call_dummy_breakpoint_offset;
168   int call_dummy_breakpoint_offset_p;
169   int call_dummy_length;
170   gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
171   int call_dummy_p;
172   LONGEST * call_dummy_words;
173   int sizeof_call_dummy_words;
174   int call_dummy_stack_adjust_p;
175   int call_dummy_stack_adjust;
176   gdbarch_fix_call_dummy_ftype *fix_call_dummy;
177   int believe_pcc_promotion;
178   int believe_pcc_promotion_type;
179   gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
180   gdbarch_get_saved_register_ftype *get_saved_register;
181   gdbarch_register_convertible_ftype *register_convertible;
182   gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
183   gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
184   gdbarch_pointer_to_address_ftype *pointer_to_address;
185   gdbarch_address_to_pointer_ftype *address_to_pointer;
186   gdbarch_return_value_on_stack_ftype *return_value_on_stack;
187   gdbarch_extract_return_value_ftype *extract_return_value;
188   gdbarch_push_arguments_ftype *push_arguments;
189   gdbarch_push_dummy_frame_ftype *push_dummy_frame;
190   gdbarch_push_return_address_ftype *push_return_address;
191   gdbarch_pop_frame_ftype *pop_frame;
192   gdbarch_d10v_make_daddr_ftype *d10v_make_daddr;
193   gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
194   gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
195   gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
196   gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
197   gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
198   gdbarch_store_struct_return_ftype *store_struct_return;
199   gdbarch_store_return_value_ftype *store_return_value;
200   gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
201   gdbarch_use_struct_convention_ftype *use_struct_convention;
202   gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
203   gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
204   gdbarch_skip_prologue_ftype *skip_prologue;
205   gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
206   gdbarch_inner_than_ftype *inner_than;
207   gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
208   gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
209   gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
210   CORE_ADDR decr_pc_after_break;
211   CORE_ADDR function_start_offset;
212   gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
213   CORE_ADDR frame_args_skip;
214   gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
215   gdbarch_frame_chain_ftype *frame_chain;
216   gdbarch_frame_chain_valid_ftype *frame_chain_valid;
217   gdbarch_frame_saved_pc_ftype *frame_saved_pc;
218   gdbarch_frame_args_address_ftype *frame_args_address;
219   gdbarch_frame_locals_address_ftype *frame_locals_address;
220   gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
221   gdbarch_frame_num_args_ftype *frame_num_args;
222   gdbarch_stack_align_ftype *stack_align;
223   gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
224   gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
225   const struct floatformat * float_format;
226   const struct floatformat * double_format;
227   const struct floatformat * long_double_format;
228 };
229
230
231 /* The default architecture uses host values (for want of a better
232    choice). */
233
234 extern const struct bfd_arch_info bfd_default_arch_struct;
235
236 struct gdbarch startup_gdbarch =
237 {
238   /* basic architecture information */
239   &bfd_default_arch_struct,
240   BIG_ENDIAN,
241   /* target specific vector and its dump routine */
242   NULL, NULL,
243   /*per-architecture data-pointers and swap regions */
244   0, NULL, NULL,
245   /* Multi-arch values */
246   8 * sizeof (void*),
247   8 * sizeof (void*),
248   8 * sizeof (short),
249   8 * sizeof (int),
250   8 * sizeof (long),
251   8 * sizeof (LONGEST),
252   8 * sizeof (float),
253   8 * sizeof (double),
254   8 * sizeof (long double),
255   0,
256   0,
257   0,
258   0,
259   0,
260   0,
261   0,
262   0,
263   0,
264   0,
265   0,
266   0,
267   0,
268   0,
269   0,
270   0,
271   0,
272   0,
273   0,
274   0,
275   0,
276   0,
277   0,
278   0,
279   0,
280   0,
281   0,
282   0,
283   0,
284   0,
285   0,
286   0,
287   0,
288   0,
289   0,
290   0,
291   0,
292   0,
293   0,
294   0,
295   generic_get_saved_register,
296   0,
297   0,
298   0,
299   0,
300   0,
301   0,
302   0,
303   0,
304   0,
305   0,
306   0,
307   0,
308   0,
309   0,
310   0,
311   0,
312   0,
313   0,
314   0,
315   0,
316   0,
317   0,
318   0,
319   0,
320   0,
321   0,
322   0,
323   0,
324   0,
325   0,
326   0,
327   0,
328   0,
329   0,
330   0,
331   0,
332   0,
333   0,
334   0,
335   0,
336   0,
337   0,
338   0,
339   0,
340   0,
341   0,
342   0,
343   /* startup_gdbarch() */
344 };
345
346 struct gdbarch *current_gdbarch = &startup_gdbarch;
347
348
349 /* Create a new ``struct gdbarch'' based in information provided by
350    ``struct gdbarch_info''. */
351
352 struct gdbarch *
353 gdbarch_alloc (const struct gdbarch_info *info,
354                struct gdbarch_tdep *tdep)
355 {
356   struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
357   memset (gdbarch, 0, sizeof (*gdbarch));
358
359   gdbarch->tdep = tdep;
360
361   gdbarch->bfd_arch_info = info->bfd_arch_info;
362   gdbarch->byte_order = info->byte_order;
363
364   /* Force the explicit initialization of these. */
365   gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
366   gdbarch->num_regs = -1;
367   gdbarch->sp_regnum = -1;
368   gdbarch->fp_regnum = -1;
369   gdbarch->pc_regnum = -1;
370   gdbarch->fp0_regnum = -1;
371   gdbarch->npc_regnum = -1;
372   gdbarch->nnpc_regnum = -1;
373   gdbarch->register_name = legacy_register_name;
374   gdbarch->register_size = -1;
375   gdbarch->register_bytes = -1;
376   gdbarch->max_register_raw_size = -1;
377   gdbarch->max_register_virtual_size = -1;
378   gdbarch->use_generic_dummy_frames = -1;
379   gdbarch->call_dummy_start_offset = -1;
380   gdbarch->call_dummy_breakpoint_offset = -1;
381   gdbarch->call_dummy_breakpoint_offset_p = -1;
382   gdbarch->call_dummy_length = -1;
383   gdbarch->call_dummy_p = -1;
384   gdbarch->call_dummy_words = legacy_call_dummy_words;
385   gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
386   gdbarch->call_dummy_stack_adjust_p = -1;
387   gdbarch->coerce_float_to_double = default_coerce_float_to_double;
388   gdbarch->register_convertible = generic_register_convertible_not;
389   gdbarch->pointer_to_address = unsigned_pointer_to_address;
390   gdbarch->address_to_pointer = unsigned_address_to_pointer;
391   gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
392   gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
393   gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
394   gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
395   gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
396   gdbarch->decr_pc_after_break = -1;
397   gdbarch->function_start_offset = -1;
398   gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
399   gdbarch->frame_args_skip = -1;
400   gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
401   /* gdbarch_alloc() */
402
403   return gdbarch;
404 }
405
406
407 /* Free a gdbarch struct.  This should never happen in normal
408    operation --- once you've created a gdbarch, you keep it around.
409    However, if an architecture's init function encounters an error
410    building the structure, it may need to clean up a partially
411    constructed gdbarch.  */
412
413 void
414 gdbarch_free (struct gdbarch *arch)
415 {
416   /* At the moment, this is trivial.  */
417   free (arch);
418 }
419
420
421 /* Ensure that all values in a GDBARCH are reasonable. */
422
423 static void
424 verify_gdbarch (struct gdbarch *gdbarch)
425 {
426   /* Only perform sanity checks on a multi-arch target. */
427   if (GDB_MULTI_ARCH <= 0)
428     return;
429   /* fundamental */
430   if (gdbarch->byte_order == 0)
431     internal_error ("verify_gdbarch: byte-order unset");
432   if (gdbarch->bfd_arch_info == NULL)
433     internal_error ("verify_gdbarch: bfd_arch_info unset");
434   /* Check those that need to be defined for the given multi-arch level. */
435   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
436   if ((GDB_MULTI_ARCH >= 1)
437       && (gdbarch->ptr_bit == 0))
438     internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
439   if ((GDB_MULTI_ARCH >= 1)
440       && (gdbarch->short_bit == 0))
441     internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
442   if ((GDB_MULTI_ARCH >= 1)
443       && (gdbarch->int_bit == 0))
444     internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
445   if ((GDB_MULTI_ARCH >= 1)
446       && (gdbarch->long_bit == 0))
447     internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
448   if ((GDB_MULTI_ARCH >= 1)
449       && (gdbarch->long_long_bit == 0))
450     internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
451   if ((GDB_MULTI_ARCH >= 1)
452       && (gdbarch->float_bit == 0))
453     internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
454   if ((GDB_MULTI_ARCH >= 1)
455       && (gdbarch->double_bit == 0))
456     internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
457   if ((GDB_MULTI_ARCH >= 1)
458       && (gdbarch->long_double_bit == 0))
459     internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
460   /* Skip verify of ieee_float, invalid_p == 0 */
461   if ((GDB_MULTI_ARCH >= 1)
462       && (gdbarch->read_pc == 0))
463     internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
464   if ((GDB_MULTI_ARCH >= 1)
465       && (gdbarch->write_pc == 0))
466     internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
467   if ((GDB_MULTI_ARCH >= 1)
468       && (gdbarch->read_fp == 0))
469     internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
470   if ((GDB_MULTI_ARCH >= 1)
471       && (gdbarch->write_fp == 0))
472     internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
473   if ((GDB_MULTI_ARCH >= 1)
474       && (gdbarch->read_sp == 0))
475     internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
476   if ((GDB_MULTI_ARCH >= 1)
477       && (gdbarch->write_sp == 0))
478     internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
479   if ((GDB_MULTI_ARCH >= 2)
480       && (gdbarch->num_regs == -1))
481     internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
482   if ((GDB_MULTI_ARCH >= 2)
483       && (gdbarch->sp_regnum == -1))
484     internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
485   if ((GDB_MULTI_ARCH >= 2)
486       && (gdbarch->fp_regnum == -1))
487     internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
488   if ((GDB_MULTI_ARCH >= 2)
489       && (gdbarch->pc_regnum == -1))
490     internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
491   /* Skip verify of fp0_regnum, invalid_p == 0 */
492   /* Skip verify of npc_regnum, invalid_p == 0 */
493   /* Skip verify of nnpc_regnum, invalid_p == 0 */
494   /* Skip verify of register_name, invalid_p == 0 */
495   if ((GDB_MULTI_ARCH >= 2)
496       && (gdbarch->register_size == -1))
497     internal_error ("gdbarch: verify_gdbarch: register_size invalid");
498   if ((GDB_MULTI_ARCH >= 2)
499       && (gdbarch->register_bytes == -1))
500     internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
501   if ((GDB_MULTI_ARCH >= 2)
502       && (gdbarch->register_byte == 0))
503     internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
504   if ((GDB_MULTI_ARCH >= 2)
505       && (gdbarch->register_raw_size == 0))
506     internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
507   if ((GDB_MULTI_ARCH >= 2)
508       && (gdbarch->max_register_raw_size == -1))
509     internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
510   if ((GDB_MULTI_ARCH >= 2)
511       && (gdbarch->register_virtual_size == 0))
512     internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
513   if ((GDB_MULTI_ARCH >= 2)
514       && (gdbarch->max_register_virtual_size == -1))
515     internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
516   if ((GDB_MULTI_ARCH >= 2)
517       && (gdbarch->register_virtual_type == 0))
518     internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
519   if ((GDB_MULTI_ARCH >= 1)
520       && (gdbarch->use_generic_dummy_frames == -1))
521     internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
522   if ((GDB_MULTI_ARCH >= 2)
523       && (gdbarch->call_dummy_location == 0))
524     internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
525   if ((GDB_MULTI_ARCH >= 2)
526       && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
527     internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
528   if ((GDB_MULTI_ARCH >= 2)
529       && (gdbarch->call_dummy_start_offset == -1))
530     internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
531   if ((GDB_MULTI_ARCH >= 2)
532       && (gdbarch->call_dummy_breakpoint_offset == -1))
533     internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
534   if ((GDB_MULTI_ARCH >= 1)
535       && (gdbarch->call_dummy_breakpoint_offset_p == -1))
536     internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
537   if ((GDB_MULTI_ARCH >= 2)
538       && (gdbarch->call_dummy_length == -1))
539     internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
540   if ((GDB_MULTI_ARCH >= 2)
541       && (gdbarch->pc_in_call_dummy == 0))
542     internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
543   if ((GDB_MULTI_ARCH >= 1)
544       && (gdbarch->call_dummy_p == -1))
545     internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
546   /* Skip verify of call_dummy_words, invalid_p == 0 */
547   /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
548   if ((GDB_MULTI_ARCH >= 1)
549       && (gdbarch->call_dummy_stack_adjust_p == -1))
550     internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
551   if ((GDB_MULTI_ARCH >= 2)
552       && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
553     internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
554   if ((GDB_MULTI_ARCH >= 2)
555       && (gdbarch->fix_call_dummy == 0))
556     internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
557   /* Skip verify of coerce_float_to_double, invalid_p == 0 */
558   if ((GDB_MULTI_ARCH >= 1)
559       && (gdbarch->get_saved_register == 0))
560     internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
561   /* Skip verify of register_convertible, invalid_p == 0 */
562   /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
563   /* Skip verify of register_convert_to_raw, invalid_p == 0 */
564   /* Skip verify of pointer_to_address, invalid_p == 0 */
565   /* Skip verify of address_to_pointer, invalid_p == 0 */
566   /* Skip verify of return_value_on_stack, invalid_p == 0 */
567   if ((GDB_MULTI_ARCH >= 2)
568       && (gdbarch->extract_return_value == 0))
569     internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
570   if ((GDB_MULTI_ARCH >= 1)
571       && (gdbarch->push_arguments == 0))
572     internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
573   if ((GDB_MULTI_ARCH >= 2)
574       && (gdbarch->push_dummy_frame == 0))
575     internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
576   if ((GDB_MULTI_ARCH >= 1)
577       && (gdbarch->push_return_address == 0))
578     internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
579   if ((GDB_MULTI_ARCH >= 2)
580       && (gdbarch->pop_frame == 0))
581     internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
582   /* Skip verify of d10v_make_daddr, invalid_p == 0 */
583   /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
584   /* Skip verify of d10v_daddr_p, invalid_p == 0 */
585   /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
586   /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
587   /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
588   if ((GDB_MULTI_ARCH >= 2)
589       && (gdbarch->store_struct_return == 0))
590     internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
591   if ((GDB_MULTI_ARCH >= 2)
592       && (gdbarch->store_return_value == 0))
593     internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
594   if ((GDB_MULTI_ARCH >= 2)
595       && (gdbarch->extract_struct_value_address == 0))
596     internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
597   if ((GDB_MULTI_ARCH >= 2)
598       && (gdbarch->use_struct_convention == 0))
599     internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
600   if ((GDB_MULTI_ARCH >= 2)
601       && (gdbarch->frame_init_saved_regs == 0))
602     internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
603   if ((GDB_MULTI_ARCH >= 2)
604       && (gdbarch->init_extra_frame_info == 0))
605     internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
606   if ((GDB_MULTI_ARCH >= 2)
607       && (gdbarch->skip_prologue == 0))
608     internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
609   /* Skip verify of prologue_frameless_p, invalid_p == 0 */
610   if ((GDB_MULTI_ARCH >= 2)
611       && (gdbarch->inner_than == 0))
612     internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
613   /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
614   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
615   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
616   if ((GDB_MULTI_ARCH >= 2)
617       && (gdbarch->decr_pc_after_break == -1))
618     internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
619   if ((GDB_MULTI_ARCH >= 2)
620       && (gdbarch->function_start_offset == -1))
621     internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
622   /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
623   if ((GDB_MULTI_ARCH >= 2)
624       && (gdbarch->frame_args_skip == -1))
625     internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
626   /* Skip verify of frameless_function_invocation, invalid_p == 0 */
627   if ((GDB_MULTI_ARCH >= 2)
628       && (gdbarch->frame_chain == 0))
629     internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
630   if ((GDB_MULTI_ARCH >= 1)
631       && (gdbarch->frame_chain_valid == 0))
632     internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
633   if ((GDB_MULTI_ARCH >= 2)
634       && (gdbarch->frame_saved_pc == 0))
635     internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
636   if ((GDB_MULTI_ARCH >= 2)
637       && (gdbarch->frame_args_address == 0))
638     internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
639   if ((GDB_MULTI_ARCH >= 2)
640       && (gdbarch->frame_locals_address == 0))
641     internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
642   if ((GDB_MULTI_ARCH >= 2)
643       && (gdbarch->saved_pc_after_call == 0))
644     internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
645   if ((GDB_MULTI_ARCH >= 2)
646       && (gdbarch->frame_num_args == 0))
647     internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
648   /* Skip verify of stack_align, has predicate */
649   /* Skip verify of reg_struct_has_addr, has predicate */
650   /* Skip verify of save_dummy_frame_tos, has predicate */
651   if (gdbarch->float_format == 0)
652     gdbarch->float_format = default_float_format (gdbarch);
653   if (gdbarch->double_format == 0)
654     gdbarch->double_format = default_double_format (gdbarch);
655   if (gdbarch->long_double_format == 0)
656     gdbarch->long_double_format = &floatformat_unknown;
657 }
658
659
660 /* Print out the details of the current architecture. */
661
662 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
663    just happens to match the global variable ``current_gdbarch''.  That
664    way macros refering to that variable get the local and not the global
665    version - ulgh.  Once everything is parameterised with gdbarch, this
666    will go away. */
667
668 void
669 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
670 {
671   fprintf_unfiltered (file,
672                       "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
673                       GDB_MULTI_ARCH);
674 #ifdef TARGET_ARCHITECTURE
675   fprintf_unfiltered (file,
676                       "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
677                       XSTRING (TARGET_ARCHITECTURE));
678 #endif
679 #ifdef TARGET_BYTE_ORDER
680   fprintf_unfiltered (file,
681                       "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
682                       XSTRING (TARGET_BYTE_ORDER));
683 #endif
684 #ifdef TARGET_BFD_VMA_BIT
685   fprintf_unfiltered (file,
686                       "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
687                       XSTRING (TARGET_BFD_VMA_BIT));
688 #endif
689 #ifdef TARGET_PTR_BIT
690   fprintf_unfiltered (file,
691                       "gdbarch_dump: TARGET_PTR_BIT # %s\n",
692                       XSTRING (TARGET_PTR_BIT));
693 #endif
694 #ifdef TARGET_SHORT_BIT
695   fprintf_unfiltered (file,
696                       "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
697                       XSTRING (TARGET_SHORT_BIT));
698 #endif
699 #ifdef TARGET_INT_BIT
700   fprintf_unfiltered (file,
701                       "gdbarch_dump: TARGET_INT_BIT # %s\n",
702                       XSTRING (TARGET_INT_BIT));
703 #endif
704 #ifdef TARGET_LONG_BIT
705   fprintf_unfiltered (file,
706                       "gdbarch_dump: TARGET_LONG_BIT # %s\n",
707                       XSTRING (TARGET_LONG_BIT));
708 #endif
709 #ifdef TARGET_LONG_LONG_BIT
710   fprintf_unfiltered (file,
711                       "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
712                       XSTRING (TARGET_LONG_LONG_BIT));
713 #endif
714 #ifdef TARGET_FLOAT_BIT
715   fprintf_unfiltered (file,
716                       "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
717                       XSTRING (TARGET_FLOAT_BIT));
718 #endif
719 #ifdef TARGET_DOUBLE_BIT
720   fprintf_unfiltered (file,
721                       "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
722                       XSTRING (TARGET_DOUBLE_BIT));
723 #endif
724 #ifdef TARGET_LONG_DOUBLE_BIT
725   fprintf_unfiltered (file,
726                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
727                       XSTRING (TARGET_LONG_DOUBLE_BIT));
728 #endif
729 #ifdef IEEE_FLOAT
730   fprintf_unfiltered (file,
731                       "gdbarch_dump: IEEE_FLOAT # %s\n",
732                       XSTRING (IEEE_FLOAT));
733 #endif
734 #ifdef TARGET_READ_PC
735   fprintf_unfiltered (file,
736                       "gdbarch_dump: %s # %s\n",
737                       "TARGET_READ_PC(pid)",
738                       XSTRING (TARGET_READ_PC (pid)));
739 #endif
740 #ifdef TARGET_WRITE_PC
741   fprintf_unfiltered (file,
742                       "gdbarch_dump: %s # %s\n",
743                       "TARGET_WRITE_PC(val, pid)",
744                       XSTRING (TARGET_WRITE_PC (val, pid)));
745 #endif
746 #ifdef TARGET_READ_FP
747   fprintf_unfiltered (file,
748                       "gdbarch_dump: %s # %s\n",
749                       "TARGET_READ_FP()",
750                       XSTRING (TARGET_READ_FP ()));
751 #endif
752 #ifdef TARGET_WRITE_FP
753   fprintf_unfiltered (file,
754                       "gdbarch_dump: %s # %s\n",
755                       "TARGET_WRITE_FP(val)",
756                       XSTRING (TARGET_WRITE_FP (val)));
757 #endif
758 #ifdef TARGET_READ_SP
759   fprintf_unfiltered (file,
760                       "gdbarch_dump: %s # %s\n",
761                       "TARGET_READ_SP()",
762                       XSTRING (TARGET_READ_SP ()));
763 #endif
764 #ifdef TARGET_WRITE_SP
765   fprintf_unfiltered (file,
766                       "gdbarch_dump: %s # %s\n",
767                       "TARGET_WRITE_SP(val)",
768                       XSTRING (TARGET_WRITE_SP (val)));
769 #endif
770 #ifdef NUM_REGS
771   fprintf_unfiltered (file,
772                       "gdbarch_dump: NUM_REGS # %s\n",
773                       XSTRING (NUM_REGS));
774 #endif
775 #ifdef SP_REGNUM
776   fprintf_unfiltered (file,
777                       "gdbarch_dump: SP_REGNUM # %s\n",
778                       XSTRING (SP_REGNUM));
779 #endif
780 #ifdef FP_REGNUM
781   fprintf_unfiltered (file,
782                       "gdbarch_dump: FP_REGNUM # %s\n",
783                       XSTRING (FP_REGNUM));
784 #endif
785 #ifdef PC_REGNUM
786   fprintf_unfiltered (file,
787                       "gdbarch_dump: PC_REGNUM # %s\n",
788                       XSTRING (PC_REGNUM));
789 #endif
790 #ifdef FP0_REGNUM
791   fprintf_unfiltered (file,
792                       "gdbarch_dump: FP0_REGNUM # %s\n",
793                       XSTRING (FP0_REGNUM));
794 #endif
795 #ifdef NPC_REGNUM
796   fprintf_unfiltered (file,
797                       "gdbarch_dump: NPC_REGNUM # %s\n",
798                       XSTRING (NPC_REGNUM));
799 #endif
800 #ifdef NNPC_REGNUM
801   fprintf_unfiltered (file,
802                       "gdbarch_dump: NNPC_REGNUM # %s\n",
803                       XSTRING (NNPC_REGNUM));
804 #endif
805 #ifdef REGISTER_NAME
806   fprintf_unfiltered (file,
807                       "gdbarch_dump: %s # %s\n",
808                       "REGISTER_NAME(regnr)",
809                       XSTRING (REGISTER_NAME (regnr)));
810 #endif
811 #ifdef REGISTER_SIZE
812   fprintf_unfiltered (file,
813                       "gdbarch_dump: REGISTER_SIZE # %s\n",
814                       XSTRING (REGISTER_SIZE));
815 #endif
816 #ifdef REGISTER_BYTES
817   fprintf_unfiltered (file,
818                       "gdbarch_dump: REGISTER_BYTES # %s\n",
819                       XSTRING (REGISTER_BYTES));
820 #endif
821 #ifdef REGISTER_BYTE
822   fprintf_unfiltered (file,
823                       "gdbarch_dump: %s # %s\n",
824                       "REGISTER_BYTE(reg_nr)",
825                       XSTRING (REGISTER_BYTE (reg_nr)));
826 #endif
827 #ifdef REGISTER_RAW_SIZE
828   fprintf_unfiltered (file,
829                       "gdbarch_dump: %s # %s\n",
830                       "REGISTER_RAW_SIZE(reg_nr)",
831                       XSTRING (REGISTER_RAW_SIZE (reg_nr)));
832 #endif
833 #ifdef MAX_REGISTER_RAW_SIZE
834   fprintf_unfiltered (file,
835                       "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
836                       XSTRING (MAX_REGISTER_RAW_SIZE));
837 #endif
838 #ifdef REGISTER_VIRTUAL_SIZE
839   fprintf_unfiltered (file,
840                       "gdbarch_dump: %s # %s\n",
841                       "REGISTER_VIRTUAL_SIZE(reg_nr)",
842                       XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
843 #endif
844 #ifdef MAX_REGISTER_VIRTUAL_SIZE
845   fprintf_unfiltered (file,
846                       "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
847                       XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
848 #endif
849 #ifdef REGISTER_VIRTUAL_TYPE
850   fprintf_unfiltered (file,
851                       "gdbarch_dump: %s # %s\n",
852                       "REGISTER_VIRTUAL_TYPE(reg_nr)",
853                       XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
854 #endif
855 #ifdef USE_GENERIC_DUMMY_FRAMES
856   fprintf_unfiltered (file,
857                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
858                       XSTRING (USE_GENERIC_DUMMY_FRAMES));
859 #endif
860 #ifdef CALL_DUMMY_LOCATION
861   fprintf_unfiltered (file,
862                       "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
863                       XSTRING (CALL_DUMMY_LOCATION));
864 #endif
865 #ifdef CALL_DUMMY_ADDRESS
866   fprintf_unfiltered (file,
867                       "gdbarch_dump: %s # %s\n",
868                       "CALL_DUMMY_ADDRESS()",
869                       XSTRING (CALL_DUMMY_ADDRESS ()));
870 #endif
871 #ifdef CALL_DUMMY_START_OFFSET
872   fprintf_unfiltered (file,
873                       "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
874                       XSTRING (CALL_DUMMY_START_OFFSET));
875 #endif
876 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
877   fprintf_unfiltered (file,
878                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
879                       XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
880 #endif
881 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
882   fprintf_unfiltered (file,
883                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
884                       XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
885 #endif
886 #ifdef CALL_DUMMY_LENGTH
887   fprintf_unfiltered (file,
888                       "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
889                       XSTRING (CALL_DUMMY_LENGTH));
890 #endif
891 #ifdef PC_IN_CALL_DUMMY
892   fprintf_unfiltered (file,
893                       "gdbarch_dump: %s # %s\n",
894                       "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
895                       XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
896 #endif
897 #ifdef CALL_DUMMY_P
898   fprintf_unfiltered (file,
899                       "gdbarch_dump: CALL_DUMMY_P # %s\n",
900                       XSTRING (CALL_DUMMY_P));
901 #endif
902 #ifdef CALL_DUMMY_WORDS
903   fprintf_unfiltered (file,
904                       "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
905                       XSTRING (CALL_DUMMY_WORDS));
906 #endif
907 #ifdef SIZEOF_CALL_DUMMY_WORDS
908   fprintf_unfiltered (file,
909                       "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
910                       XSTRING (SIZEOF_CALL_DUMMY_WORDS));
911 #endif
912 #ifdef CALL_DUMMY_STACK_ADJUST_P
913   fprintf_unfiltered (file,
914                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
915                       XSTRING (CALL_DUMMY_STACK_ADJUST_P));
916 #endif
917 #ifdef CALL_DUMMY_STACK_ADJUST
918   fprintf_unfiltered (file,
919                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
920                       XSTRING (CALL_DUMMY_STACK_ADJUST));
921 #endif
922 #ifdef FIX_CALL_DUMMY
923   fprintf_unfiltered (file,
924                       "gdbarch_dump: %s # %s\n",
925                       "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
926                       XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
927 #endif
928 #ifdef BELIEVE_PCC_PROMOTION
929   fprintf_unfiltered (file,
930                       "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
931                       XSTRING (BELIEVE_PCC_PROMOTION));
932 #endif
933 #ifdef BELIEVE_PCC_PROMOTION_TYPE
934   fprintf_unfiltered (file,
935                       "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
936                       XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
937 #endif
938 #ifdef COERCE_FLOAT_TO_DOUBLE
939   fprintf_unfiltered (file,
940                       "gdbarch_dump: %s # %s\n",
941                       "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
942                       XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
943 #endif
944 #ifdef GET_SAVED_REGISTER
945   fprintf_unfiltered (file,
946                       "gdbarch_dump: %s # %s\n",
947                       "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
948                       XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
949 #endif
950 #ifdef REGISTER_CONVERTIBLE
951   fprintf_unfiltered (file,
952                       "gdbarch_dump: %s # %s\n",
953                       "REGISTER_CONVERTIBLE(nr)",
954                       XSTRING (REGISTER_CONVERTIBLE (nr)));
955 #endif
956 #ifdef REGISTER_CONVERT_TO_VIRTUAL
957   fprintf_unfiltered (file,
958                       "gdbarch_dump: %s # %s\n",
959                       "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
960                       XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
961 #endif
962 #ifdef REGISTER_CONVERT_TO_RAW
963   fprintf_unfiltered (file,
964                       "gdbarch_dump: %s # %s\n",
965                       "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
966                       XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
967 #endif
968 #ifdef POINTER_TO_ADDRESS
969   fprintf_unfiltered (file,
970                       "gdbarch_dump: %s # %s\n",
971                       "POINTER_TO_ADDRESS(type, buf)",
972                       XSTRING (POINTER_TO_ADDRESS (type, buf)));
973 #endif
974 #ifdef ADDRESS_TO_POINTER
975   fprintf_unfiltered (file,
976                       "gdbarch_dump: %s # %s\n",
977                       "ADDRESS_TO_POINTER(type, buf, addr)",
978                       XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
979 #endif
980 #ifdef RETURN_VALUE_ON_STACK
981   fprintf_unfiltered (file,
982                       "gdbarch_dump: %s # %s\n",
983                       "RETURN_VALUE_ON_STACK(type)",
984                       XSTRING (RETURN_VALUE_ON_STACK (type)));
985 #endif
986 #ifdef EXTRACT_RETURN_VALUE
987   fprintf_unfiltered (file,
988                       "gdbarch_dump: %s # %s\n",
989                       "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
990                       XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
991 #endif
992 #ifdef PUSH_ARGUMENTS
993   fprintf_unfiltered (file,
994                       "gdbarch_dump: %s # %s\n",
995                       "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
996                       XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
997 #endif
998 #ifdef PUSH_DUMMY_FRAME
999   fprintf_unfiltered (file,
1000                       "gdbarch_dump: %s # %s\n",
1001                       "PUSH_DUMMY_FRAME(-)",
1002                       XSTRING (PUSH_DUMMY_FRAME (-)));
1003 #endif
1004 #ifdef PUSH_RETURN_ADDRESS
1005   fprintf_unfiltered (file,
1006                       "gdbarch_dump: %s # %s\n",
1007                       "PUSH_RETURN_ADDRESS(pc, sp)",
1008                       XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1009 #endif
1010 #ifdef POP_FRAME
1011   fprintf_unfiltered (file,
1012                       "gdbarch_dump: %s # %s\n",
1013                       "POP_FRAME(-)",
1014                       XSTRING (POP_FRAME (-)));
1015 #endif
1016 #ifdef D10V_MAKE_DADDR
1017   fprintf_unfiltered (file,
1018                       "gdbarch_dump: %s # %s\n",
1019                       "D10V_MAKE_DADDR(x)",
1020                       XSTRING (D10V_MAKE_DADDR (x)));
1021 #endif
1022 #ifdef D10V_MAKE_IADDR
1023   fprintf_unfiltered (file,
1024                       "gdbarch_dump: %s # %s\n",
1025                       "D10V_MAKE_IADDR(x)",
1026                       XSTRING (D10V_MAKE_IADDR (x)));
1027 #endif
1028 #ifdef D10V_DADDR_P
1029   fprintf_unfiltered (file,
1030                       "gdbarch_dump: %s # %s\n",
1031                       "D10V_DADDR_P(x)",
1032                       XSTRING (D10V_DADDR_P (x)));
1033 #endif
1034 #ifdef D10V_IADDR_P
1035   fprintf_unfiltered (file,
1036                       "gdbarch_dump: %s # %s\n",
1037                       "D10V_IADDR_P(x)",
1038                       XSTRING (D10V_IADDR_P (x)));
1039 #endif
1040 #ifdef D10V_CONVERT_DADDR_TO_RAW
1041   fprintf_unfiltered (file,
1042                       "gdbarch_dump: %s # %s\n",
1043                       "D10V_CONVERT_DADDR_TO_RAW(x)",
1044                       XSTRING (D10V_CONVERT_DADDR_TO_RAW (x)));
1045 #endif
1046 #ifdef D10V_CONVERT_IADDR_TO_RAW
1047   fprintf_unfiltered (file,
1048                       "gdbarch_dump: %s # %s\n",
1049                       "D10V_CONVERT_IADDR_TO_RAW(x)",
1050                       XSTRING (D10V_CONVERT_IADDR_TO_RAW (x)));
1051 #endif
1052 #ifdef STORE_STRUCT_RETURN
1053   fprintf_unfiltered (file,
1054                       "gdbarch_dump: %s # %s\n",
1055                       "STORE_STRUCT_RETURN(addr, sp)",
1056                       XSTRING (STORE_STRUCT_RETURN (addr, sp)));
1057 #endif
1058 #ifdef STORE_RETURN_VALUE
1059   fprintf_unfiltered (file,
1060                       "gdbarch_dump: %s # %s\n",
1061                       "STORE_RETURN_VALUE(type, valbuf)",
1062                       XSTRING (STORE_RETURN_VALUE (type, valbuf)));
1063 #endif
1064 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1065   fprintf_unfiltered (file,
1066                       "gdbarch_dump: %s # %s\n",
1067                       "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1068                       XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1069 #endif
1070 #ifdef USE_STRUCT_CONVENTION
1071   fprintf_unfiltered (file,
1072                       "gdbarch_dump: %s # %s\n",
1073                       "USE_STRUCT_CONVENTION(gcc_p, value_type)",
1074                       XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
1075 #endif
1076 #ifdef FRAME_INIT_SAVED_REGS
1077   fprintf_unfiltered (file,
1078                       "gdbarch_dump: %s # %s\n",
1079                       "FRAME_INIT_SAVED_REGS(frame)",
1080                       XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1081 #endif
1082 #ifdef INIT_EXTRA_FRAME_INFO
1083   fprintf_unfiltered (file,
1084                       "gdbarch_dump: %s # %s\n",
1085                       "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1086                       XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1087 #endif
1088 #ifdef SKIP_PROLOGUE
1089   fprintf_unfiltered (file,
1090                       "gdbarch_dump: %s # %s\n",
1091                       "SKIP_PROLOGUE(ip)",
1092                       XSTRING (SKIP_PROLOGUE (ip)));
1093 #endif
1094 #ifdef PROLOGUE_FRAMELESS_P
1095   fprintf_unfiltered (file,
1096                       "gdbarch_dump: %s # %s\n",
1097                       "PROLOGUE_FRAMELESS_P(ip)",
1098                       XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1099 #endif
1100 #ifdef INNER_THAN
1101   fprintf_unfiltered (file,
1102                       "gdbarch_dump: %s # %s\n",
1103                       "INNER_THAN(lhs, rhs)",
1104                       XSTRING (INNER_THAN (lhs, rhs)));
1105 #endif
1106 #ifdef BREAKPOINT_FROM_PC
1107   fprintf_unfiltered (file,
1108                       "gdbarch_dump: %s # %s\n",
1109                       "BREAKPOINT_FROM_PC(pcptr, lenptr)",
1110                       XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
1111 #endif
1112 #ifdef MEMORY_INSERT_BREAKPOINT
1113   fprintf_unfiltered (file,
1114                       "gdbarch_dump: %s # %s\n",
1115                       "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1116                       XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1117 #endif
1118 #ifdef MEMORY_REMOVE_BREAKPOINT
1119   fprintf_unfiltered (file,
1120                       "gdbarch_dump: %s # %s\n",
1121                       "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1122                       XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1123 #endif
1124 #ifdef DECR_PC_AFTER_BREAK
1125   fprintf_unfiltered (file,
1126                       "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1127                       XSTRING (DECR_PC_AFTER_BREAK));
1128 #endif
1129 #ifdef FUNCTION_START_OFFSET
1130   fprintf_unfiltered (file,
1131                       "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1132                       XSTRING (FUNCTION_START_OFFSET));
1133 #endif
1134 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1135   fprintf_unfiltered (file,
1136                       "gdbarch_dump: %s # %s\n",
1137                       "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
1138                       XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
1139 #endif
1140 #ifdef FRAME_ARGS_SKIP
1141   fprintf_unfiltered (file,
1142                       "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1143                       XSTRING (FRAME_ARGS_SKIP));
1144 #endif
1145 #ifdef FRAMELESS_FUNCTION_INVOCATION
1146   fprintf_unfiltered (file,
1147                       "gdbarch_dump: %s # %s\n",
1148                       "FRAMELESS_FUNCTION_INVOCATION(fi)",
1149                       XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1150 #endif
1151 #ifdef FRAME_CHAIN
1152   fprintf_unfiltered (file,
1153                       "gdbarch_dump: %s # %s\n",
1154                       "FRAME_CHAIN(frame)",
1155                       XSTRING (FRAME_CHAIN (frame)));
1156 #endif
1157 #ifdef FRAME_CHAIN_VALID
1158   fprintf_unfiltered (file,
1159                       "gdbarch_dump: %s # %s\n",
1160                       "FRAME_CHAIN_VALID(chain, thisframe)",
1161                       XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1162 #endif
1163 #ifdef FRAME_SAVED_PC
1164   fprintf_unfiltered (file,
1165                       "gdbarch_dump: %s # %s\n",
1166                       "FRAME_SAVED_PC(fi)",
1167                       XSTRING (FRAME_SAVED_PC (fi)));
1168 #endif
1169 #ifdef FRAME_ARGS_ADDRESS
1170   fprintf_unfiltered (file,
1171                       "gdbarch_dump: %s # %s\n",
1172                       "FRAME_ARGS_ADDRESS(fi)",
1173                       XSTRING (FRAME_ARGS_ADDRESS (fi)));
1174 #endif
1175 #ifdef FRAME_LOCALS_ADDRESS
1176   fprintf_unfiltered (file,
1177                       "gdbarch_dump: %s # %s\n",
1178                       "FRAME_LOCALS_ADDRESS(fi)",
1179                       XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1180 #endif
1181 #ifdef SAVED_PC_AFTER_CALL
1182   fprintf_unfiltered (file,
1183                       "gdbarch_dump: %s # %s\n",
1184                       "SAVED_PC_AFTER_CALL(frame)",
1185                       XSTRING (SAVED_PC_AFTER_CALL (frame)));
1186 #endif
1187 #ifdef FRAME_NUM_ARGS
1188   fprintf_unfiltered (file,
1189                       "gdbarch_dump: %s # %s\n",
1190                       "FRAME_NUM_ARGS(frame)",
1191                       XSTRING (FRAME_NUM_ARGS (frame)));
1192 #endif
1193 #ifdef STACK_ALIGN
1194   fprintf_unfiltered (file,
1195                       "gdbarch_dump: %s # %s\n",
1196                       "STACK_ALIGN(sp)",
1197                       XSTRING (STACK_ALIGN (sp)));
1198 #endif
1199 #ifdef REG_STRUCT_HAS_ADDR
1200   fprintf_unfiltered (file,
1201                       "gdbarch_dump: %s # %s\n",
1202                       "REG_STRUCT_HAS_ADDR(gcc_p, type)",
1203                       XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
1204 #endif
1205 #ifdef SAVE_DUMMY_FRAME_TOS
1206   fprintf_unfiltered (file,
1207                       "gdbarch_dump: %s # %s\n",
1208                       "SAVE_DUMMY_FRAME_TOS(sp)",
1209                       XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
1210 #endif
1211 #ifdef TARGET_FLOAT_FORMAT
1212   fprintf_unfiltered (file,
1213                       "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1214                       XSTRING (TARGET_FLOAT_FORMAT));
1215 #endif
1216 #ifdef TARGET_DOUBLE_FORMAT
1217   fprintf_unfiltered (file,
1218                       "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1219                       XSTRING (TARGET_DOUBLE_FORMAT));
1220 #endif
1221 #ifdef TARGET_LONG_DOUBLE_FORMAT
1222   fprintf_unfiltered (file,
1223                       "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1224                       XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1225 #endif
1226 #ifdef TARGET_ARCHITECTURE
1227   if (TARGET_ARCHITECTURE != NULL)
1228     fprintf_unfiltered (file,
1229                         "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
1230                         TARGET_ARCHITECTURE->printable_name);
1231 #endif
1232 #ifdef TARGET_BYTE_ORDER
1233   fprintf_unfiltered (file,
1234                       "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
1235                       (long) TARGET_BYTE_ORDER);
1236 #endif
1237 #ifdef TARGET_BFD_VMA_BIT
1238   fprintf_unfiltered (file,
1239                       "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
1240                       (long) TARGET_BFD_VMA_BIT);
1241 #endif
1242 #ifdef TARGET_PTR_BIT
1243   fprintf_unfiltered (file,
1244                       "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
1245                       (long) TARGET_PTR_BIT);
1246 #endif
1247 #ifdef TARGET_SHORT_BIT
1248   fprintf_unfiltered (file,
1249                       "gdbarch_dump: TARGET_SHORT_BIT = %ld\n",
1250                       (long) TARGET_SHORT_BIT);
1251 #endif
1252 #ifdef TARGET_INT_BIT
1253   fprintf_unfiltered (file,
1254                       "gdbarch_dump: TARGET_INT_BIT = %ld\n",
1255                       (long) TARGET_INT_BIT);
1256 #endif
1257 #ifdef TARGET_LONG_BIT
1258   fprintf_unfiltered (file,
1259                       "gdbarch_dump: TARGET_LONG_BIT = %ld\n",
1260                       (long) TARGET_LONG_BIT);
1261 #endif
1262 #ifdef TARGET_LONG_LONG_BIT
1263   fprintf_unfiltered (file,
1264                       "gdbarch_dump: TARGET_LONG_LONG_BIT = %ld\n",
1265                       (long) TARGET_LONG_LONG_BIT);
1266 #endif
1267 #ifdef TARGET_FLOAT_BIT
1268   fprintf_unfiltered (file,
1269                       "gdbarch_dump: TARGET_FLOAT_BIT = %ld\n",
1270                       (long) TARGET_FLOAT_BIT);
1271 #endif
1272 #ifdef TARGET_DOUBLE_BIT
1273   fprintf_unfiltered (file,
1274                       "gdbarch_dump: TARGET_DOUBLE_BIT = %ld\n",
1275                       (long) TARGET_DOUBLE_BIT);
1276 #endif
1277 #ifdef TARGET_LONG_DOUBLE_BIT
1278   fprintf_unfiltered (file,
1279                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n",
1280                       (long) TARGET_LONG_DOUBLE_BIT);
1281 #endif
1282 #ifdef IEEE_FLOAT
1283   fprintf_unfiltered (file,
1284                       "gdbarch_dump: IEEE_FLOAT = %ld\n",
1285                       (long) IEEE_FLOAT);
1286 #endif
1287 #ifdef TARGET_READ_PC
1288   if (GDB_MULTI_ARCH)
1289     fprintf_unfiltered (file,
1290                         "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
1291                         (long) current_gdbarch->read_pc
1292                         /*TARGET_READ_PC ()*/);
1293 #endif
1294 #ifdef TARGET_WRITE_PC
1295   if (GDB_MULTI_ARCH)
1296     fprintf_unfiltered (file,
1297                         "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
1298                         (long) current_gdbarch->write_pc
1299                         /*TARGET_WRITE_PC ()*/);
1300 #endif
1301 #ifdef TARGET_READ_FP
1302   if (GDB_MULTI_ARCH)
1303     fprintf_unfiltered (file,
1304                         "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
1305                         (long) current_gdbarch->read_fp
1306                         /*TARGET_READ_FP ()*/);
1307 #endif
1308 #ifdef TARGET_WRITE_FP
1309   if (GDB_MULTI_ARCH)
1310     fprintf_unfiltered (file,
1311                         "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
1312                         (long) current_gdbarch->write_fp
1313                         /*TARGET_WRITE_FP ()*/);
1314 #endif
1315 #ifdef TARGET_READ_SP
1316   if (GDB_MULTI_ARCH)
1317     fprintf_unfiltered (file,
1318                         "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
1319                         (long) current_gdbarch->read_sp
1320                         /*TARGET_READ_SP ()*/);
1321 #endif
1322 #ifdef TARGET_WRITE_SP
1323   if (GDB_MULTI_ARCH)
1324     fprintf_unfiltered (file,
1325                         "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
1326                         (long) current_gdbarch->write_sp
1327                         /*TARGET_WRITE_SP ()*/);
1328 #endif
1329 #ifdef NUM_REGS
1330   fprintf_unfiltered (file,
1331                       "gdbarch_dump: NUM_REGS = %ld\n",
1332                       (long) NUM_REGS);
1333 #endif
1334 #ifdef SP_REGNUM
1335   fprintf_unfiltered (file,
1336                       "gdbarch_dump: SP_REGNUM = %ld\n",
1337                       (long) SP_REGNUM);
1338 #endif
1339 #ifdef FP_REGNUM
1340   fprintf_unfiltered (file,
1341                       "gdbarch_dump: FP_REGNUM = %ld\n",
1342                       (long) FP_REGNUM);
1343 #endif
1344 #ifdef PC_REGNUM
1345   fprintf_unfiltered (file,
1346                       "gdbarch_dump: PC_REGNUM = %ld\n",
1347                       (long) PC_REGNUM);
1348 #endif
1349 #ifdef FP0_REGNUM
1350   fprintf_unfiltered (file,
1351                       "gdbarch_dump: FP0_REGNUM = %ld\n",
1352                       (long) FP0_REGNUM);
1353 #endif
1354 #ifdef NPC_REGNUM
1355   fprintf_unfiltered (file,
1356                       "gdbarch_dump: NPC_REGNUM = %ld\n",
1357                       (long) NPC_REGNUM);
1358 #endif
1359 #ifdef NNPC_REGNUM
1360   fprintf_unfiltered (file,
1361                       "gdbarch_dump: NNPC_REGNUM = %ld\n",
1362                       (long) NNPC_REGNUM);
1363 #endif
1364 #ifdef REGISTER_NAME
1365   if (GDB_MULTI_ARCH)
1366     fprintf_unfiltered (file,
1367                         "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
1368                         (long) current_gdbarch->register_name
1369                         /*REGISTER_NAME ()*/);
1370 #endif
1371 #ifdef REGISTER_SIZE
1372   fprintf_unfiltered (file,
1373                       "gdbarch_dump: REGISTER_SIZE = %ld\n",
1374                       (long) REGISTER_SIZE);
1375 #endif
1376 #ifdef REGISTER_BYTES
1377   fprintf_unfiltered (file,
1378                       "gdbarch_dump: REGISTER_BYTES = %ld\n",
1379                       (long) REGISTER_BYTES);
1380 #endif
1381 #ifdef REGISTER_BYTE
1382   if (GDB_MULTI_ARCH)
1383     fprintf_unfiltered (file,
1384                         "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
1385                         (long) current_gdbarch->register_byte
1386                         /*REGISTER_BYTE ()*/);
1387 #endif
1388 #ifdef REGISTER_RAW_SIZE
1389   if (GDB_MULTI_ARCH)
1390     fprintf_unfiltered (file,
1391                         "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
1392                         (long) current_gdbarch->register_raw_size
1393                         /*REGISTER_RAW_SIZE ()*/);
1394 #endif
1395 #ifdef MAX_REGISTER_RAW_SIZE
1396   fprintf_unfiltered (file,
1397                       "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %ld\n",
1398                       (long) MAX_REGISTER_RAW_SIZE);
1399 #endif
1400 #ifdef REGISTER_VIRTUAL_SIZE
1401   if (GDB_MULTI_ARCH)
1402     fprintf_unfiltered (file,
1403                         "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
1404                         (long) current_gdbarch->register_virtual_size
1405                         /*REGISTER_VIRTUAL_SIZE ()*/);
1406 #endif
1407 #ifdef MAX_REGISTER_VIRTUAL_SIZE
1408   fprintf_unfiltered (file,
1409                       "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
1410                       (long) MAX_REGISTER_VIRTUAL_SIZE);
1411 #endif
1412 #ifdef REGISTER_VIRTUAL_TYPE
1413   if (GDB_MULTI_ARCH)
1414     fprintf_unfiltered (file,
1415                         "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
1416                         (long) current_gdbarch->register_virtual_type
1417                         /*REGISTER_VIRTUAL_TYPE ()*/);
1418 #endif
1419 #ifdef USE_GENERIC_DUMMY_FRAMES
1420   fprintf_unfiltered (file,
1421                       "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
1422                       (long) USE_GENERIC_DUMMY_FRAMES);
1423 #endif
1424 #ifdef CALL_DUMMY_LOCATION
1425   fprintf_unfiltered (file,
1426                       "gdbarch_dump: CALL_DUMMY_LOCATION = %ld\n",
1427                       (long) CALL_DUMMY_LOCATION);
1428 #endif
1429 #ifdef CALL_DUMMY_ADDRESS
1430   if (GDB_MULTI_ARCH)
1431     fprintf_unfiltered (file,
1432                         "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
1433                         (long) current_gdbarch->call_dummy_address
1434                         /*CALL_DUMMY_ADDRESS ()*/);
1435 #endif
1436 #ifdef CALL_DUMMY_START_OFFSET
1437   fprintf_unfiltered (file,
1438                       "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
1439                       (long) CALL_DUMMY_START_OFFSET);
1440 #endif
1441 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
1442   fprintf_unfiltered (file,
1443                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
1444                       (long) CALL_DUMMY_BREAKPOINT_OFFSET);
1445 #endif
1446 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
1447   fprintf_unfiltered (file,
1448                       "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
1449                       (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
1450 #endif
1451 #ifdef CALL_DUMMY_LENGTH
1452   if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
1453     fprintf_unfiltered (file,
1454                         "gdbarch_dump: CALL_DUMMY_LENGTH = %ld\n",
1455                         (long) CALL_DUMMY_LENGTH);
1456 #endif
1457 #ifdef PC_IN_CALL_DUMMY
1458   if (GDB_MULTI_ARCH)
1459     fprintf_unfiltered (file,
1460                         "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
1461                         (long) current_gdbarch->pc_in_call_dummy
1462                         /*PC_IN_CALL_DUMMY ()*/);
1463 #endif
1464 #ifdef CALL_DUMMY_P
1465   fprintf_unfiltered (file,
1466                       "gdbarch_dump: CALL_DUMMY_P = %ld\n",
1467                       (long) CALL_DUMMY_P);
1468 #endif
1469 #ifdef CALL_DUMMY_WORDS
1470   fprintf_unfiltered (file,
1471                       "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
1472                       (long) CALL_DUMMY_WORDS);
1473 #endif
1474 #ifdef SIZEOF_CALL_DUMMY_WORDS
1475   fprintf_unfiltered (file,
1476                       "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
1477                       (long) SIZEOF_CALL_DUMMY_WORDS);
1478 #endif
1479 #ifdef CALL_DUMMY_STACK_ADJUST_P
1480   fprintf_unfiltered (file,
1481                       "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
1482                       (long) CALL_DUMMY_STACK_ADJUST_P);
1483 #endif
1484 #ifdef CALL_DUMMY_STACK_ADJUST
1485   if (CALL_DUMMY_STACK_ADJUST_P)
1486     fprintf_unfiltered (file,
1487                         "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
1488                         (long) CALL_DUMMY_STACK_ADJUST);
1489 #endif
1490 #ifdef FIX_CALL_DUMMY
1491   if (GDB_MULTI_ARCH)
1492     fprintf_unfiltered (file,
1493                         "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1494                         (long) current_gdbarch->fix_call_dummy
1495                         /*FIX_CALL_DUMMY ()*/);
1496 #endif
1497 #ifdef BELIEVE_PCC_PROMOTION
1498   fprintf_unfiltered (file,
1499                       "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n",
1500                       (long) BELIEVE_PCC_PROMOTION);
1501 #endif
1502 #ifdef BELIEVE_PCC_PROMOTION_TYPE
1503   fprintf_unfiltered (file,
1504                       "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
1505                       (long) BELIEVE_PCC_PROMOTION_TYPE);
1506 #endif
1507 #ifdef COERCE_FLOAT_TO_DOUBLE
1508   if (GDB_MULTI_ARCH)
1509     fprintf_unfiltered (file,
1510                         "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
1511                         (long) current_gdbarch->coerce_float_to_double
1512                         /*COERCE_FLOAT_TO_DOUBLE ()*/);
1513 #endif
1514 #ifdef GET_SAVED_REGISTER
1515   if (GDB_MULTI_ARCH)
1516     fprintf_unfiltered (file,
1517                         "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1518                         (long) current_gdbarch->get_saved_register
1519                         /*GET_SAVED_REGISTER ()*/);
1520 #endif
1521 #ifdef REGISTER_CONVERTIBLE
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_VIRTUAL
1529   if (GDB_MULTI_ARCH)
1530     fprintf_unfiltered (file,
1531                         "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
1532                         (long) current_gdbarch->register_convert_to_virtual
1533                         /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
1534 #endif
1535 #ifdef REGISTER_CONVERT_TO_RAW
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 POINTER_TO_ADDRESS
1543   if (GDB_MULTI_ARCH)
1544     fprintf_unfiltered (file,
1545                         "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
1546                         (long) current_gdbarch->pointer_to_address
1547                         /*POINTER_TO_ADDRESS ()*/);
1548 #endif
1549 #ifdef ADDRESS_TO_POINTER
1550   if (GDB_MULTI_ARCH)
1551     fprintf_unfiltered (file,
1552                         "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
1553                         (long) current_gdbarch->address_to_pointer
1554                         /*ADDRESS_TO_POINTER ()*/);
1555 #endif
1556 #ifdef RETURN_VALUE_ON_STACK
1557   if (GDB_MULTI_ARCH)
1558     fprintf_unfiltered (file,
1559                         "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
1560                         (long) current_gdbarch->return_value_on_stack
1561                         /*RETURN_VALUE_ON_STACK ()*/);
1562 #endif
1563 #ifdef EXTRACT_RETURN_VALUE
1564   if (GDB_MULTI_ARCH)
1565     fprintf_unfiltered (file,
1566                         "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1567                         (long) current_gdbarch->extract_return_value
1568                         /*EXTRACT_RETURN_VALUE ()*/);
1569 #endif
1570 #ifdef PUSH_ARGUMENTS
1571   if (GDB_MULTI_ARCH)
1572     fprintf_unfiltered (file,
1573                         "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
1574                         (long) current_gdbarch->push_arguments
1575                         /*PUSH_ARGUMENTS ()*/);
1576 #endif
1577 #ifdef PUSH_DUMMY_FRAME
1578   if (GDB_MULTI_ARCH)
1579     fprintf_unfiltered (file,
1580                         "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
1581                         (long) current_gdbarch->push_dummy_frame
1582                         /*PUSH_DUMMY_FRAME ()*/);
1583 #endif
1584 #ifdef PUSH_RETURN_ADDRESS
1585   if (GDB_MULTI_ARCH)
1586     fprintf_unfiltered (file,
1587                         "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
1588                         (long) current_gdbarch->push_return_address
1589                         /*PUSH_RETURN_ADDRESS ()*/);
1590 #endif
1591 #ifdef POP_FRAME
1592   if (GDB_MULTI_ARCH)
1593     fprintf_unfiltered (file,
1594                         "gdbarch_dump: POP_FRAME = 0x%08lx\n",
1595                         (long) current_gdbarch->pop_frame
1596                         /*POP_FRAME ()*/);
1597 #endif
1598 #ifdef D10V_MAKE_DADDR
1599   if (GDB_MULTI_ARCH)
1600     fprintf_unfiltered (file,
1601                         "gdbarch_dump: D10V_MAKE_DADDR = 0x%08lx\n",
1602                         (long) current_gdbarch->d10v_make_daddr
1603                         /*D10V_MAKE_DADDR ()*/);
1604 #endif
1605 #ifdef D10V_MAKE_IADDR
1606   if (GDB_MULTI_ARCH)
1607     fprintf_unfiltered (file,
1608                         "gdbarch_dump: D10V_MAKE_IADDR = 0x%08lx\n",
1609                         (long) current_gdbarch->d10v_make_iaddr
1610                         /*D10V_MAKE_IADDR ()*/);
1611 #endif
1612 #ifdef D10V_DADDR_P
1613   if (GDB_MULTI_ARCH)
1614     fprintf_unfiltered (file,
1615                         "gdbarch_dump: D10V_DADDR_P = 0x%08lx\n",
1616                         (long) current_gdbarch->d10v_daddr_p
1617                         /*D10V_DADDR_P ()*/);
1618 #endif
1619 #ifdef D10V_IADDR_P
1620   if (GDB_MULTI_ARCH)
1621     fprintf_unfiltered (file,
1622                         "gdbarch_dump: D10V_IADDR_P = 0x%08lx\n",
1623                         (long) current_gdbarch->d10v_iaddr_p
1624                         /*D10V_IADDR_P ()*/);
1625 #endif
1626 #ifdef D10V_CONVERT_DADDR_TO_RAW
1627   if (GDB_MULTI_ARCH)
1628     fprintf_unfiltered (file,
1629                         "gdbarch_dump: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1630                         (long) current_gdbarch->d10v_convert_daddr_to_raw
1631                         /*D10V_CONVERT_DADDR_TO_RAW ()*/);
1632 #endif
1633 #ifdef D10V_CONVERT_IADDR_TO_RAW
1634   if (GDB_MULTI_ARCH)
1635     fprintf_unfiltered (file,
1636                         "gdbarch_dump: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1637                         (long) current_gdbarch->d10v_convert_iaddr_to_raw
1638                         /*D10V_CONVERT_IADDR_TO_RAW ()*/);
1639 #endif
1640 #ifdef STORE_STRUCT_RETURN
1641   if (GDB_MULTI_ARCH)
1642     fprintf_unfiltered (file,
1643                         "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
1644                         (long) current_gdbarch->store_struct_return
1645                         /*STORE_STRUCT_RETURN ()*/);
1646 #endif
1647 #ifdef STORE_RETURN_VALUE
1648   if (GDB_MULTI_ARCH)
1649     fprintf_unfiltered (file,
1650                         "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
1651                         (long) current_gdbarch->store_return_value
1652                         /*STORE_RETURN_VALUE ()*/);
1653 #endif
1654 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1655   if (GDB_MULTI_ARCH)
1656     fprintf_unfiltered (file,
1657                         "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1658                         (long) current_gdbarch->extract_struct_value_address
1659                         /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1660 #endif
1661 #ifdef USE_STRUCT_CONVENTION
1662   if (GDB_MULTI_ARCH)
1663     fprintf_unfiltered (file,
1664                         "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
1665                         (long) current_gdbarch->use_struct_convention
1666                         /*USE_STRUCT_CONVENTION ()*/);
1667 #endif
1668 #ifdef FRAME_INIT_SAVED_REGS
1669   if (GDB_MULTI_ARCH)
1670     fprintf_unfiltered (file,
1671                         "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1672                         (long) current_gdbarch->frame_init_saved_regs
1673                         /*FRAME_INIT_SAVED_REGS ()*/);
1674 #endif
1675 #ifdef INIT_EXTRA_FRAME_INFO
1676   if (GDB_MULTI_ARCH)
1677     fprintf_unfiltered (file,
1678                         "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1679                         (long) current_gdbarch->init_extra_frame_info
1680                         /*INIT_EXTRA_FRAME_INFO ()*/);
1681 #endif
1682 #ifdef SKIP_PROLOGUE
1683   if (GDB_MULTI_ARCH)
1684     fprintf_unfiltered (file,
1685                         "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
1686                         (long) current_gdbarch->skip_prologue
1687                         /*SKIP_PROLOGUE ()*/);
1688 #endif
1689 #ifdef PROLOGUE_FRAMELESS_P
1690   if (GDB_MULTI_ARCH)
1691     fprintf_unfiltered (file,
1692                         "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1693                         (long) current_gdbarch->prologue_frameless_p
1694                         /*PROLOGUE_FRAMELESS_P ()*/);
1695 #endif
1696 #ifdef INNER_THAN
1697   if (GDB_MULTI_ARCH)
1698     fprintf_unfiltered (file,
1699                         "gdbarch_dump: INNER_THAN = 0x%08lx\n",
1700                         (long) current_gdbarch->inner_than
1701                         /*INNER_THAN ()*/);
1702 #endif
1703 #ifdef BREAKPOINT_FROM_PC
1704   if (GDB_MULTI_ARCH)
1705     fprintf_unfiltered (file,
1706                         "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
1707                         (long) current_gdbarch->breakpoint_from_pc
1708                         /*BREAKPOINT_FROM_PC ()*/);
1709 #endif
1710 #ifdef MEMORY_INSERT_BREAKPOINT
1711   if (GDB_MULTI_ARCH)
1712     fprintf_unfiltered (file,
1713                         "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1714                         (long) current_gdbarch->memory_insert_breakpoint
1715                         /*MEMORY_INSERT_BREAKPOINT ()*/);
1716 #endif
1717 #ifdef MEMORY_REMOVE_BREAKPOINT
1718   if (GDB_MULTI_ARCH)
1719     fprintf_unfiltered (file,
1720                         "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1721                         (long) current_gdbarch->memory_remove_breakpoint
1722                         /*MEMORY_REMOVE_BREAKPOINT ()*/);
1723 #endif
1724 #ifdef DECR_PC_AFTER_BREAK
1725   fprintf_unfiltered (file,
1726                       "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1727                       (long) DECR_PC_AFTER_BREAK);
1728 #endif
1729 #ifdef FUNCTION_START_OFFSET
1730   fprintf_unfiltered (file,
1731                       "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1732                       (long) FUNCTION_START_OFFSET);
1733 #endif
1734 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1735   if (GDB_MULTI_ARCH)
1736     fprintf_unfiltered (file,
1737                         "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1738                         (long) current_gdbarch->remote_translate_xfer_address
1739                         /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1740 #endif
1741 #ifdef FRAME_ARGS_SKIP
1742   fprintf_unfiltered (file,
1743                       "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1744                       (long) FRAME_ARGS_SKIP);
1745 #endif
1746 #ifdef FRAMELESS_FUNCTION_INVOCATION
1747   if (GDB_MULTI_ARCH)
1748     fprintf_unfiltered (file,
1749                         "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1750                         (long) current_gdbarch->frameless_function_invocation
1751                         /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1752 #endif
1753 #ifdef FRAME_CHAIN
1754   if (GDB_MULTI_ARCH)
1755     fprintf_unfiltered (file,
1756                         "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
1757                         (long) current_gdbarch->frame_chain
1758                         /*FRAME_CHAIN ()*/);
1759 #endif
1760 #ifdef FRAME_CHAIN_VALID
1761   if (GDB_MULTI_ARCH)
1762     fprintf_unfiltered (file,
1763                         "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
1764                         (long) current_gdbarch->frame_chain_valid
1765                         /*FRAME_CHAIN_VALID ()*/);
1766 #endif
1767 #ifdef FRAME_SAVED_PC
1768   if (GDB_MULTI_ARCH)
1769     fprintf_unfiltered (file,
1770                         "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
1771                         (long) current_gdbarch->frame_saved_pc
1772                         /*FRAME_SAVED_PC ()*/);
1773 #endif
1774 #ifdef FRAME_ARGS_ADDRESS
1775   if (GDB_MULTI_ARCH)
1776     fprintf_unfiltered (file,
1777                         "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1778                         (long) current_gdbarch->frame_args_address
1779                         /*FRAME_ARGS_ADDRESS ()*/);
1780 #endif
1781 #ifdef FRAME_LOCALS_ADDRESS
1782   if (GDB_MULTI_ARCH)
1783     fprintf_unfiltered (file,
1784                         "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1785                         (long) current_gdbarch->frame_locals_address
1786                         /*FRAME_LOCALS_ADDRESS ()*/);
1787 #endif
1788 #ifdef SAVED_PC_AFTER_CALL
1789   if (GDB_MULTI_ARCH)
1790     fprintf_unfiltered (file,
1791                         "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1792                         (long) current_gdbarch->saved_pc_after_call
1793                         /*SAVED_PC_AFTER_CALL ()*/);
1794 #endif
1795 #ifdef FRAME_NUM_ARGS
1796   if (GDB_MULTI_ARCH)
1797     fprintf_unfiltered (file,
1798                         "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
1799                         (long) current_gdbarch->frame_num_args
1800                         /*FRAME_NUM_ARGS ()*/);
1801 #endif
1802 #ifdef STACK_ALIGN
1803   if (GDB_MULTI_ARCH)
1804     fprintf_unfiltered (file,
1805                         "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
1806                         (long) current_gdbarch->stack_align
1807                         /*STACK_ALIGN ()*/);
1808 #endif
1809 #ifdef REG_STRUCT_HAS_ADDR
1810   if (GDB_MULTI_ARCH)
1811     fprintf_unfiltered (file,
1812                         "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1813                         (long) current_gdbarch->reg_struct_has_addr
1814                         /*REG_STRUCT_HAS_ADDR ()*/);
1815 #endif
1816 #ifdef SAVE_DUMMY_FRAME_TOS
1817   if (GDB_MULTI_ARCH)
1818     fprintf_unfiltered (file,
1819                         "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
1820                         (long) current_gdbarch->save_dummy_frame_tos
1821                         /*SAVE_DUMMY_FRAME_TOS ()*/);
1822 #endif
1823 #ifdef TARGET_FLOAT_FORMAT
1824   fprintf_unfiltered (file,
1825                       "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
1826                       (long) TARGET_FLOAT_FORMAT);
1827 #endif
1828 #ifdef TARGET_DOUBLE_FORMAT
1829   fprintf_unfiltered (file,
1830                       "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
1831                       (long) TARGET_DOUBLE_FORMAT);
1832 #endif
1833 #ifdef TARGET_LONG_DOUBLE_FORMAT
1834   fprintf_unfiltered (file,
1835                       "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
1836                       (long) TARGET_LONG_DOUBLE_FORMAT);
1837 #endif
1838   if (current_gdbarch->dump_tdep != NULL)
1839     current_gdbarch->dump_tdep (current_gdbarch, file);
1840 }
1841
1842 struct gdbarch_tdep *
1843 gdbarch_tdep (struct gdbarch *gdbarch)
1844 {
1845   if (gdbarch_debug >= 2)
1846     fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1847   return gdbarch->tdep;
1848 }
1849
1850
1851 const struct bfd_arch_info *
1852 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1853 {
1854   if (gdbarch_debug >= 2)
1855     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1856   return gdbarch->bfd_arch_info;
1857 }
1858
1859 int
1860 gdbarch_byte_order (struct gdbarch *gdbarch)
1861 {
1862   if (gdbarch_debug >= 2)
1863     fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1864   return gdbarch->byte_order;
1865 }
1866
1867 int
1868 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1869 {
1870   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1871   if (gdbarch_debug >= 2)
1872     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1873   return gdbarch->bfd_vma_bit;
1874 }
1875
1876 void
1877 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1878                          int bfd_vma_bit)
1879 {
1880   gdbarch->bfd_vma_bit = bfd_vma_bit;
1881 }
1882
1883 int
1884 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1885 {
1886   if (gdbarch->ptr_bit == 0)
1887     internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1888   if (gdbarch_debug >= 2)
1889     fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1890   return gdbarch->ptr_bit;
1891 }
1892
1893 void
1894 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1895                      int ptr_bit)
1896 {
1897   gdbarch->ptr_bit = ptr_bit;
1898 }
1899
1900 int
1901 gdbarch_short_bit (struct gdbarch *gdbarch)
1902 {
1903   if (gdbarch->short_bit == 0)
1904     internal_error ("gdbarch: gdbarch_short_bit invalid");
1905   if (gdbarch_debug >= 2)
1906     fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1907   return gdbarch->short_bit;
1908 }
1909
1910 void
1911 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1912                        int short_bit)
1913 {
1914   gdbarch->short_bit = short_bit;
1915 }
1916
1917 int
1918 gdbarch_int_bit (struct gdbarch *gdbarch)
1919 {
1920   if (gdbarch->int_bit == 0)
1921     internal_error ("gdbarch: gdbarch_int_bit invalid");
1922   if (gdbarch_debug >= 2)
1923     fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1924   return gdbarch->int_bit;
1925 }
1926
1927 void
1928 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1929                      int int_bit)
1930 {
1931   gdbarch->int_bit = int_bit;
1932 }
1933
1934 int
1935 gdbarch_long_bit (struct gdbarch *gdbarch)
1936 {
1937   if (gdbarch->long_bit == 0)
1938     internal_error ("gdbarch: gdbarch_long_bit invalid");
1939   if (gdbarch_debug >= 2)
1940     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1941   return gdbarch->long_bit;
1942 }
1943
1944 void
1945 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1946                       int long_bit)
1947 {
1948   gdbarch->long_bit = long_bit;
1949 }
1950
1951 int
1952 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1953 {
1954   if (gdbarch->long_long_bit == 0)
1955     internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1956   if (gdbarch_debug >= 2)
1957     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1958   return gdbarch->long_long_bit;
1959 }
1960
1961 void
1962 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1963                            int long_long_bit)
1964 {
1965   gdbarch->long_long_bit = long_long_bit;
1966 }
1967
1968 int
1969 gdbarch_float_bit (struct gdbarch *gdbarch)
1970 {
1971   if (gdbarch->float_bit == 0)
1972     internal_error ("gdbarch: gdbarch_float_bit invalid");
1973   if (gdbarch_debug >= 2)
1974     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1975   return gdbarch->float_bit;
1976 }
1977
1978 void
1979 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1980                        int float_bit)
1981 {
1982   gdbarch->float_bit = float_bit;
1983 }
1984
1985 int
1986 gdbarch_double_bit (struct gdbarch *gdbarch)
1987 {
1988   if (gdbarch->double_bit == 0)
1989     internal_error ("gdbarch: gdbarch_double_bit invalid");
1990   if (gdbarch_debug >= 2)
1991     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1992   return gdbarch->double_bit;
1993 }
1994
1995 void
1996 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1997                         int double_bit)
1998 {
1999   gdbarch->double_bit = double_bit;
2000 }
2001
2002 int
2003 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2004 {
2005   if (gdbarch->long_double_bit == 0)
2006     internal_error ("gdbarch: gdbarch_long_double_bit invalid");
2007   if (gdbarch_debug >= 2)
2008     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2009   return gdbarch->long_double_bit;
2010 }
2011
2012 void
2013 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2014                              int long_double_bit)
2015 {
2016   gdbarch->long_double_bit = long_double_bit;
2017 }
2018
2019 int
2020 gdbarch_ieee_float (struct gdbarch *gdbarch)
2021 {
2022   /* Skip verify of ieee_float, invalid_p == 0 */
2023   if (gdbarch_debug >= 2)
2024     fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n");
2025   return gdbarch->ieee_float;
2026 }
2027
2028 void
2029 set_gdbarch_ieee_float (struct gdbarch *gdbarch,
2030                         int ieee_float)
2031 {
2032   gdbarch->ieee_float = ieee_float;
2033 }
2034
2035 CORE_ADDR
2036 gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
2037 {
2038   if (gdbarch->read_pc == 0)
2039     internal_error ("gdbarch: gdbarch_read_pc invalid");
2040   if (gdbarch_debug >= 2)
2041     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2042   return gdbarch->read_pc (pid);
2043 }
2044
2045 void
2046 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2047                      gdbarch_read_pc_ftype read_pc)
2048 {
2049   gdbarch->read_pc = read_pc;
2050 }
2051
2052 void
2053 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
2054 {
2055   if (gdbarch->write_pc == 0)
2056     internal_error ("gdbarch: gdbarch_write_pc invalid");
2057   if (gdbarch_debug >= 2)
2058     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2059   gdbarch->write_pc (val, pid);
2060 }
2061
2062 void
2063 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2064                       gdbarch_write_pc_ftype write_pc)
2065 {
2066   gdbarch->write_pc = write_pc;
2067 }
2068
2069 CORE_ADDR
2070 gdbarch_read_fp (struct gdbarch *gdbarch)
2071 {
2072   if (gdbarch->read_fp == 0)
2073     internal_error ("gdbarch: gdbarch_read_fp invalid");
2074   if (gdbarch_debug >= 2)
2075     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2076   return gdbarch->read_fp ();
2077 }
2078
2079 void
2080 set_gdbarch_read_fp (struct gdbarch *gdbarch,
2081                      gdbarch_read_fp_ftype read_fp)
2082 {
2083   gdbarch->read_fp = read_fp;
2084 }
2085
2086 void
2087 gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
2088 {
2089   if (gdbarch->write_fp == 0)
2090     internal_error ("gdbarch: gdbarch_write_fp invalid");
2091   if (gdbarch_debug >= 2)
2092     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
2093   gdbarch->write_fp (val);
2094 }
2095
2096 void
2097 set_gdbarch_write_fp (struct gdbarch *gdbarch,
2098                       gdbarch_write_fp_ftype write_fp)
2099 {
2100   gdbarch->write_fp = write_fp;
2101 }
2102
2103 CORE_ADDR
2104 gdbarch_read_sp (struct gdbarch *gdbarch)
2105 {
2106   if (gdbarch->read_sp == 0)
2107     internal_error ("gdbarch: gdbarch_read_sp invalid");
2108   if (gdbarch_debug >= 2)
2109     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2110   return gdbarch->read_sp ();
2111 }
2112
2113 void
2114 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2115                      gdbarch_read_sp_ftype read_sp)
2116 {
2117   gdbarch->read_sp = read_sp;
2118 }
2119
2120 void
2121 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2122 {
2123   if (gdbarch->write_sp == 0)
2124     internal_error ("gdbarch: gdbarch_write_sp invalid");
2125   if (gdbarch_debug >= 2)
2126     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2127   gdbarch->write_sp (val);
2128 }
2129
2130 void
2131 set_gdbarch_write_sp (struct gdbarch *gdbarch,
2132                       gdbarch_write_sp_ftype write_sp)
2133 {
2134   gdbarch->write_sp = write_sp;
2135 }
2136
2137 int
2138 gdbarch_num_regs (struct gdbarch *gdbarch)
2139 {
2140   if (gdbarch->num_regs == -1)
2141     internal_error ("gdbarch: gdbarch_num_regs invalid");
2142   if (gdbarch_debug >= 2)
2143     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2144   return gdbarch->num_regs;
2145 }
2146
2147 void
2148 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2149                       int num_regs)
2150 {
2151   gdbarch->num_regs = num_regs;
2152 }
2153
2154 int
2155 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2156 {
2157   if (gdbarch->sp_regnum == -1)
2158     internal_error ("gdbarch: gdbarch_sp_regnum invalid");
2159   if (gdbarch_debug >= 2)
2160     fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2161   return gdbarch->sp_regnum;
2162 }
2163
2164 void
2165 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2166                        int sp_regnum)
2167 {
2168   gdbarch->sp_regnum = sp_regnum;
2169 }
2170
2171 int
2172 gdbarch_fp_regnum (struct gdbarch *gdbarch)
2173 {
2174   if (gdbarch->fp_regnum == -1)
2175     internal_error ("gdbarch: gdbarch_fp_regnum invalid");
2176   if (gdbarch_debug >= 2)
2177     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
2178   return gdbarch->fp_regnum;
2179 }
2180
2181 void
2182 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
2183                        int fp_regnum)
2184 {
2185   gdbarch->fp_regnum = fp_regnum;
2186 }
2187
2188 int
2189 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2190 {
2191   if (gdbarch->pc_regnum == -1)
2192     internal_error ("gdbarch: gdbarch_pc_regnum invalid");
2193   if (gdbarch_debug >= 2)
2194     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2195   return gdbarch->pc_regnum;
2196 }
2197
2198 void
2199 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2200                        int pc_regnum)
2201 {
2202   gdbarch->pc_regnum = pc_regnum;
2203 }
2204
2205 int
2206 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2207 {
2208   /* Skip verify of fp0_regnum, invalid_p == 0 */
2209   if (gdbarch_debug >= 2)
2210     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2211   return gdbarch->fp0_regnum;
2212 }
2213
2214 void
2215 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2216                         int fp0_regnum)
2217 {
2218   gdbarch->fp0_regnum = fp0_regnum;
2219 }
2220
2221 int
2222 gdbarch_npc_regnum (struct gdbarch *gdbarch)
2223 {
2224   /* Skip verify of npc_regnum, invalid_p == 0 */
2225   if (gdbarch_debug >= 2)
2226     fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
2227   return gdbarch->npc_regnum;
2228 }
2229
2230 void
2231 set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
2232                         int npc_regnum)
2233 {
2234   gdbarch->npc_regnum = npc_regnum;
2235 }
2236
2237 int
2238 gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
2239 {
2240   /* Skip verify of nnpc_regnum, invalid_p == 0 */
2241   if (gdbarch_debug >= 2)
2242     fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
2243   return gdbarch->nnpc_regnum;
2244 }
2245
2246 void
2247 set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
2248                          int nnpc_regnum)
2249 {
2250   gdbarch->nnpc_regnum = nnpc_regnum;
2251 }
2252
2253 char *
2254 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2255 {
2256   if (gdbarch->register_name == 0)
2257     internal_error ("gdbarch: gdbarch_register_name invalid");
2258   if (gdbarch_debug >= 2)
2259     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2260   return gdbarch->register_name (regnr);
2261 }
2262
2263 void
2264 set_gdbarch_register_name (struct gdbarch *gdbarch,
2265                            gdbarch_register_name_ftype register_name)
2266 {
2267   gdbarch->register_name = register_name;
2268 }
2269
2270 int
2271 gdbarch_register_size (struct gdbarch *gdbarch)
2272 {
2273   if (gdbarch->register_size == -1)
2274     internal_error ("gdbarch: gdbarch_register_size invalid");
2275   if (gdbarch_debug >= 2)
2276     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
2277   return gdbarch->register_size;
2278 }
2279
2280 void
2281 set_gdbarch_register_size (struct gdbarch *gdbarch,
2282                            int register_size)
2283 {
2284   gdbarch->register_size = register_size;
2285 }
2286
2287 int
2288 gdbarch_register_bytes (struct gdbarch *gdbarch)
2289 {
2290   if (gdbarch->register_bytes == -1)
2291     internal_error ("gdbarch: gdbarch_register_bytes invalid");
2292   if (gdbarch_debug >= 2)
2293     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
2294   return gdbarch->register_bytes;
2295 }
2296
2297 void
2298 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
2299                             int register_bytes)
2300 {
2301   gdbarch->register_bytes = register_bytes;
2302 }
2303
2304 int
2305 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
2306 {
2307   if (gdbarch->register_byte == 0)
2308     internal_error ("gdbarch: gdbarch_register_byte invalid");
2309   if (gdbarch_debug >= 2)
2310     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
2311   return gdbarch->register_byte (reg_nr);
2312 }
2313
2314 void
2315 set_gdbarch_register_byte (struct gdbarch *gdbarch,
2316                            gdbarch_register_byte_ftype register_byte)
2317 {
2318   gdbarch->register_byte = register_byte;
2319 }
2320
2321 int
2322 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
2323 {
2324   if (gdbarch->register_raw_size == 0)
2325     internal_error ("gdbarch: gdbarch_register_raw_size invalid");
2326   if (gdbarch_debug >= 2)
2327     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
2328   return gdbarch->register_raw_size (reg_nr);
2329 }
2330
2331 void
2332 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
2333                                gdbarch_register_raw_size_ftype register_raw_size)
2334 {
2335   gdbarch->register_raw_size = register_raw_size;
2336 }
2337
2338 int
2339 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
2340 {
2341   if (gdbarch->max_register_raw_size == -1)
2342     internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
2343   if (gdbarch_debug >= 2)
2344     fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
2345   return gdbarch->max_register_raw_size;
2346 }
2347
2348 void
2349 set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
2350                                    int max_register_raw_size)
2351 {
2352   gdbarch->max_register_raw_size = max_register_raw_size;
2353 }
2354
2355 int
2356 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
2357 {
2358   if (gdbarch->register_virtual_size == 0)
2359     internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
2360   if (gdbarch_debug >= 2)
2361     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
2362   return gdbarch->register_virtual_size (reg_nr);
2363 }
2364
2365 void
2366 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
2367                                    gdbarch_register_virtual_size_ftype register_virtual_size)
2368 {
2369   gdbarch->register_virtual_size = register_virtual_size;
2370 }
2371
2372 int
2373 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
2374 {
2375   if (gdbarch->max_register_virtual_size == -1)
2376     internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
2377   if (gdbarch_debug >= 2)
2378     fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
2379   return gdbarch->max_register_virtual_size;
2380 }
2381
2382 void
2383 set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
2384                                        int max_register_virtual_size)
2385 {
2386   gdbarch->max_register_virtual_size = max_register_virtual_size;
2387 }
2388
2389 struct type *
2390 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
2391 {
2392   if (gdbarch->register_virtual_type == 0)
2393     internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
2394   if (gdbarch_debug >= 2)
2395     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
2396   return gdbarch->register_virtual_type (reg_nr);
2397 }
2398
2399 void
2400 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
2401                                    gdbarch_register_virtual_type_ftype register_virtual_type)
2402 {
2403   gdbarch->register_virtual_type = register_virtual_type;
2404 }
2405
2406 int
2407 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
2408 {
2409   if (gdbarch->use_generic_dummy_frames == -1)
2410     internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
2411   if (gdbarch_debug >= 2)
2412     fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
2413   return gdbarch->use_generic_dummy_frames;
2414 }
2415
2416 void
2417 set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
2418                                       int use_generic_dummy_frames)
2419 {
2420   gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
2421 }
2422
2423 int
2424 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2425 {
2426   if (gdbarch->call_dummy_location == 0)
2427     internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
2428   if (gdbarch_debug >= 2)
2429     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2430   return gdbarch->call_dummy_location;
2431 }
2432
2433 void
2434 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2435                                  int call_dummy_location)
2436 {
2437   gdbarch->call_dummy_location = call_dummy_location;
2438 }
2439
2440 CORE_ADDR
2441 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
2442 {
2443   if (gdbarch->call_dummy_address == 0)
2444     internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
2445   if (gdbarch_debug >= 2)
2446     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
2447   return gdbarch->call_dummy_address ();
2448 }
2449
2450 void
2451 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
2452                                 gdbarch_call_dummy_address_ftype call_dummy_address)
2453 {
2454   gdbarch->call_dummy_address = call_dummy_address;
2455 }
2456
2457 CORE_ADDR
2458 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
2459 {
2460   if (gdbarch->call_dummy_start_offset == -1)
2461     internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
2462   if (gdbarch_debug >= 2)
2463     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
2464   return gdbarch->call_dummy_start_offset;
2465 }
2466
2467 void
2468 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
2469                                      CORE_ADDR call_dummy_start_offset)
2470 {
2471   gdbarch->call_dummy_start_offset = call_dummy_start_offset;
2472 }
2473
2474 CORE_ADDR
2475 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
2476 {
2477   if (gdbarch->call_dummy_breakpoint_offset == -1)
2478     internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
2479   if (gdbarch_debug >= 2)
2480     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
2481   return gdbarch->call_dummy_breakpoint_offset;
2482 }
2483
2484 void
2485 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
2486                                           CORE_ADDR call_dummy_breakpoint_offset)
2487 {
2488   gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
2489 }
2490
2491 int
2492 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
2493 {
2494   if (gdbarch->call_dummy_breakpoint_offset_p == -1)
2495     internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
2496   if (gdbarch_debug >= 2)
2497     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
2498   return gdbarch->call_dummy_breakpoint_offset_p;
2499 }
2500
2501 void
2502 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
2503                                             int call_dummy_breakpoint_offset_p)
2504 {
2505   gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
2506 }
2507
2508 int
2509 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
2510 {
2511   if (gdbarch->call_dummy_length == -1)
2512     internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
2513   if (gdbarch_debug >= 2)
2514     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
2515   return gdbarch->call_dummy_length;
2516 }
2517
2518 void
2519 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
2520                                int call_dummy_length)
2521 {
2522   gdbarch->call_dummy_length = call_dummy_length;
2523 }
2524
2525 int
2526 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
2527 {
2528   if (gdbarch->pc_in_call_dummy == 0)
2529     internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
2530   if (gdbarch_debug >= 2)
2531     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
2532   return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
2533 }
2534
2535 void
2536 set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
2537                               gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
2538 {
2539   gdbarch->pc_in_call_dummy = pc_in_call_dummy;
2540 }
2541
2542 int
2543 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
2544 {
2545   if (gdbarch->call_dummy_p == -1)
2546     internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
2547   if (gdbarch_debug >= 2)
2548     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
2549   return gdbarch->call_dummy_p;
2550 }
2551
2552 void
2553 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
2554                           int call_dummy_p)
2555 {
2556   gdbarch->call_dummy_p = call_dummy_p;
2557 }
2558
2559 LONGEST *
2560 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
2561 {
2562   /* Skip verify of call_dummy_words, invalid_p == 0 */
2563   if (gdbarch_debug >= 2)
2564     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
2565   return gdbarch->call_dummy_words;
2566 }
2567
2568 void
2569 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
2570                               LONGEST * call_dummy_words)
2571 {
2572   gdbarch->call_dummy_words = call_dummy_words;
2573 }
2574
2575 int
2576 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
2577 {
2578   /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
2579   if (gdbarch_debug >= 2)
2580     fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
2581   return gdbarch->sizeof_call_dummy_words;
2582 }
2583
2584 void
2585 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
2586                                      int sizeof_call_dummy_words)
2587 {
2588   gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
2589 }
2590
2591 int
2592 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
2593 {
2594   if (gdbarch->call_dummy_stack_adjust_p == -1)
2595     internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
2596   if (gdbarch_debug >= 2)
2597     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
2598   return gdbarch->call_dummy_stack_adjust_p;
2599 }
2600
2601 void
2602 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
2603                                        int call_dummy_stack_adjust_p)
2604 {
2605   gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
2606 }
2607
2608 int
2609 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
2610 {
2611   if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
2612     internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
2613   if (gdbarch_debug >= 2)
2614     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
2615   return gdbarch->call_dummy_stack_adjust;
2616 }
2617
2618 void
2619 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
2620                                      int call_dummy_stack_adjust)
2621 {
2622   gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
2623 }
2624
2625 void
2626 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)
2627 {
2628   if (gdbarch->fix_call_dummy == 0)
2629     internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
2630   if (gdbarch_debug >= 2)
2631     fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
2632   gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
2633 }
2634
2635 void
2636 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
2637                             gdbarch_fix_call_dummy_ftype fix_call_dummy)
2638 {
2639   gdbarch->fix_call_dummy = fix_call_dummy;
2640 }
2641
2642 int
2643 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2644 {
2645   if (gdbarch_debug >= 2)
2646     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2647   return gdbarch->believe_pcc_promotion;
2648 }
2649
2650 void
2651 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2652                                    int believe_pcc_promotion)
2653 {
2654   gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2655 }
2656
2657 int
2658 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
2659 {
2660   if (gdbarch_debug >= 2)
2661     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
2662   return gdbarch->believe_pcc_promotion_type;
2663 }
2664
2665 void
2666 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
2667                                         int believe_pcc_promotion_type)
2668 {
2669   gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
2670 }
2671
2672 int
2673 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
2674 {
2675   if (gdbarch->coerce_float_to_double == 0)
2676     internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
2677   if (gdbarch_debug >= 2)
2678     fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
2679   return gdbarch->coerce_float_to_double (formal, actual);
2680 }
2681
2682 void
2683 set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
2684                                     gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
2685 {
2686   gdbarch->coerce_float_to_double = coerce_float_to_double;
2687 }
2688
2689 void
2690 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)
2691 {
2692   if (gdbarch->get_saved_register == 0)
2693     internal_error ("gdbarch: gdbarch_get_saved_register invalid");
2694   if (gdbarch_debug >= 2)
2695     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
2696   gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
2697 }
2698
2699 void
2700 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
2701                                 gdbarch_get_saved_register_ftype get_saved_register)
2702 {
2703   gdbarch->get_saved_register = get_saved_register;
2704 }
2705
2706 int
2707 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
2708 {
2709   if (gdbarch->register_convertible == 0)
2710     internal_error ("gdbarch: gdbarch_register_convertible invalid");
2711   if (gdbarch_debug >= 2)
2712     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
2713   return gdbarch->register_convertible (nr);
2714 }
2715
2716 void
2717 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
2718                                   gdbarch_register_convertible_ftype register_convertible)
2719 {
2720   gdbarch->register_convertible = register_convertible;
2721 }
2722
2723 void
2724 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
2725 {
2726   if (gdbarch->register_convert_to_virtual == 0)
2727     internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
2728   if (gdbarch_debug >= 2)
2729     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
2730   gdbarch->register_convert_to_virtual (regnum, type, from, to);
2731 }
2732
2733 void
2734 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
2735                                          gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
2736 {
2737   gdbarch->register_convert_to_virtual = register_convert_to_virtual;
2738 }
2739
2740 void
2741 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
2742 {
2743   if (gdbarch->register_convert_to_raw == 0)
2744     internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
2745   if (gdbarch_debug >= 2)
2746     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
2747   gdbarch->register_convert_to_raw (type, regnum, from, to);
2748 }
2749
2750 void
2751 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
2752                                      gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
2753 {
2754   gdbarch->register_convert_to_raw = register_convert_to_raw;
2755 }
2756
2757 CORE_ADDR
2758 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
2759 {
2760   if (gdbarch->pointer_to_address == 0)
2761     internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
2762   if (gdbarch_debug >= 2)
2763     fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2764   return gdbarch->pointer_to_address (type, buf);
2765 }
2766
2767 void
2768 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2769                                 gdbarch_pointer_to_address_ftype pointer_to_address)
2770 {
2771   gdbarch->pointer_to_address = pointer_to_address;
2772 }
2773
2774 void
2775 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
2776 {
2777   if (gdbarch->address_to_pointer == 0)
2778     internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
2779   if (gdbarch_debug >= 2)
2780     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2781   gdbarch->address_to_pointer (type, buf, addr);
2782 }
2783
2784 void
2785 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2786                                 gdbarch_address_to_pointer_ftype address_to_pointer)
2787 {
2788   gdbarch->address_to_pointer = address_to_pointer;
2789 }
2790
2791 int
2792 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
2793 {
2794   if (gdbarch->return_value_on_stack == 0)
2795     internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
2796   if (gdbarch_debug >= 2)
2797     fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
2798   return gdbarch->return_value_on_stack (type);
2799 }
2800
2801 void
2802 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
2803                                    gdbarch_return_value_on_stack_ftype return_value_on_stack)
2804 {
2805   gdbarch->return_value_on_stack = return_value_on_stack;
2806 }
2807
2808 void
2809 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
2810 {
2811   if (gdbarch->extract_return_value == 0)
2812     internal_error ("gdbarch: gdbarch_extract_return_value invalid");
2813   if (gdbarch_debug >= 2)
2814     fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2815   gdbarch->extract_return_value (type, regbuf, valbuf);
2816 }
2817
2818 void
2819 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2820                                   gdbarch_extract_return_value_ftype extract_return_value)
2821 {
2822   gdbarch->extract_return_value = extract_return_value;
2823 }
2824
2825 CORE_ADDR
2826 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2827 {
2828   if (gdbarch->push_arguments == 0)
2829     internal_error ("gdbarch: gdbarch_push_arguments invalid");
2830   if (gdbarch_debug >= 2)
2831     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
2832   return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
2833 }
2834
2835 void
2836 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
2837                             gdbarch_push_arguments_ftype push_arguments)
2838 {
2839   gdbarch->push_arguments = push_arguments;
2840 }
2841
2842 void
2843 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
2844 {
2845   if (gdbarch->push_dummy_frame == 0)
2846     internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
2847   if (gdbarch_debug >= 2)
2848     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
2849   gdbarch->push_dummy_frame ();
2850 }
2851
2852 void
2853 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
2854                               gdbarch_push_dummy_frame_ftype push_dummy_frame)
2855 {
2856   gdbarch->push_dummy_frame = push_dummy_frame;
2857 }
2858
2859 CORE_ADDR
2860 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
2861 {
2862   if (gdbarch->push_return_address == 0)
2863     internal_error ("gdbarch: gdbarch_push_return_address invalid");
2864   if (gdbarch_debug >= 2)
2865     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
2866   return gdbarch->push_return_address (pc, sp);
2867 }
2868
2869 void
2870 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
2871                                  gdbarch_push_return_address_ftype push_return_address)
2872 {
2873   gdbarch->push_return_address = push_return_address;
2874 }
2875
2876 void
2877 gdbarch_pop_frame (struct gdbarch *gdbarch)
2878 {
2879   if (gdbarch->pop_frame == 0)
2880     internal_error ("gdbarch: gdbarch_pop_frame invalid");
2881   if (gdbarch_debug >= 2)
2882     fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
2883   gdbarch->pop_frame ();
2884 }
2885
2886 void
2887 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
2888                        gdbarch_pop_frame_ftype pop_frame)
2889 {
2890   gdbarch->pop_frame = pop_frame;
2891 }
2892
2893 CORE_ADDR
2894 gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
2895 {
2896   if (gdbarch->d10v_make_daddr == 0)
2897     internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2898   if (gdbarch_debug >= 2)
2899     fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
2900   return gdbarch->d10v_make_daddr (x);
2901 }
2902
2903 void
2904 set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch,
2905                              gdbarch_d10v_make_daddr_ftype d10v_make_daddr)
2906 {
2907   gdbarch->d10v_make_daddr = d10v_make_daddr;
2908 }
2909
2910 CORE_ADDR
2911 gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
2912 {
2913   if (gdbarch->d10v_make_iaddr == 0)
2914     internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2915   if (gdbarch_debug >= 2)
2916     fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
2917   return gdbarch->d10v_make_iaddr (x);
2918 }
2919
2920 void
2921 set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch,
2922                              gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr)
2923 {
2924   gdbarch->d10v_make_iaddr = d10v_make_iaddr;
2925 }
2926
2927 int
2928 gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
2929 {
2930   if (gdbarch->d10v_daddr_p == 0)
2931     internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2932   if (gdbarch_debug >= 2)
2933     fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
2934   return gdbarch->d10v_daddr_p (x);
2935 }
2936
2937 void
2938 set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch,
2939                           gdbarch_d10v_daddr_p_ftype d10v_daddr_p)
2940 {
2941   gdbarch->d10v_daddr_p = d10v_daddr_p;
2942 }
2943
2944 int
2945 gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
2946 {
2947   if (gdbarch->d10v_iaddr_p == 0)
2948     internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2949   if (gdbarch_debug >= 2)
2950     fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
2951   return gdbarch->d10v_iaddr_p (x);
2952 }
2953
2954 void
2955 set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch,
2956                           gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p)
2957 {
2958   gdbarch->d10v_iaddr_p = d10v_iaddr_p;
2959 }
2960
2961 CORE_ADDR
2962 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2963 {
2964   if (gdbarch->d10v_convert_daddr_to_raw == 0)
2965     internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2966   if (gdbarch_debug >= 2)
2967     fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
2968   return gdbarch->d10v_convert_daddr_to_raw (x);
2969 }
2970
2971 void
2972 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch,
2973                                        gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw)
2974 {
2975   gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
2976 }
2977
2978 CORE_ADDR
2979 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2980 {
2981   if (gdbarch->d10v_convert_iaddr_to_raw == 0)
2982     internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2983   if (gdbarch_debug >= 2)
2984     fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2985   return gdbarch->d10v_convert_iaddr_to_raw (x);
2986 }
2987
2988 void
2989 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch,
2990                                        gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw)
2991 {
2992   gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
2993 }
2994
2995 void
2996 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2997 {
2998   if (gdbarch->store_struct_return == 0)
2999     internal_error ("gdbarch: gdbarch_store_struct_return invalid");
3000   if (gdbarch_debug >= 2)
3001     fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3002   gdbarch->store_struct_return (addr, sp);
3003 }
3004
3005 void
3006 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3007                                  gdbarch_store_struct_return_ftype store_struct_return)
3008 {
3009   gdbarch->store_struct_return = store_struct_return;
3010 }
3011
3012 void
3013 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3014 {
3015   if (gdbarch->store_return_value == 0)
3016     internal_error ("gdbarch: gdbarch_store_return_value invalid");
3017   if (gdbarch_debug >= 2)
3018     fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3019   gdbarch->store_return_value (type, valbuf);
3020 }
3021
3022 void
3023 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3024                                 gdbarch_store_return_value_ftype store_return_value)
3025 {
3026   gdbarch->store_return_value = store_return_value;
3027 }
3028
3029 CORE_ADDR
3030 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
3031 {
3032   if (gdbarch->extract_struct_value_address == 0)
3033     internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
3034   if (gdbarch_debug >= 2)
3035     fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
3036   return gdbarch->extract_struct_value_address (regbuf);
3037 }
3038
3039 void
3040 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
3041                                           gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
3042 {
3043   gdbarch->extract_struct_value_address = extract_struct_value_address;
3044 }
3045
3046 int
3047 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3048 {
3049   if (gdbarch->use_struct_convention == 0)
3050     internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
3051   if (gdbarch_debug >= 2)
3052     fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3053   return gdbarch->use_struct_convention (gcc_p, value_type);
3054 }
3055
3056 void
3057 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
3058                                    gdbarch_use_struct_convention_ftype use_struct_convention)
3059 {
3060   gdbarch->use_struct_convention = use_struct_convention;
3061 }
3062
3063 void
3064 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3065 {
3066   if (gdbarch->frame_init_saved_regs == 0)
3067     internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
3068   if (gdbarch_debug >= 2)
3069     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
3070   gdbarch->frame_init_saved_regs (frame);
3071 }
3072
3073 void
3074 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
3075                                    gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
3076 {
3077   gdbarch->frame_init_saved_regs = frame_init_saved_regs;
3078 }
3079
3080 void
3081 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3082 {
3083   if (gdbarch->init_extra_frame_info == 0)
3084     internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
3085   if (gdbarch_debug >= 2)
3086     fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
3087   gdbarch->init_extra_frame_info (fromleaf, frame);
3088 }
3089
3090 void
3091 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
3092                                    gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
3093 {
3094   gdbarch->init_extra_frame_info = init_extra_frame_info;
3095 }
3096
3097 CORE_ADDR
3098 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3099 {
3100   if (gdbarch->skip_prologue == 0)
3101     internal_error ("gdbarch: gdbarch_skip_prologue invalid");
3102   if (gdbarch_debug >= 2)
3103     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3104   return gdbarch->skip_prologue (ip);
3105 }
3106
3107 void
3108 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3109                            gdbarch_skip_prologue_ftype skip_prologue)
3110 {
3111   gdbarch->skip_prologue = skip_prologue;
3112 }
3113
3114 int
3115 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
3116 {
3117   if (gdbarch->prologue_frameless_p == 0)
3118     internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
3119   if (gdbarch_debug >= 2)
3120     fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
3121   return gdbarch->prologue_frameless_p (ip);
3122 }
3123
3124 void
3125 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
3126                                   gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
3127 {
3128   gdbarch->prologue_frameless_p = prologue_frameless_p;
3129 }
3130
3131 int
3132 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3133 {
3134   if (gdbarch->inner_than == 0)
3135     internal_error ("gdbarch: gdbarch_inner_than invalid");
3136   if (gdbarch_debug >= 2)
3137     fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3138   return gdbarch->inner_than (lhs, rhs);
3139 }
3140
3141 void
3142 set_gdbarch_inner_than (struct gdbarch *gdbarch,
3143                         gdbarch_inner_than_ftype inner_than)
3144 {
3145   gdbarch->inner_than = inner_than;
3146 }
3147
3148 unsigned char *
3149 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
3150 {
3151   if (gdbarch->breakpoint_from_pc == 0)
3152     internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
3153   if (gdbarch_debug >= 2)
3154     fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3155   return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3156 }
3157
3158 void
3159 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3160                                 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
3161 {
3162   gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3163 }
3164
3165 int
3166 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3167 {
3168   if (gdbarch->memory_insert_breakpoint == 0)
3169     internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
3170   if (gdbarch_debug >= 2)
3171     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3172   return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3173 }
3174
3175 void
3176 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3177                                       gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3178 {
3179   gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3180 }
3181
3182 int
3183 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3184 {
3185   if (gdbarch->memory_remove_breakpoint == 0)
3186     internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
3187   if (gdbarch_debug >= 2)
3188     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3189   return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3190 }
3191
3192 void
3193 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3194                                       gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3195 {
3196   gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3197 }
3198
3199 CORE_ADDR
3200 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3201 {
3202   if (gdbarch->decr_pc_after_break == -1)
3203     internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
3204   if (gdbarch_debug >= 2)
3205     fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3206   return gdbarch->decr_pc_after_break;
3207 }
3208
3209 void
3210 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3211                                  CORE_ADDR decr_pc_after_break)
3212 {
3213   gdbarch->decr_pc_after_break = decr_pc_after_break;
3214 }
3215
3216 CORE_ADDR
3217 gdbarch_function_start_offset (struct gdbarch *gdbarch)
3218 {
3219   if (gdbarch->function_start_offset == -1)
3220     internal_error ("gdbarch: gdbarch_function_start_offset invalid");
3221   if (gdbarch_debug >= 2)
3222     fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
3223   return gdbarch->function_start_offset;
3224 }
3225
3226 void
3227 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
3228                                    CORE_ADDR function_start_offset)
3229 {
3230   gdbarch->function_start_offset = function_start_offset;
3231 }
3232
3233 void
3234 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
3235 {
3236   if (gdbarch->remote_translate_xfer_address == 0)
3237     internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
3238   if (gdbarch_debug >= 2)
3239     fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3240   gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
3241 }
3242
3243 void
3244 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3245                                            gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3246 {
3247   gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3248 }
3249
3250 CORE_ADDR
3251 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3252 {
3253   if (gdbarch->frame_args_skip == -1)
3254     internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
3255   if (gdbarch_debug >= 2)
3256     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3257   return gdbarch->frame_args_skip;
3258 }
3259
3260 void
3261 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3262                              CORE_ADDR frame_args_skip)
3263 {
3264   gdbarch->frame_args_skip = frame_args_skip;
3265 }
3266
3267 int
3268 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
3269 {
3270   if (gdbarch->frameless_function_invocation == 0)
3271     internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
3272   if (gdbarch_debug >= 2)
3273     fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
3274   return gdbarch->frameless_function_invocation (fi);
3275 }
3276
3277 void
3278 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
3279                                            gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
3280 {
3281   gdbarch->frameless_function_invocation = frameless_function_invocation;
3282 }
3283
3284 CORE_ADDR
3285 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3286 {
3287   if (gdbarch->frame_chain == 0)
3288     internal_error ("gdbarch: gdbarch_frame_chain invalid");
3289   if (gdbarch_debug >= 2)
3290     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
3291   return gdbarch->frame_chain (frame);
3292 }
3293
3294 void
3295 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
3296                          gdbarch_frame_chain_ftype frame_chain)
3297 {
3298   gdbarch->frame_chain = frame_chain;
3299 }
3300
3301 int
3302 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3303 {
3304   if (gdbarch->frame_chain_valid == 0)
3305     internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
3306   if (gdbarch_debug >= 2)
3307     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
3308   return gdbarch->frame_chain_valid (chain, thisframe);
3309 }
3310
3311 void
3312 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
3313                                gdbarch_frame_chain_valid_ftype frame_chain_valid)
3314 {
3315   gdbarch->frame_chain_valid = frame_chain_valid;
3316 }
3317
3318 CORE_ADDR
3319 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3320 {
3321   if (gdbarch->frame_saved_pc == 0)
3322     internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
3323   if (gdbarch_debug >= 2)
3324     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
3325   return gdbarch->frame_saved_pc (fi);
3326 }
3327
3328 void
3329 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
3330                             gdbarch_frame_saved_pc_ftype frame_saved_pc)
3331 {
3332   gdbarch->frame_saved_pc = frame_saved_pc;
3333 }
3334
3335 CORE_ADDR
3336 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3337 {
3338   if (gdbarch->frame_args_address == 0)
3339     internal_error ("gdbarch: gdbarch_frame_args_address invalid");
3340   if (gdbarch_debug >= 2)
3341     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
3342   return gdbarch->frame_args_address (fi);
3343 }
3344
3345 void
3346 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
3347                                 gdbarch_frame_args_address_ftype frame_args_address)
3348 {
3349   gdbarch->frame_args_address = frame_args_address;
3350 }
3351
3352 CORE_ADDR
3353 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
3354 {
3355   if (gdbarch->frame_locals_address == 0)
3356     internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
3357   if (gdbarch_debug >= 2)
3358     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
3359   return gdbarch->frame_locals_address (fi);
3360 }
3361
3362 void
3363 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
3364                                   gdbarch_frame_locals_address_ftype frame_locals_address)
3365 {
3366   gdbarch->frame_locals_address = frame_locals_address;
3367 }
3368
3369 CORE_ADDR
3370 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3371 {
3372   if (gdbarch->saved_pc_after_call == 0)
3373     internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
3374   if (gdbarch_debug >= 2)
3375     fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
3376   return gdbarch->saved_pc_after_call (frame);
3377 }
3378
3379 void
3380 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
3381                                  gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
3382 {
3383   gdbarch->saved_pc_after_call = saved_pc_after_call;
3384 }
3385
3386 int
3387 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3388 {
3389   if (gdbarch->frame_num_args == 0)
3390     internal_error ("gdbarch: gdbarch_frame_num_args invalid");
3391   if (gdbarch_debug >= 2)
3392     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3393   return gdbarch->frame_num_args (frame);
3394 }
3395
3396 void
3397 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3398                             gdbarch_frame_num_args_ftype frame_num_args)
3399 {
3400   gdbarch->frame_num_args = frame_num_args;
3401 }
3402
3403 int
3404 gdbarch_stack_align_p (struct gdbarch *gdbarch)
3405 {
3406   return gdbarch->stack_align != 0;
3407 }
3408
3409 CORE_ADDR
3410 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3411 {
3412   if (gdbarch->stack_align == 0)
3413     internal_error ("gdbarch: gdbarch_stack_align invalid");
3414   if (gdbarch_debug >= 2)
3415     fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
3416   return gdbarch->stack_align (sp);
3417 }
3418
3419 void
3420 set_gdbarch_stack_align (struct gdbarch *gdbarch,
3421                          gdbarch_stack_align_ftype stack_align)
3422 {
3423   gdbarch->stack_align = stack_align;
3424 }
3425
3426 int
3427 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3428 {
3429   return gdbarch->reg_struct_has_addr != 0;
3430 }
3431
3432 int
3433 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3434 {
3435   if (gdbarch->reg_struct_has_addr == 0)
3436     internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
3437   if (gdbarch_debug >= 2)
3438     fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
3439   return gdbarch->reg_struct_has_addr (gcc_p, type);
3440 }
3441
3442 void
3443 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
3444                                  gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
3445 {
3446   gdbarch->reg_struct_has_addr = reg_struct_has_addr;
3447 }
3448
3449 int
3450 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
3451 {
3452   return gdbarch->save_dummy_frame_tos != 0;
3453 }
3454
3455 void
3456 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
3457 {
3458   if (gdbarch->save_dummy_frame_tos == 0)
3459     internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid");
3460   if (gdbarch_debug >= 2)
3461     fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
3462   gdbarch->save_dummy_frame_tos (sp);
3463 }
3464
3465 void
3466 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
3467                                   gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
3468 {
3469   gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
3470 }
3471
3472 const struct floatformat *
3473 gdbarch_float_format (struct gdbarch *gdbarch)
3474 {
3475   if (gdbarch_debug >= 2)
3476     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
3477   return gdbarch->float_format;
3478 }
3479
3480 void
3481 set_gdbarch_float_format (struct gdbarch *gdbarch,
3482                           const struct floatformat * float_format)
3483 {
3484   gdbarch->float_format = float_format;
3485 }
3486
3487 const struct floatformat *
3488 gdbarch_double_format (struct gdbarch *gdbarch)
3489 {
3490   if (gdbarch_debug >= 2)
3491     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
3492   return gdbarch->double_format;
3493 }
3494
3495 void
3496 set_gdbarch_double_format (struct gdbarch *gdbarch,
3497                            const struct floatformat * double_format)
3498 {
3499   gdbarch->double_format = double_format;
3500 }
3501
3502 const struct floatformat *
3503 gdbarch_long_double_format (struct gdbarch *gdbarch)
3504 {
3505   if (gdbarch_debug >= 2)
3506     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
3507   return gdbarch->long_double_format;
3508 }
3509
3510 void
3511 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
3512                                 const struct floatformat * long_double_format)
3513 {
3514   gdbarch->long_double_format = long_double_format;
3515 }
3516
3517
3518 /* Keep a registrary of per-architecture data-pointers required by GDB
3519    modules. */
3520
3521 struct gdbarch_data
3522 {
3523   int index;
3524 };
3525
3526 struct gdbarch_data_registration
3527 {
3528   gdbarch_data_ftype *init;
3529   struct gdbarch_data *data;
3530   struct gdbarch_data_registration *next;
3531 };
3532
3533 struct gdbarch_data_registrary
3534 {
3535   int nr;
3536   struct gdbarch_data_registration *registrations;
3537 };
3538
3539 struct gdbarch_data_registrary gdbarch_data_registrary =
3540 {
3541   0, NULL,
3542 };
3543
3544 struct gdbarch_data *
3545 register_gdbarch_data (gdbarch_data_ftype *init)
3546 {
3547   struct gdbarch_data_registration **curr;
3548   for (curr = &gdbarch_data_registrary.registrations;
3549        (*curr) != NULL;
3550        curr = &(*curr)->next);
3551   (*curr) = XMALLOC (struct gdbarch_data_registration);
3552   (*curr)->next = NULL;
3553   (*curr)->init = init;
3554   (*curr)->data = XMALLOC (struct gdbarch_data);
3555   (*curr)->data->index = gdbarch_data_registrary.nr++;
3556   return (*curr)->data;
3557 }
3558
3559
3560 /* Walk through all the registered users initializing each in turn. */
3561
3562 static void
3563 init_gdbarch_data (struct gdbarch *gdbarch)
3564 {
3565   struct gdbarch_data_registration *rego;
3566   gdbarch->nr_data = gdbarch_data_registrary.nr + 1;
3567   gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
3568   for (rego = gdbarch_data_registrary.registrations;
3569        rego != NULL;
3570        rego = rego->next)
3571     {
3572       if (rego->data->index < gdbarch->nr_data)
3573         gdbarch->data[rego->data->index] = rego->init ();
3574     }
3575 }
3576
3577
3578 /* Return the current value of the specified per-architecture
3579    data-pointer. */
3580
3581 void *
3582 gdbarch_data (data)
3583      struct gdbarch_data *data;
3584 {
3585   if (data->index >= current_gdbarch->nr_data)
3586     internal_error ("gdbarch_data: request for non-existant data.");
3587   return current_gdbarch->data[data->index];
3588 }
3589
3590
3591
3592 /* Keep a registrary of swaped data required by GDB modules. */
3593
3594 struct gdbarch_swap
3595 {
3596   void *swap;
3597   struct gdbarch_swap_registration *source;
3598   struct gdbarch_swap *next;
3599 };
3600
3601 struct gdbarch_swap_registration
3602 {
3603   void *data;
3604   unsigned long sizeof_data;
3605   gdbarch_swap_ftype *init;
3606   struct gdbarch_swap_registration *next;
3607 };
3608
3609 struct gdbarch_swap_registrary
3610 {
3611   int nr;
3612   struct gdbarch_swap_registration *registrations;
3613 };
3614
3615 struct gdbarch_swap_registrary gdbarch_swap_registrary = 
3616 {
3617   0, NULL,
3618 };
3619
3620 void
3621 register_gdbarch_swap (void *data,
3622                        unsigned long sizeof_data,
3623                        gdbarch_swap_ftype *init)
3624 {
3625   struct gdbarch_swap_registration **rego;
3626   for (rego = &gdbarch_swap_registrary.registrations;
3627        (*rego) != NULL;
3628        rego = &(*rego)->next);
3629   (*rego) = XMALLOC (struct gdbarch_swap_registration);
3630   (*rego)->next = NULL;
3631   (*rego)->init = init;
3632   (*rego)->data = data;
3633   (*rego)->sizeof_data = sizeof_data;
3634 }
3635
3636
3637 static void
3638 init_gdbarch_swap (struct gdbarch *gdbarch)
3639 {
3640   struct gdbarch_swap_registration *rego;
3641   struct gdbarch_swap **curr = &gdbarch->swap;
3642   for (rego = gdbarch_swap_registrary.registrations;
3643        rego != NULL;
3644        rego = rego->next)
3645     {
3646       if (rego->data != NULL)
3647         {
3648           (*curr) = XMALLOC (struct gdbarch_swap);
3649           (*curr)->source = rego;
3650           (*curr)->swap = xmalloc (rego->sizeof_data);
3651           (*curr)->next = NULL;
3652           memset (rego->data, 0, rego->sizeof_data);
3653           curr = &(*curr)->next;
3654         }
3655       if (rego->init != NULL)
3656         rego->init ();
3657     }
3658 }
3659
3660 static void
3661 swapout_gdbarch_swap (struct gdbarch *gdbarch)
3662 {
3663   struct gdbarch_swap *curr;
3664   for (curr = gdbarch->swap;
3665        curr != NULL;
3666        curr = curr->next)
3667     memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3668 }
3669
3670 static void
3671 swapin_gdbarch_swap (struct gdbarch *gdbarch)
3672 {
3673   struct gdbarch_swap *curr;
3674   for (curr = gdbarch->swap;
3675        curr != NULL;
3676        curr = curr->next)
3677     memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3678 }
3679
3680
3681 /* Keep a registrary of the architectures known by GDB. */
3682
3683 struct gdbarch_registration
3684 {
3685   enum bfd_architecture bfd_architecture;
3686   gdbarch_init_ftype *init;
3687   gdbarch_dump_tdep_ftype *dump_tdep;
3688   struct gdbarch_list *arches;
3689   struct gdbarch_registration *next;
3690 };
3691
3692 static struct gdbarch_registration *gdbarch_registrary = NULL;
3693
3694 static void
3695 append_name (const char ***buf, int *nr, const char *name)
3696 {
3697   *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3698   (*buf)[*nr] = name;
3699   *nr += 1;
3700 }
3701
3702 const char **
3703 gdbarch_printable_names (void)
3704 {
3705   if (GDB_MULTI_ARCH)
3706     {
3707       /* Accumulate a list of names based on the registed list of
3708          architectures. */
3709       enum bfd_architecture a;
3710       int nr_arches = 0;
3711       const char **arches = NULL;
3712       struct gdbarch_registration *rego;
3713       for (rego = gdbarch_registrary;
3714            rego != NULL;
3715            rego = rego->next)
3716         {
3717           const struct bfd_arch_info *ap;
3718           ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3719           if (ap == NULL)
3720             internal_error ("gdbarch_architecture_names: multi-arch unknown");
3721           do
3722             {
3723               append_name (&arches, &nr_arches, ap->printable_name);
3724               ap = ap->next;
3725             }
3726           while (ap != NULL);
3727         }
3728       append_name (&arches, &nr_arches, NULL);
3729       return arches;
3730     }
3731   else
3732     /* Just return all the architectures that BFD knows.  Assume that
3733        the legacy architecture framework supports them. */
3734     return bfd_arch_list ();
3735 }
3736
3737
3738 void
3739 gdbarch_register (enum bfd_architecture bfd_architecture,
3740                   gdbarch_init_ftype *init,
3741                   gdbarch_dump_tdep_ftype *dump_tdep)
3742 {
3743   struct gdbarch_registration **curr;
3744   const struct bfd_arch_info *bfd_arch_info;
3745   /* Check that BFD reconizes this architecture */
3746   bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3747   if (bfd_arch_info == NULL)
3748     {
3749       internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
3750     }
3751   /* Check that we haven't seen this architecture before */
3752   for (curr = &gdbarch_registrary;
3753        (*curr) != NULL;
3754        curr = &(*curr)->next)
3755     {
3756       if (bfd_architecture == (*curr)->bfd_architecture)
3757         internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
3758                bfd_arch_info->printable_name);
3759     }
3760   /* log it */
3761   if (gdbarch_debug)
3762     fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3763                         bfd_arch_info->printable_name,
3764                         (long) init);
3765   /* Append it */
3766   (*curr) = XMALLOC (struct gdbarch_registration);
3767   (*curr)->bfd_architecture = bfd_architecture;
3768   (*curr)->init = init;
3769   (*curr)->dump_tdep = dump_tdep;
3770   (*curr)->arches = NULL;
3771   (*curr)->next = NULL;
3772   /* When non- multi-arch, install what ever target dump routine we've
3773      been provided - hopefully that routine has been writen correct
3774      and works regardless of multi-arch. */
3775   if (!GDB_MULTI_ARCH && dump_tdep != NULL
3776       && startup_gdbarch.dump_tdep == NULL)
3777     startup_gdbarch.dump_tdep = dump_tdep;
3778 }
3779
3780 void
3781 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3782                        gdbarch_init_ftype *init)
3783 {
3784   gdbarch_register (bfd_architecture, init, NULL);
3785 }
3786
3787
3788 /* Look for an architecture using gdbarch_info.  Base search on only
3789    BFD_ARCH_INFO and BYTE_ORDER. */
3790
3791 struct gdbarch_list *
3792 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3793                              const struct gdbarch_info *info)
3794 {
3795   for (; arches != NULL; arches = arches->next)
3796     {
3797       if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3798         continue;
3799       if (info->byte_order != arches->gdbarch->byte_order)
3800         continue;
3801       return arches;
3802     }
3803   return NULL;
3804 }
3805
3806
3807 /* Update the current architecture. Return ZERO if the update request
3808    failed. */
3809
3810 int
3811 gdbarch_update (struct gdbarch_info info)
3812 {
3813   struct gdbarch *new_gdbarch;
3814   struct gdbarch_list **list;
3815   struct gdbarch_registration *rego;
3816
3817   /* Fill in any missing bits. Most important is the bfd_architecture
3818      which is used to select the target architecture. */
3819   if (info.bfd_architecture == bfd_arch_unknown)
3820     {
3821       if (info.bfd_arch_info != NULL)
3822         info.bfd_architecture = info.bfd_arch_info->arch;
3823       else if (info.abfd != NULL)
3824         info.bfd_architecture = bfd_get_arch (info.abfd);
3825       /* FIXME - should query BFD for its default architecture. */
3826       else
3827         info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
3828     }
3829   if (info.bfd_arch_info == NULL)
3830     {
3831       if (target_architecture_auto && info.abfd != NULL)
3832         info.bfd_arch_info = bfd_get_arch_info (info.abfd);
3833       else
3834         info.bfd_arch_info = current_gdbarch->bfd_arch_info;
3835     }
3836   if (info.byte_order == 0)
3837     {
3838       if (target_byte_order_auto && info.abfd != NULL)
3839         info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
3840                            : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
3841                            : 0);
3842       else
3843         info.byte_order = current_gdbarch->byte_order;
3844       /* FIXME - should query BFD for its default byte-order. */
3845     }
3846   /* A default for abfd? */
3847
3848   /* Find the target that knows about this architecture. */
3849   for (rego = gdbarch_registrary;
3850        rego != NULL;
3851        rego = rego->next)
3852     if (rego->bfd_architecture == info.bfd_architecture)
3853       break;
3854   if (rego == NULL)
3855     {
3856       if (gdbarch_debug)
3857         fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
3858       return 0;
3859     }
3860
3861   if (gdbarch_debug)
3862     {
3863       fprintf_unfiltered (gdb_stdlog,
3864                           "gdbarch_update: info.bfd_architecture %d (%s)\n",
3865                           info.bfd_architecture,
3866                           bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
3867       fprintf_unfiltered (gdb_stdlog,
3868                           "gdbarch_update: info.bfd_arch_info %s\n",
3869                           (info.bfd_arch_info != NULL
3870                            ? info.bfd_arch_info->printable_name
3871                            : "(null)"));
3872       fprintf_unfiltered (gdb_stdlog,
3873                           "gdbarch_update: info.byte_order %d (%s)\n",
3874                           info.byte_order,
3875                           (info.byte_order == BIG_ENDIAN ? "big"
3876                            : info.byte_order == LITTLE_ENDIAN ? "little"
3877                            : "default"));
3878       fprintf_unfiltered (gdb_stdlog,
3879                           "gdbarch_update: info.abfd 0x%lx\n",
3880                           (long) info.abfd);
3881       fprintf_unfiltered (gdb_stdlog,
3882                           "gdbarch_update: info.tdep_info 0x%lx\n",
3883                           (long) info.tdep_info);
3884     }
3885
3886   /* Ask the target for a replacement architecture. */
3887   new_gdbarch = rego->init (info, rego->arches);
3888
3889   /* Did the target like it?  No. Reject the change. */
3890   if (new_gdbarch == NULL)
3891     {
3892       if (gdbarch_debug)
3893         fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
3894       return 0;
3895     }
3896
3897   /* Did the architecture change?  No. Do nothing. */
3898   if (current_gdbarch == new_gdbarch)
3899     {
3900       if (gdbarch_debug)
3901         fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
3902                             (long) new_gdbarch,
3903                             new_gdbarch->bfd_arch_info->printable_name);
3904       return 1;
3905     }
3906
3907   /* Swap all data belonging to the old target out */
3908   swapout_gdbarch_swap (current_gdbarch);
3909
3910   /* Is this a pre-existing architecture?  Yes. Swap it in.  */
3911   for (list = &rego->arches;
3912        (*list) != NULL;
3913        list = &(*list)->next)
3914     {
3915       if ((*list)->gdbarch == new_gdbarch)
3916         {
3917           if (gdbarch_debug)
3918             fprintf_unfiltered (gdb_stdlog,
3919                                 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
3920                                 (long) new_gdbarch,
3921                                 new_gdbarch->bfd_arch_info->printable_name);
3922           current_gdbarch = new_gdbarch;
3923           swapin_gdbarch_swap (new_gdbarch);
3924           return 1;
3925         }
3926     }
3927
3928   /* Append this new architecture to this targets list. */
3929   (*list) = XMALLOC (struct gdbarch_list);
3930   (*list)->next = NULL;
3931   (*list)->gdbarch = new_gdbarch;
3932
3933   /* Switch to this new architecture.  Dump it out. */
3934   current_gdbarch = new_gdbarch;
3935   if (gdbarch_debug)
3936     {
3937       fprintf_unfiltered (gdb_stdlog,
3938                           "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
3939                           (long) new_gdbarch,
3940                           new_gdbarch->bfd_arch_info->printable_name);
3941     }
3942   
3943   /* Check that the newly installed architecture is valid.  Plug in
3944      any post init values.  */
3945   new_gdbarch->dump_tdep = rego->dump_tdep;
3946   verify_gdbarch (new_gdbarch);
3947
3948   /* Initialize the per-architecture memory (swap) areas.
3949      CURRENT_GDBARCH must be update before these modules are
3950      called. */
3951   init_gdbarch_swap (new_gdbarch);
3952   
3953   /* Initialize the per-architecture data-pointer of all parties that
3954      registered an interest in this architecture.  CURRENT_GDBARCH
3955      must be updated before these modules are called. */
3956   init_gdbarch_data (new_gdbarch);
3957   
3958   if (gdbarch_debug)
3959     gdbarch_dump (current_gdbarch, gdb_stdlog);
3960
3961   return 1;
3962 }
3963
3964
3965 /* Disassembler */
3966
3967 /* Pointer to the target-dependent disassembly function.  */
3968 int (*tm_print_insn) (bfd_vma, disassemble_info *);
3969 disassemble_info tm_print_insn_info;
3970
3971
3972 extern void _initialize_gdbarch (void);
3973
3974 void
3975 _initialize_gdbarch ()
3976 {
3977   struct cmd_list_element *c;
3978
3979   INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
3980   tm_print_insn_info.flavour = bfd_target_unknown_flavour;
3981   tm_print_insn_info.read_memory_func = dis_asm_read_memory;
3982   tm_print_insn_info.memory_error_func = dis_asm_memory_error;
3983   tm_print_insn_info.print_address_func = dis_asm_print_address;
3984
3985   add_show_from_set (add_set_cmd ("arch",
3986                                   class_maintenance,
3987                                   var_zinteger,
3988                                   (char *)&gdbarch_debug,
3989                                   "Set architecture debugging.\n\
3990 When non-zero, architecture debugging is enabled.", &setdebuglist),
3991                      &showdebuglist);
3992   c = add_set_cmd ("archdebug",
3993                    class_maintenance,
3994                    var_zinteger,
3995                    (char *)&gdbarch_debug,
3996                    "Set architecture debugging.\n\
3997 When non-zero, architecture debugging is enabled.", &setlist);
3998
3999   deprecate_cmd (c, "set debug arch");
4000   deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
4001 }
This page took 0.258884 seconds and 4 git commands to generate.