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