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