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