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