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