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 bourn 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 makeing 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 to 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).
141 gdbarch_read_pc_ftype *read_pc;
142 gdbarch_write_pc_ftype *write_pc;
143 gdbarch_read_fp_ftype *read_fp;
144 gdbarch_write_fp_ftype *write_fp;
145 gdbarch_read_sp_ftype *read_sp;
146 gdbarch_write_sp_ftype *write_sp;
154 gdbarch_register_name_ftype *register_name;
157 gdbarch_register_byte_ftype *register_byte;
158 gdbarch_register_raw_size_ftype *register_raw_size;
159 int max_register_raw_size;
160 gdbarch_register_virtual_size_ftype *register_virtual_size;
161 int max_register_virtual_size;
162 gdbarch_register_virtual_type_ftype *register_virtual_type;
163 int use_generic_dummy_frames;
164 int call_dummy_location;
165 gdbarch_call_dummy_address_ftype *call_dummy_address;
166 CORE_ADDR call_dummy_start_offset;
167 CORE_ADDR call_dummy_breakpoint_offset;
168 int call_dummy_breakpoint_offset_p;
169 int call_dummy_length;
170 gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
172 LONGEST * call_dummy_words;
173 int sizeof_call_dummy_words;
174 int call_dummy_stack_adjust_p;
175 int call_dummy_stack_adjust;
176 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
177 int believe_pcc_promotion;
178 int believe_pcc_promotion_type;
179 gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
180 gdbarch_get_saved_register_ftype *get_saved_register;
181 gdbarch_register_convertible_ftype *register_convertible;
182 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
183 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
184 gdbarch_pointer_to_address_ftype *pointer_to_address;
185 gdbarch_address_to_pointer_ftype *address_to_pointer;
186 gdbarch_return_value_on_stack_ftype *return_value_on_stack;
187 gdbarch_extract_return_value_ftype *extract_return_value;
188 gdbarch_push_arguments_ftype *push_arguments;
189 gdbarch_push_dummy_frame_ftype *push_dummy_frame;
190 gdbarch_push_return_address_ftype *push_return_address;
191 gdbarch_pop_frame_ftype *pop_frame;
192 gdbarch_d10v_make_daddr_ftype *d10v_make_daddr;
193 gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
194 gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
195 gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
196 gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
197 gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
198 gdbarch_store_struct_return_ftype *store_struct_return;
199 gdbarch_store_return_value_ftype *store_return_value;
200 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
201 gdbarch_use_struct_convention_ftype *use_struct_convention;
202 gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
203 gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
204 gdbarch_skip_prologue_ftype *skip_prologue;
205 gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
206 gdbarch_inner_than_ftype *inner_than;
207 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
208 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
209 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
210 CORE_ADDR decr_pc_after_break;
211 CORE_ADDR function_start_offset;
212 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
213 CORE_ADDR frame_args_skip;
214 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
215 gdbarch_frame_chain_ftype *frame_chain;
216 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
217 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
218 gdbarch_frame_args_address_ftype *frame_args_address;
219 gdbarch_frame_locals_address_ftype *frame_locals_address;
220 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
221 gdbarch_frame_num_args_ftype *frame_num_args;
222 gdbarch_stack_align_ftype *stack_align;
223 gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
224 gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
225 const struct floatformat * float_format;
226 const struct floatformat * double_format;
227 const struct floatformat * long_double_format;
231 /* The default architecture uses host values (for want of a better
234 extern const struct bfd_arch_info bfd_default_arch_struct;
236 struct gdbarch startup_gdbarch =
238 /* basic architecture information */
239 &bfd_default_arch_struct,
241 /* target specific vector and its dump routine */
243 /*per-architecture data-pointers and swap regions */
245 /* Multi-arch values */
251 8 * sizeof (LONGEST),
254 8 * sizeof (long double),
295 generic_get_saved_register,
343 /* startup_gdbarch() */
346 struct gdbarch *current_gdbarch = &startup_gdbarch;
349 /* Create a new ``struct gdbarch'' based in information provided by
350 ``struct gdbarch_info''. */
353 gdbarch_alloc (const struct gdbarch_info *info,
354 struct gdbarch_tdep *tdep)
356 struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
357 memset (gdbarch, 0, sizeof (*gdbarch));
359 gdbarch->tdep = tdep;
361 gdbarch->bfd_arch_info = info->bfd_arch_info;
362 gdbarch->byte_order = info->byte_order;
364 /* Force the explicit initialization of these. */
365 gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
366 gdbarch->num_regs = -1;
367 gdbarch->sp_regnum = -1;
368 gdbarch->fp_regnum = -1;
369 gdbarch->pc_regnum = -1;
370 gdbarch->fp0_regnum = -1;
371 gdbarch->npc_regnum = -1;
372 gdbarch->nnpc_regnum = -1;
373 gdbarch->register_name = legacy_register_name;
374 gdbarch->register_size = -1;
375 gdbarch->register_bytes = -1;
376 gdbarch->max_register_raw_size = -1;
377 gdbarch->max_register_virtual_size = -1;
378 gdbarch->use_generic_dummy_frames = -1;
379 gdbarch->call_dummy_start_offset = -1;
380 gdbarch->call_dummy_breakpoint_offset = -1;
381 gdbarch->call_dummy_breakpoint_offset_p = -1;
382 gdbarch->call_dummy_length = -1;
383 gdbarch->call_dummy_p = -1;
384 gdbarch->call_dummy_words = legacy_call_dummy_words;
385 gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
386 gdbarch->call_dummy_stack_adjust_p = -1;
387 gdbarch->coerce_float_to_double = default_coerce_float_to_double;
388 gdbarch->register_convertible = generic_register_convertible_not;
389 gdbarch->pointer_to_address = unsigned_pointer_to_address;
390 gdbarch->address_to_pointer = unsigned_address_to_pointer;
391 gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
392 gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
393 gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
394 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
395 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
396 gdbarch->decr_pc_after_break = -1;
397 gdbarch->function_start_offset = -1;
398 gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
399 gdbarch->frame_args_skip = -1;
400 gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
401 /* gdbarch_alloc() */
407 /* Free a gdbarch struct. This should never happen in normal
408 operation --- once you've created a gdbarch, you keep it around.
409 However, if an architecture's init function encounters an error
410 building the structure, it may need to clean up a partially
411 constructed gdbarch. */
414 gdbarch_free (struct gdbarch *arch)
416 /* At the moment, this is trivial. */
421 /* Ensure that all values in a GDBARCH are reasonable. */
424 verify_gdbarch (struct gdbarch *gdbarch)
426 /* Only perform sanity checks on a multi-arch target. */
427 if (GDB_MULTI_ARCH <= 0)
430 if (gdbarch->byte_order == 0)
431 internal_error ("verify_gdbarch: byte-order unset");
432 if (gdbarch->bfd_arch_info == NULL)
433 internal_error ("verify_gdbarch: bfd_arch_info unset");
434 /* Check those that need to be defined for the given multi-arch level. */
435 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
436 if ((GDB_MULTI_ARCH >= 1)
437 && (gdbarch->ptr_bit == 0))
438 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
439 if ((GDB_MULTI_ARCH >= 1)
440 && (gdbarch->short_bit == 0))
441 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
442 if ((GDB_MULTI_ARCH >= 1)
443 && (gdbarch->int_bit == 0))
444 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
445 if ((GDB_MULTI_ARCH >= 1)
446 && (gdbarch->long_bit == 0))
447 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
448 if ((GDB_MULTI_ARCH >= 1)
449 && (gdbarch->long_long_bit == 0))
450 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
451 if ((GDB_MULTI_ARCH >= 1)
452 && (gdbarch->float_bit == 0))
453 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
454 if ((GDB_MULTI_ARCH >= 1)
455 && (gdbarch->double_bit == 0))
456 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
457 if ((GDB_MULTI_ARCH >= 1)
458 && (gdbarch->long_double_bit == 0))
459 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
460 /* Skip verify of ieee_float, invalid_p == 0 */
461 if ((GDB_MULTI_ARCH >= 1)
462 && (gdbarch->read_pc == 0))
463 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
464 if ((GDB_MULTI_ARCH >= 1)
465 && (gdbarch->write_pc == 0))
466 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
467 if ((GDB_MULTI_ARCH >= 1)
468 && (gdbarch->read_fp == 0))
469 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
470 if ((GDB_MULTI_ARCH >= 1)
471 && (gdbarch->write_fp == 0))
472 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
473 if ((GDB_MULTI_ARCH >= 1)
474 && (gdbarch->read_sp == 0))
475 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
476 if ((GDB_MULTI_ARCH >= 1)
477 && (gdbarch->write_sp == 0))
478 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
479 if ((GDB_MULTI_ARCH >= 2)
480 && (gdbarch->num_regs == -1))
481 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
482 if ((GDB_MULTI_ARCH >= 2)
483 && (gdbarch->sp_regnum == -1))
484 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
485 if ((GDB_MULTI_ARCH >= 2)
486 && (gdbarch->fp_regnum == -1))
487 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
488 if ((GDB_MULTI_ARCH >= 2)
489 && (gdbarch->pc_regnum == -1))
490 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
491 /* Skip verify of fp0_regnum, invalid_p == 0 */
492 /* Skip verify of npc_regnum, invalid_p == 0 */
493 /* Skip verify of nnpc_regnum, invalid_p == 0 */
494 /* Skip verify of register_name, invalid_p == 0 */
495 if ((GDB_MULTI_ARCH >= 2)
496 && (gdbarch->register_size == -1))
497 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
498 if ((GDB_MULTI_ARCH >= 2)
499 && (gdbarch->register_bytes == -1))
500 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
501 if ((GDB_MULTI_ARCH >= 2)
502 && (gdbarch->register_byte == 0))
503 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
504 if ((GDB_MULTI_ARCH >= 2)
505 && (gdbarch->register_raw_size == 0))
506 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
507 if ((GDB_MULTI_ARCH >= 2)
508 && (gdbarch->max_register_raw_size == -1))
509 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
510 if ((GDB_MULTI_ARCH >= 2)
511 && (gdbarch->register_virtual_size == 0))
512 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
513 if ((GDB_MULTI_ARCH >= 2)
514 && (gdbarch->max_register_virtual_size == -1))
515 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
516 if ((GDB_MULTI_ARCH >= 2)
517 && (gdbarch->register_virtual_type == 0))
518 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
519 if ((GDB_MULTI_ARCH >= 1)
520 && (gdbarch->use_generic_dummy_frames == -1))
521 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
522 if ((GDB_MULTI_ARCH >= 2)
523 && (gdbarch->call_dummy_location == 0))
524 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
525 if ((GDB_MULTI_ARCH >= 2)
526 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
527 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
528 if ((GDB_MULTI_ARCH >= 2)
529 && (gdbarch->call_dummy_start_offset == -1))
530 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
531 if ((GDB_MULTI_ARCH >= 2)
532 && (gdbarch->call_dummy_breakpoint_offset == -1))
533 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
534 if ((GDB_MULTI_ARCH >= 1)
535 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
536 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
537 if ((GDB_MULTI_ARCH >= 2)
538 && (gdbarch->call_dummy_length == -1))
539 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
540 if ((GDB_MULTI_ARCH >= 2)
541 && (gdbarch->pc_in_call_dummy == 0))
542 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
543 if ((GDB_MULTI_ARCH >= 1)
544 && (gdbarch->call_dummy_p == -1))
545 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
546 /* Skip verify of call_dummy_words, invalid_p == 0 */
547 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
548 if ((GDB_MULTI_ARCH >= 1)
549 && (gdbarch->call_dummy_stack_adjust_p == -1))
550 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
551 if ((GDB_MULTI_ARCH >= 2)
552 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
553 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
554 if ((GDB_MULTI_ARCH >= 2)
555 && (gdbarch->fix_call_dummy == 0))
556 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
557 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
558 if ((GDB_MULTI_ARCH >= 1)
559 && (gdbarch->get_saved_register == 0))
560 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
561 /* Skip verify of register_convertible, invalid_p == 0 */
562 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
563 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
564 /* Skip verify of pointer_to_address, invalid_p == 0 */
565 /* Skip verify of address_to_pointer, invalid_p == 0 */
566 /* Skip verify of return_value_on_stack, invalid_p == 0 */
567 if ((GDB_MULTI_ARCH >= 2)
568 && (gdbarch->extract_return_value == 0))
569 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
570 if ((GDB_MULTI_ARCH >= 1)
571 && (gdbarch->push_arguments == 0))
572 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
573 if ((GDB_MULTI_ARCH >= 2)
574 && (gdbarch->push_dummy_frame == 0))
575 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
576 if ((GDB_MULTI_ARCH >= 1)
577 && (gdbarch->push_return_address == 0))
578 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
579 if ((GDB_MULTI_ARCH >= 2)
580 && (gdbarch->pop_frame == 0))
581 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
582 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
583 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
584 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
585 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
586 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
587 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
588 if ((GDB_MULTI_ARCH >= 2)
589 && (gdbarch->store_struct_return == 0))
590 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
591 if ((GDB_MULTI_ARCH >= 2)
592 && (gdbarch->store_return_value == 0))
593 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
594 if ((GDB_MULTI_ARCH >= 2)
595 && (gdbarch->extract_struct_value_address == 0))
596 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
597 if ((GDB_MULTI_ARCH >= 2)
598 && (gdbarch->use_struct_convention == 0))
599 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
600 if ((GDB_MULTI_ARCH >= 2)
601 && (gdbarch->frame_init_saved_regs == 0))
602 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
603 if ((GDB_MULTI_ARCH >= 2)
604 && (gdbarch->init_extra_frame_info == 0))
605 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
606 if ((GDB_MULTI_ARCH >= 2)
607 && (gdbarch->skip_prologue == 0))
608 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
609 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
610 if ((GDB_MULTI_ARCH >= 2)
611 && (gdbarch->inner_than == 0))
612 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
613 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
614 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
615 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
616 if ((GDB_MULTI_ARCH >= 2)
617 && (gdbarch->decr_pc_after_break == -1))
618 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
619 if ((GDB_MULTI_ARCH >= 2)
620 && (gdbarch->function_start_offset == -1))
621 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
622 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
623 if ((GDB_MULTI_ARCH >= 2)
624 && (gdbarch->frame_args_skip == -1))
625 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
626 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
627 if ((GDB_MULTI_ARCH >= 2)
628 && (gdbarch->frame_chain == 0))
629 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
630 if ((GDB_MULTI_ARCH >= 1)
631 && (gdbarch->frame_chain_valid == 0))
632 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
633 if ((GDB_MULTI_ARCH >= 2)
634 && (gdbarch->frame_saved_pc == 0))
635 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
636 if ((GDB_MULTI_ARCH >= 2)
637 && (gdbarch->frame_args_address == 0))
638 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
639 if ((GDB_MULTI_ARCH >= 2)
640 && (gdbarch->frame_locals_address == 0))
641 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
642 if ((GDB_MULTI_ARCH >= 2)
643 && (gdbarch->saved_pc_after_call == 0))
644 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
645 if ((GDB_MULTI_ARCH >= 2)
646 && (gdbarch->frame_num_args == 0))
647 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
648 /* Skip verify of stack_align, has predicate */
649 /* Skip verify of reg_struct_has_addr, has predicate */
650 /* Skip verify of save_dummy_frame_tos, has predicate */
651 if (gdbarch->float_format == 0)
652 gdbarch->float_format = default_float_format (gdbarch);
653 if (gdbarch->double_format == 0)
654 gdbarch->double_format = default_double_format (gdbarch);
655 if (gdbarch->long_double_format == 0)
656 gdbarch->long_double_format = &floatformat_unknown;
660 /* Print out the details of the current architecture. */
662 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
663 just happens to match the global variable ``current_gdbarch''. That
664 way macros refering to that variable get the local and not the global
665 version - ulgh. Once everything is parameterised with gdbarch, this
669 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
671 fprintf_unfiltered (file,
672 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
674 #ifdef TARGET_ARCHITECTURE
675 fprintf_unfiltered (file,
676 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
677 XSTRING (TARGET_ARCHITECTURE));
679 #ifdef TARGET_BYTE_ORDER
680 fprintf_unfiltered (file,
681 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
682 XSTRING (TARGET_BYTE_ORDER));
684 #ifdef TARGET_BFD_VMA_BIT
685 fprintf_unfiltered (file,
686 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
687 XSTRING (TARGET_BFD_VMA_BIT));
689 #ifdef TARGET_PTR_BIT
690 fprintf_unfiltered (file,
691 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
692 XSTRING (TARGET_PTR_BIT));
694 #ifdef TARGET_SHORT_BIT
695 fprintf_unfiltered (file,
696 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
697 XSTRING (TARGET_SHORT_BIT));
699 #ifdef TARGET_INT_BIT
700 fprintf_unfiltered (file,
701 "gdbarch_dump: TARGET_INT_BIT # %s\n",
702 XSTRING (TARGET_INT_BIT));
704 #ifdef TARGET_LONG_BIT
705 fprintf_unfiltered (file,
706 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
707 XSTRING (TARGET_LONG_BIT));
709 #ifdef TARGET_LONG_LONG_BIT
710 fprintf_unfiltered (file,
711 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
712 XSTRING (TARGET_LONG_LONG_BIT));
714 #ifdef TARGET_FLOAT_BIT
715 fprintf_unfiltered (file,
716 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
717 XSTRING (TARGET_FLOAT_BIT));
719 #ifdef TARGET_DOUBLE_BIT
720 fprintf_unfiltered (file,
721 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
722 XSTRING (TARGET_DOUBLE_BIT));
724 #ifdef TARGET_LONG_DOUBLE_BIT
725 fprintf_unfiltered (file,
726 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
727 XSTRING (TARGET_LONG_DOUBLE_BIT));
730 fprintf_unfiltered (file,
731 "gdbarch_dump: IEEE_FLOAT # %s\n",
732 XSTRING (IEEE_FLOAT));
734 #ifdef TARGET_READ_PC
735 fprintf_unfiltered (file,
736 "gdbarch_dump: %s # %s\n",
737 "TARGET_READ_PC(pid)",
738 XSTRING (TARGET_READ_PC (pid)));
740 #ifdef TARGET_WRITE_PC
741 fprintf_unfiltered (file,
742 "gdbarch_dump: %s # %s\n",
743 "TARGET_WRITE_PC(val, pid)",
744 XSTRING (TARGET_WRITE_PC (val, pid)));
746 #ifdef TARGET_READ_FP
747 fprintf_unfiltered (file,
748 "gdbarch_dump: %s # %s\n",
750 XSTRING (TARGET_READ_FP ()));
752 #ifdef TARGET_WRITE_FP
753 fprintf_unfiltered (file,
754 "gdbarch_dump: %s # %s\n",
755 "TARGET_WRITE_FP(val)",
756 XSTRING (TARGET_WRITE_FP (val)));
758 #ifdef TARGET_READ_SP
759 fprintf_unfiltered (file,
760 "gdbarch_dump: %s # %s\n",
762 XSTRING (TARGET_READ_SP ()));
764 #ifdef TARGET_WRITE_SP
765 fprintf_unfiltered (file,
766 "gdbarch_dump: %s # %s\n",
767 "TARGET_WRITE_SP(val)",
768 XSTRING (TARGET_WRITE_SP (val)));
771 fprintf_unfiltered (file,
772 "gdbarch_dump: NUM_REGS # %s\n",
776 fprintf_unfiltered (file,
777 "gdbarch_dump: SP_REGNUM # %s\n",
778 XSTRING (SP_REGNUM));
781 fprintf_unfiltered (file,
782 "gdbarch_dump: FP_REGNUM # %s\n",
783 XSTRING (FP_REGNUM));
786 fprintf_unfiltered (file,
787 "gdbarch_dump: PC_REGNUM # %s\n",
788 XSTRING (PC_REGNUM));
791 fprintf_unfiltered (file,
792 "gdbarch_dump: FP0_REGNUM # %s\n",
793 XSTRING (FP0_REGNUM));
796 fprintf_unfiltered (file,
797 "gdbarch_dump: NPC_REGNUM # %s\n",
798 XSTRING (NPC_REGNUM));
801 fprintf_unfiltered (file,
802 "gdbarch_dump: NNPC_REGNUM # %s\n",
803 XSTRING (NNPC_REGNUM));
806 fprintf_unfiltered (file,
807 "gdbarch_dump: %s # %s\n",
808 "REGISTER_NAME(regnr)",
809 XSTRING (REGISTER_NAME (regnr)));
812 fprintf_unfiltered (file,
813 "gdbarch_dump: REGISTER_SIZE # %s\n",
814 XSTRING (REGISTER_SIZE));
816 #ifdef REGISTER_BYTES
817 fprintf_unfiltered (file,
818 "gdbarch_dump: REGISTER_BYTES # %s\n",
819 XSTRING (REGISTER_BYTES));
822 fprintf_unfiltered (file,
823 "gdbarch_dump: %s # %s\n",
824 "REGISTER_BYTE(reg_nr)",
825 XSTRING (REGISTER_BYTE (reg_nr)));
827 #ifdef REGISTER_RAW_SIZE
828 fprintf_unfiltered (file,
829 "gdbarch_dump: %s # %s\n",
830 "REGISTER_RAW_SIZE(reg_nr)",
831 XSTRING (REGISTER_RAW_SIZE (reg_nr)));
833 #ifdef MAX_REGISTER_RAW_SIZE
834 fprintf_unfiltered (file,
835 "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
836 XSTRING (MAX_REGISTER_RAW_SIZE));
838 #ifdef REGISTER_VIRTUAL_SIZE
839 fprintf_unfiltered (file,
840 "gdbarch_dump: %s # %s\n",
841 "REGISTER_VIRTUAL_SIZE(reg_nr)",
842 XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
844 #ifdef MAX_REGISTER_VIRTUAL_SIZE
845 fprintf_unfiltered (file,
846 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
847 XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
849 #ifdef REGISTER_VIRTUAL_TYPE
850 fprintf_unfiltered (file,
851 "gdbarch_dump: %s # %s\n",
852 "REGISTER_VIRTUAL_TYPE(reg_nr)",
853 XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
855 #ifdef USE_GENERIC_DUMMY_FRAMES
856 fprintf_unfiltered (file,
857 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
858 XSTRING (USE_GENERIC_DUMMY_FRAMES));
860 #ifdef CALL_DUMMY_LOCATION
861 fprintf_unfiltered (file,
862 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
863 XSTRING (CALL_DUMMY_LOCATION));
865 #ifdef CALL_DUMMY_ADDRESS
866 fprintf_unfiltered (file,
867 "gdbarch_dump: %s # %s\n",
868 "CALL_DUMMY_ADDRESS()",
869 XSTRING (CALL_DUMMY_ADDRESS ()));
871 #ifdef CALL_DUMMY_START_OFFSET
872 fprintf_unfiltered (file,
873 "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
874 XSTRING (CALL_DUMMY_START_OFFSET));
876 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
877 fprintf_unfiltered (file,
878 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
879 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
881 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
882 fprintf_unfiltered (file,
883 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
884 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
886 #ifdef CALL_DUMMY_LENGTH
887 fprintf_unfiltered (file,
888 "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
889 XSTRING (CALL_DUMMY_LENGTH));
891 #ifdef PC_IN_CALL_DUMMY
892 fprintf_unfiltered (file,
893 "gdbarch_dump: %s # %s\n",
894 "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
895 XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
898 fprintf_unfiltered (file,
899 "gdbarch_dump: CALL_DUMMY_P # %s\n",
900 XSTRING (CALL_DUMMY_P));
902 #ifdef CALL_DUMMY_WORDS
903 fprintf_unfiltered (file,
904 "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
905 XSTRING (CALL_DUMMY_WORDS));
907 #ifdef SIZEOF_CALL_DUMMY_WORDS
908 fprintf_unfiltered (file,
909 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
910 XSTRING (SIZEOF_CALL_DUMMY_WORDS));
912 #ifdef CALL_DUMMY_STACK_ADJUST_P
913 fprintf_unfiltered (file,
914 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
915 XSTRING (CALL_DUMMY_STACK_ADJUST_P));
917 #ifdef CALL_DUMMY_STACK_ADJUST
918 fprintf_unfiltered (file,
919 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
920 XSTRING (CALL_DUMMY_STACK_ADJUST));
922 #ifdef FIX_CALL_DUMMY
923 fprintf_unfiltered (file,
924 "gdbarch_dump: %s # %s\n",
925 "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
926 XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
928 #ifdef BELIEVE_PCC_PROMOTION
929 fprintf_unfiltered (file,
930 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
931 XSTRING (BELIEVE_PCC_PROMOTION));
933 #ifdef BELIEVE_PCC_PROMOTION_TYPE
934 fprintf_unfiltered (file,
935 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
936 XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
938 #ifdef COERCE_FLOAT_TO_DOUBLE
939 fprintf_unfiltered (file,
940 "gdbarch_dump: %s # %s\n",
941 "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
942 XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
944 #ifdef GET_SAVED_REGISTER
945 fprintf_unfiltered (file,
946 "gdbarch_dump: %s # %s\n",
947 "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
948 XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
950 #ifdef REGISTER_CONVERTIBLE
951 fprintf_unfiltered (file,
952 "gdbarch_dump: %s # %s\n",
953 "REGISTER_CONVERTIBLE(nr)",
954 XSTRING (REGISTER_CONVERTIBLE (nr)));
956 #ifdef REGISTER_CONVERT_TO_VIRTUAL
957 fprintf_unfiltered (file,
958 "gdbarch_dump: %s # %s\n",
959 "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
960 XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
962 #ifdef REGISTER_CONVERT_TO_RAW
963 fprintf_unfiltered (file,
964 "gdbarch_dump: %s # %s\n",
965 "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
966 XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
968 #ifdef POINTER_TO_ADDRESS
969 fprintf_unfiltered (file,
970 "gdbarch_dump: %s # %s\n",
971 "POINTER_TO_ADDRESS(type, buf)",
972 XSTRING (POINTER_TO_ADDRESS (type, buf)));
974 #ifdef ADDRESS_TO_POINTER
975 fprintf_unfiltered (file,
976 "gdbarch_dump: %s # %s\n",
977 "ADDRESS_TO_POINTER(type, buf, addr)",
978 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
980 #ifdef RETURN_VALUE_ON_STACK
981 fprintf_unfiltered (file,
982 "gdbarch_dump: %s # %s\n",
983 "RETURN_VALUE_ON_STACK(type)",
984 XSTRING (RETURN_VALUE_ON_STACK (type)));
986 #ifdef EXTRACT_RETURN_VALUE
987 fprintf_unfiltered (file,
988 "gdbarch_dump: %s # %s\n",
989 "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
990 XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
992 #ifdef PUSH_ARGUMENTS
993 fprintf_unfiltered (file,
994 "gdbarch_dump: %s # %s\n",
995 "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
996 XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
998 #ifdef PUSH_DUMMY_FRAME
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: %s # %s\n",
1001 "PUSH_DUMMY_FRAME(-)",
1002 XSTRING (PUSH_DUMMY_FRAME (-)));
1004 #ifdef PUSH_RETURN_ADDRESS
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: %s # %s\n",
1007 "PUSH_RETURN_ADDRESS(pc, sp)",
1008 XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1011 fprintf_unfiltered (file,
1012 "gdbarch_dump: %s # %s\n",
1014 XSTRING (POP_FRAME (-)));
1016 #ifdef D10V_MAKE_DADDR
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: %s # %s\n",
1019 "D10V_MAKE_DADDR(x)",
1020 XSTRING (D10V_MAKE_DADDR (x)));
1022 #ifdef D10V_MAKE_IADDR
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: %s # %s\n",
1025 "D10V_MAKE_IADDR(x)",
1026 XSTRING (D10V_MAKE_IADDR (x)));
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: %s # %s\n",
1032 XSTRING (D10V_DADDR_P (x)));
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: %s # %s\n",
1038 XSTRING (D10V_IADDR_P (x)));
1040 #ifdef D10V_CONVERT_DADDR_TO_RAW
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: %s # %s\n",
1043 "D10V_CONVERT_DADDR_TO_RAW(x)",
1044 XSTRING (D10V_CONVERT_DADDR_TO_RAW (x)));
1046 #ifdef D10V_CONVERT_IADDR_TO_RAW
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: %s # %s\n",
1049 "D10V_CONVERT_IADDR_TO_RAW(x)",
1050 XSTRING (D10V_CONVERT_IADDR_TO_RAW (x)));
1052 #ifdef STORE_STRUCT_RETURN
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: %s # %s\n",
1055 "STORE_STRUCT_RETURN(addr, sp)",
1056 XSTRING (STORE_STRUCT_RETURN (addr, sp)));
1058 #ifdef STORE_RETURN_VALUE
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: %s # %s\n",
1061 "STORE_RETURN_VALUE(type, valbuf)",
1062 XSTRING (STORE_RETURN_VALUE (type, valbuf)));
1064 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: %s # %s\n",
1067 "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1068 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1070 #ifdef USE_STRUCT_CONVENTION
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: %s # %s\n",
1073 "USE_STRUCT_CONVENTION(gcc_p, value_type)",
1074 XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
1076 #ifdef FRAME_INIT_SAVED_REGS
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: %s # %s\n",
1079 "FRAME_INIT_SAVED_REGS(frame)",
1080 XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1082 #ifdef INIT_EXTRA_FRAME_INFO
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: %s # %s\n",
1085 "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1086 XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1088 #ifdef SKIP_PROLOGUE
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: %s # %s\n",
1091 "SKIP_PROLOGUE(ip)",
1092 XSTRING (SKIP_PROLOGUE (ip)));
1094 #ifdef PROLOGUE_FRAMELESS_P
1095 fprintf_unfiltered (file,
1096 "gdbarch_dump: %s # %s\n",
1097 "PROLOGUE_FRAMELESS_P(ip)",
1098 XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1101 fprintf_unfiltered (file,
1102 "gdbarch_dump: %s # %s\n",
1103 "INNER_THAN(lhs, rhs)",
1104 XSTRING (INNER_THAN (lhs, rhs)));
1106 #ifdef BREAKPOINT_FROM_PC
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: %s # %s\n",
1109 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
1110 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
1112 #ifdef MEMORY_INSERT_BREAKPOINT
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: %s # %s\n",
1115 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1116 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1118 #ifdef MEMORY_REMOVE_BREAKPOINT
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: %s # %s\n",
1121 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1122 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1124 #ifdef DECR_PC_AFTER_BREAK
1125 fprintf_unfiltered (file,
1126 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1127 XSTRING (DECR_PC_AFTER_BREAK));
1129 #ifdef FUNCTION_START_OFFSET
1130 fprintf_unfiltered (file,
1131 "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1132 XSTRING (FUNCTION_START_OFFSET));
1134 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: %s # %s\n",
1137 "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
1138 XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
1140 #ifdef FRAME_ARGS_SKIP
1141 fprintf_unfiltered (file,
1142 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1143 XSTRING (FRAME_ARGS_SKIP));
1145 #ifdef FRAMELESS_FUNCTION_INVOCATION
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: %s # %s\n",
1148 "FRAMELESS_FUNCTION_INVOCATION(fi)",
1149 XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: %s # %s\n",
1154 "FRAME_CHAIN(frame)",
1155 XSTRING (FRAME_CHAIN (frame)));
1157 #ifdef FRAME_CHAIN_VALID
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: %s # %s\n",
1160 "FRAME_CHAIN_VALID(chain, thisframe)",
1161 XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1163 #ifdef FRAME_SAVED_PC
1164 fprintf_unfiltered (file,
1165 "gdbarch_dump: %s # %s\n",
1166 "FRAME_SAVED_PC(fi)",
1167 XSTRING (FRAME_SAVED_PC (fi)));
1169 #ifdef FRAME_ARGS_ADDRESS
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: %s # %s\n",
1172 "FRAME_ARGS_ADDRESS(fi)",
1173 XSTRING (FRAME_ARGS_ADDRESS (fi)));
1175 #ifdef FRAME_LOCALS_ADDRESS
1176 fprintf_unfiltered (file,
1177 "gdbarch_dump: %s # %s\n",
1178 "FRAME_LOCALS_ADDRESS(fi)",
1179 XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1181 #ifdef SAVED_PC_AFTER_CALL
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: %s # %s\n",
1184 "SAVED_PC_AFTER_CALL(frame)",
1185 XSTRING (SAVED_PC_AFTER_CALL (frame)));
1187 #ifdef FRAME_NUM_ARGS
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: %s # %s\n",
1190 "FRAME_NUM_ARGS(frame)",
1191 XSTRING (FRAME_NUM_ARGS (frame)));
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: %s # %s\n",
1197 XSTRING (STACK_ALIGN (sp)));
1199 #ifdef REG_STRUCT_HAS_ADDR
1200 fprintf_unfiltered (file,
1201 "gdbarch_dump: %s # %s\n",
1202 "REG_STRUCT_HAS_ADDR(gcc_p, type)",
1203 XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
1205 #ifdef SAVE_DUMMY_FRAME_TOS
1206 fprintf_unfiltered (file,
1207 "gdbarch_dump: %s # %s\n",
1208 "SAVE_DUMMY_FRAME_TOS(sp)",
1209 XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
1211 #ifdef TARGET_FLOAT_FORMAT
1212 fprintf_unfiltered (file,
1213 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1214 XSTRING (TARGET_FLOAT_FORMAT));
1216 #ifdef TARGET_DOUBLE_FORMAT
1217 fprintf_unfiltered (file,
1218 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1219 XSTRING (TARGET_DOUBLE_FORMAT));
1221 #ifdef TARGET_LONG_DOUBLE_FORMAT
1222 fprintf_unfiltered (file,
1223 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1224 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1226 #ifdef TARGET_ARCHITECTURE
1227 if (TARGET_ARCHITECTURE != NULL)
1228 fprintf_unfiltered (file,
1229 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
1230 TARGET_ARCHITECTURE->printable_name);
1232 #ifdef TARGET_BYTE_ORDER
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
1235 (long) TARGET_BYTE_ORDER);
1237 #ifdef TARGET_BFD_VMA_BIT
1238 fprintf_unfiltered (file,
1239 "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
1240 (long) TARGET_BFD_VMA_BIT);
1242 #ifdef TARGET_PTR_BIT
1243 fprintf_unfiltered (file,
1244 "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
1245 (long) TARGET_PTR_BIT);
1247 #ifdef TARGET_SHORT_BIT
1248 fprintf_unfiltered (file,
1249 "gdbarch_dump: TARGET_SHORT_BIT = %ld\n",
1250 (long) TARGET_SHORT_BIT);
1252 #ifdef TARGET_INT_BIT
1253 fprintf_unfiltered (file,
1254 "gdbarch_dump: TARGET_INT_BIT = %ld\n",
1255 (long) TARGET_INT_BIT);
1257 #ifdef TARGET_LONG_BIT
1258 fprintf_unfiltered (file,
1259 "gdbarch_dump: TARGET_LONG_BIT = %ld\n",
1260 (long) TARGET_LONG_BIT);
1262 #ifdef TARGET_LONG_LONG_BIT
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: TARGET_LONG_LONG_BIT = %ld\n",
1265 (long) TARGET_LONG_LONG_BIT);
1267 #ifdef TARGET_FLOAT_BIT
1268 fprintf_unfiltered (file,
1269 "gdbarch_dump: TARGET_FLOAT_BIT = %ld\n",
1270 (long) TARGET_FLOAT_BIT);
1272 #ifdef TARGET_DOUBLE_BIT
1273 fprintf_unfiltered (file,
1274 "gdbarch_dump: TARGET_DOUBLE_BIT = %ld\n",
1275 (long) TARGET_DOUBLE_BIT);
1277 #ifdef TARGET_LONG_DOUBLE_BIT
1278 fprintf_unfiltered (file,
1279 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n",
1280 (long) TARGET_LONG_DOUBLE_BIT);
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: IEEE_FLOAT = %ld\n",
1287 #ifdef TARGET_READ_PC
1289 fprintf_unfiltered (file,
1290 "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
1291 (long) current_gdbarch->read_pc
1292 /*TARGET_READ_PC ()*/);
1294 #ifdef TARGET_WRITE_PC
1296 fprintf_unfiltered (file,
1297 "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
1298 (long) current_gdbarch->write_pc
1299 /*TARGET_WRITE_PC ()*/);
1301 #ifdef TARGET_READ_FP
1303 fprintf_unfiltered (file,
1304 "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
1305 (long) current_gdbarch->read_fp
1306 /*TARGET_READ_FP ()*/);
1308 #ifdef TARGET_WRITE_FP
1310 fprintf_unfiltered (file,
1311 "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
1312 (long) current_gdbarch->write_fp
1313 /*TARGET_WRITE_FP ()*/);
1315 #ifdef TARGET_READ_SP
1317 fprintf_unfiltered (file,
1318 "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
1319 (long) current_gdbarch->read_sp
1320 /*TARGET_READ_SP ()*/);
1322 #ifdef TARGET_WRITE_SP
1324 fprintf_unfiltered (file,
1325 "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
1326 (long) current_gdbarch->write_sp
1327 /*TARGET_WRITE_SP ()*/);
1330 fprintf_unfiltered (file,
1331 "gdbarch_dump: NUM_REGS = %ld\n",
1335 fprintf_unfiltered (file,
1336 "gdbarch_dump: SP_REGNUM = %ld\n",
1340 fprintf_unfiltered (file,
1341 "gdbarch_dump: FP_REGNUM = %ld\n",
1345 fprintf_unfiltered (file,
1346 "gdbarch_dump: PC_REGNUM = %ld\n",
1350 fprintf_unfiltered (file,
1351 "gdbarch_dump: FP0_REGNUM = %ld\n",
1355 fprintf_unfiltered (file,
1356 "gdbarch_dump: NPC_REGNUM = %ld\n",
1360 fprintf_unfiltered (file,
1361 "gdbarch_dump: NNPC_REGNUM = %ld\n",
1362 (long) NNPC_REGNUM);
1364 #ifdef REGISTER_NAME
1366 fprintf_unfiltered (file,
1367 "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
1368 (long) current_gdbarch->register_name
1369 /*REGISTER_NAME ()*/);
1371 #ifdef REGISTER_SIZE
1372 fprintf_unfiltered (file,
1373 "gdbarch_dump: REGISTER_SIZE = %ld\n",
1374 (long) REGISTER_SIZE);
1376 #ifdef REGISTER_BYTES
1377 fprintf_unfiltered (file,
1378 "gdbarch_dump: REGISTER_BYTES = %ld\n",
1379 (long) REGISTER_BYTES);
1381 #ifdef REGISTER_BYTE
1383 fprintf_unfiltered (file,
1384 "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
1385 (long) current_gdbarch->register_byte
1386 /*REGISTER_BYTE ()*/);
1388 #ifdef REGISTER_RAW_SIZE
1390 fprintf_unfiltered (file,
1391 "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
1392 (long) current_gdbarch->register_raw_size
1393 /*REGISTER_RAW_SIZE ()*/);
1395 #ifdef MAX_REGISTER_RAW_SIZE
1396 fprintf_unfiltered (file,
1397 "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %ld\n",
1398 (long) MAX_REGISTER_RAW_SIZE);
1400 #ifdef REGISTER_VIRTUAL_SIZE
1402 fprintf_unfiltered (file,
1403 "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
1404 (long) current_gdbarch->register_virtual_size
1405 /*REGISTER_VIRTUAL_SIZE ()*/);
1407 #ifdef MAX_REGISTER_VIRTUAL_SIZE
1408 fprintf_unfiltered (file,
1409 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
1410 (long) MAX_REGISTER_VIRTUAL_SIZE);
1412 #ifdef REGISTER_VIRTUAL_TYPE
1414 fprintf_unfiltered (file,
1415 "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
1416 (long) current_gdbarch->register_virtual_type
1417 /*REGISTER_VIRTUAL_TYPE ()*/);
1419 #ifdef USE_GENERIC_DUMMY_FRAMES
1420 fprintf_unfiltered (file,
1421 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
1422 (long) USE_GENERIC_DUMMY_FRAMES);
1424 #ifdef CALL_DUMMY_LOCATION
1425 fprintf_unfiltered (file,
1426 "gdbarch_dump: CALL_DUMMY_LOCATION = %ld\n",
1427 (long) CALL_DUMMY_LOCATION);
1429 #ifdef CALL_DUMMY_ADDRESS
1431 fprintf_unfiltered (file,
1432 "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
1433 (long) current_gdbarch->call_dummy_address
1434 /*CALL_DUMMY_ADDRESS ()*/);
1436 #ifdef CALL_DUMMY_START_OFFSET
1437 fprintf_unfiltered (file,
1438 "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
1439 (long) CALL_DUMMY_START_OFFSET);
1441 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
1442 fprintf_unfiltered (file,
1443 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
1444 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
1446 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
1447 fprintf_unfiltered (file,
1448 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
1449 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
1451 #ifdef CALL_DUMMY_LENGTH
1452 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
1453 fprintf_unfiltered (file,
1454 "gdbarch_dump: CALL_DUMMY_LENGTH = %ld\n",
1455 (long) CALL_DUMMY_LENGTH);
1457 #ifdef PC_IN_CALL_DUMMY
1459 fprintf_unfiltered (file,
1460 "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
1461 (long) current_gdbarch->pc_in_call_dummy
1462 /*PC_IN_CALL_DUMMY ()*/);
1465 fprintf_unfiltered (file,
1466 "gdbarch_dump: CALL_DUMMY_P = %ld\n",
1467 (long) CALL_DUMMY_P);
1469 #ifdef CALL_DUMMY_WORDS
1470 fprintf_unfiltered (file,
1471 "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
1472 (long) CALL_DUMMY_WORDS);
1474 #ifdef SIZEOF_CALL_DUMMY_WORDS
1475 fprintf_unfiltered (file,
1476 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
1477 (long) SIZEOF_CALL_DUMMY_WORDS);
1479 #ifdef CALL_DUMMY_STACK_ADJUST_P
1480 fprintf_unfiltered (file,
1481 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
1482 (long) CALL_DUMMY_STACK_ADJUST_P);
1484 #ifdef CALL_DUMMY_STACK_ADJUST
1485 if (CALL_DUMMY_STACK_ADJUST_P)
1486 fprintf_unfiltered (file,
1487 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
1488 (long) CALL_DUMMY_STACK_ADJUST);
1490 #ifdef FIX_CALL_DUMMY
1492 fprintf_unfiltered (file,
1493 "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1494 (long) current_gdbarch->fix_call_dummy
1495 /*FIX_CALL_DUMMY ()*/);
1497 #ifdef BELIEVE_PCC_PROMOTION
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n",
1500 (long) BELIEVE_PCC_PROMOTION);
1502 #ifdef BELIEVE_PCC_PROMOTION_TYPE
1503 fprintf_unfiltered (file,
1504 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
1505 (long) BELIEVE_PCC_PROMOTION_TYPE);
1507 #ifdef COERCE_FLOAT_TO_DOUBLE
1509 fprintf_unfiltered (file,
1510 "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
1511 (long) current_gdbarch->coerce_float_to_double
1512 /*COERCE_FLOAT_TO_DOUBLE ()*/);
1514 #ifdef GET_SAVED_REGISTER
1516 fprintf_unfiltered (file,
1517 "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1518 (long) current_gdbarch->get_saved_register
1519 /*GET_SAVED_REGISTER ()*/);
1521 #ifdef REGISTER_CONVERTIBLE
1523 fprintf_unfiltered (file,
1524 "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n",
1525 (long) current_gdbarch->register_convertible
1526 /*REGISTER_CONVERTIBLE ()*/);
1528 #ifdef REGISTER_CONVERT_TO_VIRTUAL
1530 fprintf_unfiltered (file,
1531 "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
1532 (long) current_gdbarch->register_convert_to_virtual
1533 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
1535 #ifdef REGISTER_CONVERT_TO_RAW
1537 fprintf_unfiltered (file,
1538 "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
1539 (long) current_gdbarch->register_convert_to_raw
1540 /*REGISTER_CONVERT_TO_RAW ()*/);
1542 #ifdef POINTER_TO_ADDRESS
1544 fprintf_unfiltered (file,
1545 "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
1546 (long) current_gdbarch->pointer_to_address
1547 /*POINTER_TO_ADDRESS ()*/);
1549 #ifdef ADDRESS_TO_POINTER
1551 fprintf_unfiltered (file,
1552 "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
1553 (long) current_gdbarch->address_to_pointer
1554 /*ADDRESS_TO_POINTER ()*/);
1556 #ifdef RETURN_VALUE_ON_STACK
1558 fprintf_unfiltered (file,
1559 "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
1560 (long) current_gdbarch->return_value_on_stack
1561 /*RETURN_VALUE_ON_STACK ()*/);
1563 #ifdef EXTRACT_RETURN_VALUE
1565 fprintf_unfiltered (file,
1566 "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1567 (long) current_gdbarch->extract_return_value
1568 /*EXTRACT_RETURN_VALUE ()*/);
1570 #ifdef PUSH_ARGUMENTS
1572 fprintf_unfiltered (file,
1573 "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
1574 (long) current_gdbarch->push_arguments
1575 /*PUSH_ARGUMENTS ()*/);
1577 #ifdef PUSH_DUMMY_FRAME
1579 fprintf_unfiltered (file,
1580 "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
1581 (long) current_gdbarch->push_dummy_frame
1582 /*PUSH_DUMMY_FRAME ()*/);
1584 #ifdef PUSH_RETURN_ADDRESS
1586 fprintf_unfiltered (file,
1587 "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
1588 (long) current_gdbarch->push_return_address
1589 /*PUSH_RETURN_ADDRESS ()*/);
1593 fprintf_unfiltered (file,
1594 "gdbarch_dump: POP_FRAME = 0x%08lx\n",
1595 (long) current_gdbarch->pop_frame
1598 #ifdef D10V_MAKE_DADDR
1600 fprintf_unfiltered (file,
1601 "gdbarch_dump: D10V_MAKE_DADDR = 0x%08lx\n",
1602 (long) current_gdbarch->d10v_make_daddr
1603 /*D10V_MAKE_DADDR ()*/);
1605 #ifdef D10V_MAKE_IADDR
1607 fprintf_unfiltered (file,
1608 "gdbarch_dump: D10V_MAKE_IADDR = 0x%08lx\n",
1609 (long) current_gdbarch->d10v_make_iaddr
1610 /*D10V_MAKE_IADDR ()*/);
1614 fprintf_unfiltered (file,
1615 "gdbarch_dump: D10V_DADDR_P = 0x%08lx\n",
1616 (long) current_gdbarch->d10v_daddr_p
1617 /*D10V_DADDR_P ()*/);
1621 fprintf_unfiltered (file,
1622 "gdbarch_dump: D10V_IADDR_P = 0x%08lx\n",
1623 (long) current_gdbarch->d10v_iaddr_p
1624 /*D10V_IADDR_P ()*/);
1626 #ifdef D10V_CONVERT_DADDR_TO_RAW
1628 fprintf_unfiltered (file,
1629 "gdbarch_dump: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1630 (long) current_gdbarch->d10v_convert_daddr_to_raw
1631 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
1633 #ifdef D10V_CONVERT_IADDR_TO_RAW
1635 fprintf_unfiltered (file,
1636 "gdbarch_dump: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1637 (long) current_gdbarch->d10v_convert_iaddr_to_raw
1638 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
1640 #ifdef STORE_STRUCT_RETURN
1642 fprintf_unfiltered (file,
1643 "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
1644 (long) current_gdbarch->store_struct_return
1645 /*STORE_STRUCT_RETURN ()*/);
1647 #ifdef STORE_RETURN_VALUE
1649 fprintf_unfiltered (file,
1650 "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
1651 (long) current_gdbarch->store_return_value
1652 /*STORE_RETURN_VALUE ()*/);
1654 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1656 fprintf_unfiltered (file,
1657 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1658 (long) current_gdbarch->extract_struct_value_address
1659 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1661 #ifdef USE_STRUCT_CONVENTION
1663 fprintf_unfiltered (file,
1664 "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
1665 (long) current_gdbarch->use_struct_convention
1666 /*USE_STRUCT_CONVENTION ()*/);
1668 #ifdef FRAME_INIT_SAVED_REGS
1670 fprintf_unfiltered (file,
1671 "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1672 (long) current_gdbarch->frame_init_saved_regs
1673 /*FRAME_INIT_SAVED_REGS ()*/);
1675 #ifdef INIT_EXTRA_FRAME_INFO
1677 fprintf_unfiltered (file,
1678 "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1679 (long) current_gdbarch->init_extra_frame_info
1680 /*INIT_EXTRA_FRAME_INFO ()*/);
1682 #ifdef SKIP_PROLOGUE
1684 fprintf_unfiltered (file,
1685 "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
1686 (long) current_gdbarch->skip_prologue
1687 /*SKIP_PROLOGUE ()*/);
1689 #ifdef PROLOGUE_FRAMELESS_P
1691 fprintf_unfiltered (file,
1692 "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1693 (long) current_gdbarch->prologue_frameless_p
1694 /*PROLOGUE_FRAMELESS_P ()*/);
1698 fprintf_unfiltered (file,
1699 "gdbarch_dump: INNER_THAN = 0x%08lx\n",
1700 (long) current_gdbarch->inner_than
1703 #ifdef BREAKPOINT_FROM_PC
1705 fprintf_unfiltered (file,
1706 "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
1707 (long) current_gdbarch->breakpoint_from_pc
1708 /*BREAKPOINT_FROM_PC ()*/);
1710 #ifdef MEMORY_INSERT_BREAKPOINT
1712 fprintf_unfiltered (file,
1713 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1714 (long) current_gdbarch->memory_insert_breakpoint
1715 /*MEMORY_INSERT_BREAKPOINT ()*/);
1717 #ifdef MEMORY_REMOVE_BREAKPOINT
1719 fprintf_unfiltered (file,
1720 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1721 (long) current_gdbarch->memory_remove_breakpoint
1722 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1724 #ifdef DECR_PC_AFTER_BREAK
1725 fprintf_unfiltered (file,
1726 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1727 (long) DECR_PC_AFTER_BREAK);
1729 #ifdef FUNCTION_START_OFFSET
1730 fprintf_unfiltered (file,
1731 "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1732 (long) FUNCTION_START_OFFSET);
1734 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1736 fprintf_unfiltered (file,
1737 "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1738 (long) current_gdbarch->remote_translate_xfer_address
1739 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1741 #ifdef FRAME_ARGS_SKIP
1742 fprintf_unfiltered (file,
1743 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1744 (long) FRAME_ARGS_SKIP);
1746 #ifdef FRAMELESS_FUNCTION_INVOCATION
1748 fprintf_unfiltered (file,
1749 "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1750 (long) current_gdbarch->frameless_function_invocation
1751 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1755 fprintf_unfiltered (file,
1756 "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
1757 (long) current_gdbarch->frame_chain
1758 /*FRAME_CHAIN ()*/);
1760 #ifdef FRAME_CHAIN_VALID
1762 fprintf_unfiltered (file,
1763 "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
1764 (long) current_gdbarch->frame_chain_valid
1765 /*FRAME_CHAIN_VALID ()*/);
1767 #ifdef FRAME_SAVED_PC
1769 fprintf_unfiltered (file,
1770 "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
1771 (long) current_gdbarch->frame_saved_pc
1772 /*FRAME_SAVED_PC ()*/);
1774 #ifdef FRAME_ARGS_ADDRESS
1776 fprintf_unfiltered (file,
1777 "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1778 (long) current_gdbarch->frame_args_address
1779 /*FRAME_ARGS_ADDRESS ()*/);
1781 #ifdef FRAME_LOCALS_ADDRESS
1783 fprintf_unfiltered (file,
1784 "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1785 (long) current_gdbarch->frame_locals_address
1786 /*FRAME_LOCALS_ADDRESS ()*/);
1788 #ifdef SAVED_PC_AFTER_CALL
1790 fprintf_unfiltered (file,
1791 "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1792 (long) current_gdbarch->saved_pc_after_call
1793 /*SAVED_PC_AFTER_CALL ()*/);
1795 #ifdef FRAME_NUM_ARGS
1797 fprintf_unfiltered (file,
1798 "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
1799 (long) current_gdbarch->frame_num_args
1800 /*FRAME_NUM_ARGS ()*/);
1804 fprintf_unfiltered (file,
1805 "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
1806 (long) current_gdbarch->stack_align
1807 /*STACK_ALIGN ()*/);
1809 #ifdef REG_STRUCT_HAS_ADDR
1811 fprintf_unfiltered (file,
1812 "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1813 (long) current_gdbarch->reg_struct_has_addr
1814 /*REG_STRUCT_HAS_ADDR ()*/);
1816 #ifdef SAVE_DUMMY_FRAME_TOS
1818 fprintf_unfiltered (file,
1819 "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
1820 (long) current_gdbarch->save_dummy_frame_tos
1821 /*SAVE_DUMMY_FRAME_TOS ()*/);
1823 #ifdef TARGET_FLOAT_FORMAT
1824 fprintf_unfiltered (file,
1825 "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
1826 (long) TARGET_FLOAT_FORMAT);
1828 #ifdef TARGET_DOUBLE_FORMAT
1829 fprintf_unfiltered (file,
1830 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
1831 (long) TARGET_DOUBLE_FORMAT);
1833 #ifdef TARGET_LONG_DOUBLE_FORMAT
1834 fprintf_unfiltered (file,
1835 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
1836 (long) TARGET_LONG_DOUBLE_FORMAT);
1838 if (current_gdbarch->dump_tdep != NULL)
1839 current_gdbarch->dump_tdep (current_gdbarch, file);
1842 struct gdbarch_tdep *
1843 gdbarch_tdep (struct gdbarch *gdbarch)
1845 if (gdbarch_debug >= 2)
1846 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1847 return gdbarch->tdep;
1851 const struct bfd_arch_info *
1852 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1854 if (gdbarch_debug >= 2)
1855 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1856 return gdbarch->bfd_arch_info;
1860 gdbarch_byte_order (struct gdbarch *gdbarch)
1862 if (gdbarch_debug >= 2)
1863 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1864 return gdbarch->byte_order;
1868 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1870 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1871 if (gdbarch_debug >= 2)
1872 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1873 return gdbarch->bfd_vma_bit;
1877 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1880 gdbarch->bfd_vma_bit = bfd_vma_bit;
1884 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1886 if (gdbarch->ptr_bit == 0)
1887 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1888 if (gdbarch_debug >= 2)
1889 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1890 return gdbarch->ptr_bit;
1894 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1897 gdbarch->ptr_bit = ptr_bit;
1901 gdbarch_short_bit (struct gdbarch *gdbarch)
1903 if (gdbarch->short_bit == 0)
1904 internal_error ("gdbarch: gdbarch_short_bit invalid");
1905 if (gdbarch_debug >= 2)
1906 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1907 return gdbarch->short_bit;
1911 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1914 gdbarch->short_bit = short_bit;
1918 gdbarch_int_bit (struct gdbarch *gdbarch)
1920 if (gdbarch->int_bit == 0)
1921 internal_error ("gdbarch: gdbarch_int_bit invalid");
1922 if (gdbarch_debug >= 2)
1923 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1924 return gdbarch->int_bit;
1928 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1931 gdbarch->int_bit = int_bit;
1935 gdbarch_long_bit (struct gdbarch *gdbarch)
1937 if (gdbarch->long_bit == 0)
1938 internal_error ("gdbarch: gdbarch_long_bit invalid");
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1941 return gdbarch->long_bit;
1945 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1948 gdbarch->long_bit = long_bit;
1952 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1954 if (gdbarch->long_long_bit == 0)
1955 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1956 if (gdbarch_debug >= 2)
1957 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1958 return gdbarch->long_long_bit;
1962 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1965 gdbarch->long_long_bit = long_long_bit;
1969 gdbarch_float_bit (struct gdbarch *gdbarch)
1971 if (gdbarch->float_bit == 0)
1972 internal_error ("gdbarch: gdbarch_float_bit invalid");
1973 if (gdbarch_debug >= 2)
1974 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1975 return gdbarch->float_bit;
1979 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1982 gdbarch->float_bit = float_bit;
1986 gdbarch_double_bit (struct gdbarch *gdbarch)
1988 if (gdbarch->double_bit == 0)
1989 internal_error ("gdbarch: gdbarch_double_bit invalid");
1990 if (gdbarch_debug >= 2)
1991 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1992 return gdbarch->double_bit;
1996 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1999 gdbarch->double_bit = double_bit;
2003 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2005 if (gdbarch->long_double_bit == 0)
2006 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
2007 if (gdbarch_debug >= 2)
2008 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2009 return gdbarch->long_double_bit;
2013 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2014 int long_double_bit)
2016 gdbarch->long_double_bit = long_double_bit;
2020 gdbarch_ieee_float (struct gdbarch *gdbarch)
2022 /* Skip verify of ieee_float, invalid_p == 0 */
2023 if (gdbarch_debug >= 2)
2024 fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n");
2025 return gdbarch->ieee_float;
2029 set_gdbarch_ieee_float (struct gdbarch *gdbarch,
2032 gdbarch->ieee_float = ieee_float;
2036 gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
2038 if (gdbarch->read_pc == 0)
2039 internal_error ("gdbarch: gdbarch_read_pc invalid");
2040 if (gdbarch_debug >= 2)
2041 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2042 return gdbarch->read_pc (pid);
2046 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2047 gdbarch_read_pc_ftype read_pc)
2049 gdbarch->read_pc = read_pc;
2053 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
2055 if (gdbarch->write_pc == 0)
2056 internal_error ("gdbarch: gdbarch_write_pc invalid");
2057 if (gdbarch_debug >= 2)
2058 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2059 gdbarch->write_pc (val, pid);
2063 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2064 gdbarch_write_pc_ftype write_pc)
2066 gdbarch->write_pc = write_pc;
2070 gdbarch_read_fp (struct gdbarch *gdbarch)
2072 if (gdbarch->read_fp == 0)
2073 internal_error ("gdbarch: gdbarch_read_fp invalid");
2074 if (gdbarch_debug >= 2)
2075 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2076 return gdbarch->read_fp ();
2080 set_gdbarch_read_fp (struct gdbarch *gdbarch,
2081 gdbarch_read_fp_ftype read_fp)
2083 gdbarch->read_fp = read_fp;
2087 gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
2089 if (gdbarch->write_fp == 0)
2090 internal_error ("gdbarch: gdbarch_write_fp invalid");
2091 if (gdbarch_debug >= 2)
2092 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
2093 gdbarch->write_fp (val);
2097 set_gdbarch_write_fp (struct gdbarch *gdbarch,
2098 gdbarch_write_fp_ftype write_fp)
2100 gdbarch->write_fp = write_fp;
2104 gdbarch_read_sp (struct gdbarch *gdbarch)
2106 if (gdbarch->read_sp == 0)
2107 internal_error ("gdbarch: gdbarch_read_sp invalid");
2108 if (gdbarch_debug >= 2)
2109 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2110 return gdbarch->read_sp ();
2114 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2115 gdbarch_read_sp_ftype read_sp)
2117 gdbarch->read_sp = read_sp;
2121 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2123 if (gdbarch->write_sp == 0)
2124 internal_error ("gdbarch: gdbarch_write_sp invalid");
2125 if (gdbarch_debug >= 2)
2126 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2127 gdbarch->write_sp (val);
2131 set_gdbarch_write_sp (struct gdbarch *gdbarch,
2132 gdbarch_write_sp_ftype write_sp)
2134 gdbarch->write_sp = write_sp;
2138 gdbarch_num_regs (struct gdbarch *gdbarch)
2140 if (gdbarch->num_regs == -1)
2141 internal_error ("gdbarch: gdbarch_num_regs invalid");
2142 if (gdbarch_debug >= 2)
2143 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2144 return gdbarch->num_regs;
2148 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2151 gdbarch->num_regs = num_regs;
2155 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2157 if (gdbarch->sp_regnum == -1)
2158 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
2159 if (gdbarch_debug >= 2)
2160 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2161 return gdbarch->sp_regnum;
2165 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2168 gdbarch->sp_regnum = sp_regnum;
2172 gdbarch_fp_regnum (struct gdbarch *gdbarch)
2174 if (gdbarch->fp_regnum == -1)
2175 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
2176 if (gdbarch_debug >= 2)
2177 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
2178 return gdbarch->fp_regnum;
2182 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
2185 gdbarch->fp_regnum = fp_regnum;
2189 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2191 if (gdbarch->pc_regnum == -1)
2192 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
2193 if (gdbarch_debug >= 2)
2194 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2195 return gdbarch->pc_regnum;
2199 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2202 gdbarch->pc_regnum = pc_regnum;
2206 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2208 /* Skip verify of fp0_regnum, invalid_p == 0 */
2209 if (gdbarch_debug >= 2)
2210 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2211 return gdbarch->fp0_regnum;
2215 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2218 gdbarch->fp0_regnum = fp0_regnum;
2222 gdbarch_npc_regnum (struct gdbarch *gdbarch)
2224 /* Skip verify of npc_regnum, invalid_p == 0 */
2225 if (gdbarch_debug >= 2)
2226 fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
2227 return gdbarch->npc_regnum;
2231 set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
2234 gdbarch->npc_regnum = npc_regnum;
2238 gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
2240 /* Skip verify of nnpc_regnum, invalid_p == 0 */
2241 if (gdbarch_debug >= 2)
2242 fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
2243 return gdbarch->nnpc_regnum;
2247 set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
2250 gdbarch->nnpc_regnum = nnpc_regnum;
2254 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2256 if (gdbarch->register_name == 0)
2257 internal_error ("gdbarch: gdbarch_register_name invalid");
2258 if (gdbarch_debug >= 2)
2259 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2260 return gdbarch->register_name (regnr);
2264 set_gdbarch_register_name (struct gdbarch *gdbarch,
2265 gdbarch_register_name_ftype register_name)
2267 gdbarch->register_name = register_name;
2271 gdbarch_register_size (struct gdbarch *gdbarch)
2273 if (gdbarch->register_size == -1)
2274 internal_error ("gdbarch: gdbarch_register_size invalid");
2275 if (gdbarch_debug >= 2)
2276 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
2277 return gdbarch->register_size;
2281 set_gdbarch_register_size (struct gdbarch *gdbarch,
2284 gdbarch->register_size = register_size;
2288 gdbarch_register_bytes (struct gdbarch *gdbarch)
2290 if (gdbarch->register_bytes == -1)
2291 internal_error ("gdbarch: gdbarch_register_bytes invalid");
2292 if (gdbarch_debug >= 2)
2293 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
2294 return gdbarch->register_bytes;
2298 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
2301 gdbarch->register_bytes = register_bytes;
2305 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
2307 if (gdbarch->register_byte == 0)
2308 internal_error ("gdbarch: gdbarch_register_byte invalid");
2309 if (gdbarch_debug >= 2)
2310 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
2311 return gdbarch->register_byte (reg_nr);
2315 set_gdbarch_register_byte (struct gdbarch *gdbarch,
2316 gdbarch_register_byte_ftype register_byte)
2318 gdbarch->register_byte = register_byte;
2322 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
2324 if (gdbarch->register_raw_size == 0)
2325 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
2326 if (gdbarch_debug >= 2)
2327 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
2328 return gdbarch->register_raw_size (reg_nr);
2332 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
2333 gdbarch_register_raw_size_ftype register_raw_size)
2335 gdbarch->register_raw_size = register_raw_size;
2339 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
2341 if (gdbarch->max_register_raw_size == -1)
2342 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
2343 if (gdbarch_debug >= 2)
2344 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
2345 return gdbarch->max_register_raw_size;
2349 set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
2350 int max_register_raw_size)
2352 gdbarch->max_register_raw_size = max_register_raw_size;
2356 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
2358 if (gdbarch->register_virtual_size == 0)
2359 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
2360 if (gdbarch_debug >= 2)
2361 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
2362 return gdbarch->register_virtual_size (reg_nr);
2366 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
2367 gdbarch_register_virtual_size_ftype register_virtual_size)
2369 gdbarch->register_virtual_size = register_virtual_size;
2373 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
2375 if (gdbarch->max_register_virtual_size == -1)
2376 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
2377 if (gdbarch_debug >= 2)
2378 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
2379 return gdbarch->max_register_virtual_size;
2383 set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
2384 int max_register_virtual_size)
2386 gdbarch->max_register_virtual_size = max_register_virtual_size;
2390 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
2392 if (gdbarch->register_virtual_type == 0)
2393 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
2394 if (gdbarch_debug >= 2)
2395 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
2396 return gdbarch->register_virtual_type (reg_nr);
2400 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
2401 gdbarch_register_virtual_type_ftype register_virtual_type)
2403 gdbarch->register_virtual_type = register_virtual_type;
2407 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
2409 if (gdbarch->use_generic_dummy_frames == -1)
2410 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
2411 if (gdbarch_debug >= 2)
2412 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
2413 return gdbarch->use_generic_dummy_frames;
2417 set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
2418 int use_generic_dummy_frames)
2420 gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
2424 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2426 if (gdbarch->call_dummy_location == 0)
2427 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
2428 if (gdbarch_debug >= 2)
2429 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2430 return gdbarch->call_dummy_location;
2434 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2435 int call_dummy_location)
2437 gdbarch->call_dummy_location = call_dummy_location;
2441 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
2443 if (gdbarch->call_dummy_address == 0)
2444 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
2445 if (gdbarch_debug >= 2)
2446 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
2447 return gdbarch->call_dummy_address ();
2451 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
2452 gdbarch_call_dummy_address_ftype call_dummy_address)
2454 gdbarch->call_dummy_address = call_dummy_address;
2458 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
2460 if (gdbarch->call_dummy_start_offset == -1)
2461 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
2462 if (gdbarch_debug >= 2)
2463 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
2464 return gdbarch->call_dummy_start_offset;
2468 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
2469 CORE_ADDR call_dummy_start_offset)
2471 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
2475 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
2477 if (gdbarch->call_dummy_breakpoint_offset == -1)
2478 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
2479 if (gdbarch_debug >= 2)
2480 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
2481 return gdbarch->call_dummy_breakpoint_offset;
2485 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
2486 CORE_ADDR call_dummy_breakpoint_offset)
2488 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
2492 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
2494 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
2495 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
2496 if (gdbarch_debug >= 2)
2497 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
2498 return gdbarch->call_dummy_breakpoint_offset_p;
2502 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
2503 int call_dummy_breakpoint_offset_p)
2505 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
2509 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
2511 if (gdbarch->call_dummy_length == -1)
2512 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
2513 if (gdbarch_debug >= 2)
2514 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
2515 return gdbarch->call_dummy_length;
2519 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
2520 int call_dummy_length)
2522 gdbarch->call_dummy_length = call_dummy_length;
2526 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
2528 if (gdbarch->pc_in_call_dummy == 0)
2529 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
2530 if (gdbarch_debug >= 2)
2531 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
2532 return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
2536 set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
2537 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
2539 gdbarch->pc_in_call_dummy = pc_in_call_dummy;
2543 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
2545 if (gdbarch->call_dummy_p == -1)
2546 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
2547 if (gdbarch_debug >= 2)
2548 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
2549 return gdbarch->call_dummy_p;
2553 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
2556 gdbarch->call_dummy_p = call_dummy_p;
2560 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
2562 /* Skip verify of call_dummy_words, invalid_p == 0 */
2563 if (gdbarch_debug >= 2)
2564 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
2565 return gdbarch->call_dummy_words;
2569 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
2570 LONGEST * call_dummy_words)
2572 gdbarch->call_dummy_words = call_dummy_words;
2576 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
2578 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
2579 if (gdbarch_debug >= 2)
2580 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
2581 return gdbarch->sizeof_call_dummy_words;
2585 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
2586 int sizeof_call_dummy_words)
2588 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
2592 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
2594 if (gdbarch->call_dummy_stack_adjust_p == -1)
2595 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
2596 if (gdbarch_debug >= 2)
2597 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
2598 return gdbarch->call_dummy_stack_adjust_p;
2602 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
2603 int call_dummy_stack_adjust_p)
2605 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
2609 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
2611 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
2612 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
2613 if (gdbarch_debug >= 2)
2614 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
2615 return gdbarch->call_dummy_stack_adjust;
2619 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
2620 int call_dummy_stack_adjust)
2622 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
2626 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)
2628 if (gdbarch->fix_call_dummy == 0)
2629 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
2630 if (gdbarch_debug >= 2)
2631 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
2632 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
2636 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
2637 gdbarch_fix_call_dummy_ftype fix_call_dummy)
2639 gdbarch->fix_call_dummy = fix_call_dummy;
2643 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2645 if (gdbarch_debug >= 2)
2646 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2647 return gdbarch->believe_pcc_promotion;
2651 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2652 int believe_pcc_promotion)
2654 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2658 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
2660 if (gdbarch_debug >= 2)
2661 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
2662 return gdbarch->believe_pcc_promotion_type;
2666 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
2667 int believe_pcc_promotion_type)
2669 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
2673 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
2675 if (gdbarch->coerce_float_to_double == 0)
2676 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
2677 if (gdbarch_debug >= 2)
2678 fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
2679 return gdbarch->coerce_float_to_double (formal, actual);
2683 set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
2684 gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
2686 gdbarch->coerce_float_to_double = coerce_float_to_double;
2690 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)
2692 if (gdbarch->get_saved_register == 0)
2693 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
2694 if (gdbarch_debug >= 2)
2695 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
2696 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
2700 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
2701 gdbarch_get_saved_register_ftype get_saved_register)
2703 gdbarch->get_saved_register = get_saved_register;
2707 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
2709 if (gdbarch->register_convertible == 0)
2710 internal_error ("gdbarch: gdbarch_register_convertible invalid");
2711 if (gdbarch_debug >= 2)
2712 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
2713 return gdbarch->register_convertible (nr);
2717 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
2718 gdbarch_register_convertible_ftype register_convertible)
2720 gdbarch->register_convertible = register_convertible;
2724 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
2726 if (gdbarch->register_convert_to_virtual == 0)
2727 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
2728 if (gdbarch_debug >= 2)
2729 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
2730 gdbarch->register_convert_to_virtual (regnum, type, from, to);
2734 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
2735 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
2737 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
2741 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
2743 if (gdbarch->register_convert_to_raw == 0)
2744 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
2745 if (gdbarch_debug >= 2)
2746 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
2747 gdbarch->register_convert_to_raw (type, regnum, from, to);
2751 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
2752 gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
2754 gdbarch->register_convert_to_raw = register_convert_to_raw;
2758 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
2760 if (gdbarch->pointer_to_address == 0)
2761 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
2762 if (gdbarch_debug >= 2)
2763 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2764 return gdbarch->pointer_to_address (type, buf);
2768 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2769 gdbarch_pointer_to_address_ftype pointer_to_address)
2771 gdbarch->pointer_to_address = pointer_to_address;
2775 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
2777 if (gdbarch->address_to_pointer == 0)
2778 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
2779 if (gdbarch_debug >= 2)
2780 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2781 gdbarch->address_to_pointer (type, buf, addr);
2785 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2786 gdbarch_address_to_pointer_ftype address_to_pointer)
2788 gdbarch->address_to_pointer = address_to_pointer;
2792 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
2794 if (gdbarch->return_value_on_stack == 0)
2795 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
2796 if (gdbarch_debug >= 2)
2797 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
2798 return gdbarch->return_value_on_stack (type);
2802 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
2803 gdbarch_return_value_on_stack_ftype return_value_on_stack)
2805 gdbarch->return_value_on_stack = return_value_on_stack;
2809 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
2811 if (gdbarch->extract_return_value == 0)
2812 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
2813 if (gdbarch_debug >= 2)
2814 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2815 gdbarch->extract_return_value (type, regbuf, valbuf);
2819 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2820 gdbarch_extract_return_value_ftype extract_return_value)
2822 gdbarch->extract_return_value = extract_return_value;
2826 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2828 if (gdbarch->push_arguments == 0)
2829 internal_error ("gdbarch: gdbarch_push_arguments invalid");
2830 if (gdbarch_debug >= 2)
2831 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
2832 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
2836 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
2837 gdbarch_push_arguments_ftype push_arguments)
2839 gdbarch->push_arguments = push_arguments;
2843 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
2845 if (gdbarch->push_dummy_frame == 0)
2846 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
2847 if (gdbarch_debug >= 2)
2848 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
2849 gdbarch->push_dummy_frame ();
2853 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
2854 gdbarch_push_dummy_frame_ftype push_dummy_frame)
2856 gdbarch->push_dummy_frame = push_dummy_frame;
2860 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
2862 if (gdbarch->push_return_address == 0)
2863 internal_error ("gdbarch: gdbarch_push_return_address invalid");
2864 if (gdbarch_debug >= 2)
2865 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
2866 return gdbarch->push_return_address (pc, sp);
2870 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
2871 gdbarch_push_return_address_ftype push_return_address)
2873 gdbarch->push_return_address = push_return_address;
2877 gdbarch_pop_frame (struct gdbarch *gdbarch)
2879 if (gdbarch->pop_frame == 0)
2880 internal_error ("gdbarch: gdbarch_pop_frame invalid");
2881 if (gdbarch_debug >= 2)
2882 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
2883 gdbarch->pop_frame ();
2887 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
2888 gdbarch_pop_frame_ftype pop_frame)
2890 gdbarch->pop_frame = pop_frame;
2894 gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
2896 if (gdbarch->d10v_make_daddr == 0)
2897 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2898 if (gdbarch_debug >= 2)
2899 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
2900 return gdbarch->d10v_make_daddr (x);
2904 set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch,
2905 gdbarch_d10v_make_daddr_ftype d10v_make_daddr)
2907 gdbarch->d10v_make_daddr = d10v_make_daddr;
2911 gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
2913 if (gdbarch->d10v_make_iaddr == 0)
2914 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2915 if (gdbarch_debug >= 2)
2916 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
2917 return gdbarch->d10v_make_iaddr (x);
2921 set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch,
2922 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr)
2924 gdbarch->d10v_make_iaddr = d10v_make_iaddr;
2928 gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
2930 if (gdbarch->d10v_daddr_p == 0)
2931 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2932 if (gdbarch_debug >= 2)
2933 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
2934 return gdbarch->d10v_daddr_p (x);
2938 set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch,
2939 gdbarch_d10v_daddr_p_ftype d10v_daddr_p)
2941 gdbarch->d10v_daddr_p = d10v_daddr_p;
2945 gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
2947 if (gdbarch->d10v_iaddr_p == 0)
2948 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2949 if (gdbarch_debug >= 2)
2950 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
2951 return gdbarch->d10v_iaddr_p (x);
2955 set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch,
2956 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p)
2958 gdbarch->d10v_iaddr_p = d10v_iaddr_p;
2962 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2964 if (gdbarch->d10v_convert_daddr_to_raw == 0)
2965 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2966 if (gdbarch_debug >= 2)
2967 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
2968 return gdbarch->d10v_convert_daddr_to_raw (x);
2972 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch,
2973 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw)
2975 gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
2979 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2981 if (gdbarch->d10v_convert_iaddr_to_raw == 0)
2982 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2983 if (gdbarch_debug >= 2)
2984 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2985 return gdbarch->d10v_convert_iaddr_to_raw (x);
2989 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch,
2990 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw)
2992 gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
2996 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2998 if (gdbarch->store_struct_return == 0)
2999 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
3000 if (gdbarch_debug >= 2)
3001 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3002 gdbarch->store_struct_return (addr, sp);
3006 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3007 gdbarch_store_struct_return_ftype store_struct_return)
3009 gdbarch->store_struct_return = store_struct_return;
3013 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3015 if (gdbarch->store_return_value == 0)
3016 internal_error ("gdbarch: gdbarch_store_return_value invalid");
3017 if (gdbarch_debug >= 2)
3018 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3019 gdbarch->store_return_value (type, valbuf);
3023 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3024 gdbarch_store_return_value_ftype store_return_value)
3026 gdbarch->store_return_value = store_return_value;
3030 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
3032 if (gdbarch->extract_struct_value_address == 0)
3033 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
3034 if (gdbarch_debug >= 2)
3035 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
3036 return gdbarch->extract_struct_value_address (regbuf);
3040 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
3041 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
3043 gdbarch->extract_struct_value_address = extract_struct_value_address;
3047 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3049 if (gdbarch->use_struct_convention == 0)
3050 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
3051 if (gdbarch_debug >= 2)
3052 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3053 return gdbarch->use_struct_convention (gcc_p, value_type);
3057 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
3058 gdbarch_use_struct_convention_ftype use_struct_convention)
3060 gdbarch->use_struct_convention = use_struct_convention;
3064 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3066 if (gdbarch->frame_init_saved_regs == 0)
3067 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
3068 if (gdbarch_debug >= 2)
3069 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
3070 gdbarch->frame_init_saved_regs (frame);
3074 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
3075 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
3077 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
3081 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3083 if (gdbarch->init_extra_frame_info == 0)
3084 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
3085 if (gdbarch_debug >= 2)
3086 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
3087 gdbarch->init_extra_frame_info (fromleaf, frame);
3091 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
3092 gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
3094 gdbarch->init_extra_frame_info = init_extra_frame_info;
3098 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3100 if (gdbarch->skip_prologue == 0)
3101 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
3102 if (gdbarch_debug >= 2)
3103 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3104 return gdbarch->skip_prologue (ip);
3108 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3109 gdbarch_skip_prologue_ftype skip_prologue)
3111 gdbarch->skip_prologue = skip_prologue;
3115 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
3117 if (gdbarch->prologue_frameless_p == 0)
3118 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
3119 if (gdbarch_debug >= 2)
3120 fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
3121 return gdbarch->prologue_frameless_p (ip);
3125 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
3126 gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
3128 gdbarch->prologue_frameless_p = prologue_frameless_p;
3132 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3134 if (gdbarch->inner_than == 0)
3135 internal_error ("gdbarch: gdbarch_inner_than invalid");
3136 if (gdbarch_debug >= 2)
3137 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3138 return gdbarch->inner_than (lhs, rhs);
3142 set_gdbarch_inner_than (struct gdbarch *gdbarch,
3143 gdbarch_inner_than_ftype inner_than)
3145 gdbarch->inner_than = inner_than;
3149 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
3151 if (gdbarch->breakpoint_from_pc == 0)
3152 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
3153 if (gdbarch_debug >= 2)
3154 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3155 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3159 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3160 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
3162 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3166 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3168 if (gdbarch->memory_insert_breakpoint == 0)
3169 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
3170 if (gdbarch_debug >= 2)
3171 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3172 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3176 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3177 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3179 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3183 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3185 if (gdbarch->memory_remove_breakpoint == 0)
3186 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
3187 if (gdbarch_debug >= 2)
3188 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3189 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3193 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3194 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3196 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3200 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3202 if (gdbarch->decr_pc_after_break == -1)
3203 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
3204 if (gdbarch_debug >= 2)
3205 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3206 return gdbarch->decr_pc_after_break;
3210 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3211 CORE_ADDR decr_pc_after_break)
3213 gdbarch->decr_pc_after_break = decr_pc_after_break;
3217 gdbarch_function_start_offset (struct gdbarch *gdbarch)
3219 if (gdbarch->function_start_offset == -1)
3220 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
3221 if (gdbarch_debug >= 2)
3222 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
3223 return gdbarch->function_start_offset;
3227 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
3228 CORE_ADDR function_start_offset)
3230 gdbarch->function_start_offset = function_start_offset;
3234 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
3236 if (gdbarch->remote_translate_xfer_address == 0)
3237 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
3238 if (gdbarch_debug >= 2)
3239 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3240 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
3244 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3245 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3247 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3251 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3253 if (gdbarch->frame_args_skip == -1)
3254 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
3255 if (gdbarch_debug >= 2)
3256 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3257 return gdbarch->frame_args_skip;
3261 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3262 CORE_ADDR frame_args_skip)
3264 gdbarch->frame_args_skip = frame_args_skip;
3268 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
3270 if (gdbarch->frameless_function_invocation == 0)
3271 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
3272 if (gdbarch_debug >= 2)
3273 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
3274 return gdbarch->frameless_function_invocation (fi);
3278 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
3279 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
3281 gdbarch->frameless_function_invocation = frameless_function_invocation;
3285 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3287 if (gdbarch->frame_chain == 0)
3288 internal_error ("gdbarch: gdbarch_frame_chain invalid");
3289 if (gdbarch_debug >= 2)
3290 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
3291 return gdbarch->frame_chain (frame);
3295 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
3296 gdbarch_frame_chain_ftype frame_chain)
3298 gdbarch->frame_chain = frame_chain;
3302 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3304 if (gdbarch->frame_chain_valid == 0)
3305 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
3306 if (gdbarch_debug >= 2)
3307 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
3308 return gdbarch->frame_chain_valid (chain, thisframe);
3312 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
3313 gdbarch_frame_chain_valid_ftype frame_chain_valid)
3315 gdbarch->frame_chain_valid = frame_chain_valid;
3319 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3321 if (gdbarch->frame_saved_pc == 0)
3322 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
3323 if (gdbarch_debug >= 2)
3324 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
3325 return gdbarch->frame_saved_pc (fi);
3329 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
3330 gdbarch_frame_saved_pc_ftype frame_saved_pc)
3332 gdbarch->frame_saved_pc = frame_saved_pc;
3336 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3338 if (gdbarch->frame_args_address == 0)
3339 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
3340 if (gdbarch_debug >= 2)
3341 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
3342 return gdbarch->frame_args_address (fi);
3346 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
3347 gdbarch_frame_args_address_ftype frame_args_address)
3349 gdbarch->frame_args_address = frame_args_address;
3353 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
3355 if (gdbarch->frame_locals_address == 0)
3356 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
3357 if (gdbarch_debug >= 2)
3358 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
3359 return gdbarch->frame_locals_address (fi);
3363 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
3364 gdbarch_frame_locals_address_ftype frame_locals_address)
3366 gdbarch->frame_locals_address = frame_locals_address;
3370 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3372 if (gdbarch->saved_pc_after_call == 0)
3373 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
3374 if (gdbarch_debug >= 2)
3375 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
3376 return gdbarch->saved_pc_after_call (frame);
3380 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
3381 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
3383 gdbarch->saved_pc_after_call = saved_pc_after_call;
3387 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3389 if (gdbarch->frame_num_args == 0)
3390 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
3391 if (gdbarch_debug >= 2)
3392 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3393 return gdbarch->frame_num_args (frame);
3397 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3398 gdbarch_frame_num_args_ftype frame_num_args)
3400 gdbarch->frame_num_args = frame_num_args;
3404 gdbarch_stack_align_p (struct gdbarch *gdbarch)
3406 return gdbarch->stack_align != 0;
3410 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3412 if (gdbarch->stack_align == 0)
3413 internal_error ("gdbarch: gdbarch_stack_align invalid");
3414 if (gdbarch_debug >= 2)
3415 fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
3416 return gdbarch->stack_align (sp);
3420 set_gdbarch_stack_align (struct gdbarch *gdbarch,
3421 gdbarch_stack_align_ftype stack_align)
3423 gdbarch->stack_align = stack_align;
3427 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3429 return gdbarch->reg_struct_has_addr != 0;
3433 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3435 if (gdbarch->reg_struct_has_addr == 0)
3436 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
3437 if (gdbarch_debug >= 2)
3438 fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
3439 return gdbarch->reg_struct_has_addr (gcc_p, type);
3443 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
3444 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
3446 gdbarch->reg_struct_has_addr = reg_struct_has_addr;
3450 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
3452 return gdbarch->save_dummy_frame_tos != 0;
3456 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
3458 if (gdbarch->save_dummy_frame_tos == 0)
3459 internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid");
3460 if (gdbarch_debug >= 2)
3461 fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
3462 gdbarch->save_dummy_frame_tos (sp);
3466 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
3467 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
3469 gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
3472 const struct floatformat *
3473 gdbarch_float_format (struct gdbarch *gdbarch)
3475 if (gdbarch_debug >= 2)
3476 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
3477 return gdbarch->float_format;
3481 set_gdbarch_float_format (struct gdbarch *gdbarch,
3482 const struct floatformat * float_format)
3484 gdbarch->float_format = float_format;
3487 const struct floatformat *
3488 gdbarch_double_format (struct gdbarch *gdbarch)
3490 if (gdbarch_debug >= 2)
3491 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
3492 return gdbarch->double_format;
3496 set_gdbarch_double_format (struct gdbarch *gdbarch,
3497 const struct floatformat * double_format)
3499 gdbarch->double_format = double_format;
3502 const struct floatformat *
3503 gdbarch_long_double_format (struct gdbarch *gdbarch)
3505 if (gdbarch_debug >= 2)
3506 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
3507 return gdbarch->long_double_format;
3511 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
3512 const struct floatformat * long_double_format)
3514 gdbarch->long_double_format = long_double_format;
3518 /* Keep a registrary of per-architecture data-pointers required by GDB
3526 struct gdbarch_data_registration
3528 gdbarch_data_ftype *init;
3529 struct gdbarch_data *data;
3530 struct gdbarch_data_registration *next;
3533 struct gdbarch_data_registrary
3536 struct gdbarch_data_registration *registrations;
3539 struct gdbarch_data_registrary gdbarch_data_registrary =
3544 struct gdbarch_data *
3545 register_gdbarch_data (gdbarch_data_ftype *init)
3547 struct gdbarch_data_registration **curr;
3548 for (curr = &gdbarch_data_registrary.registrations;
3550 curr = &(*curr)->next);
3551 (*curr) = XMALLOC (struct gdbarch_data_registration);
3552 (*curr)->next = NULL;
3553 (*curr)->init = init;
3554 (*curr)->data = XMALLOC (struct gdbarch_data);
3555 (*curr)->data->index = gdbarch_data_registrary.nr++;
3556 return (*curr)->data;
3560 /* Walk through all the registered users initializing each in turn. */
3563 init_gdbarch_data (struct gdbarch *gdbarch)
3565 struct gdbarch_data_registration *rego;
3566 gdbarch->nr_data = gdbarch_data_registrary.nr + 1;
3567 gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
3568 for (rego = gdbarch_data_registrary.registrations;
3572 if (rego->data->index < gdbarch->nr_data)
3573 gdbarch->data[rego->data->index] = rego->init ();
3578 /* Return the current value of the specified per-architecture
3583 struct gdbarch_data *data;
3585 if (data->index >= current_gdbarch->nr_data)
3586 internal_error ("gdbarch_data: request for non-existant data.");
3587 return current_gdbarch->data[data->index];
3592 /* Keep a registrary of swaped data required by GDB modules. */
3597 struct gdbarch_swap_registration *source;
3598 struct gdbarch_swap *next;
3601 struct gdbarch_swap_registration
3604 unsigned long sizeof_data;
3605 gdbarch_swap_ftype *init;
3606 struct gdbarch_swap_registration *next;
3609 struct gdbarch_swap_registrary
3612 struct gdbarch_swap_registration *registrations;
3615 struct gdbarch_swap_registrary gdbarch_swap_registrary =
3621 register_gdbarch_swap (void *data,
3622 unsigned long sizeof_data,
3623 gdbarch_swap_ftype *init)
3625 struct gdbarch_swap_registration **rego;
3626 for (rego = &gdbarch_swap_registrary.registrations;
3628 rego = &(*rego)->next);
3629 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3630 (*rego)->next = NULL;
3631 (*rego)->init = init;
3632 (*rego)->data = data;
3633 (*rego)->sizeof_data = sizeof_data;
3638 init_gdbarch_swap (struct gdbarch *gdbarch)
3640 struct gdbarch_swap_registration *rego;
3641 struct gdbarch_swap **curr = &gdbarch->swap;
3642 for (rego = gdbarch_swap_registrary.registrations;
3646 if (rego->data != NULL)
3648 (*curr) = XMALLOC (struct gdbarch_swap);
3649 (*curr)->source = rego;
3650 (*curr)->swap = xmalloc (rego->sizeof_data);
3651 (*curr)->next = NULL;
3652 memset (rego->data, 0, rego->sizeof_data);
3653 curr = &(*curr)->next;
3655 if (rego->init != NULL)
3661 swapout_gdbarch_swap (struct gdbarch *gdbarch)
3663 struct gdbarch_swap *curr;
3664 for (curr = gdbarch->swap;
3667 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3671 swapin_gdbarch_swap (struct gdbarch *gdbarch)
3673 struct gdbarch_swap *curr;
3674 for (curr = gdbarch->swap;
3677 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3681 /* Keep a registrary of the architectures known by GDB. */
3683 struct gdbarch_registration
3685 enum bfd_architecture bfd_architecture;
3686 gdbarch_init_ftype *init;
3687 gdbarch_dump_tdep_ftype *dump_tdep;
3688 struct gdbarch_list *arches;
3689 struct gdbarch_registration *next;
3692 static struct gdbarch_registration *gdbarch_registrary = NULL;
3695 append_name (const char ***buf, int *nr, const char *name)
3697 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3703 gdbarch_printable_names (void)
3707 /* Accumulate a list of names based on the registed list of
3709 enum bfd_architecture a;
3711 const char **arches = NULL;
3712 struct gdbarch_registration *rego;
3713 for (rego = gdbarch_registrary;
3717 const struct bfd_arch_info *ap;
3718 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3720 internal_error ("gdbarch_architecture_names: multi-arch unknown");
3723 append_name (&arches, &nr_arches, ap->printable_name);
3728 append_name (&arches, &nr_arches, NULL);
3732 /* Just return all the architectures that BFD knows. Assume that
3733 the legacy architecture framework supports them. */
3734 return bfd_arch_list ();
3739 gdbarch_register (enum bfd_architecture bfd_architecture,
3740 gdbarch_init_ftype *init,
3741 gdbarch_dump_tdep_ftype *dump_tdep)
3743 struct gdbarch_registration **curr;
3744 const struct bfd_arch_info *bfd_arch_info;
3745 /* Check that BFD reconizes this architecture */
3746 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3747 if (bfd_arch_info == NULL)
3749 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
3751 /* Check that we haven't seen this architecture before */
3752 for (curr = &gdbarch_registrary;
3754 curr = &(*curr)->next)
3756 if (bfd_architecture == (*curr)->bfd_architecture)
3757 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
3758 bfd_arch_info->printable_name);
3762 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3763 bfd_arch_info->printable_name,
3766 (*curr) = XMALLOC (struct gdbarch_registration);
3767 (*curr)->bfd_architecture = bfd_architecture;
3768 (*curr)->init = init;
3769 (*curr)->dump_tdep = dump_tdep;
3770 (*curr)->arches = NULL;
3771 (*curr)->next = NULL;
3772 /* When non- multi-arch, install what ever target dump routine we've
3773 been provided - hopefully that routine has been writen correct
3774 and works regardless of multi-arch. */
3775 if (!GDB_MULTI_ARCH && dump_tdep != NULL
3776 && startup_gdbarch.dump_tdep == NULL)
3777 startup_gdbarch.dump_tdep = dump_tdep;
3781 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3782 gdbarch_init_ftype *init)
3784 gdbarch_register (bfd_architecture, init, NULL);
3788 /* Look for an architecture using gdbarch_info. Base search on only
3789 BFD_ARCH_INFO and BYTE_ORDER. */
3791 struct gdbarch_list *
3792 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3793 const struct gdbarch_info *info)
3795 for (; arches != NULL; arches = arches->next)
3797 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3799 if (info->byte_order != arches->gdbarch->byte_order)
3807 /* Update the current architecture. Return ZERO if the update request
3811 gdbarch_update (struct gdbarch_info info)
3813 struct gdbarch *new_gdbarch;
3814 struct gdbarch_list **list;
3815 struct gdbarch_registration *rego;
3817 /* Fill in any missing bits. Most important is the bfd_architecture
3818 which is used to select the target architecture. */
3819 if (info.bfd_architecture == bfd_arch_unknown)
3821 if (info.bfd_arch_info != NULL)
3822 info.bfd_architecture = info.bfd_arch_info->arch;
3823 else if (info.abfd != NULL)
3824 info.bfd_architecture = bfd_get_arch (info.abfd);
3825 /* FIXME - should query BFD for its default architecture. */
3827 info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
3829 if (info.bfd_arch_info == NULL)
3831 if (target_architecture_auto && info.abfd != NULL)
3832 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
3834 info.bfd_arch_info = current_gdbarch->bfd_arch_info;
3836 if (info.byte_order == 0)
3838 if (target_byte_order_auto && info.abfd != NULL)
3839 info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
3840 : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
3843 info.byte_order = current_gdbarch->byte_order;
3844 /* FIXME - should query BFD for its default byte-order. */
3846 /* A default for abfd? */
3848 /* Find the target that knows about this architecture. */
3849 for (rego = gdbarch_registrary;
3852 if (rego->bfd_architecture == info.bfd_architecture)
3857 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
3863 fprintf_unfiltered (gdb_stdlog,
3864 "gdbarch_update: info.bfd_architecture %d (%s)\n",
3865 info.bfd_architecture,
3866 bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
3867 fprintf_unfiltered (gdb_stdlog,
3868 "gdbarch_update: info.bfd_arch_info %s\n",
3869 (info.bfd_arch_info != NULL
3870 ? info.bfd_arch_info->printable_name
3872 fprintf_unfiltered (gdb_stdlog,
3873 "gdbarch_update: info.byte_order %d (%s)\n",
3875 (info.byte_order == BIG_ENDIAN ? "big"
3876 : info.byte_order == LITTLE_ENDIAN ? "little"
3878 fprintf_unfiltered (gdb_stdlog,
3879 "gdbarch_update: info.abfd 0x%lx\n",
3881 fprintf_unfiltered (gdb_stdlog,
3882 "gdbarch_update: info.tdep_info 0x%lx\n",
3883 (long) info.tdep_info);
3886 /* Ask the target for a replacement architecture. */
3887 new_gdbarch = rego->init (info, rego->arches);
3889 /* Did the target like it? No. Reject the change. */
3890 if (new_gdbarch == NULL)
3893 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
3897 /* Did the architecture change? No. Do nothing. */
3898 if (current_gdbarch == new_gdbarch)
3901 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
3903 new_gdbarch->bfd_arch_info->printable_name);
3907 /* Swap all data belonging to the old target out */
3908 swapout_gdbarch_swap (current_gdbarch);
3910 /* Is this a pre-existing architecture? Yes. Swap it in. */
3911 for (list = ®o->arches;
3913 list = &(*list)->next)
3915 if ((*list)->gdbarch == new_gdbarch)
3918 fprintf_unfiltered (gdb_stdlog,
3919 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
3921 new_gdbarch->bfd_arch_info->printable_name);
3922 current_gdbarch = new_gdbarch;
3923 swapin_gdbarch_swap (new_gdbarch);
3928 /* Append this new architecture to this targets list. */
3929 (*list) = XMALLOC (struct gdbarch_list);
3930 (*list)->next = NULL;
3931 (*list)->gdbarch = new_gdbarch;
3933 /* Switch to this new architecture. Dump it out. */
3934 current_gdbarch = new_gdbarch;
3937 fprintf_unfiltered (gdb_stdlog,
3938 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
3940 new_gdbarch->bfd_arch_info->printable_name);
3943 /* Check that the newly installed architecture is valid. Plug in
3944 any post init values. */
3945 new_gdbarch->dump_tdep = rego->dump_tdep;
3946 verify_gdbarch (new_gdbarch);
3948 /* Initialize the per-architecture memory (swap) areas.
3949 CURRENT_GDBARCH must be update before these modules are
3951 init_gdbarch_swap (new_gdbarch);
3953 /* Initialize the per-architecture data-pointer of all parties that
3954 registered an interest in this architecture. CURRENT_GDBARCH
3955 must be updated before these modules are called. */
3956 init_gdbarch_data (new_gdbarch);
3959 gdbarch_dump (current_gdbarch, gdb_stdlog);
3967 /* Pointer to the target-dependent disassembly function. */
3968 int (*tm_print_insn) (bfd_vma, disassemble_info *);
3969 disassemble_info tm_print_insn_info;
3972 extern void _initialize_gdbarch (void);
3975 _initialize_gdbarch ()
3977 struct cmd_list_element *c;
3979 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
3980 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
3981 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
3982 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
3983 tm_print_insn_info.print_address_func = dis_asm_print_address;
3985 add_show_from_set (add_set_cmd ("arch",
3988 (char *)&gdbarch_debug,
3989 "Set architecture debugging.\n\
3990 When non-zero, architecture debugging is enabled.", &setdebuglist),
3992 c = add_set_cmd ("archdebug",
3995 (char *)&gdbarch_debug,
3996 "Set architecture debugging.\n\
3997 When non-zero, architecture debugging is enabled.", &setlist);
3999 deprecate_cmd (c, "set debug arch");
4000 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");