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