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