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