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