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