1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
4 Copyright 1998-1999, Free Software Foundation, Inc.
6 This file is part of GDB.
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.
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.
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. */
23 /* This file was created with the aid of ``gdbarch.sh''.
25 The Bourne shell script ``gdbarch.sh'' creates the files
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
30 If editing this file, please also run gdbarch.sh and merge any
31 changes into that script. Conversely, when making sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
37 #include "arch-utils.h"
41 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
43 /* Just include everything in sight so that the every old definition
44 of macro is visible. */
45 #include "gdb_string.h"
50 #include "breakpoint.h"
55 #include "gdbthread.h"
57 #include "symfile.h" /* for overlay functions */
61 #include "floatformat.h"
63 /* Static function declarations */
65 static void verify_gdbarch (struct gdbarch *gdbarch);
66 static void init_gdbarch_data (struct gdbarch *);
67 static void init_gdbarch_swap (struct gdbarch *);
68 static void swapout_gdbarch_swap (struct gdbarch *);
69 static void swapin_gdbarch_swap (struct gdbarch *);
71 /* Convenience macro for allocting typesafe memory. */
74 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
78 /* Non-zero if we want to trace architecture code. */
81 #define GDBARCH_DEBUG 0
83 int gdbarch_debug = GDBARCH_DEBUG;
86 /* Maintain the struct gdbarch object */
90 /* basic architectural information */
91 const struct bfd_arch_info * bfd_arch_info;
94 /* target specific vector. */
95 struct gdbarch_tdep *tdep;
96 gdbarch_dump_tdep_ftype *dump_tdep;
98 /* per-architecture data-pointers */
102 /* per-architecture swap-regions */
103 struct gdbarch_swap *swap;
105 /* Multi-arch values.
107 When extending this structure you must:
111 Declare set/get functions and define the corresponding
114 gdbarch_alloc(): If zero/NULL is not a suitable default,
115 initialize the new field.
117 verify_gdbarch(): Confirm that the target updated the field
120 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
123 ``startup_gdbarch()'': Append an initial value to the static
124 variable (base values on the host's c-type system).
126 get_gdbarch(): Implement the set/get functions (probably using
127 the macro's as shortcuts).
142 gdbarch_read_pc_ftype *read_pc;
143 gdbarch_write_pc_ftype *write_pc;
144 gdbarch_read_fp_ftype *read_fp;
145 gdbarch_write_fp_ftype *write_fp;
146 gdbarch_read_sp_ftype *read_sp;
147 gdbarch_write_sp_ftype *write_sp;
156 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
157 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
158 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
159 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
160 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
161 gdbarch_register_name_ftype *register_name;
164 gdbarch_register_byte_ftype *register_byte;
165 gdbarch_register_raw_size_ftype *register_raw_size;
166 int max_register_raw_size;
167 gdbarch_register_virtual_size_ftype *register_virtual_size;
168 int max_register_virtual_size;
169 gdbarch_register_virtual_type_ftype *register_virtual_type;
170 gdbarch_do_registers_info_ftype *do_registers_info;
171 gdbarch_register_sim_regno_ftype *register_sim_regno;
172 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
173 int use_generic_dummy_frames;
174 int call_dummy_location;
175 gdbarch_call_dummy_address_ftype *call_dummy_address;
176 CORE_ADDR call_dummy_start_offset;
177 CORE_ADDR call_dummy_breakpoint_offset;
178 int call_dummy_breakpoint_offset_p;
179 int call_dummy_length;
180 gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
182 LONGEST * call_dummy_words;
183 int sizeof_call_dummy_words;
184 int call_dummy_stack_adjust_p;
185 int call_dummy_stack_adjust;
186 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
187 int believe_pcc_promotion;
188 int believe_pcc_promotion_type;
189 gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
190 gdbarch_get_saved_register_ftype *get_saved_register;
191 gdbarch_register_convertible_ftype *register_convertible;
192 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
193 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
194 gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
195 gdbarch_store_pseudo_register_ftype *store_pseudo_register;
196 gdbarch_pointer_to_address_ftype *pointer_to_address;
197 gdbarch_address_to_pointer_ftype *address_to_pointer;
198 gdbarch_return_value_on_stack_ftype *return_value_on_stack;
199 gdbarch_extract_return_value_ftype *extract_return_value;
200 gdbarch_push_arguments_ftype *push_arguments;
201 gdbarch_push_dummy_frame_ftype *push_dummy_frame;
202 gdbarch_push_return_address_ftype *push_return_address;
203 gdbarch_pop_frame_ftype *pop_frame;
204 gdbarch_d10v_make_daddr_ftype *d10v_make_daddr;
205 gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
206 gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
207 gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
208 gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
209 gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
210 gdbarch_store_struct_return_ftype *store_struct_return;
211 gdbarch_store_return_value_ftype *store_return_value;
212 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
213 gdbarch_use_struct_convention_ftype *use_struct_convention;
214 gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
215 gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
216 gdbarch_skip_prologue_ftype *skip_prologue;
217 gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
218 gdbarch_inner_than_ftype *inner_than;
219 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
220 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
221 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
222 CORE_ADDR decr_pc_after_break;
223 CORE_ADDR function_start_offset;
224 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
225 CORE_ADDR frame_args_skip;
226 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
227 gdbarch_frame_chain_ftype *frame_chain;
228 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
229 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
230 gdbarch_frame_args_address_ftype *frame_args_address;
231 gdbarch_frame_locals_address_ftype *frame_locals_address;
232 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
233 gdbarch_frame_num_args_ftype *frame_num_args;
234 gdbarch_stack_align_ftype *stack_align;
235 int extra_stack_alignment_needed;
236 gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
237 gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
238 const struct floatformat * float_format;
239 const struct floatformat * double_format;
240 const struct floatformat * long_double_format;
241 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
245 /* The default architecture uses host values (for want of a better
248 extern const struct bfd_arch_info bfd_default_arch_struct;
250 struct gdbarch startup_gdbarch =
252 /* basic architecture information */
253 &bfd_default_arch_struct,
255 /* target specific vector and its dump routine */
257 /*per-architecture data-pointers and swap regions */
259 /* Multi-arch values */
263 8 * sizeof (LONGEST),
266 8 * sizeof (long double),
319 generic_get_saved_register,
371 /* startup_gdbarch() */
374 struct gdbarch *current_gdbarch = &startup_gdbarch;
377 /* Create a new ``struct gdbarch'' based on information provided by
378 ``struct gdbarch_info''. */
381 gdbarch_alloc (const struct gdbarch_info *info,
382 struct gdbarch_tdep *tdep)
384 struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
385 memset (gdbarch, 0, sizeof (*gdbarch));
387 gdbarch->tdep = tdep;
389 gdbarch->bfd_arch_info = info->bfd_arch_info;
390 gdbarch->byte_order = info->byte_order;
392 /* Force the explicit initialization of these. */
393 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
394 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
395 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
396 gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
397 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
398 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
399 gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
400 gdbarch->ptr_bit = TARGET_INT_BIT;
401 gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
402 gdbarch->read_pc = generic_target_read_pc;
403 gdbarch->write_pc = generic_target_write_pc;
404 gdbarch->read_fp = generic_target_read_fp;
405 gdbarch->write_fp = generic_target_write_fp;
406 gdbarch->read_sp = generic_target_read_sp;
407 gdbarch->write_sp = generic_target_write_sp;
408 gdbarch->num_regs = -1;
409 gdbarch->sp_regnum = -1;
410 gdbarch->fp_regnum = -1;
411 gdbarch->pc_regnum = -1;
412 gdbarch->fp0_regnum = -1;
413 gdbarch->npc_regnum = -1;
414 gdbarch->nnpc_regnum = -1;
415 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
416 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
417 gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
418 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
419 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
420 gdbarch->register_name = legacy_register_name;
421 gdbarch->register_size = -1;
422 gdbarch->register_bytes = -1;
423 gdbarch->max_register_raw_size = -1;
424 gdbarch->max_register_virtual_size = -1;
425 gdbarch->do_registers_info = do_registers_info;
426 gdbarch->register_sim_regno = default_register_sim_regno;
427 gdbarch->use_generic_dummy_frames = -1;
428 gdbarch->call_dummy_start_offset = -1;
429 gdbarch->call_dummy_breakpoint_offset = -1;
430 gdbarch->call_dummy_breakpoint_offset_p = -1;
431 gdbarch->call_dummy_length = -1;
432 gdbarch->call_dummy_p = -1;
433 gdbarch->call_dummy_words = legacy_call_dummy_words;
434 gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
435 gdbarch->call_dummy_stack_adjust_p = -1;
436 gdbarch->coerce_float_to_double = default_coerce_float_to_double;
437 gdbarch->register_convertible = generic_register_convertible_not;
438 gdbarch->pointer_to_address = unsigned_pointer_to_address;
439 gdbarch->address_to_pointer = unsigned_address_to_pointer;
440 gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
441 gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
442 gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
443 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
444 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
445 gdbarch->decr_pc_after_break = -1;
446 gdbarch->function_start_offset = -1;
447 gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
448 gdbarch->frame_args_skip = -1;
449 gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
450 gdbarch->extra_stack_alignment_needed = 1;
451 gdbarch->convert_from_func_ptr_addr = default_convert_from_func_ptr_addr;
452 /* gdbarch_alloc() */
458 /* Free a gdbarch struct. This should never happen in normal
459 operation --- once you've created a gdbarch, you keep it around.
460 However, if an architecture's init function encounters an error
461 building the structure, it may need to clean up a partially
462 constructed gdbarch. */
465 gdbarch_free (struct gdbarch *arch)
467 /* At the moment, this is trivial. */
472 /* Ensure that all values in a GDBARCH are reasonable. */
475 verify_gdbarch (struct gdbarch *gdbarch)
477 /* Only perform sanity checks on a multi-arch target. */
481 if (gdbarch->byte_order == 0)
482 internal_error ("verify_gdbarch: byte-order unset");
483 if (gdbarch->bfd_arch_info == NULL)
484 internal_error ("verify_gdbarch: bfd_arch_info unset");
485 /* Check those that need to be defined for the given multi-arch level. */
486 /* Skip verify of short_bit, invalid_p == 0 */
487 /* Skip verify of int_bit, invalid_p == 0 */
488 /* Skip verify of long_bit, invalid_p == 0 */
489 /* Skip verify of long_long_bit, invalid_p == 0 */
490 /* Skip verify of float_bit, invalid_p == 0 */
491 /* Skip verify of double_bit, invalid_p == 0 */
492 /* Skip verify of long_double_bit, invalid_p == 0 */
493 /* Skip verify of ptr_bit, invalid_p == 0 */
494 if (gdbarch->addr_bit == 0)
495 gdbarch->addr_bit = TARGET_PTR_BIT;
496 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
497 /* Skip verify of ieee_float, invalid_p == 0 */
498 /* Skip verify of read_pc, invalid_p == 0 */
499 /* Skip verify of write_pc, invalid_p == 0 */
500 /* Skip verify of read_fp, invalid_p == 0 */
501 /* Skip verify of write_fp, invalid_p == 0 */
502 /* Skip verify of read_sp, invalid_p == 0 */
503 /* Skip verify of write_sp, invalid_p == 0 */
504 if ((GDB_MULTI_ARCH >= 2)
505 && (gdbarch->num_regs == -1))
506 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
507 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
508 if ((GDB_MULTI_ARCH >= 2)
509 && (gdbarch->sp_regnum == -1))
510 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
511 if ((GDB_MULTI_ARCH >= 2)
512 && (gdbarch->fp_regnum == -1))
513 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
514 if ((GDB_MULTI_ARCH >= 2)
515 && (gdbarch->pc_regnum == -1))
516 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
517 /* Skip verify of fp0_regnum, invalid_p == 0 */
518 /* Skip verify of npc_regnum, invalid_p == 0 */
519 /* Skip verify of nnpc_regnum, invalid_p == 0 */
520 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
521 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
522 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
523 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
524 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
525 /* Skip verify of register_name, invalid_p == 0 */
526 if ((GDB_MULTI_ARCH >= 2)
527 && (gdbarch->register_size == -1))
528 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
529 if ((GDB_MULTI_ARCH >= 2)
530 && (gdbarch->register_bytes == -1))
531 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
532 if ((GDB_MULTI_ARCH >= 2)
533 && (gdbarch->register_byte == 0))
534 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
535 if ((GDB_MULTI_ARCH >= 2)
536 && (gdbarch->register_raw_size == 0))
537 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
538 if ((GDB_MULTI_ARCH >= 2)
539 && (gdbarch->max_register_raw_size == -1))
540 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
541 if ((GDB_MULTI_ARCH >= 2)
542 && (gdbarch->register_virtual_size == 0))
543 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
544 if ((GDB_MULTI_ARCH >= 2)
545 && (gdbarch->max_register_virtual_size == -1))
546 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
547 if ((GDB_MULTI_ARCH >= 2)
548 && (gdbarch->register_virtual_type == 0))
549 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
550 /* Skip verify of do_registers_info, invalid_p == 0 */
551 /* Skip verify of register_sim_regno, invalid_p == 0 */
552 /* Skip verify of register_bytes_ok, has predicate */
553 if ((GDB_MULTI_ARCH >= 1)
554 && (gdbarch->use_generic_dummy_frames == -1))
555 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
556 if ((GDB_MULTI_ARCH >= 2)
557 && (gdbarch->call_dummy_location == 0))
558 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
559 if ((GDB_MULTI_ARCH >= 2)
560 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
561 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
562 if ((GDB_MULTI_ARCH >= 2)
563 && (gdbarch->call_dummy_start_offset == -1))
564 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
565 if ((GDB_MULTI_ARCH >= 2)
566 && (gdbarch->call_dummy_breakpoint_offset == -1))
567 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
568 if ((GDB_MULTI_ARCH >= 1)
569 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
570 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
571 if ((GDB_MULTI_ARCH >= 2)
572 && (gdbarch->call_dummy_length == -1))
573 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
574 if ((GDB_MULTI_ARCH >= 2)
575 && (gdbarch->pc_in_call_dummy == 0))
576 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
577 if ((GDB_MULTI_ARCH >= 1)
578 && (gdbarch->call_dummy_p == -1))
579 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
580 /* Skip verify of call_dummy_words, invalid_p == 0 */
581 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
582 if ((GDB_MULTI_ARCH >= 1)
583 && (gdbarch->call_dummy_stack_adjust_p == -1))
584 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
585 if ((GDB_MULTI_ARCH >= 2)
586 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
587 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
588 if ((GDB_MULTI_ARCH >= 2)
589 && (gdbarch->fix_call_dummy == 0))
590 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
591 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
592 if ((GDB_MULTI_ARCH >= 1)
593 && (gdbarch->get_saved_register == 0))
594 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
595 /* Skip verify of register_convertible, invalid_p == 0 */
596 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
597 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
598 /* Skip verify of fetch_pseudo_register, invalid_p == 0 */
599 /* Skip verify of store_pseudo_register, invalid_p == 0 */
600 /* Skip verify of pointer_to_address, invalid_p == 0 */
601 /* Skip verify of address_to_pointer, invalid_p == 0 */
602 /* Skip verify of return_value_on_stack, invalid_p == 0 */
603 if ((GDB_MULTI_ARCH >= 2)
604 && (gdbarch->extract_return_value == 0))
605 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
606 if ((GDB_MULTI_ARCH >= 1)
607 && (gdbarch->push_arguments == 0))
608 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
609 if ((GDB_MULTI_ARCH >= 2)
610 && (gdbarch->push_dummy_frame == 0))
611 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
612 if ((GDB_MULTI_ARCH >= 1)
613 && (gdbarch->push_return_address == 0))
614 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
615 if ((GDB_MULTI_ARCH >= 2)
616 && (gdbarch->pop_frame == 0))
617 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
618 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
619 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
620 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
621 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
622 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
623 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
624 if ((GDB_MULTI_ARCH >= 2)
625 && (gdbarch->store_struct_return == 0))
626 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
627 if ((GDB_MULTI_ARCH >= 2)
628 && (gdbarch->store_return_value == 0))
629 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
630 if ((GDB_MULTI_ARCH >= 2)
631 && (gdbarch->extract_struct_value_address == 0))
632 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
633 if ((GDB_MULTI_ARCH >= 2)
634 && (gdbarch->use_struct_convention == 0))
635 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
636 if ((GDB_MULTI_ARCH >= 2)
637 && (gdbarch->frame_init_saved_regs == 0))
638 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
639 if ((GDB_MULTI_ARCH >= 2)
640 && (gdbarch->init_extra_frame_info == 0))
641 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
642 if ((GDB_MULTI_ARCH >= 2)
643 && (gdbarch->skip_prologue == 0))
644 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
645 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
646 if ((GDB_MULTI_ARCH >= 2)
647 && (gdbarch->inner_than == 0))
648 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
649 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
650 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
651 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
652 if ((GDB_MULTI_ARCH >= 2)
653 && (gdbarch->decr_pc_after_break == -1))
654 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
655 if ((GDB_MULTI_ARCH >= 2)
656 && (gdbarch->function_start_offset == -1))
657 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
658 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
659 if ((GDB_MULTI_ARCH >= 2)
660 && (gdbarch->frame_args_skip == -1))
661 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
662 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
663 if ((GDB_MULTI_ARCH >= 2)
664 && (gdbarch->frame_chain == 0))
665 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
666 if ((GDB_MULTI_ARCH >= 1)
667 && (gdbarch->frame_chain_valid == 0))
668 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
669 if ((GDB_MULTI_ARCH >= 2)
670 && (gdbarch->frame_saved_pc == 0))
671 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
672 if ((GDB_MULTI_ARCH >= 2)
673 && (gdbarch->frame_args_address == 0))
674 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
675 if ((GDB_MULTI_ARCH >= 2)
676 && (gdbarch->frame_locals_address == 0))
677 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
678 if ((GDB_MULTI_ARCH >= 2)
679 && (gdbarch->saved_pc_after_call == 0))
680 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
681 if ((GDB_MULTI_ARCH >= 2)
682 && (gdbarch->frame_num_args == 0))
683 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
684 /* Skip verify of stack_align, has predicate */
685 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
686 /* Skip verify of reg_struct_has_addr, has predicate */
687 /* Skip verify of save_dummy_frame_tos, has predicate */
688 if (gdbarch->float_format == 0)
689 gdbarch->float_format = default_float_format (gdbarch);
690 if (gdbarch->double_format == 0)
691 gdbarch->double_format = default_double_format (gdbarch);
692 if (gdbarch->long_double_format == 0)
693 gdbarch->long_double_format = &floatformat_unknown;
694 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
698 /* Print out the details of the current architecture. */
700 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
701 just happens to match the global variable ``current_gdbarch''. That
702 way macros refering to that variable get the local and not the global
703 version - ulgh. Once everything is parameterised with gdbarch, this
707 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
709 fprintf_unfiltered (file,
710 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
712 #ifdef TARGET_ARCHITECTURE
713 fprintf_unfiltered (file,
714 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
715 XSTRING (TARGET_ARCHITECTURE));
717 #ifdef TARGET_BYTE_ORDER
718 fprintf_unfiltered (file,
719 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
720 XSTRING (TARGET_BYTE_ORDER));
722 #ifdef TARGET_SHORT_BIT
723 fprintf_unfiltered (file,
724 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
725 XSTRING (TARGET_SHORT_BIT));
727 #ifdef TARGET_INT_BIT
728 fprintf_unfiltered (file,
729 "gdbarch_dump: TARGET_INT_BIT # %s\n",
730 XSTRING (TARGET_INT_BIT));
732 #ifdef TARGET_LONG_BIT
733 fprintf_unfiltered (file,
734 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
735 XSTRING (TARGET_LONG_BIT));
737 #ifdef TARGET_LONG_LONG_BIT
738 fprintf_unfiltered (file,
739 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
740 XSTRING (TARGET_LONG_LONG_BIT));
742 #ifdef TARGET_FLOAT_BIT
743 fprintf_unfiltered (file,
744 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
745 XSTRING (TARGET_FLOAT_BIT));
747 #ifdef TARGET_DOUBLE_BIT
748 fprintf_unfiltered (file,
749 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
750 XSTRING (TARGET_DOUBLE_BIT));
752 #ifdef TARGET_LONG_DOUBLE_BIT
753 fprintf_unfiltered (file,
754 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
755 XSTRING (TARGET_LONG_DOUBLE_BIT));
757 #ifdef TARGET_PTR_BIT
758 fprintf_unfiltered (file,
759 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
760 XSTRING (TARGET_PTR_BIT));
762 #ifdef TARGET_ADDR_BIT
763 fprintf_unfiltered (file,
764 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
765 XSTRING (TARGET_ADDR_BIT));
767 #ifdef TARGET_BFD_VMA_BIT
768 fprintf_unfiltered (file,
769 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
770 XSTRING (TARGET_BFD_VMA_BIT));
773 fprintf_unfiltered (file,
774 "gdbarch_dump: IEEE_FLOAT # %s\n",
775 XSTRING (IEEE_FLOAT));
777 #ifdef TARGET_READ_PC
778 fprintf_unfiltered (file,
779 "gdbarch_dump: %s # %s\n",
780 "TARGET_READ_PC(pid)",
781 XSTRING (TARGET_READ_PC (pid)));
783 #if defined (TARGET_WRITE_PC) && GDB_MULTI_ARCH
784 /* Macro might contain `[{}]' when not multi-arch */
785 fprintf_unfiltered (file,
786 "gdbarch_dump: %s # %s\n",
787 "TARGET_WRITE_PC(val, pid)",
788 XSTRING (TARGET_WRITE_PC (val, pid)));
790 #ifdef TARGET_READ_FP
791 fprintf_unfiltered (file,
792 "gdbarch_dump: %s # %s\n",
794 XSTRING (TARGET_READ_FP ()));
796 #if defined (TARGET_WRITE_FP) && GDB_MULTI_ARCH
797 /* Macro might contain `[{}]' when not multi-arch */
798 fprintf_unfiltered (file,
799 "gdbarch_dump: %s # %s\n",
800 "TARGET_WRITE_FP(val)",
801 XSTRING (TARGET_WRITE_FP (val)));
803 #ifdef TARGET_READ_SP
804 fprintf_unfiltered (file,
805 "gdbarch_dump: %s # %s\n",
807 XSTRING (TARGET_READ_SP ()));
809 #if defined (TARGET_WRITE_SP) && GDB_MULTI_ARCH
810 /* Macro might contain `[{}]' when not multi-arch */
811 fprintf_unfiltered (file,
812 "gdbarch_dump: %s # %s\n",
813 "TARGET_WRITE_SP(val)",
814 XSTRING (TARGET_WRITE_SP (val)));
817 fprintf_unfiltered (file,
818 "gdbarch_dump: NUM_REGS # %s\n",
821 #ifdef NUM_PSEUDO_REGS
822 fprintf_unfiltered (file,
823 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
824 XSTRING (NUM_PSEUDO_REGS));
827 fprintf_unfiltered (file,
828 "gdbarch_dump: SP_REGNUM # %s\n",
829 XSTRING (SP_REGNUM));
832 fprintf_unfiltered (file,
833 "gdbarch_dump: FP_REGNUM # %s\n",
834 XSTRING (FP_REGNUM));
837 fprintf_unfiltered (file,
838 "gdbarch_dump: PC_REGNUM # %s\n",
839 XSTRING (PC_REGNUM));
842 fprintf_unfiltered (file,
843 "gdbarch_dump: FP0_REGNUM # %s\n",
844 XSTRING (FP0_REGNUM));
847 fprintf_unfiltered (file,
848 "gdbarch_dump: NPC_REGNUM # %s\n",
849 XSTRING (NPC_REGNUM));
852 fprintf_unfiltered (file,
853 "gdbarch_dump: NNPC_REGNUM # %s\n",
854 XSTRING (NNPC_REGNUM));
856 #ifdef STAB_REG_TO_REGNUM
857 fprintf_unfiltered (file,
858 "gdbarch_dump: %s # %s\n",
859 "STAB_REG_TO_REGNUM(stab_regnr)",
860 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
862 #ifdef ECOFF_REG_TO_REGNUM
863 fprintf_unfiltered (file,
864 "gdbarch_dump: %s # %s\n",
865 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
866 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
868 #ifdef DWARF_REG_TO_REGNUM
869 fprintf_unfiltered (file,
870 "gdbarch_dump: %s # %s\n",
871 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
872 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
874 #ifdef SDB_REG_TO_REGNUM
875 fprintf_unfiltered (file,
876 "gdbarch_dump: %s # %s\n",
877 "SDB_REG_TO_REGNUM(sdb_regnr)",
878 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
880 #ifdef DWARF2_REG_TO_REGNUM
881 fprintf_unfiltered (file,
882 "gdbarch_dump: %s # %s\n",
883 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
884 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
887 fprintf_unfiltered (file,
888 "gdbarch_dump: %s # %s\n",
889 "REGISTER_NAME(regnr)",
890 XSTRING (REGISTER_NAME (regnr)));
893 fprintf_unfiltered (file,
894 "gdbarch_dump: REGISTER_SIZE # %s\n",
895 XSTRING (REGISTER_SIZE));
897 #ifdef REGISTER_BYTES
898 fprintf_unfiltered (file,
899 "gdbarch_dump: REGISTER_BYTES # %s\n",
900 XSTRING (REGISTER_BYTES));
903 fprintf_unfiltered (file,
904 "gdbarch_dump: %s # %s\n",
905 "REGISTER_BYTE(reg_nr)",
906 XSTRING (REGISTER_BYTE (reg_nr)));
908 #ifdef REGISTER_RAW_SIZE
909 fprintf_unfiltered (file,
910 "gdbarch_dump: %s # %s\n",
911 "REGISTER_RAW_SIZE(reg_nr)",
912 XSTRING (REGISTER_RAW_SIZE (reg_nr)));
914 #ifdef MAX_REGISTER_RAW_SIZE
915 fprintf_unfiltered (file,
916 "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
917 XSTRING (MAX_REGISTER_RAW_SIZE));
919 #ifdef REGISTER_VIRTUAL_SIZE
920 fprintf_unfiltered (file,
921 "gdbarch_dump: %s # %s\n",
922 "REGISTER_VIRTUAL_SIZE(reg_nr)",
923 XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
925 #ifdef MAX_REGISTER_VIRTUAL_SIZE
926 fprintf_unfiltered (file,
927 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
928 XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
930 #ifdef REGISTER_VIRTUAL_TYPE
931 fprintf_unfiltered (file,
932 "gdbarch_dump: %s # %s\n",
933 "REGISTER_VIRTUAL_TYPE(reg_nr)",
934 XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
936 #if defined (DO_REGISTERS_INFO) && GDB_MULTI_ARCH
937 /* Macro might contain `[{}]' when not multi-arch */
938 fprintf_unfiltered (file,
939 "gdbarch_dump: %s # %s\n",
940 "DO_REGISTERS_INFO(reg_nr, fpregs)",
941 XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
943 #ifdef REGISTER_SIM_REGNO
944 fprintf_unfiltered (file,
945 "gdbarch_dump: %s # %s\n",
946 "REGISTER_SIM_REGNO(reg_nr)",
947 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
949 #ifdef REGISTER_BYTES_OK
950 fprintf_unfiltered (file,
951 "gdbarch_dump: %s # %s\n",
952 "REGISTER_BYTES_OK(nr_bytes)",
953 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
955 #ifdef USE_GENERIC_DUMMY_FRAMES
956 fprintf_unfiltered (file,
957 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
958 XSTRING (USE_GENERIC_DUMMY_FRAMES));
960 #ifdef CALL_DUMMY_LOCATION
961 fprintf_unfiltered (file,
962 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
963 XSTRING (CALL_DUMMY_LOCATION));
965 #ifdef CALL_DUMMY_ADDRESS
966 fprintf_unfiltered (file,
967 "gdbarch_dump: %s # %s\n",
968 "CALL_DUMMY_ADDRESS()",
969 XSTRING (CALL_DUMMY_ADDRESS ()));
971 #ifdef CALL_DUMMY_START_OFFSET
972 fprintf_unfiltered (file,
973 "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
974 XSTRING (CALL_DUMMY_START_OFFSET));
976 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
977 fprintf_unfiltered (file,
978 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
979 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
981 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
982 fprintf_unfiltered (file,
983 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
984 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
986 #ifdef CALL_DUMMY_LENGTH
987 fprintf_unfiltered (file,
988 "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
989 XSTRING (CALL_DUMMY_LENGTH));
991 #ifdef PC_IN_CALL_DUMMY
992 fprintf_unfiltered (file,
993 "gdbarch_dump: %s # %s\n",
994 "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
995 XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
998 fprintf_unfiltered (file,
999 "gdbarch_dump: CALL_DUMMY_P # %s\n",
1000 XSTRING (CALL_DUMMY_P));
1002 #ifdef CALL_DUMMY_WORDS
1003 fprintf_unfiltered (file,
1004 "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
1005 XSTRING (CALL_DUMMY_WORDS));
1007 #ifdef SIZEOF_CALL_DUMMY_WORDS
1008 fprintf_unfiltered (file,
1009 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
1010 XSTRING (SIZEOF_CALL_DUMMY_WORDS));
1012 #ifdef CALL_DUMMY_STACK_ADJUST_P
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
1015 XSTRING (CALL_DUMMY_STACK_ADJUST_P));
1017 #ifdef CALL_DUMMY_STACK_ADJUST
1018 fprintf_unfiltered (file,
1019 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
1020 XSTRING (CALL_DUMMY_STACK_ADJUST));
1022 #if defined (FIX_CALL_DUMMY) && GDB_MULTI_ARCH
1023 /* Macro might contain `[{}]' when not multi-arch */
1024 fprintf_unfiltered (file,
1025 "gdbarch_dump: %s # %s\n",
1026 "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
1027 XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
1029 #ifdef BELIEVE_PCC_PROMOTION
1030 fprintf_unfiltered (file,
1031 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
1032 XSTRING (BELIEVE_PCC_PROMOTION));
1034 #ifdef BELIEVE_PCC_PROMOTION_TYPE
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
1037 XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
1039 #ifdef COERCE_FLOAT_TO_DOUBLE
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: %s # %s\n",
1042 "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
1043 XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
1045 #if defined (GET_SAVED_REGISTER) && GDB_MULTI_ARCH
1046 /* Macro might contain `[{}]' when not multi-arch */
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: %s # %s\n",
1049 "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1050 XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1052 #ifdef REGISTER_CONVERTIBLE
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: %s # %s\n",
1055 "REGISTER_CONVERTIBLE(nr)",
1056 XSTRING (REGISTER_CONVERTIBLE (nr)));
1058 #if defined (REGISTER_CONVERT_TO_VIRTUAL) && GDB_MULTI_ARCH
1059 /* Macro might contain `[{}]' when not multi-arch */
1060 fprintf_unfiltered (file,
1061 "gdbarch_dump: %s # %s\n",
1062 "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
1063 XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
1065 #if defined (REGISTER_CONVERT_TO_RAW) && GDB_MULTI_ARCH
1066 /* Macro might contain `[{}]' when not multi-arch */
1067 fprintf_unfiltered (file,
1068 "gdbarch_dump: %s # %s\n",
1069 "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
1070 XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
1072 #if defined (FETCH_PSEUDO_REGISTER) && GDB_MULTI_ARCH
1073 /* Macro might contain `[{}]' when not multi-arch */
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: %s # %s\n",
1076 "FETCH_PSEUDO_REGISTER(regnum)",
1077 XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
1079 #if defined (STORE_PSEUDO_REGISTER) && GDB_MULTI_ARCH
1080 /* Macro might contain `[{}]' when not multi-arch */
1081 fprintf_unfiltered (file,
1082 "gdbarch_dump: %s # %s\n",
1083 "STORE_PSEUDO_REGISTER(regnum)",
1084 XSTRING (STORE_PSEUDO_REGISTER (regnum)));
1086 #ifdef POINTER_TO_ADDRESS
1087 fprintf_unfiltered (file,
1088 "gdbarch_dump: %s # %s\n",
1089 "POINTER_TO_ADDRESS(type, buf)",
1090 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1092 #if defined (ADDRESS_TO_POINTER) && GDB_MULTI_ARCH
1093 /* Macro might contain `[{}]' when not multi-arch */
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: %s # %s\n",
1096 "ADDRESS_TO_POINTER(type, buf, addr)",
1097 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
1099 #ifdef RETURN_VALUE_ON_STACK
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: %s # %s\n",
1102 "RETURN_VALUE_ON_STACK(type)",
1103 XSTRING (RETURN_VALUE_ON_STACK (type)));
1105 #if defined (EXTRACT_RETURN_VALUE) && GDB_MULTI_ARCH
1106 /* Macro might contain `[{}]' when not multi-arch */
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: %s # %s\n",
1109 "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
1110 XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
1112 #ifdef PUSH_ARGUMENTS
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: %s # %s\n",
1115 "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1116 XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1118 #if defined (PUSH_DUMMY_FRAME) && GDB_MULTI_ARCH
1119 /* Macro might contain `[{}]' when not multi-arch */
1120 fprintf_unfiltered (file,
1121 "gdbarch_dump: %s # %s\n",
1122 "PUSH_DUMMY_FRAME(-)",
1123 XSTRING (PUSH_DUMMY_FRAME (-)));
1125 #ifdef PUSH_RETURN_ADDRESS
1126 fprintf_unfiltered (file,
1127 "gdbarch_dump: %s # %s\n",
1128 "PUSH_RETURN_ADDRESS(pc, sp)",
1129 XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1131 #if defined (POP_FRAME) && GDB_MULTI_ARCH
1132 /* Macro might contain `[{}]' when not multi-arch */
1133 fprintf_unfiltered (file,
1134 "gdbarch_dump: %s # %s\n",
1136 XSTRING (POP_FRAME (-)));
1138 #ifdef D10V_MAKE_DADDR
1139 fprintf_unfiltered (file,
1140 "gdbarch_dump: %s # %s\n",
1141 "D10V_MAKE_DADDR(x)",
1142 XSTRING (D10V_MAKE_DADDR (x)));
1144 #ifdef D10V_MAKE_IADDR
1145 fprintf_unfiltered (file,
1146 "gdbarch_dump: %s # %s\n",
1147 "D10V_MAKE_IADDR(x)",
1148 XSTRING (D10V_MAKE_IADDR (x)));
1151 fprintf_unfiltered (file,
1152 "gdbarch_dump: %s # %s\n",
1154 XSTRING (D10V_DADDR_P (x)));
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: %s # %s\n",
1160 XSTRING (D10V_IADDR_P (x)));
1162 #ifdef D10V_CONVERT_DADDR_TO_RAW
1163 fprintf_unfiltered (file,
1164 "gdbarch_dump: %s # %s\n",
1165 "D10V_CONVERT_DADDR_TO_RAW(x)",
1166 XSTRING (D10V_CONVERT_DADDR_TO_RAW (x)));
1168 #ifdef D10V_CONVERT_IADDR_TO_RAW
1169 fprintf_unfiltered (file,
1170 "gdbarch_dump: %s # %s\n",
1171 "D10V_CONVERT_IADDR_TO_RAW(x)",
1172 XSTRING (D10V_CONVERT_IADDR_TO_RAW (x)));
1174 #if defined (STORE_STRUCT_RETURN) && GDB_MULTI_ARCH
1175 /* Macro might contain `[{}]' when not multi-arch */
1176 fprintf_unfiltered (file,
1177 "gdbarch_dump: %s # %s\n",
1178 "STORE_STRUCT_RETURN(addr, sp)",
1179 XSTRING (STORE_STRUCT_RETURN (addr, sp)));
1181 #if defined (STORE_RETURN_VALUE) && GDB_MULTI_ARCH
1182 /* Macro might contain `[{}]' when not multi-arch */
1183 fprintf_unfiltered (file,
1184 "gdbarch_dump: %s # %s\n",
1185 "STORE_RETURN_VALUE(type, valbuf)",
1186 XSTRING (STORE_RETURN_VALUE (type, valbuf)));
1188 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1189 fprintf_unfiltered (file,
1190 "gdbarch_dump: %s # %s\n",
1191 "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1192 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1194 #ifdef USE_STRUCT_CONVENTION
1195 fprintf_unfiltered (file,
1196 "gdbarch_dump: %s # %s\n",
1197 "USE_STRUCT_CONVENTION(gcc_p, value_type)",
1198 XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
1200 #if defined (FRAME_INIT_SAVED_REGS) && GDB_MULTI_ARCH
1201 /* Macro might contain `[{}]' when not multi-arch */
1202 fprintf_unfiltered (file,
1203 "gdbarch_dump: %s # %s\n",
1204 "FRAME_INIT_SAVED_REGS(frame)",
1205 XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1207 #if defined (INIT_EXTRA_FRAME_INFO) && GDB_MULTI_ARCH
1208 /* Macro might contain `[{}]' when not multi-arch */
1209 fprintf_unfiltered (file,
1210 "gdbarch_dump: %s # %s\n",
1211 "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1212 XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1214 #ifdef SKIP_PROLOGUE
1215 fprintf_unfiltered (file,
1216 "gdbarch_dump: %s # %s\n",
1217 "SKIP_PROLOGUE(ip)",
1218 XSTRING (SKIP_PROLOGUE (ip)));
1220 #ifdef PROLOGUE_FRAMELESS_P
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: %s # %s\n",
1223 "PROLOGUE_FRAMELESS_P(ip)",
1224 XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1227 fprintf_unfiltered (file,
1228 "gdbarch_dump: %s # %s\n",
1229 "INNER_THAN(lhs, rhs)",
1230 XSTRING (INNER_THAN (lhs, rhs)));
1232 #ifdef BREAKPOINT_FROM_PC
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: %s # %s\n",
1235 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
1236 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
1238 #ifdef MEMORY_INSERT_BREAKPOINT
1239 fprintf_unfiltered (file,
1240 "gdbarch_dump: %s # %s\n",
1241 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1242 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1244 #ifdef MEMORY_REMOVE_BREAKPOINT
1245 fprintf_unfiltered (file,
1246 "gdbarch_dump: %s # %s\n",
1247 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1248 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1250 #ifdef DECR_PC_AFTER_BREAK
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1253 XSTRING (DECR_PC_AFTER_BREAK));
1255 #ifdef FUNCTION_START_OFFSET
1256 fprintf_unfiltered (file,
1257 "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1258 XSTRING (FUNCTION_START_OFFSET));
1260 #if defined (REMOTE_TRANSLATE_XFER_ADDRESS) && GDB_MULTI_ARCH
1261 /* Macro might contain `[{}]' when not multi-arch */
1262 fprintf_unfiltered (file,
1263 "gdbarch_dump: %s # %s\n",
1264 "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
1265 XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
1267 #ifdef FRAME_ARGS_SKIP
1268 fprintf_unfiltered (file,
1269 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1270 XSTRING (FRAME_ARGS_SKIP));
1272 #ifdef FRAMELESS_FUNCTION_INVOCATION
1273 fprintf_unfiltered (file,
1274 "gdbarch_dump: %s # %s\n",
1275 "FRAMELESS_FUNCTION_INVOCATION(fi)",
1276 XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1279 fprintf_unfiltered (file,
1280 "gdbarch_dump: %s # %s\n",
1281 "FRAME_CHAIN(frame)",
1282 XSTRING (FRAME_CHAIN (frame)));
1284 #ifdef FRAME_CHAIN_VALID
1285 fprintf_unfiltered (file,
1286 "gdbarch_dump: %s # %s\n",
1287 "FRAME_CHAIN_VALID(chain, thisframe)",
1288 XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1290 #ifdef FRAME_SAVED_PC
1291 fprintf_unfiltered (file,
1292 "gdbarch_dump: %s # %s\n",
1293 "FRAME_SAVED_PC(fi)",
1294 XSTRING (FRAME_SAVED_PC (fi)));
1296 #ifdef FRAME_ARGS_ADDRESS
1297 fprintf_unfiltered (file,
1298 "gdbarch_dump: %s # %s\n",
1299 "FRAME_ARGS_ADDRESS(fi)",
1300 XSTRING (FRAME_ARGS_ADDRESS (fi)));
1302 #ifdef FRAME_LOCALS_ADDRESS
1303 fprintf_unfiltered (file,
1304 "gdbarch_dump: %s # %s\n",
1305 "FRAME_LOCALS_ADDRESS(fi)",
1306 XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1308 #ifdef SAVED_PC_AFTER_CALL
1309 fprintf_unfiltered (file,
1310 "gdbarch_dump: %s # %s\n",
1311 "SAVED_PC_AFTER_CALL(frame)",
1312 XSTRING (SAVED_PC_AFTER_CALL (frame)));
1314 #ifdef FRAME_NUM_ARGS
1315 fprintf_unfiltered (file,
1316 "gdbarch_dump: %s # %s\n",
1317 "FRAME_NUM_ARGS(frame)",
1318 XSTRING (FRAME_NUM_ARGS (frame)));
1321 fprintf_unfiltered (file,
1322 "gdbarch_dump: %s # %s\n",
1324 XSTRING (STACK_ALIGN (sp)));
1326 #ifdef EXTRA_STACK_ALIGNMENT_NEEDED
1327 fprintf_unfiltered (file,
1328 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
1329 XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
1331 #ifdef REG_STRUCT_HAS_ADDR
1332 fprintf_unfiltered (file,
1333 "gdbarch_dump: %s # %s\n",
1334 "REG_STRUCT_HAS_ADDR(gcc_p, type)",
1335 XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
1337 #if defined (SAVE_DUMMY_FRAME_TOS) && GDB_MULTI_ARCH
1338 /* Macro might contain `[{}]' when not multi-arch */
1339 fprintf_unfiltered (file,
1340 "gdbarch_dump: %s # %s\n",
1341 "SAVE_DUMMY_FRAME_TOS(sp)",
1342 XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
1344 #ifdef TARGET_FLOAT_FORMAT
1345 fprintf_unfiltered (file,
1346 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1347 XSTRING (TARGET_FLOAT_FORMAT));
1349 #ifdef TARGET_DOUBLE_FORMAT
1350 fprintf_unfiltered (file,
1351 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1352 XSTRING (TARGET_DOUBLE_FORMAT));
1354 #ifdef TARGET_LONG_DOUBLE_FORMAT
1355 fprintf_unfiltered (file,
1356 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1357 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1359 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
1360 fprintf_unfiltered (file,
1361 "gdbarch_dump: %s # %s\n",
1362 "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
1363 XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
1365 #ifdef TARGET_ARCHITECTURE
1366 if (TARGET_ARCHITECTURE != NULL)
1367 fprintf_unfiltered (file,
1368 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
1369 TARGET_ARCHITECTURE->printable_name);
1371 #ifdef TARGET_BYTE_ORDER
1372 fprintf_unfiltered (file,
1373 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
1374 (long) TARGET_BYTE_ORDER);
1376 #ifdef TARGET_SHORT_BIT
1377 fprintf_unfiltered (file,
1378 "gdbarch_dump: TARGET_SHORT_BIT = %ld\n",
1379 (long) TARGET_SHORT_BIT);
1381 #ifdef TARGET_INT_BIT
1382 fprintf_unfiltered (file,
1383 "gdbarch_dump: TARGET_INT_BIT = %ld\n",
1384 (long) TARGET_INT_BIT);
1386 #ifdef TARGET_LONG_BIT
1387 fprintf_unfiltered (file,
1388 "gdbarch_dump: TARGET_LONG_BIT = %ld\n",
1389 (long) TARGET_LONG_BIT);
1391 #ifdef TARGET_LONG_LONG_BIT
1392 fprintf_unfiltered (file,
1393 "gdbarch_dump: TARGET_LONG_LONG_BIT = %ld\n",
1394 (long) TARGET_LONG_LONG_BIT);
1396 #ifdef TARGET_FLOAT_BIT
1397 fprintf_unfiltered (file,
1398 "gdbarch_dump: TARGET_FLOAT_BIT = %ld\n",
1399 (long) TARGET_FLOAT_BIT);
1401 #ifdef TARGET_DOUBLE_BIT
1402 fprintf_unfiltered (file,
1403 "gdbarch_dump: TARGET_DOUBLE_BIT = %ld\n",
1404 (long) TARGET_DOUBLE_BIT);
1406 #ifdef TARGET_LONG_DOUBLE_BIT
1407 fprintf_unfiltered (file,
1408 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n",
1409 (long) TARGET_LONG_DOUBLE_BIT);
1411 #ifdef TARGET_PTR_BIT
1412 fprintf_unfiltered (file,
1413 "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
1414 (long) TARGET_PTR_BIT);
1416 #ifdef TARGET_ADDR_BIT
1417 fprintf_unfiltered (file,
1418 "gdbarch_dump: TARGET_ADDR_BIT = %ld\n",
1419 (long) TARGET_ADDR_BIT);
1421 #ifdef TARGET_BFD_VMA_BIT
1422 fprintf_unfiltered (file,
1423 "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
1424 (long) TARGET_BFD_VMA_BIT);
1427 fprintf_unfiltered (file,
1428 "gdbarch_dump: IEEE_FLOAT = %ld\n",
1431 #ifdef TARGET_READ_PC
1433 fprintf_unfiltered (file,
1434 "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
1435 (long) current_gdbarch->read_pc
1436 /*TARGET_READ_PC ()*/);
1438 #ifdef TARGET_WRITE_PC
1440 fprintf_unfiltered (file,
1441 "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
1442 (long) current_gdbarch->write_pc
1443 /*TARGET_WRITE_PC ()*/);
1445 #ifdef TARGET_READ_FP
1447 fprintf_unfiltered (file,
1448 "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
1449 (long) current_gdbarch->read_fp
1450 /*TARGET_READ_FP ()*/);
1452 #ifdef TARGET_WRITE_FP
1454 fprintf_unfiltered (file,
1455 "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
1456 (long) current_gdbarch->write_fp
1457 /*TARGET_WRITE_FP ()*/);
1459 #ifdef TARGET_READ_SP
1461 fprintf_unfiltered (file,
1462 "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
1463 (long) current_gdbarch->read_sp
1464 /*TARGET_READ_SP ()*/);
1466 #ifdef TARGET_WRITE_SP
1468 fprintf_unfiltered (file,
1469 "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
1470 (long) current_gdbarch->write_sp
1471 /*TARGET_WRITE_SP ()*/);
1474 fprintf_unfiltered (file,
1475 "gdbarch_dump: NUM_REGS = %ld\n",
1478 #ifdef NUM_PSEUDO_REGS
1479 fprintf_unfiltered (file,
1480 "gdbarch_dump: NUM_PSEUDO_REGS = %ld\n",
1481 (long) NUM_PSEUDO_REGS);
1484 fprintf_unfiltered (file,
1485 "gdbarch_dump: SP_REGNUM = %ld\n",
1489 fprintf_unfiltered (file,
1490 "gdbarch_dump: FP_REGNUM = %ld\n",
1494 fprintf_unfiltered (file,
1495 "gdbarch_dump: PC_REGNUM = %ld\n",
1499 fprintf_unfiltered (file,
1500 "gdbarch_dump: FP0_REGNUM = %ld\n",
1504 fprintf_unfiltered (file,
1505 "gdbarch_dump: NPC_REGNUM = %ld\n",
1509 fprintf_unfiltered (file,
1510 "gdbarch_dump: NNPC_REGNUM = %ld\n",
1511 (long) NNPC_REGNUM);
1513 #ifdef STAB_REG_TO_REGNUM
1515 fprintf_unfiltered (file,
1516 "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n",
1517 (long) current_gdbarch->stab_reg_to_regnum
1518 /*STAB_REG_TO_REGNUM ()*/);
1520 #ifdef ECOFF_REG_TO_REGNUM
1522 fprintf_unfiltered (file,
1523 "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
1524 (long) current_gdbarch->ecoff_reg_to_regnum
1525 /*ECOFF_REG_TO_REGNUM ()*/);
1527 #ifdef DWARF_REG_TO_REGNUM
1529 fprintf_unfiltered (file,
1530 "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
1531 (long) current_gdbarch->dwarf_reg_to_regnum
1532 /*DWARF_REG_TO_REGNUM ()*/);
1534 #ifdef SDB_REG_TO_REGNUM
1536 fprintf_unfiltered (file,
1537 "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n",
1538 (long) current_gdbarch->sdb_reg_to_regnum
1539 /*SDB_REG_TO_REGNUM ()*/);
1541 #ifdef DWARF2_REG_TO_REGNUM
1543 fprintf_unfiltered (file,
1544 "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
1545 (long) current_gdbarch->dwarf2_reg_to_regnum
1546 /*DWARF2_REG_TO_REGNUM ()*/);
1548 #ifdef REGISTER_NAME
1550 fprintf_unfiltered (file,
1551 "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
1552 (long) current_gdbarch->register_name
1553 /*REGISTER_NAME ()*/);
1555 #ifdef REGISTER_SIZE
1556 fprintf_unfiltered (file,
1557 "gdbarch_dump: REGISTER_SIZE = %ld\n",
1558 (long) REGISTER_SIZE);
1560 #ifdef REGISTER_BYTES
1561 fprintf_unfiltered (file,
1562 "gdbarch_dump: REGISTER_BYTES = %ld\n",
1563 (long) REGISTER_BYTES);
1565 #ifdef REGISTER_BYTE
1567 fprintf_unfiltered (file,
1568 "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
1569 (long) current_gdbarch->register_byte
1570 /*REGISTER_BYTE ()*/);
1572 #ifdef REGISTER_RAW_SIZE
1574 fprintf_unfiltered (file,
1575 "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
1576 (long) current_gdbarch->register_raw_size
1577 /*REGISTER_RAW_SIZE ()*/);
1579 #ifdef MAX_REGISTER_RAW_SIZE
1580 fprintf_unfiltered (file,
1581 "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %ld\n",
1582 (long) MAX_REGISTER_RAW_SIZE);
1584 #ifdef REGISTER_VIRTUAL_SIZE
1586 fprintf_unfiltered (file,
1587 "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
1588 (long) current_gdbarch->register_virtual_size
1589 /*REGISTER_VIRTUAL_SIZE ()*/);
1591 #ifdef MAX_REGISTER_VIRTUAL_SIZE
1592 fprintf_unfiltered (file,
1593 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
1594 (long) MAX_REGISTER_VIRTUAL_SIZE);
1596 #ifdef REGISTER_VIRTUAL_TYPE
1598 fprintf_unfiltered (file,
1599 "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
1600 (long) current_gdbarch->register_virtual_type
1601 /*REGISTER_VIRTUAL_TYPE ()*/);
1603 #ifdef DO_REGISTERS_INFO
1605 fprintf_unfiltered (file,
1606 "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
1607 (long) current_gdbarch->do_registers_info
1608 /*DO_REGISTERS_INFO ()*/);
1610 #ifdef REGISTER_SIM_REGNO
1612 fprintf_unfiltered (file,
1613 "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n",
1614 (long) current_gdbarch->register_sim_regno
1615 /*REGISTER_SIM_REGNO ()*/);
1617 #ifdef REGISTER_BYTES_OK
1619 fprintf_unfiltered (file,
1620 "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n",
1621 (long) current_gdbarch->register_bytes_ok
1622 /*REGISTER_BYTES_OK ()*/);
1624 #ifdef USE_GENERIC_DUMMY_FRAMES
1625 fprintf_unfiltered (file,
1626 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
1627 (long) USE_GENERIC_DUMMY_FRAMES);
1629 #ifdef CALL_DUMMY_LOCATION
1630 fprintf_unfiltered (file,
1631 "gdbarch_dump: CALL_DUMMY_LOCATION = %ld\n",
1632 (long) CALL_DUMMY_LOCATION);
1634 #ifdef CALL_DUMMY_ADDRESS
1636 fprintf_unfiltered (file,
1637 "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
1638 (long) current_gdbarch->call_dummy_address
1639 /*CALL_DUMMY_ADDRESS ()*/);
1641 #ifdef CALL_DUMMY_START_OFFSET
1642 fprintf_unfiltered (file,
1643 "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
1644 (long) CALL_DUMMY_START_OFFSET);
1646 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
1647 if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
1648 fprintf_unfiltered (file,
1649 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
1650 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
1652 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
1653 fprintf_unfiltered (file,
1654 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
1655 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
1657 #ifdef CALL_DUMMY_LENGTH
1658 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
1659 fprintf_unfiltered (file,
1660 "gdbarch_dump: CALL_DUMMY_LENGTH = %ld\n",
1661 (long) CALL_DUMMY_LENGTH);
1663 #ifdef PC_IN_CALL_DUMMY
1665 fprintf_unfiltered (file,
1666 "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
1667 (long) current_gdbarch->pc_in_call_dummy
1668 /*PC_IN_CALL_DUMMY ()*/);
1671 fprintf_unfiltered (file,
1672 "gdbarch_dump: CALL_DUMMY_P = %ld\n",
1673 (long) CALL_DUMMY_P);
1675 #ifdef CALL_DUMMY_WORDS
1676 fprintf_unfiltered (file,
1677 "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
1678 (long) CALL_DUMMY_WORDS);
1680 #ifdef SIZEOF_CALL_DUMMY_WORDS
1681 fprintf_unfiltered (file,
1682 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
1683 (long) SIZEOF_CALL_DUMMY_WORDS);
1685 #ifdef CALL_DUMMY_STACK_ADJUST_P
1686 fprintf_unfiltered (file,
1687 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
1688 (long) CALL_DUMMY_STACK_ADJUST_P);
1690 #ifdef CALL_DUMMY_STACK_ADJUST
1691 if (CALL_DUMMY_STACK_ADJUST_P)
1692 fprintf_unfiltered (file,
1693 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
1694 (long) CALL_DUMMY_STACK_ADJUST);
1696 #ifdef FIX_CALL_DUMMY
1698 fprintf_unfiltered (file,
1699 "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1700 (long) current_gdbarch->fix_call_dummy
1701 /*FIX_CALL_DUMMY ()*/);
1703 #ifdef BELIEVE_PCC_PROMOTION
1704 fprintf_unfiltered (file,
1705 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n",
1706 (long) BELIEVE_PCC_PROMOTION);
1708 #ifdef BELIEVE_PCC_PROMOTION_TYPE
1709 fprintf_unfiltered (file,
1710 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
1711 (long) BELIEVE_PCC_PROMOTION_TYPE);
1713 #ifdef COERCE_FLOAT_TO_DOUBLE
1715 fprintf_unfiltered (file,
1716 "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
1717 (long) current_gdbarch->coerce_float_to_double
1718 /*COERCE_FLOAT_TO_DOUBLE ()*/);
1720 #ifdef GET_SAVED_REGISTER
1722 fprintf_unfiltered (file,
1723 "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1724 (long) current_gdbarch->get_saved_register
1725 /*GET_SAVED_REGISTER ()*/);
1727 #ifdef REGISTER_CONVERTIBLE
1729 fprintf_unfiltered (file,
1730 "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n",
1731 (long) current_gdbarch->register_convertible
1732 /*REGISTER_CONVERTIBLE ()*/);
1734 #ifdef REGISTER_CONVERT_TO_VIRTUAL
1736 fprintf_unfiltered (file,
1737 "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
1738 (long) current_gdbarch->register_convert_to_virtual
1739 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
1741 #ifdef REGISTER_CONVERT_TO_RAW
1743 fprintf_unfiltered (file,
1744 "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
1745 (long) current_gdbarch->register_convert_to_raw
1746 /*REGISTER_CONVERT_TO_RAW ()*/);
1748 #ifdef FETCH_PSEUDO_REGISTER
1750 fprintf_unfiltered (file,
1751 "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
1752 (long) current_gdbarch->fetch_pseudo_register
1753 /*FETCH_PSEUDO_REGISTER ()*/);
1755 #ifdef STORE_PSEUDO_REGISTER
1757 fprintf_unfiltered (file,
1758 "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
1759 (long) current_gdbarch->store_pseudo_register
1760 /*STORE_PSEUDO_REGISTER ()*/);
1762 #ifdef POINTER_TO_ADDRESS
1764 fprintf_unfiltered (file,
1765 "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
1766 (long) current_gdbarch->pointer_to_address
1767 /*POINTER_TO_ADDRESS ()*/);
1769 #ifdef ADDRESS_TO_POINTER
1771 fprintf_unfiltered (file,
1772 "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
1773 (long) current_gdbarch->address_to_pointer
1774 /*ADDRESS_TO_POINTER ()*/);
1776 #ifdef RETURN_VALUE_ON_STACK
1778 fprintf_unfiltered (file,
1779 "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
1780 (long) current_gdbarch->return_value_on_stack
1781 /*RETURN_VALUE_ON_STACK ()*/);
1783 #ifdef EXTRACT_RETURN_VALUE
1785 fprintf_unfiltered (file,
1786 "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1787 (long) current_gdbarch->extract_return_value
1788 /*EXTRACT_RETURN_VALUE ()*/);
1790 #ifdef PUSH_ARGUMENTS
1792 fprintf_unfiltered (file,
1793 "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
1794 (long) current_gdbarch->push_arguments
1795 /*PUSH_ARGUMENTS ()*/);
1797 #ifdef PUSH_DUMMY_FRAME
1799 fprintf_unfiltered (file,
1800 "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
1801 (long) current_gdbarch->push_dummy_frame
1802 /*PUSH_DUMMY_FRAME ()*/);
1804 #ifdef PUSH_RETURN_ADDRESS
1806 fprintf_unfiltered (file,
1807 "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
1808 (long) current_gdbarch->push_return_address
1809 /*PUSH_RETURN_ADDRESS ()*/);
1813 fprintf_unfiltered (file,
1814 "gdbarch_dump: POP_FRAME = 0x%08lx\n",
1815 (long) current_gdbarch->pop_frame
1818 #ifdef D10V_MAKE_DADDR
1820 fprintf_unfiltered (file,
1821 "gdbarch_dump: D10V_MAKE_DADDR = 0x%08lx\n",
1822 (long) current_gdbarch->d10v_make_daddr
1823 /*D10V_MAKE_DADDR ()*/);
1825 #ifdef D10V_MAKE_IADDR
1827 fprintf_unfiltered (file,
1828 "gdbarch_dump: D10V_MAKE_IADDR = 0x%08lx\n",
1829 (long) current_gdbarch->d10v_make_iaddr
1830 /*D10V_MAKE_IADDR ()*/);
1834 fprintf_unfiltered (file,
1835 "gdbarch_dump: D10V_DADDR_P = 0x%08lx\n",
1836 (long) current_gdbarch->d10v_daddr_p
1837 /*D10V_DADDR_P ()*/);
1841 fprintf_unfiltered (file,
1842 "gdbarch_dump: D10V_IADDR_P = 0x%08lx\n",
1843 (long) current_gdbarch->d10v_iaddr_p
1844 /*D10V_IADDR_P ()*/);
1846 #ifdef D10V_CONVERT_DADDR_TO_RAW
1848 fprintf_unfiltered (file,
1849 "gdbarch_dump: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1850 (long) current_gdbarch->d10v_convert_daddr_to_raw
1851 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
1853 #ifdef D10V_CONVERT_IADDR_TO_RAW
1855 fprintf_unfiltered (file,
1856 "gdbarch_dump: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1857 (long) current_gdbarch->d10v_convert_iaddr_to_raw
1858 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
1860 #ifdef STORE_STRUCT_RETURN
1862 fprintf_unfiltered (file,
1863 "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
1864 (long) current_gdbarch->store_struct_return
1865 /*STORE_STRUCT_RETURN ()*/);
1867 #ifdef STORE_RETURN_VALUE
1869 fprintf_unfiltered (file,
1870 "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
1871 (long) current_gdbarch->store_return_value
1872 /*STORE_RETURN_VALUE ()*/);
1874 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1876 fprintf_unfiltered (file,
1877 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1878 (long) current_gdbarch->extract_struct_value_address
1879 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1881 #ifdef USE_STRUCT_CONVENTION
1883 fprintf_unfiltered (file,
1884 "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
1885 (long) current_gdbarch->use_struct_convention
1886 /*USE_STRUCT_CONVENTION ()*/);
1888 #ifdef FRAME_INIT_SAVED_REGS
1890 fprintf_unfiltered (file,
1891 "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1892 (long) current_gdbarch->frame_init_saved_regs
1893 /*FRAME_INIT_SAVED_REGS ()*/);
1895 #ifdef INIT_EXTRA_FRAME_INFO
1897 fprintf_unfiltered (file,
1898 "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1899 (long) current_gdbarch->init_extra_frame_info
1900 /*INIT_EXTRA_FRAME_INFO ()*/);
1902 #ifdef SKIP_PROLOGUE
1904 fprintf_unfiltered (file,
1905 "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
1906 (long) current_gdbarch->skip_prologue
1907 /*SKIP_PROLOGUE ()*/);
1909 #ifdef PROLOGUE_FRAMELESS_P
1911 fprintf_unfiltered (file,
1912 "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1913 (long) current_gdbarch->prologue_frameless_p
1914 /*PROLOGUE_FRAMELESS_P ()*/);
1918 fprintf_unfiltered (file,
1919 "gdbarch_dump: INNER_THAN = 0x%08lx\n",
1920 (long) current_gdbarch->inner_than
1923 #ifdef BREAKPOINT_FROM_PC
1925 fprintf_unfiltered (file,
1926 "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
1927 (long) current_gdbarch->breakpoint_from_pc
1928 /*BREAKPOINT_FROM_PC ()*/);
1930 #ifdef MEMORY_INSERT_BREAKPOINT
1932 fprintf_unfiltered (file,
1933 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1934 (long) current_gdbarch->memory_insert_breakpoint
1935 /*MEMORY_INSERT_BREAKPOINT ()*/);
1937 #ifdef MEMORY_REMOVE_BREAKPOINT
1939 fprintf_unfiltered (file,
1940 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1941 (long) current_gdbarch->memory_remove_breakpoint
1942 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1944 #ifdef DECR_PC_AFTER_BREAK
1945 fprintf_unfiltered (file,
1946 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1947 (long) DECR_PC_AFTER_BREAK);
1949 #ifdef FUNCTION_START_OFFSET
1950 fprintf_unfiltered (file,
1951 "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1952 (long) FUNCTION_START_OFFSET);
1954 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1956 fprintf_unfiltered (file,
1957 "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1958 (long) current_gdbarch->remote_translate_xfer_address
1959 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1961 #ifdef FRAME_ARGS_SKIP
1962 fprintf_unfiltered (file,
1963 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1964 (long) FRAME_ARGS_SKIP);
1966 #ifdef FRAMELESS_FUNCTION_INVOCATION
1968 fprintf_unfiltered (file,
1969 "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1970 (long) current_gdbarch->frameless_function_invocation
1971 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1975 fprintf_unfiltered (file,
1976 "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
1977 (long) current_gdbarch->frame_chain
1978 /*FRAME_CHAIN ()*/);
1980 #ifdef FRAME_CHAIN_VALID
1982 fprintf_unfiltered (file,
1983 "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
1984 (long) current_gdbarch->frame_chain_valid
1985 /*FRAME_CHAIN_VALID ()*/);
1987 #ifdef FRAME_SAVED_PC
1989 fprintf_unfiltered (file,
1990 "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
1991 (long) current_gdbarch->frame_saved_pc
1992 /*FRAME_SAVED_PC ()*/);
1994 #ifdef FRAME_ARGS_ADDRESS
1996 fprintf_unfiltered (file,
1997 "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1998 (long) current_gdbarch->frame_args_address
1999 /*FRAME_ARGS_ADDRESS ()*/);
2001 #ifdef FRAME_LOCALS_ADDRESS
2003 fprintf_unfiltered (file,
2004 "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
2005 (long) current_gdbarch->frame_locals_address
2006 /*FRAME_LOCALS_ADDRESS ()*/);
2008 #ifdef SAVED_PC_AFTER_CALL
2010 fprintf_unfiltered (file,
2011 "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
2012 (long) current_gdbarch->saved_pc_after_call
2013 /*SAVED_PC_AFTER_CALL ()*/);
2015 #ifdef FRAME_NUM_ARGS
2017 fprintf_unfiltered (file,
2018 "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
2019 (long) current_gdbarch->frame_num_args
2020 /*FRAME_NUM_ARGS ()*/);
2024 fprintf_unfiltered (file,
2025 "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
2026 (long) current_gdbarch->stack_align
2027 /*STACK_ALIGN ()*/);
2029 #ifdef EXTRA_STACK_ALIGNMENT_NEEDED
2030 fprintf_unfiltered (file,
2031 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %ld\n",
2032 (long) EXTRA_STACK_ALIGNMENT_NEEDED);
2034 #ifdef REG_STRUCT_HAS_ADDR
2036 fprintf_unfiltered (file,
2037 "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
2038 (long) current_gdbarch->reg_struct_has_addr
2039 /*REG_STRUCT_HAS_ADDR ()*/);
2041 #ifdef SAVE_DUMMY_FRAME_TOS
2043 fprintf_unfiltered (file,
2044 "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
2045 (long) current_gdbarch->save_dummy_frame_tos
2046 /*SAVE_DUMMY_FRAME_TOS ()*/);
2048 #ifdef TARGET_FLOAT_FORMAT
2049 fprintf_unfiltered (file,
2050 "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
2051 (long) TARGET_FLOAT_FORMAT);
2053 #ifdef TARGET_DOUBLE_FORMAT
2054 fprintf_unfiltered (file,
2055 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
2056 (long) TARGET_DOUBLE_FORMAT);
2058 #ifdef TARGET_LONG_DOUBLE_FORMAT
2059 fprintf_unfiltered (file,
2060 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
2061 (long) TARGET_LONG_DOUBLE_FORMAT);
2063 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
2065 fprintf_unfiltered (file,
2066 "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
2067 (long) current_gdbarch->convert_from_func_ptr_addr
2068 /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
2070 if (current_gdbarch->dump_tdep != NULL)
2071 current_gdbarch->dump_tdep (current_gdbarch, file);
2074 struct gdbarch_tdep *
2075 gdbarch_tdep (struct gdbarch *gdbarch)
2077 if (gdbarch_debug >= 2)
2078 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
2079 return gdbarch->tdep;
2083 const struct bfd_arch_info *
2084 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
2086 if (gdbarch_debug >= 2)
2087 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
2088 return gdbarch->bfd_arch_info;
2092 gdbarch_byte_order (struct gdbarch *gdbarch)
2094 if (gdbarch_debug >= 2)
2095 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
2096 return gdbarch->byte_order;
2100 gdbarch_short_bit (struct gdbarch *gdbarch)
2102 /* Skip verify of short_bit, invalid_p == 0 */
2103 if (gdbarch_debug >= 2)
2104 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
2105 return gdbarch->short_bit;
2109 set_gdbarch_short_bit (struct gdbarch *gdbarch,
2112 gdbarch->short_bit = short_bit;
2116 gdbarch_int_bit (struct gdbarch *gdbarch)
2118 /* Skip verify of int_bit, invalid_p == 0 */
2119 if (gdbarch_debug >= 2)
2120 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
2121 return gdbarch->int_bit;
2125 set_gdbarch_int_bit (struct gdbarch *gdbarch,
2128 gdbarch->int_bit = int_bit;
2132 gdbarch_long_bit (struct gdbarch *gdbarch)
2134 /* Skip verify of long_bit, invalid_p == 0 */
2135 if (gdbarch_debug >= 2)
2136 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
2137 return gdbarch->long_bit;
2141 set_gdbarch_long_bit (struct gdbarch *gdbarch,
2144 gdbarch->long_bit = long_bit;
2148 gdbarch_long_long_bit (struct gdbarch *gdbarch)
2150 /* Skip verify of long_long_bit, invalid_p == 0 */
2151 if (gdbarch_debug >= 2)
2152 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
2153 return gdbarch->long_long_bit;
2157 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
2160 gdbarch->long_long_bit = long_long_bit;
2164 gdbarch_float_bit (struct gdbarch *gdbarch)
2166 /* Skip verify of float_bit, invalid_p == 0 */
2167 if (gdbarch_debug >= 2)
2168 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
2169 return gdbarch->float_bit;
2173 set_gdbarch_float_bit (struct gdbarch *gdbarch,
2176 gdbarch->float_bit = float_bit;
2180 gdbarch_double_bit (struct gdbarch *gdbarch)
2182 /* Skip verify of double_bit, invalid_p == 0 */
2183 if (gdbarch_debug >= 2)
2184 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2185 return gdbarch->double_bit;
2189 set_gdbarch_double_bit (struct gdbarch *gdbarch,
2192 gdbarch->double_bit = double_bit;
2196 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2198 /* Skip verify of long_double_bit, invalid_p == 0 */
2199 if (gdbarch_debug >= 2)
2200 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2201 return gdbarch->long_double_bit;
2205 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2206 int long_double_bit)
2208 gdbarch->long_double_bit = long_double_bit;
2212 gdbarch_ptr_bit (struct gdbarch *gdbarch)
2214 /* Skip verify of ptr_bit, invalid_p == 0 */
2215 if (gdbarch_debug >= 2)
2216 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2217 return gdbarch->ptr_bit;
2221 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2224 gdbarch->ptr_bit = ptr_bit;
2228 gdbarch_addr_bit (struct gdbarch *gdbarch)
2230 if (gdbarch->addr_bit == 0)
2231 internal_error ("gdbarch: gdbarch_addr_bit invalid");
2232 if (gdbarch_debug >= 2)
2233 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2234 return gdbarch->addr_bit;
2238 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2241 gdbarch->addr_bit = addr_bit;
2245 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2247 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2248 if (gdbarch_debug >= 2)
2249 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2250 return gdbarch->bfd_vma_bit;
2254 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2257 gdbarch->bfd_vma_bit = bfd_vma_bit;
2261 gdbarch_ieee_float (struct gdbarch *gdbarch)
2263 /* Skip verify of ieee_float, invalid_p == 0 */
2264 if (gdbarch_debug >= 2)
2265 fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n");
2266 return gdbarch->ieee_float;
2270 set_gdbarch_ieee_float (struct gdbarch *gdbarch,
2273 gdbarch->ieee_float = ieee_float;
2277 gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
2279 if (gdbarch->read_pc == 0)
2280 internal_error ("gdbarch: gdbarch_read_pc invalid");
2281 if (gdbarch_debug >= 2)
2282 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2283 return gdbarch->read_pc (pid);
2287 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2288 gdbarch_read_pc_ftype read_pc)
2290 gdbarch->read_pc = read_pc;
2294 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
2296 if (gdbarch->write_pc == 0)
2297 internal_error ("gdbarch: gdbarch_write_pc invalid");
2298 if (gdbarch_debug >= 2)
2299 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2300 gdbarch->write_pc (val, pid);
2304 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2305 gdbarch_write_pc_ftype write_pc)
2307 gdbarch->write_pc = write_pc;
2311 gdbarch_read_fp (struct gdbarch *gdbarch)
2313 if (gdbarch->read_fp == 0)
2314 internal_error ("gdbarch: gdbarch_read_fp invalid");
2315 if (gdbarch_debug >= 2)
2316 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2317 return gdbarch->read_fp ();
2321 set_gdbarch_read_fp (struct gdbarch *gdbarch,
2322 gdbarch_read_fp_ftype read_fp)
2324 gdbarch->read_fp = read_fp;
2328 gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
2330 if (gdbarch->write_fp == 0)
2331 internal_error ("gdbarch: gdbarch_write_fp invalid");
2332 if (gdbarch_debug >= 2)
2333 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
2334 gdbarch->write_fp (val);
2338 set_gdbarch_write_fp (struct gdbarch *gdbarch,
2339 gdbarch_write_fp_ftype write_fp)
2341 gdbarch->write_fp = write_fp;
2345 gdbarch_read_sp (struct gdbarch *gdbarch)
2347 if (gdbarch->read_sp == 0)
2348 internal_error ("gdbarch: gdbarch_read_sp invalid");
2349 if (gdbarch_debug >= 2)
2350 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2351 return gdbarch->read_sp ();
2355 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2356 gdbarch_read_sp_ftype read_sp)
2358 gdbarch->read_sp = read_sp;
2362 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2364 if (gdbarch->write_sp == 0)
2365 internal_error ("gdbarch: gdbarch_write_sp invalid");
2366 if (gdbarch_debug >= 2)
2367 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2368 gdbarch->write_sp (val);
2372 set_gdbarch_write_sp (struct gdbarch *gdbarch,
2373 gdbarch_write_sp_ftype write_sp)
2375 gdbarch->write_sp = write_sp;
2379 gdbarch_num_regs (struct gdbarch *gdbarch)
2381 if (gdbarch->num_regs == -1)
2382 internal_error ("gdbarch: gdbarch_num_regs invalid");
2383 if (gdbarch_debug >= 2)
2384 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2385 return gdbarch->num_regs;
2389 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2392 gdbarch->num_regs = num_regs;
2396 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2398 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2399 if (gdbarch_debug >= 2)
2400 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2401 return gdbarch->num_pseudo_regs;
2405 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2406 int num_pseudo_regs)
2408 gdbarch->num_pseudo_regs = num_pseudo_regs;
2412 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2414 if (gdbarch->sp_regnum == -1)
2415 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
2416 if (gdbarch_debug >= 2)
2417 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2418 return gdbarch->sp_regnum;
2422 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2425 gdbarch->sp_regnum = sp_regnum;
2429 gdbarch_fp_regnum (struct gdbarch *gdbarch)
2431 if (gdbarch->fp_regnum == -1)
2432 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
2433 if (gdbarch_debug >= 2)
2434 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
2435 return gdbarch->fp_regnum;
2439 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
2442 gdbarch->fp_regnum = fp_regnum;
2446 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2448 if (gdbarch->pc_regnum == -1)
2449 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
2450 if (gdbarch_debug >= 2)
2451 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2452 return gdbarch->pc_regnum;
2456 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2459 gdbarch->pc_regnum = pc_regnum;
2463 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2465 /* Skip verify of fp0_regnum, invalid_p == 0 */
2466 if (gdbarch_debug >= 2)
2467 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2468 return gdbarch->fp0_regnum;
2472 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2475 gdbarch->fp0_regnum = fp0_regnum;
2479 gdbarch_npc_regnum (struct gdbarch *gdbarch)
2481 /* Skip verify of npc_regnum, invalid_p == 0 */
2482 if (gdbarch_debug >= 2)
2483 fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
2484 return gdbarch->npc_regnum;
2488 set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
2491 gdbarch->npc_regnum = npc_regnum;
2495 gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
2497 /* Skip verify of nnpc_regnum, invalid_p == 0 */
2498 if (gdbarch_debug >= 2)
2499 fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
2500 return gdbarch->nnpc_regnum;
2504 set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
2507 gdbarch->nnpc_regnum = nnpc_regnum;
2511 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2513 if (gdbarch->stab_reg_to_regnum == 0)
2514 internal_error ("gdbarch: gdbarch_stab_reg_to_regnum invalid");
2515 if (gdbarch_debug >= 2)
2516 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2517 return gdbarch->stab_reg_to_regnum (stab_regnr);
2521 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2522 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2524 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2528 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2530 if (gdbarch->ecoff_reg_to_regnum == 0)
2531 internal_error ("gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
2532 if (gdbarch_debug >= 2)
2533 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2534 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2538 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2539 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2541 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2545 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2547 if (gdbarch->dwarf_reg_to_regnum == 0)
2548 internal_error ("gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
2549 if (gdbarch_debug >= 2)
2550 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2551 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2555 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2556 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2558 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2562 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2564 if (gdbarch->sdb_reg_to_regnum == 0)
2565 internal_error ("gdbarch: gdbarch_sdb_reg_to_regnum invalid");
2566 if (gdbarch_debug >= 2)
2567 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2568 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2572 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2573 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2575 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2579 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2581 if (gdbarch->dwarf2_reg_to_regnum == 0)
2582 internal_error ("gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
2583 if (gdbarch_debug >= 2)
2584 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2585 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2589 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2590 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2592 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2596 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2598 if (gdbarch->register_name == 0)
2599 internal_error ("gdbarch: gdbarch_register_name invalid");
2600 if (gdbarch_debug >= 2)
2601 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2602 return gdbarch->register_name (regnr);
2606 set_gdbarch_register_name (struct gdbarch *gdbarch,
2607 gdbarch_register_name_ftype register_name)
2609 gdbarch->register_name = register_name;
2613 gdbarch_register_size (struct gdbarch *gdbarch)
2615 if (gdbarch->register_size == -1)
2616 internal_error ("gdbarch: gdbarch_register_size invalid");
2617 if (gdbarch_debug >= 2)
2618 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
2619 return gdbarch->register_size;
2623 set_gdbarch_register_size (struct gdbarch *gdbarch,
2626 gdbarch->register_size = register_size;
2630 gdbarch_register_bytes (struct gdbarch *gdbarch)
2632 if (gdbarch->register_bytes == -1)
2633 internal_error ("gdbarch: gdbarch_register_bytes invalid");
2634 if (gdbarch_debug >= 2)
2635 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
2636 return gdbarch->register_bytes;
2640 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
2643 gdbarch->register_bytes = register_bytes;
2647 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
2649 if (gdbarch->register_byte == 0)
2650 internal_error ("gdbarch: gdbarch_register_byte invalid");
2651 if (gdbarch_debug >= 2)
2652 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
2653 return gdbarch->register_byte (reg_nr);
2657 set_gdbarch_register_byte (struct gdbarch *gdbarch,
2658 gdbarch_register_byte_ftype register_byte)
2660 gdbarch->register_byte = register_byte;
2664 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
2666 if (gdbarch->register_raw_size == 0)
2667 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
2668 if (gdbarch_debug >= 2)
2669 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
2670 return gdbarch->register_raw_size (reg_nr);
2674 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
2675 gdbarch_register_raw_size_ftype register_raw_size)
2677 gdbarch->register_raw_size = register_raw_size;
2681 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
2683 if (gdbarch->max_register_raw_size == -1)
2684 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
2687 return gdbarch->max_register_raw_size;
2691 set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
2692 int max_register_raw_size)
2694 gdbarch->max_register_raw_size = max_register_raw_size;
2698 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
2700 if (gdbarch->register_virtual_size == 0)
2701 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
2702 if (gdbarch_debug >= 2)
2703 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
2704 return gdbarch->register_virtual_size (reg_nr);
2708 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
2709 gdbarch_register_virtual_size_ftype register_virtual_size)
2711 gdbarch->register_virtual_size = register_virtual_size;
2715 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
2717 if (gdbarch->max_register_virtual_size == -1)
2718 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
2719 if (gdbarch_debug >= 2)
2720 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
2721 return gdbarch->max_register_virtual_size;
2725 set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
2726 int max_register_virtual_size)
2728 gdbarch->max_register_virtual_size = max_register_virtual_size;
2732 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
2734 if (gdbarch->register_virtual_type == 0)
2735 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
2736 if (gdbarch_debug >= 2)
2737 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
2738 return gdbarch->register_virtual_type (reg_nr);
2742 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
2743 gdbarch_register_virtual_type_ftype register_virtual_type)
2745 gdbarch->register_virtual_type = register_virtual_type;
2749 gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
2751 if (gdbarch->do_registers_info == 0)
2752 internal_error ("gdbarch: gdbarch_do_registers_info invalid");
2753 if (gdbarch_debug >= 2)
2754 fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
2755 gdbarch->do_registers_info (reg_nr, fpregs);
2759 set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
2760 gdbarch_do_registers_info_ftype do_registers_info)
2762 gdbarch->do_registers_info = do_registers_info;
2766 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2768 if (gdbarch->register_sim_regno == 0)
2769 internal_error ("gdbarch: gdbarch_register_sim_regno invalid");
2770 if (gdbarch_debug >= 2)
2771 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2772 return gdbarch->register_sim_regno (reg_nr);
2776 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2777 gdbarch_register_sim_regno_ftype register_sim_regno)
2779 gdbarch->register_sim_regno = register_sim_regno;
2783 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2785 return gdbarch->register_bytes_ok != 0;
2789 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2791 if (gdbarch->register_bytes_ok == 0)
2792 internal_error ("gdbarch: gdbarch_register_bytes_ok invalid");
2793 if (gdbarch_debug >= 2)
2794 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2795 return gdbarch->register_bytes_ok (nr_bytes);
2799 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2800 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2802 gdbarch->register_bytes_ok = register_bytes_ok;
2806 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
2808 if (gdbarch->use_generic_dummy_frames == -1)
2809 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
2810 if (gdbarch_debug >= 2)
2811 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
2812 return gdbarch->use_generic_dummy_frames;
2816 set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
2817 int use_generic_dummy_frames)
2819 gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
2823 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2825 if (gdbarch->call_dummy_location == 0)
2826 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
2827 if (gdbarch_debug >= 2)
2828 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2829 return gdbarch->call_dummy_location;
2833 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2834 int call_dummy_location)
2836 gdbarch->call_dummy_location = call_dummy_location;
2840 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
2842 if (gdbarch->call_dummy_address == 0)
2843 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
2844 if (gdbarch_debug >= 2)
2845 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
2846 return gdbarch->call_dummy_address ();
2850 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
2851 gdbarch_call_dummy_address_ftype call_dummy_address)
2853 gdbarch->call_dummy_address = call_dummy_address;
2857 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
2859 if (gdbarch->call_dummy_start_offset == -1)
2860 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
2861 if (gdbarch_debug >= 2)
2862 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
2863 return gdbarch->call_dummy_start_offset;
2867 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
2868 CORE_ADDR call_dummy_start_offset)
2870 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
2874 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
2876 if (gdbarch->call_dummy_breakpoint_offset == -1)
2877 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
2878 if (gdbarch_debug >= 2)
2879 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
2880 return gdbarch->call_dummy_breakpoint_offset;
2884 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
2885 CORE_ADDR call_dummy_breakpoint_offset)
2887 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
2891 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
2893 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
2894 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
2895 if (gdbarch_debug >= 2)
2896 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
2897 return gdbarch->call_dummy_breakpoint_offset_p;
2901 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
2902 int call_dummy_breakpoint_offset_p)
2904 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
2908 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
2910 if (gdbarch->call_dummy_length == -1)
2911 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
2912 if (gdbarch_debug >= 2)
2913 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
2914 return gdbarch->call_dummy_length;
2918 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
2919 int call_dummy_length)
2921 gdbarch->call_dummy_length = call_dummy_length;
2925 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
2927 if (gdbarch->pc_in_call_dummy == 0)
2928 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
2929 if (gdbarch_debug >= 2)
2930 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
2931 return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
2935 set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
2936 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
2938 gdbarch->pc_in_call_dummy = pc_in_call_dummy;
2942 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
2944 if (gdbarch->call_dummy_p == -1)
2945 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
2946 if (gdbarch_debug >= 2)
2947 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
2948 return gdbarch->call_dummy_p;
2952 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
2955 gdbarch->call_dummy_p = call_dummy_p;
2959 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
2961 /* Skip verify of call_dummy_words, invalid_p == 0 */
2962 if (gdbarch_debug >= 2)
2963 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
2964 return gdbarch->call_dummy_words;
2968 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
2969 LONGEST * call_dummy_words)
2971 gdbarch->call_dummy_words = call_dummy_words;
2975 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
2977 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
2978 if (gdbarch_debug >= 2)
2979 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
2980 return gdbarch->sizeof_call_dummy_words;
2984 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
2985 int sizeof_call_dummy_words)
2987 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
2991 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
2993 if (gdbarch->call_dummy_stack_adjust_p == -1)
2994 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
2995 if (gdbarch_debug >= 2)
2996 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
2997 return gdbarch->call_dummy_stack_adjust_p;
3001 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
3002 int call_dummy_stack_adjust_p)
3004 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
3008 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
3010 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
3011 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
3012 if (gdbarch_debug >= 2)
3013 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
3014 return gdbarch->call_dummy_stack_adjust;
3018 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
3019 int call_dummy_stack_adjust)
3021 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
3025 gdbarch_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)
3027 if (gdbarch->fix_call_dummy == 0)
3028 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
3029 if (gdbarch_debug >= 2)
3030 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
3031 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
3035 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
3036 gdbarch_fix_call_dummy_ftype fix_call_dummy)
3038 gdbarch->fix_call_dummy = fix_call_dummy;
3042 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
3044 if (gdbarch_debug >= 2)
3045 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
3046 return gdbarch->believe_pcc_promotion;
3050 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
3051 int believe_pcc_promotion)
3053 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
3057 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
3059 if (gdbarch_debug >= 2)
3060 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
3061 return gdbarch->believe_pcc_promotion_type;
3065 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
3066 int believe_pcc_promotion_type)
3068 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
3072 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
3074 if (gdbarch->coerce_float_to_double == 0)
3075 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
3076 if (gdbarch_debug >= 2)
3077 fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
3078 return gdbarch->coerce_float_to_double (formal, actual);
3082 set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
3083 gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
3085 gdbarch->coerce_float_to_double = coerce_float_to_double;
3089 gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
3091 if (gdbarch->get_saved_register == 0)
3092 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
3093 if (gdbarch_debug >= 2)
3094 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
3095 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
3099 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
3100 gdbarch_get_saved_register_ftype get_saved_register)
3102 gdbarch->get_saved_register = get_saved_register;
3106 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
3108 if (gdbarch->register_convertible == 0)
3109 internal_error ("gdbarch: gdbarch_register_convertible invalid");
3110 if (gdbarch_debug >= 2)
3111 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
3112 return gdbarch->register_convertible (nr);
3116 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
3117 gdbarch_register_convertible_ftype register_convertible)
3119 gdbarch->register_convertible = register_convertible;
3123 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
3125 if (gdbarch->register_convert_to_virtual == 0)
3126 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
3127 if (gdbarch_debug >= 2)
3128 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
3129 gdbarch->register_convert_to_virtual (regnum, type, from, to);
3133 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
3134 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
3136 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
3140 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
3142 if (gdbarch->register_convert_to_raw == 0)
3143 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
3144 if (gdbarch_debug >= 2)
3145 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
3146 gdbarch->register_convert_to_raw (type, regnum, from, to);
3150 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
3151 gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
3153 gdbarch->register_convert_to_raw = register_convert_to_raw;
3157 gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
3159 if (gdbarch->fetch_pseudo_register == 0)
3160 internal_error ("gdbarch: gdbarch_fetch_pseudo_register invalid");
3161 if (gdbarch_debug >= 2)
3162 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
3163 gdbarch->fetch_pseudo_register (regnum);
3167 set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
3168 gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
3170 gdbarch->fetch_pseudo_register = fetch_pseudo_register;
3174 gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
3176 if (gdbarch->store_pseudo_register == 0)
3177 internal_error ("gdbarch: gdbarch_store_pseudo_register invalid");
3178 if (gdbarch_debug >= 2)
3179 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
3180 gdbarch->store_pseudo_register (regnum);
3184 set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
3185 gdbarch_store_pseudo_register_ftype store_pseudo_register)
3187 gdbarch->store_pseudo_register = store_pseudo_register;
3191 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3193 if (gdbarch->pointer_to_address == 0)
3194 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
3195 if (gdbarch_debug >= 2)
3196 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
3197 return gdbarch->pointer_to_address (type, buf);
3201 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
3202 gdbarch_pointer_to_address_ftype pointer_to_address)
3204 gdbarch->pointer_to_address = pointer_to_address;
3208 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
3210 if (gdbarch->address_to_pointer == 0)
3211 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
3212 if (gdbarch_debug >= 2)
3213 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
3214 gdbarch->address_to_pointer (type, buf, addr);
3218 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
3219 gdbarch_address_to_pointer_ftype address_to_pointer)
3221 gdbarch->address_to_pointer = address_to_pointer;
3225 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
3227 if (gdbarch->return_value_on_stack == 0)
3228 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
3229 if (gdbarch_debug >= 2)
3230 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
3231 return gdbarch->return_value_on_stack (type);
3235 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
3236 gdbarch_return_value_on_stack_ftype return_value_on_stack)
3238 gdbarch->return_value_on_stack = return_value_on_stack;
3242 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3244 if (gdbarch->extract_return_value == 0)
3245 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
3246 if (gdbarch_debug >= 2)
3247 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3248 gdbarch->extract_return_value (type, regbuf, valbuf);
3252 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3253 gdbarch_extract_return_value_ftype extract_return_value)
3255 gdbarch->extract_return_value = extract_return_value;
3259 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
3261 if (gdbarch->push_arguments == 0)
3262 internal_error ("gdbarch: gdbarch_push_arguments invalid");
3263 if (gdbarch_debug >= 2)
3264 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
3265 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
3269 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
3270 gdbarch_push_arguments_ftype push_arguments)
3272 gdbarch->push_arguments = push_arguments;
3276 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
3278 if (gdbarch->push_dummy_frame == 0)
3279 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
3280 if (gdbarch_debug >= 2)
3281 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
3282 gdbarch->push_dummy_frame ();
3286 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
3287 gdbarch_push_dummy_frame_ftype push_dummy_frame)
3289 gdbarch->push_dummy_frame = push_dummy_frame;
3293 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
3295 if (gdbarch->push_return_address == 0)
3296 internal_error ("gdbarch: gdbarch_push_return_address invalid");
3297 if (gdbarch_debug >= 2)
3298 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
3299 return gdbarch->push_return_address (pc, sp);
3303 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
3304 gdbarch_push_return_address_ftype push_return_address)
3306 gdbarch->push_return_address = push_return_address;
3310 gdbarch_pop_frame (struct gdbarch *gdbarch)
3312 if (gdbarch->pop_frame == 0)
3313 internal_error ("gdbarch: gdbarch_pop_frame invalid");
3314 if (gdbarch_debug >= 2)
3315 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
3316 gdbarch->pop_frame ();
3320 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
3321 gdbarch_pop_frame_ftype pop_frame)
3323 gdbarch->pop_frame = pop_frame;
3327 gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
3329 if (gdbarch->d10v_make_daddr == 0)
3330 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
3331 if (gdbarch_debug >= 2)
3332 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
3333 return gdbarch->d10v_make_daddr (x);
3337 set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch,
3338 gdbarch_d10v_make_daddr_ftype d10v_make_daddr)
3340 gdbarch->d10v_make_daddr = d10v_make_daddr;
3344 gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
3346 if (gdbarch->d10v_make_iaddr == 0)
3347 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
3348 if (gdbarch_debug >= 2)
3349 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
3350 return gdbarch->d10v_make_iaddr (x);
3354 set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch,
3355 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr)
3357 gdbarch->d10v_make_iaddr = d10v_make_iaddr;
3361 gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
3363 if (gdbarch->d10v_daddr_p == 0)
3364 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
3365 if (gdbarch_debug >= 2)
3366 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
3367 return gdbarch->d10v_daddr_p (x);
3371 set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch,
3372 gdbarch_d10v_daddr_p_ftype d10v_daddr_p)
3374 gdbarch->d10v_daddr_p = d10v_daddr_p;
3378 gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
3380 if (gdbarch->d10v_iaddr_p == 0)
3381 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
3382 if (gdbarch_debug >= 2)
3383 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
3384 return gdbarch->d10v_iaddr_p (x);
3388 set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch,
3389 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p)
3391 gdbarch->d10v_iaddr_p = d10v_iaddr_p;
3395 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
3397 if (gdbarch->d10v_convert_daddr_to_raw == 0)
3398 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
3399 if (gdbarch_debug >= 2)
3400 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
3401 return gdbarch->d10v_convert_daddr_to_raw (x);
3405 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch,
3406 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw)
3408 gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
3412 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
3414 if (gdbarch->d10v_convert_iaddr_to_raw == 0)
3415 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
3416 if (gdbarch_debug >= 2)
3417 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
3418 return gdbarch->d10v_convert_iaddr_to_raw (x);
3422 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch,
3423 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw)
3425 gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
3429 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
3431 if (gdbarch->store_struct_return == 0)
3432 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
3433 if (gdbarch_debug >= 2)
3434 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3435 gdbarch->store_struct_return (addr, sp);
3439 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3440 gdbarch_store_struct_return_ftype store_struct_return)
3442 gdbarch->store_struct_return = store_struct_return;
3446 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3448 if (gdbarch->store_return_value == 0)
3449 internal_error ("gdbarch: gdbarch_store_return_value invalid");
3450 if (gdbarch_debug >= 2)
3451 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3452 gdbarch->store_return_value (type, valbuf);
3456 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3457 gdbarch_store_return_value_ftype store_return_value)
3459 gdbarch->store_return_value = store_return_value;
3463 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
3465 if (gdbarch->extract_struct_value_address == 0)
3466 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
3467 if (gdbarch_debug >= 2)
3468 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
3469 return gdbarch->extract_struct_value_address (regbuf);
3473 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
3474 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
3476 gdbarch->extract_struct_value_address = extract_struct_value_address;
3480 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3482 if (gdbarch->use_struct_convention == 0)
3483 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
3484 if (gdbarch_debug >= 2)
3485 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3486 return gdbarch->use_struct_convention (gcc_p, value_type);
3490 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
3491 gdbarch_use_struct_convention_ftype use_struct_convention)
3493 gdbarch->use_struct_convention = use_struct_convention;
3497 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3499 if (gdbarch->frame_init_saved_regs == 0)
3500 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
3501 if (gdbarch_debug >= 2)
3502 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
3503 gdbarch->frame_init_saved_regs (frame);
3507 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
3508 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
3510 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
3514 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3516 if (gdbarch->init_extra_frame_info == 0)
3517 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
3518 if (gdbarch_debug >= 2)
3519 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
3520 gdbarch->init_extra_frame_info (fromleaf, frame);
3524 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
3525 gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
3527 gdbarch->init_extra_frame_info = init_extra_frame_info;
3531 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3533 if (gdbarch->skip_prologue == 0)
3534 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
3535 if (gdbarch_debug >= 2)
3536 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3537 return gdbarch->skip_prologue (ip);
3541 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3542 gdbarch_skip_prologue_ftype skip_prologue)
3544 gdbarch->skip_prologue = skip_prologue;
3548 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
3550 if (gdbarch->prologue_frameless_p == 0)
3551 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
3552 if (gdbarch_debug >= 2)
3553 fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
3554 return gdbarch->prologue_frameless_p (ip);
3558 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
3559 gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
3561 gdbarch->prologue_frameless_p = prologue_frameless_p;
3565 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3567 if (gdbarch->inner_than == 0)
3568 internal_error ("gdbarch: gdbarch_inner_than invalid");
3569 if (gdbarch_debug >= 2)
3570 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3571 return gdbarch->inner_than (lhs, rhs);
3575 set_gdbarch_inner_than (struct gdbarch *gdbarch,
3576 gdbarch_inner_than_ftype inner_than)
3578 gdbarch->inner_than = inner_than;
3582 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
3584 if (gdbarch->breakpoint_from_pc == 0)
3585 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
3586 if (gdbarch_debug >= 2)
3587 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3588 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3592 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3593 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
3595 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3599 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3601 if (gdbarch->memory_insert_breakpoint == 0)
3602 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
3603 if (gdbarch_debug >= 2)
3604 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3605 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3609 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3610 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3612 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3616 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3618 if (gdbarch->memory_remove_breakpoint == 0)
3619 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
3620 if (gdbarch_debug >= 2)
3621 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3622 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3626 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3627 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3629 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3633 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3635 if (gdbarch->decr_pc_after_break == -1)
3636 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
3637 if (gdbarch_debug >= 2)
3638 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3639 return gdbarch->decr_pc_after_break;
3643 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3644 CORE_ADDR decr_pc_after_break)
3646 gdbarch->decr_pc_after_break = decr_pc_after_break;
3650 gdbarch_function_start_offset (struct gdbarch *gdbarch)
3652 if (gdbarch->function_start_offset == -1)
3653 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
3654 if (gdbarch_debug >= 2)
3655 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
3656 return gdbarch->function_start_offset;
3660 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
3661 CORE_ADDR function_start_offset)
3663 gdbarch->function_start_offset = function_start_offset;
3667 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
3669 if (gdbarch->remote_translate_xfer_address == 0)
3670 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
3671 if (gdbarch_debug >= 2)
3672 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3673 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
3677 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3678 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3680 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3684 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3686 if (gdbarch->frame_args_skip == -1)
3687 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
3688 if (gdbarch_debug >= 2)
3689 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3690 return gdbarch->frame_args_skip;
3694 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3695 CORE_ADDR frame_args_skip)
3697 gdbarch->frame_args_skip = frame_args_skip;
3701 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
3703 if (gdbarch->frameless_function_invocation == 0)
3704 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
3705 if (gdbarch_debug >= 2)
3706 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
3707 return gdbarch->frameless_function_invocation (fi);
3711 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
3712 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
3714 gdbarch->frameless_function_invocation = frameless_function_invocation;
3718 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3720 if (gdbarch->frame_chain == 0)
3721 internal_error ("gdbarch: gdbarch_frame_chain invalid");
3722 if (gdbarch_debug >= 2)
3723 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
3724 return gdbarch->frame_chain (frame);
3728 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
3729 gdbarch_frame_chain_ftype frame_chain)
3731 gdbarch->frame_chain = frame_chain;
3735 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3737 if (gdbarch->frame_chain_valid == 0)
3738 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
3739 if (gdbarch_debug >= 2)
3740 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
3741 return gdbarch->frame_chain_valid (chain, thisframe);
3745 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
3746 gdbarch_frame_chain_valid_ftype frame_chain_valid)
3748 gdbarch->frame_chain_valid = frame_chain_valid;
3752 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3754 if (gdbarch->frame_saved_pc == 0)
3755 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
3756 if (gdbarch_debug >= 2)
3757 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
3758 return gdbarch->frame_saved_pc (fi);
3762 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
3763 gdbarch_frame_saved_pc_ftype frame_saved_pc)
3765 gdbarch->frame_saved_pc = frame_saved_pc;
3769 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3771 if (gdbarch->frame_args_address == 0)
3772 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
3773 if (gdbarch_debug >= 2)
3774 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
3775 return gdbarch->frame_args_address (fi);
3779 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
3780 gdbarch_frame_args_address_ftype frame_args_address)
3782 gdbarch->frame_args_address = frame_args_address;
3786 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
3788 if (gdbarch->frame_locals_address == 0)
3789 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
3790 if (gdbarch_debug >= 2)
3791 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
3792 return gdbarch->frame_locals_address (fi);
3796 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
3797 gdbarch_frame_locals_address_ftype frame_locals_address)
3799 gdbarch->frame_locals_address = frame_locals_address;
3803 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3805 if (gdbarch->saved_pc_after_call == 0)
3806 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
3807 if (gdbarch_debug >= 2)
3808 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
3809 return gdbarch->saved_pc_after_call (frame);
3813 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
3814 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
3816 gdbarch->saved_pc_after_call = saved_pc_after_call;
3820 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3822 if (gdbarch->frame_num_args == 0)
3823 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
3824 if (gdbarch_debug >= 2)
3825 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3826 return gdbarch->frame_num_args (frame);
3830 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3831 gdbarch_frame_num_args_ftype frame_num_args)
3833 gdbarch->frame_num_args = frame_num_args;
3837 gdbarch_stack_align_p (struct gdbarch *gdbarch)
3839 return gdbarch->stack_align != 0;
3843 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3845 if (gdbarch->stack_align == 0)
3846 internal_error ("gdbarch: gdbarch_stack_align invalid");
3847 if (gdbarch_debug >= 2)
3848 fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
3849 return gdbarch->stack_align (sp);
3853 set_gdbarch_stack_align (struct gdbarch *gdbarch,
3854 gdbarch_stack_align_ftype stack_align)
3856 gdbarch->stack_align = stack_align;
3860 gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
3862 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
3863 if (gdbarch_debug >= 2)
3864 fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
3865 return gdbarch->extra_stack_alignment_needed;
3869 set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
3870 int extra_stack_alignment_needed)
3872 gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
3876 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3878 return gdbarch->reg_struct_has_addr != 0;
3882 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3884 if (gdbarch->reg_struct_has_addr == 0)
3885 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
3886 if (gdbarch_debug >= 2)
3887 fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
3888 return gdbarch->reg_struct_has_addr (gcc_p, type);
3892 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
3893 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
3895 gdbarch->reg_struct_has_addr = reg_struct_has_addr;
3899 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
3901 return gdbarch->save_dummy_frame_tos != 0;
3905 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
3907 if (gdbarch->save_dummy_frame_tos == 0)
3908 internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid");
3909 if (gdbarch_debug >= 2)
3910 fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
3911 gdbarch->save_dummy_frame_tos (sp);
3915 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
3916 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
3918 gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
3921 const struct floatformat *
3922 gdbarch_float_format (struct gdbarch *gdbarch)
3924 if (gdbarch_debug >= 2)
3925 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
3926 return gdbarch->float_format;
3930 set_gdbarch_float_format (struct gdbarch *gdbarch,
3931 const struct floatformat * float_format)
3933 gdbarch->float_format = float_format;
3936 const struct floatformat *
3937 gdbarch_double_format (struct gdbarch *gdbarch)
3939 if (gdbarch_debug >= 2)
3940 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
3941 return gdbarch->double_format;
3945 set_gdbarch_double_format (struct gdbarch *gdbarch,
3946 const struct floatformat * double_format)
3948 gdbarch->double_format = double_format;
3951 const struct floatformat *
3952 gdbarch_long_double_format (struct gdbarch *gdbarch)
3954 if (gdbarch_debug >= 2)
3955 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
3956 return gdbarch->long_double_format;
3960 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
3961 const struct floatformat * long_double_format)
3963 gdbarch->long_double_format = long_double_format;
3967 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
3969 if (gdbarch->convert_from_func_ptr_addr == 0)
3970 internal_error ("gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
3971 if (gdbarch_debug >= 2)
3972 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3973 return gdbarch->convert_from_func_ptr_addr (addr);
3977 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3978 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3980 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3984 /* Keep a registry of per-architecture data-pointers required by GDB
3992 struct gdbarch_data_registration
3994 gdbarch_data_ftype *init;
3995 struct gdbarch_data *data;
3996 struct gdbarch_data_registration *next;
3999 struct gdbarch_data_registry
4002 struct gdbarch_data_registration *registrations;
4005 struct gdbarch_data_registry gdbarch_data_registry =
4010 struct gdbarch_data *
4011 register_gdbarch_data (gdbarch_data_ftype *init)
4013 struct gdbarch_data_registration **curr;
4014 for (curr = &gdbarch_data_registry.registrations;
4016 curr = &(*curr)->next);
4017 (*curr) = XMALLOC (struct gdbarch_data_registration);
4018 (*curr)->next = NULL;
4019 (*curr)->init = init;
4020 (*curr)->data = XMALLOC (struct gdbarch_data);
4021 (*curr)->data->index = gdbarch_data_registry.nr++;
4022 return (*curr)->data;
4026 /* Walk through all the registered users initializing each in turn. */
4029 init_gdbarch_data (struct gdbarch *gdbarch)
4031 struct gdbarch_data_registration *rego;
4032 gdbarch->nr_data = gdbarch_data_registry.nr + 1;
4033 gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
4034 for (rego = gdbarch_data_registry.registrations;
4038 if (rego->data->index < gdbarch->nr_data)
4039 gdbarch->data[rego->data->index] = rego->init ();
4044 /* Return the current value of the specified per-architecture
4048 gdbarch_data (struct gdbarch_data *data)
4050 if (data->index >= current_gdbarch->nr_data)
4051 internal_error ("gdbarch_data: request for non-existant data.");
4052 return current_gdbarch->data[data->index];
4057 /* Keep a registry of swapped data required by GDB modules. */
4062 struct gdbarch_swap_registration *source;
4063 struct gdbarch_swap *next;
4066 struct gdbarch_swap_registration
4069 unsigned long sizeof_data;
4070 gdbarch_swap_ftype *init;
4071 struct gdbarch_swap_registration *next;
4074 struct gdbarch_swap_registry
4077 struct gdbarch_swap_registration *registrations;
4080 struct gdbarch_swap_registry gdbarch_swap_registry =
4086 register_gdbarch_swap (void *data,
4087 unsigned long sizeof_data,
4088 gdbarch_swap_ftype *init)
4090 struct gdbarch_swap_registration **rego;
4091 for (rego = &gdbarch_swap_registry.registrations;
4093 rego = &(*rego)->next);
4094 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4095 (*rego)->next = NULL;
4096 (*rego)->init = init;
4097 (*rego)->data = data;
4098 (*rego)->sizeof_data = sizeof_data;
4103 init_gdbarch_swap (struct gdbarch *gdbarch)
4105 struct gdbarch_swap_registration *rego;
4106 struct gdbarch_swap **curr = &gdbarch->swap;
4107 for (rego = gdbarch_swap_registry.registrations;
4111 if (rego->data != NULL)
4113 (*curr) = XMALLOC (struct gdbarch_swap);
4114 (*curr)->source = rego;
4115 (*curr)->swap = xmalloc (rego->sizeof_data);
4116 (*curr)->next = NULL;
4117 memset (rego->data, 0, rego->sizeof_data);
4118 curr = &(*curr)->next;
4120 if (rego->init != NULL)
4126 swapout_gdbarch_swap (struct gdbarch *gdbarch)
4128 struct gdbarch_swap *curr;
4129 for (curr = gdbarch->swap;
4132 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
4136 swapin_gdbarch_swap (struct gdbarch *gdbarch)
4138 struct gdbarch_swap *curr;
4139 for (curr = gdbarch->swap;
4142 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
4146 /* Keep a registry of the architectures known by GDB. */
4148 struct gdbarch_registration
4150 enum bfd_architecture bfd_architecture;
4151 gdbarch_init_ftype *init;
4152 gdbarch_dump_tdep_ftype *dump_tdep;
4153 struct gdbarch_list *arches;
4154 struct gdbarch_registration *next;
4157 static struct gdbarch_registration *gdbarch_registry = NULL;
4160 append_name (const char ***buf, int *nr, const char *name)
4162 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4168 gdbarch_printable_names (void)
4172 /* Accumulate a list of names based on the registed list of
4174 enum bfd_architecture a;
4176 const char **arches = NULL;
4177 struct gdbarch_registration *rego;
4178 for (rego = gdbarch_registry;
4182 const struct bfd_arch_info *ap;
4183 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4185 internal_error ("gdbarch_architecture_names: multi-arch unknown");
4188 append_name (&arches, &nr_arches, ap->printable_name);
4193 append_name (&arches, &nr_arches, NULL);
4197 /* Just return all the architectures that BFD knows. Assume that
4198 the legacy architecture framework supports them. */
4199 return bfd_arch_list ();
4204 gdbarch_register (enum bfd_architecture bfd_architecture,
4205 gdbarch_init_ftype *init,
4206 gdbarch_dump_tdep_ftype *dump_tdep)
4208 struct gdbarch_registration **curr;
4209 const struct bfd_arch_info *bfd_arch_info;
4210 /* Check that BFD recognizes this architecture */
4211 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4212 if (bfd_arch_info == NULL)
4214 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
4216 /* Check that we haven't seen this architecture before */
4217 for (curr = &gdbarch_registry;
4219 curr = &(*curr)->next)
4221 if (bfd_architecture == (*curr)->bfd_architecture)
4222 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
4223 bfd_arch_info->printable_name);
4227 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4228 bfd_arch_info->printable_name,
4231 (*curr) = XMALLOC (struct gdbarch_registration);
4232 (*curr)->bfd_architecture = bfd_architecture;
4233 (*curr)->init = init;
4234 (*curr)->dump_tdep = dump_tdep;
4235 (*curr)->arches = NULL;
4236 (*curr)->next = NULL;
4237 /* When non- multi-arch, install whatever target dump routine we've
4238 been provided - hopefully that routine has been written correctly
4239 and works regardless of multi-arch. */
4240 if (!GDB_MULTI_ARCH && dump_tdep != NULL
4241 && startup_gdbarch.dump_tdep == NULL)
4242 startup_gdbarch.dump_tdep = dump_tdep;
4246 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4247 gdbarch_init_ftype *init)
4249 gdbarch_register (bfd_architecture, init, NULL);
4253 /* Look for an architecture using gdbarch_info. Base search on only
4254 BFD_ARCH_INFO and BYTE_ORDER. */
4256 struct gdbarch_list *
4257 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4258 const struct gdbarch_info *info)
4260 for (; arches != NULL; arches = arches->next)
4262 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4264 if (info->byte_order != arches->gdbarch->byte_order)
4272 /* Update the current architecture. Return ZERO if the update request
4276 gdbarch_update_p (struct gdbarch_info info)
4278 struct gdbarch *new_gdbarch;
4279 struct gdbarch_list **list;
4280 struct gdbarch_registration *rego;
4282 /* Fill in any missing bits. Most important is the bfd_architecture
4283 which is used to select the target architecture. */
4284 if (info.bfd_architecture == bfd_arch_unknown)
4286 if (info.bfd_arch_info != NULL)
4287 info.bfd_architecture = info.bfd_arch_info->arch;
4288 else if (info.abfd != NULL)
4289 info.bfd_architecture = bfd_get_arch (info.abfd);
4290 /* FIXME - should query BFD for its default architecture. */
4292 info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
4294 if (info.bfd_arch_info == NULL)
4296 if (target_architecture_auto && info.abfd != NULL)
4297 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
4299 info.bfd_arch_info = current_gdbarch->bfd_arch_info;
4301 if (info.byte_order == 0)
4303 if (target_byte_order_auto && info.abfd != NULL)
4304 info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
4305 : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
4308 info.byte_order = current_gdbarch->byte_order;
4309 /* FIXME - should query BFD for its default byte-order. */
4311 /* A default for abfd? */
4313 /* Find the target that knows about this architecture. */
4314 for (rego = gdbarch_registry;
4317 if (rego->bfd_architecture == info.bfd_architecture)
4322 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
4328 fprintf_unfiltered (gdb_stdlog,
4329 "gdbarch_update: info.bfd_architecture %d (%s)\n",
4330 info.bfd_architecture,
4331 bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
4332 fprintf_unfiltered (gdb_stdlog,
4333 "gdbarch_update: info.bfd_arch_info %s\n",
4334 (info.bfd_arch_info != NULL
4335 ? info.bfd_arch_info->printable_name
4337 fprintf_unfiltered (gdb_stdlog,
4338 "gdbarch_update: info.byte_order %d (%s)\n",
4340 (info.byte_order == BIG_ENDIAN ? "big"
4341 : info.byte_order == LITTLE_ENDIAN ? "little"
4343 fprintf_unfiltered (gdb_stdlog,
4344 "gdbarch_update: info.abfd 0x%lx\n",
4346 fprintf_unfiltered (gdb_stdlog,
4347 "gdbarch_update: info.tdep_info 0x%lx\n",
4348 (long) info.tdep_info);
4351 /* Ask the target for a replacement architecture. */
4352 new_gdbarch = rego->init (info, rego->arches);
4354 /* Did the target like it? No. Reject the change. */
4355 if (new_gdbarch == NULL)
4358 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
4362 /* Did the architecture change? No. Do nothing. */
4363 if (current_gdbarch == new_gdbarch)
4366 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
4368 new_gdbarch->bfd_arch_info->printable_name);
4372 /* Swap all data belonging to the old target out */
4373 swapout_gdbarch_swap (current_gdbarch);
4375 /* Is this a pre-existing architecture? Yes. Swap it in. */
4376 for (list = ®o->arches;
4378 list = &(*list)->next)
4380 if ((*list)->gdbarch == new_gdbarch)
4383 fprintf_unfiltered (gdb_stdlog,
4384 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
4386 new_gdbarch->bfd_arch_info->printable_name);
4387 current_gdbarch = new_gdbarch;
4388 swapin_gdbarch_swap (new_gdbarch);
4393 /* Append this new architecture to this targets list. */
4394 (*list) = XMALLOC (struct gdbarch_list);
4395 (*list)->next = NULL;
4396 (*list)->gdbarch = new_gdbarch;
4398 /* Switch to this new architecture. Dump it out. */
4399 current_gdbarch = new_gdbarch;
4402 fprintf_unfiltered (gdb_stdlog,
4403 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
4405 new_gdbarch->bfd_arch_info->printable_name);
4408 /* Check that the newly installed architecture is valid. Plug in
4409 any post init values. */
4410 new_gdbarch->dump_tdep = rego->dump_tdep;
4411 verify_gdbarch (new_gdbarch);
4413 /* Initialize the per-architecture memory (swap) areas.
4414 CURRENT_GDBARCH must be update before these modules are
4416 init_gdbarch_swap (new_gdbarch);
4418 /* Initialize the per-architecture data-pointer of all parties that
4419 registered an interest in this architecture. CURRENT_GDBARCH
4420 must be updated before these modules are called. */
4421 init_gdbarch_data (new_gdbarch);
4424 gdbarch_dump (current_gdbarch, gdb_stdlog);
4432 /* Pointer to the target-dependent disassembly function. */
4433 int (*tm_print_insn) (bfd_vma, disassemble_info *);
4434 disassemble_info tm_print_insn_info;
4437 extern void _initialize_gdbarch (void);
4440 _initialize_gdbarch (void)
4442 struct cmd_list_element *c;
4444 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
4445 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
4446 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
4447 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
4448 tm_print_insn_info.print_address_func = dis_asm_print_address;
4450 add_show_from_set (add_set_cmd ("arch",
4453 (char *)&gdbarch_debug,
4454 "Set architecture debugging.\n\
4455 When non-zero, architecture debugging is enabled.", &setdebuglist),
4457 c = add_set_cmd ("archdebug",
4460 (char *)&gdbarch_debug,
4461 "Set architecture debugging.\n\
4462 When non-zero, architecture debugging is enabled.", &setlist);
4464 deprecate_cmd (c, "set debug arch");
4465 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");