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