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