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