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