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