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