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