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
;
97 /* per-architecture data-pointers */
101 /* per-architecture swap-regions */
102 struct gdbarch_swap
*swap
;
104 /* Multi-arch values.
106 When extending this structure you must:
110 Declare set/get functions and define the corresponding
113 gdbarch_alloc(): If zero/NULL is not a suitable default,
114 initialize the new field.
116 verify_gdbarch(): Confirm that the target updated the field
119 gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
122 ``startup_gdbarch()'': Append an initial value to the static
123 variable (base values on the host's c-type system).
125 get_gdbarch(): Implement the set/get functions (probably using
126 the macro's as shortcuts).
140 gdbarch_read_pc_ftype
*read_pc
;
141 gdbarch_write_pc_ftype
*write_pc
;
142 gdbarch_read_fp_ftype
*read_fp
;
143 gdbarch_write_fp_ftype
*write_fp
;
144 gdbarch_read_sp_ftype
*read_sp
;
145 gdbarch_write_sp_ftype
*write_sp
;
153 gdbarch_register_name_ftype
*register_name
;
156 gdbarch_register_byte_ftype
*register_byte
;
157 gdbarch_register_raw_size_ftype
*register_raw_size
;
158 int max_register_raw_size
;
159 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
160 int max_register_virtual_size
;
161 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
162 int use_generic_dummy_frames
;
163 int call_dummy_location
;
164 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
165 CORE_ADDR call_dummy_start_offset
;
166 CORE_ADDR call_dummy_breakpoint_offset
;
167 int call_dummy_breakpoint_offset_p
;
168 int call_dummy_length
;
169 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
171 LONGEST
* call_dummy_words
;
172 int sizeof_call_dummy_words
;
173 int call_dummy_stack_adjust_p
;
174 int call_dummy_stack_adjust
;
175 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
176 int believe_pcc_promotion
;
177 int believe_pcc_promotion_type
;
178 gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
;
179 gdbarch_get_saved_register_ftype
*get_saved_register
;
180 gdbarch_register_convertible_ftype
*register_convertible
;
181 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
182 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
183 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
184 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
185 gdbarch_return_value_on_stack_ftype
*return_value_on_stack
;
186 gdbarch_extract_return_value_ftype
*extract_return_value
;
187 gdbarch_push_arguments_ftype
*push_arguments
;
188 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
189 gdbarch_push_return_address_ftype
*push_return_address
;
190 gdbarch_pop_frame_ftype
*pop_frame
;
191 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
192 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
193 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
194 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
195 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
196 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
197 gdbarch_store_struct_return_ftype
*store_struct_return
;
198 gdbarch_store_return_value_ftype
*store_return_value
;
199 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
200 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
201 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
202 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
203 gdbarch_skip_prologue_ftype
*skip_prologue
;
204 gdbarch_prologue_frameless_p_ftype
*prologue_frameless_p
;
205 gdbarch_inner_than_ftype
*inner_than
;
206 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
207 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
208 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
209 CORE_ADDR decr_pc_after_break
;
210 CORE_ADDR function_start_offset
;
211 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
212 CORE_ADDR frame_args_skip
;
213 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
214 gdbarch_frame_chain_ftype
*frame_chain
;
215 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
216 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
217 gdbarch_frame_args_address_ftype
*frame_args_address
;
218 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
219 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
220 gdbarch_frame_num_args_ftype
*frame_num_args
;
221 gdbarch_stack_align_ftype
*stack_align
;
222 gdbarch_reg_struct_has_addr_ftype
*reg_struct_has_addr
;
223 gdbarch_save_dummy_frame_tos_ftype
*save_dummy_frame_tos
;
224 const struct floatformat
* float_format
;
225 const struct floatformat
* double_format
;
226 const struct floatformat
* long_double_format
;
230 /* The default architecture uses host values (for want of a better
233 extern const struct bfd_arch_info bfd_default_arch_struct
;
235 struct gdbarch startup_gdbarch
= {
236 /* basic architecture information */
237 &bfd_default_arch_struct
,
239 /* target specific vector */
241 /*per-architecture data-pointers and swap regions */
243 /* Multi-arch values */
249 8 * sizeof (LONGEST
),
252 8 * sizeof (long double),
293 generic_get_saved_register
,
341 /* startup_gdbarch() */
343 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
346 /* Create a new ``struct gdbarch'' based in information provided by
347 ``struct gdbarch_info''. */
350 gdbarch_alloc (const struct gdbarch_info
*info
,
351 struct gdbarch_tdep
*tdep
)
353 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
354 memset (gdbarch
, 0, sizeof (*gdbarch
));
356 gdbarch
->tdep
= tdep
;
358 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
359 gdbarch
->byte_order
= info
->byte_order
;
361 /* Force the explicit initialization of these. */
362 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
363 gdbarch
->num_regs
= -1;
364 gdbarch
->sp_regnum
= -1;
365 gdbarch
->fp_regnum
= -1;
366 gdbarch
->pc_regnum
= -1;
367 gdbarch
->fp0_regnum
= -1;
368 gdbarch
->npc_regnum
= -1;
369 gdbarch
->nnpc_regnum
= -1;
370 gdbarch
->register_name
= legacy_register_name
;
371 gdbarch
->register_size
= -1;
372 gdbarch
->register_bytes
= -1;
373 gdbarch
->max_register_raw_size
= -1;
374 gdbarch
->max_register_virtual_size
= -1;
375 gdbarch
->use_generic_dummy_frames
= -1;
376 gdbarch
->call_dummy_start_offset
= -1;
377 gdbarch
->call_dummy_breakpoint_offset
= -1;
378 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
379 gdbarch
->call_dummy_length
= -1;
380 gdbarch
->call_dummy_p
= -1;
381 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
382 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
383 gdbarch
->call_dummy_stack_adjust_p
= -1;
384 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
385 gdbarch
->register_convertible
= generic_register_convertible_not
;
386 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
387 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
388 gdbarch
->return_value_on_stack
= generic_return_value_on_stack_not
;
389 gdbarch
->prologue_frameless_p
= generic_prologue_frameless_p
;
390 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
391 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
392 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
393 gdbarch
->decr_pc_after_break
= -1;
394 gdbarch
->function_start_offset
= -1;
395 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
396 gdbarch
->frame_args_skip
= -1;
397 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
398 /* gdbarch_alloc() */
404 /* Free a gdbarch struct. This should never happen in normal
405 operation --- once you've created a gdbarch, you keep it around.
406 However, if an architecture's init function encounters an error
407 building the structure, it may need to clean up a partially
408 constructed gdbarch. */
410 gdbarch_free (struct gdbarch
*arch
)
412 /* At the moment, this is trivial. */
417 /* Ensure that all values in a GDBARCH are reasonable. */
420 verify_gdbarch (struct gdbarch
*gdbarch
)
422 /* Only perform sanity checks on a multi-arch target. */
423 if (GDB_MULTI_ARCH
<= 0)
426 if (gdbarch
->byte_order
== 0)
427 internal_error ("verify_gdbarch: byte-order unset");
428 if (gdbarch
->bfd_arch_info
== NULL
)
429 internal_error ("verify_gdbarch: bfd_arch_info unset");
430 /* Check those that need to be defined for the given multi-arch level. */
431 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
432 if ((GDB_MULTI_ARCH
>= 1)
433 && (gdbarch
->ptr_bit
== 0))
434 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
435 if ((GDB_MULTI_ARCH
>= 1)
436 && (gdbarch
->short_bit
== 0))
437 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
438 if ((GDB_MULTI_ARCH
>= 1)
439 && (gdbarch
->int_bit
== 0))
440 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
441 if ((GDB_MULTI_ARCH
>= 1)
442 && (gdbarch
->long_bit
== 0))
443 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
444 if ((GDB_MULTI_ARCH
>= 1)
445 && (gdbarch
->long_long_bit
== 0))
446 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
447 if ((GDB_MULTI_ARCH
>= 1)
448 && (gdbarch
->float_bit
== 0))
449 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
450 if ((GDB_MULTI_ARCH
>= 1)
451 && (gdbarch
->double_bit
== 0))
452 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
453 if ((GDB_MULTI_ARCH
>= 1)
454 && (gdbarch
->long_double_bit
== 0))
455 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
456 /* Skip verify of ieee_float, invalid_p == 0 */
457 if ((GDB_MULTI_ARCH
>= 1)
458 && (gdbarch
->read_pc
== 0))
459 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
460 if ((GDB_MULTI_ARCH
>= 1)
461 && (gdbarch
->write_pc
== 0))
462 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
463 if ((GDB_MULTI_ARCH
>= 1)
464 && (gdbarch
->read_fp
== 0))
465 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
466 if ((GDB_MULTI_ARCH
>= 1)
467 && (gdbarch
->write_fp
== 0))
468 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
469 if ((GDB_MULTI_ARCH
>= 1)
470 && (gdbarch
->read_sp
== 0))
471 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
472 if ((GDB_MULTI_ARCH
>= 1)
473 && (gdbarch
->write_sp
== 0))
474 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
475 if ((GDB_MULTI_ARCH
>= 2)
476 && (gdbarch
->num_regs
== -1))
477 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
478 if ((GDB_MULTI_ARCH
>= 2)
479 && (gdbarch
->sp_regnum
== -1))
480 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
481 if ((GDB_MULTI_ARCH
>= 2)
482 && (gdbarch
->fp_regnum
== -1))
483 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
484 if ((GDB_MULTI_ARCH
>= 2)
485 && (gdbarch
->pc_regnum
== -1))
486 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
487 /* Skip verify of fp0_regnum, invalid_p == 0 */
488 /* Skip verify of npc_regnum, invalid_p == 0 */
489 /* Skip verify of nnpc_regnum, invalid_p == 0 */
490 /* Skip verify of register_name, invalid_p == 0 */
491 if ((GDB_MULTI_ARCH
>= 2)
492 && (gdbarch
->register_size
== -1))
493 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
494 if ((GDB_MULTI_ARCH
>= 2)
495 && (gdbarch
->register_bytes
== -1))
496 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
497 if ((GDB_MULTI_ARCH
>= 2)
498 && (gdbarch
->register_byte
== 0))
499 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
500 if ((GDB_MULTI_ARCH
>= 2)
501 && (gdbarch
->register_raw_size
== 0))
502 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
503 if ((GDB_MULTI_ARCH
>= 2)
504 && (gdbarch
->max_register_raw_size
== -1))
505 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
506 if ((GDB_MULTI_ARCH
>= 2)
507 && (gdbarch
->register_virtual_size
== 0))
508 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
509 if ((GDB_MULTI_ARCH
>= 2)
510 && (gdbarch
->max_register_virtual_size
== -1))
511 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
512 if ((GDB_MULTI_ARCH
>= 2)
513 && (gdbarch
->register_virtual_type
== 0))
514 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
515 if ((GDB_MULTI_ARCH
>= 1)
516 && (gdbarch
->use_generic_dummy_frames
== -1))
517 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
518 if ((GDB_MULTI_ARCH
>= 2)
519 && (gdbarch
->call_dummy_location
== 0))
520 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
521 if ((GDB_MULTI_ARCH
>= 2)
522 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
523 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
524 if ((GDB_MULTI_ARCH
>= 2)
525 && (gdbarch
->call_dummy_start_offset
== -1))
526 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
527 if ((GDB_MULTI_ARCH
>= 2)
528 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
529 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
530 if ((GDB_MULTI_ARCH
>= 1)
531 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
532 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
533 if ((GDB_MULTI_ARCH
>= 2)
534 && (gdbarch
->call_dummy_length
== -1))
535 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
536 if ((GDB_MULTI_ARCH
>= 2)
537 && (gdbarch
->pc_in_call_dummy
== 0))
538 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
539 if ((GDB_MULTI_ARCH
>= 1)
540 && (gdbarch
->call_dummy_p
== -1))
541 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
542 /* Skip verify of call_dummy_words, invalid_p == 0 */
543 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
544 if ((GDB_MULTI_ARCH
>= 1)
545 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
546 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
547 if ((GDB_MULTI_ARCH
>= 2)
548 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
549 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
550 if ((GDB_MULTI_ARCH
>= 2)
551 && (gdbarch
->fix_call_dummy
== 0))
552 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
553 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
554 if ((GDB_MULTI_ARCH
>= 1)
555 && (gdbarch
->get_saved_register
== 0))
556 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
557 /* Skip verify of register_convertible, invalid_p == 0 */
558 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
559 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
560 /* Skip verify of pointer_to_address, invalid_p == 0 */
561 /* Skip verify of address_to_pointer, invalid_p == 0 */
562 /* Skip verify of return_value_on_stack, invalid_p == 0 */
563 if ((GDB_MULTI_ARCH
>= 2)
564 && (gdbarch
->extract_return_value
== 0))
565 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
566 if ((GDB_MULTI_ARCH
>= 1)
567 && (gdbarch
->push_arguments
== 0))
568 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
569 if ((GDB_MULTI_ARCH
>= 2)
570 && (gdbarch
->push_dummy_frame
== 0))
571 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
572 if ((GDB_MULTI_ARCH
>= 1)
573 && (gdbarch
->push_return_address
== 0))
574 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
575 if ((GDB_MULTI_ARCH
>= 2)
576 && (gdbarch
->pop_frame
== 0))
577 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
578 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
579 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
580 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
581 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
582 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
583 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
584 if ((GDB_MULTI_ARCH
>= 2)
585 && (gdbarch
->store_struct_return
== 0))
586 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
587 if ((GDB_MULTI_ARCH
>= 2)
588 && (gdbarch
->store_return_value
== 0))
589 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
590 if ((GDB_MULTI_ARCH
>= 2)
591 && (gdbarch
->extract_struct_value_address
== 0))
592 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
593 if ((GDB_MULTI_ARCH
>= 2)
594 && (gdbarch
->use_struct_convention
== 0))
595 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
596 if ((GDB_MULTI_ARCH
>= 2)
597 && (gdbarch
->frame_init_saved_regs
== 0))
598 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
599 if ((GDB_MULTI_ARCH
>= 2)
600 && (gdbarch
->init_extra_frame_info
== 0))
601 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
602 if ((GDB_MULTI_ARCH
>= 2)
603 && (gdbarch
->skip_prologue
== 0))
604 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
605 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
606 if ((GDB_MULTI_ARCH
>= 2)
607 && (gdbarch
->inner_than
== 0))
608 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
609 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
610 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
611 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
612 if ((GDB_MULTI_ARCH
>= 2)
613 && (gdbarch
->decr_pc_after_break
== -1))
614 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
615 if ((GDB_MULTI_ARCH
>= 2)
616 && (gdbarch
->function_start_offset
== -1))
617 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
618 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
619 if ((GDB_MULTI_ARCH
>= 2)
620 && (gdbarch
->frame_args_skip
== -1))
621 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
622 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
623 if ((GDB_MULTI_ARCH
>= 2)
624 && (gdbarch
->frame_chain
== 0))
625 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
626 if ((GDB_MULTI_ARCH
>= 1)
627 && (gdbarch
->frame_chain_valid
== 0))
628 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
629 if ((GDB_MULTI_ARCH
>= 2)
630 && (gdbarch
->frame_saved_pc
== 0))
631 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
632 if ((GDB_MULTI_ARCH
>= 2)
633 && (gdbarch
->frame_args_address
== 0))
634 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
635 if ((GDB_MULTI_ARCH
>= 2)
636 && (gdbarch
->frame_locals_address
== 0))
637 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
638 if ((GDB_MULTI_ARCH
>= 2)
639 && (gdbarch
->saved_pc_after_call
== 0))
640 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
641 if ((GDB_MULTI_ARCH
>= 2)
642 && (gdbarch
->frame_num_args
== 0))
643 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
644 /* Skip verify of stack_align, has predicate */
645 /* Skip verify of reg_struct_has_addr, has predicate */
646 /* Skip verify of save_dummy_frame_tos, has predicate */
647 if (gdbarch
->float_format
== 0)
648 gdbarch
->float_format
= default_float_format (gdbarch
);
649 if (gdbarch
->double_format
== 0)
650 gdbarch
->double_format
= default_double_format (gdbarch
);
651 if (gdbarch
->long_double_format
== 0)
652 gdbarch
->long_double_format
= &floatformat_unknown
;
656 /* Print out the details of the current architecture. */
661 #ifdef TARGET_ARCHITECTURE
662 if (TARGET_ARCHITECTURE
!= NULL
)
663 fprintf_unfiltered (gdb_stdlog
,
664 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
665 TARGET_ARCHITECTURE
->printable_name
);
667 #ifdef TARGET_BYTE_ORDER
668 fprintf_unfiltered (gdb_stdlog
,
669 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
670 (long) TARGET_BYTE_ORDER
);
672 #ifdef TARGET_BFD_VMA_BIT
673 fprintf_unfiltered (gdb_stdlog
,
674 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
675 (long) TARGET_BFD_VMA_BIT
);
677 #ifdef TARGET_PTR_BIT
678 fprintf_unfiltered (gdb_stdlog
,
679 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
680 (long) TARGET_PTR_BIT
);
682 #ifdef TARGET_SHORT_BIT
683 fprintf_unfiltered (gdb_stdlog
,
684 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
685 (long) TARGET_SHORT_BIT
);
687 #ifdef TARGET_INT_BIT
688 fprintf_unfiltered (gdb_stdlog
,
689 "gdbarch_update: TARGET_INT_BIT = %ld\n",
690 (long) TARGET_INT_BIT
);
692 #ifdef TARGET_LONG_BIT
693 fprintf_unfiltered (gdb_stdlog
,
694 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
695 (long) TARGET_LONG_BIT
);
697 #ifdef TARGET_LONG_LONG_BIT
698 fprintf_unfiltered (gdb_stdlog
,
699 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
700 (long) TARGET_LONG_LONG_BIT
);
702 #ifdef TARGET_FLOAT_BIT
703 fprintf_unfiltered (gdb_stdlog
,
704 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
705 (long) TARGET_FLOAT_BIT
);
707 #ifdef TARGET_DOUBLE_BIT
708 fprintf_unfiltered (gdb_stdlog
,
709 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
710 (long) TARGET_DOUBLE_BIT
);
712 #ifdef TARGET_LONG_DOUBLE_BIT
713 fprintf_unfiltered (gdb_stdlog
,
714 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
715 (long) TARGET_LONG_DOUBLE_BIT
);
718 fprintf_unfiltered (gdb_stdlog
,
719 "gdbarch_update: IEEE_FLOAT = %ld\n",
722 #ifdef TARGET_READ_PC
723 fprintf_unfiltered (gdb_stdlog
,
724 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
725 (long) current_gdbarch
->read_pc
726 /*TARGET_READ_PC ()*/);
728 #ifdef TARGET_WRITE_PC
729 fprintf_unfiltered (gdb_stdlog
,
730 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
731 (long) current_gdbarch
->write_pc
732 /*TARGET_WRITE_PC ()*/);
734 #ifdef TARGET_READ_FP
735 fprintf_unfiltered (gdb_stdlog
,
736 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
737 (long) current_gdbarch
->read_fp
738 /*TARGET_READ_FP ()*/);
740 #ifdef TARGET_WRITE_FP
741 fprintf_unfiltered (gdb_stdlog
,
742 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
743 (long) current_gdbarch
->write_fp
744 /*TARGET_WRITE_FP ()*/);
746 #ifdef TARGET_READ_SP
747 fprintf_unfiltered (gdb_stdlog
,
748 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
749 (long) current_gdbarch
->read_sp
750 /*TARGET_READ_SP ()*/);
752 #ifdef TARGET_WRITE_SP
753 fprintf_unfiltered (gdb_stdlog
,
754 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
755 (long) current_gdbarch
->write_sp
756 /*TARGET_WRITE_SP ()*/);
759 fprintf_unfiltered (gdb_stdlog
,
760 "gdbarch_update: NUM_REGS = %ld\n",
764 fprintf_unfiltered (gdb_stdlog
,
765 "gdbarch_update: SP_REGNUM = %ld\n",
769 fprintf_unfiltered (gdb_stdlog
,
770 "gdbarch_update: FP_REGNUM = %ld\n",
774 fprintf_unfiltered (gdb_stdlog
,
775 "gdbarch_update: PC_REGNUM = %ld\n",
779 fprintf_unfiltered (gdb_stdlog
,
780 "gdbarch_update: FP0_REGNUM = %ld\n",
784 fprintf_unfiltered (gdb_stdlog
,
785 "gdbarch_update: NPC_REGNUM = %ld\n",
789 fprintf_unfiltered (gdb_stdlog
,
790 "gdbarch_update: NNPC_REGNUM = %ld\n",
794 fprintf_unfiltered (gdb_stdlog
,
795 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
796 (long) current_gdbarch
->register_name
797 /*REGISTER_NAME ()*/);
800 fprintf_unfiltered (gdb_stdlog
,
801 "gdbarch_update: REGISTER_SIZE = %ld\n",
802 (long) REGISTER_SIZE
);
804 #ifdef REGISTER_BYTES
805 fprintf_unfiltered (gdb_stdlog
,
806 "gdbarch_update: REGISTER_BYTES = %ld\n",
807 (long) REGISTER_BYTES
);
810 fprintf_unfiltered (gdb_stdlog
,
811 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
812 (long) current_gdbarch
->register_byte
813 /*REGISTER_BYTE ()*/);
815 #ifdef REGISTER_RAW_SIZE
816 fprintf_unfiltered (gdb_stdlog
,
817 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
818 (long) current_gdbarch
->register_raw_size
819 /*REGISTER_RAW_SIZE ()*/);
821 #ifdef MAX_REGISTER_RAW_SIZE
822 fprintf_unfiltered (gdb_stdlog
,
823 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
824 (long) MAX_REGISTER_RAW_SIZE
);
826 #ifdef REGISTER_VIRTUAL_SIZE
827 fprintf_unfiltered (gdb_stdlog
,
828 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
829 (long) current_gdbarch
->register_virtual_size
830 /*REGISTER_VIRTUAL_SIZE ()*/);
832 #ifdef MAX_REGISTER_VIRTUAL_SIZE
833 fprintf_unfiltered (gdb_stdlog
,
834 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
835 (long) MAX_REGISTER_VIRTUAL_SIZE
);
837 #ifdef REGISTER_VIRTUAL_TYPE
838 fprintf_unfiltered (gdb_stdlog
,
839 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
840 (long) current_gdbarch
->register_virtual_type
841 /*REGISTER_VIRTUAL_TYPE ()*/);
843 #ifdef USE_GENERIC_DUMMY_FRAMES
844 fprintf_unfiltered (gdb_stdlog
,
845 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
846 (long) USE_GENERIC_DUMMY_FRAMES
);
848 #ifdef CALL_DUMMY_LOCATION
849 fprintf_unfiltered (gdb_stdlog
,
850 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
851 (long) CALL_DUMMY_LOCATION
);
853 #ifdef CALL_DUMMY_ADDRESS
854 fprintf_unfiltered (gdb_stdlog
,
855 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
856 (long) current_gdbarch
->call_dummy_address
857 /*CALL_DUMMY_ADDRESS ()*/);
859 #ifdef CALL_DUMMY_START_OFFSET
860 fprintf_unfiltered (gdb_stdlog
,
861 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
862 (long) CALL_DUMMY_START_OFFSET
);
864 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
865 fprintf_unfiltered (gdb_stdlog
,
866 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
867 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
869 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
870 fprintf_unfiltered (gdb_stdlog
,
871 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
872 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
874 #ifdef CALL_DUMMY_LENGTH
875 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
876 fprintf_unfiltered (gdb_stdlog
,
877 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
878 (long) CALL_DUMMY_LENGTH
);
880 #ifdef PC_IN_CALL_DUMMY
881 fprintf_unfiltered (gdb_stdlog
,
882 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
883 (long) current_gdbarch
->pc_in_call_dummy
884 /*PC_IN_CALL_DUMMY ()*/);
887 fprintf_unfiltered (gdb_stdlog
,
888 "gdbarch_update: CALL_DUMMY_P = %ld\n",
889 (long) CALL_DUMMY_P
);
891 #ifdef CALL_DUMMY_WORDS
892 fprintf_unfiltered (gdb_stdlog
,
893 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
894 (long) CALL_DUMMY_WORDS
);
896 #ifdef SIZEOF_CALL_DUMMY_WORDS
897 fprintf_unfiltered (gdb_stdlog
,
898 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
899 (long) SIZEOF_CALL_DUMMY_WORDS
);
901 #ifdef CALL_DUMMY_STACK_ADJUST_P
902 fprintf_unfiltered (gdb_stdlog
,
903 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
904 (long) CALL_DUMMY_STACK_ADJUST_P
);
906 #ifdef CALL_DUMMY_STACK_ADJUST
907 if (CALL_DUMMY_STACK_ADJUST_P
)
908 fprintf_unfiltered (gdb_stdlog
,
909 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
910 (long) CALL_DUMMY_STACK_ADJUST
);
912 #ifdef FIX_CALL_DUMMY
913 fprintf_unfiltered (gdb_stdlog
,
914 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
915 (long) current_gdbarch
->fix_call_dummy
916 /*FIX_CALL_DUMMY ()*/);
918 #ifdef BELIEVE_PCC_PROMOTION
919 fprintf_unfiltered (gdb_stdlog
,
920 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
921 (long) BELIEVE_PCC_PROMOTION
);
923 #ifdef BELIEVE_PCC_PROMOTION_TYPE
924 fprintf_unfiltered (gdb_stdlog
,
925 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
926 (long) BELIEVE_PCC_PROMOTION_TYPE
);
928 #ifdef COERCE_FLOAT_TO_DOUBLE
929 fprintf_unfiltered (gdb_stdlog
,
930 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
931 (long) current_gdbarch
->coerce_float_to_double
932 /*COERCE_FLOAT_TO_DOUBLE ()*/);
934 #ifdef GET_SAVED_REGISTER
935 fprintf_unfiltered (gdb_stdlog
,
936 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
937 (long) current_gdbarch
->get_saved_register
938 /*GET_SAVED_REGISTER ()*/);
940 #ifdef REGISTER_CONVERTIBLE
941 fprintf_unfiltered (gdb_stdlog
,
942 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
943 (long) current_gdbarch
->register_convertible
944 /*REGISTER_CONVERTIBLE ()*/);
946 #ifdef REGISTER_CONVERT_TO_VIRTUAL
947 fprintf_unfiltered (gdb_stdlog
,
948 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
949 (long) current_gdbarch
->register_convert_to_virtual
950 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
952 #ifdef REGISTER_CONVERT_TO_RAW
953 fprintf_unfiltered (gdb_stdlog
,
954 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
955 (long) current_gdbarch
->register_convert_to_raw
956 /*REGISTER_CONVERT_TO_RAW ()*/);
958 #ifdef POINTER_TO_ADDRESS
959 fprintf_unfiltered (gdb_stdlog
,
960 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
961 (long) current_gdbarch
->pointer_to_address
962 /*POINTER_TO_ADDRESS ()*/);
964 #ifdef ADDRESS_TO_POINTER
965 fprintf_unfiltered (gdb_stdlog
,
966 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
967 (long) current_gdbarch
->address_to_pointer
968 /*ADDRESS_TO_POINTER ()*/);
970 #ifdef RETURN_VALUE_ON_STACK
971 fprintf_unfiltered (gdb_stdlog
,
972 "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n",
973 (long) current_gdbarch
->return_value_on_stack
974 /*RETURN_VALUE_ON_STACK ()*/);
976 #ifdef EXTRACT_RETURN_VALUE
977 fprintf_unfiltered (gdb_stdlog
,
978 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
979 (long) current_gdbarch
->extract_return_value
980 /*EXTRACT_RETURN_VALUE ()*/);
982 #ifdef PUSH_ARGUMENTS
983 fprintf_unfiltered (gdb_stdlog
,
984 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
985 (long) current_gdbarch
->push_arguments
986 /*PUSH_ARGUMENTS ()*/);
988 #ifdef PUSH_DUMMY_FRAME
989 fprintf_unfiltered (gdb_stdlog
,
990 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
991 (long) current_gdbarch
->push_dummy_frame
992 /*PUSH_DUMMY_FRAME ()*/);
994 #ifdef PUSH_RETURN_ADDRESS
995 fprintf_unfiltered (gdb_stdlog
,
996 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
997 (long) current_gdbarch
->push_return_address
998 /*PUSH_RETURN_ADDRESS ()*/);
1001 fprintf_unfiltered (gdb_stdlog
,
1002 "gdbarch_update: POP_FRAME = 0x%08lx\n",
1003 (long) current_gdbarch
->pop_frame
1006 #ifdef D10V_MAKE_DADDR
1007 fprintf_unfiltered (gdb_stdlog
,
1008 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
1009 (long) current_gdbarch
->d10v_make_daddr
1010 /*D10V_MAKE_DADDR ()*/);
1012 #ifdef D10V_MAKE_IADDR
1013 fprintf_unfiltered (gdb_stdlog
,
1014 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
1015 (long) current_gdbarch
->d10v_make_iaddr
1016 /*D10V_MAKE_IADDR ()*/);
1019 fprintf_unfiltered (gdb_stdlog
,
1020 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
1021 (long) current_gdbarch
->d10v_daddr_p
1022 /*D10V_DADDR_P ()*/);
1025 fprintf_unfiltered (gdb_stdlog
,
1026 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
1027 (long) current_gdbarch
->d10v_iaddr_p
1028 /*D10V_IADDR_P ()*/);
1030 #ifdef D10V_CONVERT_DADDR_TO_RAW
1031 fprintf_unfiltered (gdb_stdlog
,
1032 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1033 (long) current_gdbarch
->d10v_convert_daddr_to_raw
1034 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
1036 #ifdef D10V_CONVERT_IADDR_TO_RAW
1037 fprintf_unfiltered (gdb_stdlog
,
1038 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1039 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
1040 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
1042 #ifdef STORE_STRUCT_RETURN
1043 fprintf_unfiltered (gdb_stdlog
,
1044 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
1045 (long) current_gdbarch
->store_struct_return
1046 /*STORE_STRUCT_RETURN ()*/);
1048 #ifdef STORE_RETURN_VALUE
1049 fprintf_unfiltered (gdb_stdlog
,
1050 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
1051 (long) current_gdbarch
->store_return_value
1052 /*STORE_RETURN_VALUE ()*/);
1054 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1055 fprintf_unfiltered (gdb_stdlog
,
1056 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1057 (long) current_gdbarch
->extract_struct_value_address
1058 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1060 #ifdef USE_STRUCT_CONVENTION
1061 fprintf_unfiltered (gdb_stdlog
,
1062 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
1063 (long) current_gdbarch
->use_struct_convention
1064 /*USE_STRUCT_CONVENTION ()*/);
1066 #ifdef FRAME_INIT_SAVED_REGS
1067 fprintf_unfiltered (gdb_stdlog
,
1068 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1069 (long) current_gdbarch
->frame_init_saved_regs
1070 /*FRAME_INIT_SAVED_REGS ()*/);
1072 #ifdef INIT_EXTRA_FRAME_INFO
1073 fprintf_unfiltered (gdb_stdlog
,
1074 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1075 (long) current_gdbarch
->init_extra_frame_info
1076 /*INIT_EXTRA_FRAME_INFO ()*/);
1078 #ifdef SKIP_PROLOGUE
1079 fprintf_unfiltered (gdb_stdlog
,
1080 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
1081 (long) current_gdbarch
->skip_prologue
1082 /*SKIP_PROLOGUE ()*/);
1084 #ifdef PROLOGUE_FRAMELESS_P
1085 fprintf_unfiltered (gdb_stdlog
,
1086 "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1087 (long) current_gdbarch
->prologue_frameless_p
1088 /*PROLOGUE_FRAMELESS_P ()*/);
1091 fprintf_unfiltered (gdb_stdlog
,
1092 "gdbarch_update: INNER_THAN = 0x%08lx\n",
1093 (long) current_gdbarch
->inner_than
1096 #ifdef BREAKPOINT_FROM_PC
1097 fprintf_unfiltered (gdb_stdlog
,
1098 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
1099 (long) current_gdbarch
->breakpoint_from_pc
1100 /*BREAKPOINT_FROM_PC ()*/);
1102 #ifdef MEMORY_INSERT_BREAKPOINT
1103 fprintf_unfiltered (gdb_stdlog
,
1104 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1105 (long) current_gdbarch
->memory_insert_breakpoint
1106 /*MEMORY_INSERT_BREAKPOINT ()*/);
1108 #ifdef MEMORY_REMOVE_BREAKPOINT
1109 fprintf_unfiltered (gdb_stdlog
,
1110 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1111 (long) current_gdbarch
->memory_remove_breakpoint
1112 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1114 #ifdef DECR_PC_AFTER_BREAK
1115 fprintf_unfiltered (gdb_stdlog
,
1116 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
1117 (long) DECR_PC_AFTER_BREAK
);
1119 #ifdef FUNCTION_START_OFFSET
1120 fprintf_unfiltered (gdb_stdlog
,
1121 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
1122 (long) FUNCTION_START_OFFSET
);
1124 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1125 fprintf_unfiltered (gdb_stdlog
,
1126 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1127 (long) current_gdbarch
->remote_translate_xfer_address
1128 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1130 #ifdef FRAME_ARGS_SKIP
1131 fprintf_unfiltered (gdb_stdlog
,
1132 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
1133 (long) FRAME_ARGS_SKIP
);
1135 #ifdef FRAMELESS_FUNCTION_INVOCATION
1136 fprintf_unfiltered (gdb_stdlog
,
1137 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1138 (long) current_gdbarch
->frameless_function_invocation
1139 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1142 fprintf_unfiltered (gdb_stdlog
,
1143 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
1144 (long) current_gdbarch
->frame_chain
1145 /*FRAME_CHAIN ()*/);
1147 #ifdef FRAME_CHAIN_VALID
1148 fprintf_unfiltered (gdb_stdlog
,
1149 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
1150 (long) current_gdbarch
->frame_chain_valid
1151 /*FRAME_CHAIN_VALID ()*/);
1153 #ifdef FRAME_SAVED_PC
1154 fprintf_unfiltered (gdb_stdlog
,
1155 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
1156 (long) current_gdbarch
->frame_saved_pc
1157 /*FRAME_SAVED_PC ()*/);
1159 #ifdef FRAME_ARGS_ADDRESS
1160 fprintf_unfiltered (gdb_stdlog
,
1161 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1162 (long) current_gdbarch
->frame_args_address
1163 /*FRAME_ARGS_ADDRESS ()*/);
1165 #ifdef FRAME_LOCALS_ADDRESS
1166 fprintf_unfiltered (gdb_stdlog
,
1167 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1168 (long) current_gdbarch
->frame_locals_address
1169 /*FRAME_LOCALS_ADDRESS ()*/);
1171 #ifdef SAVED_PC_AFTER_CALL
1172 fprintf_unfiltered (gdb_stdlog
,
1173 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1174 (long) current_gdbarch
->saved_pc_after_call
1175 /*SAVED_PC_AFTER_CALL ()*/);
1177 #ifdef FRAME_NUM_ARGS
1178 fprintf_unfiltered (gdb_stdlog
,
1179 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
1180 (long) current_gdbarch
->frame_num_args
1181 /*FRAME_NUM_ARGS ()*/);
1184 fprintf_unfiltered (gdb_stdlog
,
1185 "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
1186 (long) current_gdbarch
->stack_align
1187 /*STACK_ALIGN ()*/);
1189 #ifdef REG_STRUCT_HAS_ADDR
1190 fprintf_unfiltered (gdb_stdlog
,
1191 "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1192 (long) current_gdbarch
->reg_struct_has_addr
1193 /*REG_STRUCT_HAS_ADDR ()*/);
1195 #ifdef SAVE_DUMMY_FRAME_TOS
1196 fprintf_unfiltered (gdb_stdlog
,
1197 "gdbarch_update: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
1198 (long) current_gdbarch
->save_dummy_frame_tos
1199 /*SAVE_DUMMY_FRAME_TOS ()*/);
1201 #ifdef TARGET_FLOAT_FORMAT
1202 fprintf_unfiltered (gdb_stdlog
,
1203 "gdbarch_update: TARGET_FLOAT_FORMAT = %ld\n",
1204 (long) TARGET_FLOAT_FORMAT
);
1206 #ifdef TARGET_DOUBLE_FORMAT
1207 fprintf_unfiltered (gdb_stdlog
,
1208 "gdbarch_update: TARGET_DOUBLE_FORMAT = %ld\n",
1209 (long) TARGET_DOUBLE_FORMAT
);
1211 #ifdef TARGET_LONG_DOUBLE_FORMAT
1212 fprintf_unfiltered (gdb_stdlog
,
1213 "gdbarch_update: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
1214 (long) TARGET_LONG_DOUBLE_FORMAT
);
1216 fprintf_unfiltered (gdb_stdlog
,
1217 "gdbarch_update: GDB_MULTI_ARCH = %d\n",
1221 struct gdbarch_tdep
*
1222 gdbarch_tdep (struct gdbarch
*gdbarch
)
1224 if (gdbarch_debug
>= 2)
1225 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1226 return gdbarch
->tdep
;
1230 const struct bfd_arch_info
*
1231 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1233 if (gdbarch_debug
>= 2)
1234 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1235 return gdbarch
->bfd_arch_info
;
1239 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1241 if (gdbarch_debug
>= 2)
1242 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1243 return gdbarch
->byte_order
;
1247 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1249 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1250 if (gdbarch_debug
>= 2)
1251 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1252 return gdbarch
->bfd_vma_bit
;
1256 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1259 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1263 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1265 if (gdbarch
->ptr_bit
== 0)
1266 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1267 if (gdbarch_debug
>= 2)
1268 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1269 return gdbarch
->ptr_bit
;
1273 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1276 gdbarch
->ptr_bit
= ptr_bit
;
1280 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1282 if (gdbarch
->short_bit
== 0)
1283 internal_error ("gdbarch: gdbarch_short_bit invalid");
1284 if (gdbarch_debug
>= 2)
1285 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1286 return gdbarch
->short_bit
;
1290 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1293 gdbarch
->short_bit
= short_bit
;
1297 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1299 if (gdbarch
->int_bit
== 0)
1300 internal_error ("gdbarch: gdbarch_int_bit invalid");
1301 if (gdbarch_debug
>= 2)
1302 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1303 return gdbarch
->int_bit
;
1307 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1310 gdbarch
->int_bit
= int_bit
;
1314 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1316 if (gdbarch
->long_bit
== 0)
1317 internal_error ("gdbarch: gdbarch_long_bit invalid");
1318 if (gdbarch_debug
>= 2)
1319 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1320 return gdbarch
->long_bit
;
1324 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1327 gdbarch
->long_bit
= long_bit
;
1331 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1333 if (gdbarch
->long_long_bit
== 0)
1334 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1335 if (gdbarch_debug
>= 2)
1336 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1337 return gdbarch
->long_long_bit
;
1341 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1344 gdbarch
->long_long_bit
= long_long_bit
;
1348 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1350 if (gdbarch
->float_bit
== 0)
1351 internal_error ("gdbarch: gdbarch_float_bit invalid");
1352 if (gdbarch_debug
>= 2)
1353 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1354 return gdbarch
->float_bit
;
1358 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1361 gdbarch
->float_bit
= float_bit
;
1365 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1367 if (gdbarch
->double_bit
== 0)
1368 internal_error ("gdbarch: gdbarch_double_bit invalid");
1369 if (gdbarch_debug
>= 2)
1370 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1371 return gdbarch
->double_bit
;
1375 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1378 gdbarch
->double_bit
= double_bit
;
1382 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1384 if (gdbarch
->long_double_bit
== 0)
1385 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1386 if (gdbarch_debug
>= 2)
1387 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1388 return gdbarch
->long_double_bit
;
1392 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1393 int long_double_bit
)
1395 gdbarch
->long_double_bit
= long_double_bit
;
1399 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1401 /* Skip verify of ieee_float, invalid_p == 0 */
1402 if (gdbarch_debug
>= 2)
1403 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1404 return gdbarch
->ieee_float
;
1408 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1411 gdbarch
->ieee_float
= ieee_float
;
1415 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1417 if (gdbarch
->read_pc
== 0)
1418 internal_error ("gdbarch: gdbarch_read_pc invalid");
1419 if (gdbarch_debug
>= 2)
1420 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1421 return gdbarch
->read_pc (pid
);
1425 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1426 gdbarch_read_pc_ftype read_pc
)
1428 gdbarch
->read_pc
= read_pc
;
1432 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1434 if (gdbarch
->write_pc
== 0)
1435 internal_error ("gdbarch: gdbarch_write_pc invalid");
1436 if (gdbarch_debug
>= 2)
1437 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1438 gdbarch
->write_pc (val
, pid
);
1442 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1443 gdbarch_write_pc_ftype write_pc
)
1445 gdbarch
->write_pc
= write_pc
;
1449 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1451 if (gdbarch
->read_fp
== 0)
1452 internal_error ("gdbarch: gdbarch_read_fp invalid");
1453 if (gdbarch_debug
>= 2)
1454 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1455 return gdbarch
->read_fp ();
1459 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1460 gdbarch_read_fp_ftype read_fp
)
1462 gdbarch
->read_fp
= read_fp
;
1466 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1468 if (gdbarch
->write_fp
== 0)
1469 internal_error ("gdbarch: gdbarch_write_fp invalid");
1470 if (gdbarch_debug
>= 2)
1471 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1472 gdbarch
->write_fp (val
);
1476 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1477 gdbarch_write_fp_ftype write_fp
)
1479 gdbarch
->write_fp
= write_fp
;
1483 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1485 if (gdbarch
->read_sp
== 0)
1486 internal_error ("gdbarch: gdbarch_read_sp invalid");
1487 if (gdbarch_debug
>= 2)
1488 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1489 return gdbarch
->read_sp ();
1493 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1494 gdbarch_read_sp_ftype read_sp
)
1496 gdbarch
->read_sp
= read_sp
;
1500 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1502 if (gdbarch
->write_sp
== 0)
1503 internal_error ("gdbarch: gdbarch_write_sp invalid");
1504 if (gdbarch_debug
>= 2)
1505 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1506 gdbarch
->write_sp (val
);
1510 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1511 gdbarch_write_sp_ftype write_sp
)
1513 gdbarch
->write_sp
= write_sp
;
1517 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1519 if (gdbarch
->num_regs
== -1)
1520 internal_error ("gdbarch: gdbarch_num_regs invalid");
1521 if (gdbarch_debug
>= 2)
1522 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1523 return gdbarch
->num_regs
;
1527 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1530 gdbarch
->num_regs
= num_regs
;
1534 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1536 if (gdbarch
->sp_regnum
== -1)
1537 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1538 if (gdbarch_debug
>= 2)
1539 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1540 return gdbarch
->sp_regnum
;
1544 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1547 gdbarch
->sp_regnum
= sp_regnum
;
1551 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1553 if (gdbarch
->fp_regnum
== -1)
1554 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1555 if (gdbarch_debug
>= 2)
1556 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1557 return gdbarch
->fp_regnum
;
1561 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1564 gdbarch
->fp_regnum
= fp_regnum
;
1568 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1570 if (gdbarch
->pc_regnum
== -1)
1571 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1572 if (gdbarch_debug
>= 2)
1573 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1574 return gdbarch
->pc_regnum
;
1578 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1581 gdbarch
->pc_regnum
= pc_regnum
;
1585 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1587 /* Skip verify of fp0_regnum, invalid_p == 0 */
1588 if (gdbarch_debug
>= 2)
1589 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1590 return gdbarch
->fp0_regnum
;
1594 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1597 gdbarch
->fp0_regnum
= fp0_regnum
;
1601 gdbarch_npc_regnum (struct gdbarch
*gdbarch
)
1603 /* Skip verify of npc_regnum, invalid_p == 0 */
1604 if (gdbarch_debug
>= 2)
1605 fprintf_unfiltered (gdb_stdlog
, "gdbarch_npc_regnum called\n");
1606 return gdbarch
->npc_regnum
;
1610 set_gdbarch_npc_regnum (struct gdbarch
*gdbarch
,
1613 gdbarch
->npc_regnum
= npc_regnum
;
1617 gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
)
1619 /* Skip verify of nnpc_regnum, invalid_p == 0 */
1620 if (gdbarch_debug
>= 2)
1621 fprintf_unfiltered (gdb_stdlog
, "gdbarch_nnpc_regnum called\n");
1622 return gdbarch
->nnpc_regnum
;
1626 set_gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
,
1629 gdbarch
->nnpc_regnum
= nnpc_regnum
;
1633 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1635 if (gdbarch
->register_name
== 0)
1636 internal_error ("gdbarch: gdbarch_register_name invalid");
1637 if (gdbarch_debug
>= 2)
1638 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1639 return gdbarch
->register_name (regnr
);
1643 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1644 gdbarch_register_name_ftype register_name
)
1646 gdbarch
->register_name
= register_name
;
1650 gdbarch_register_size (struct gdbarch
*gdbarch
)
1652 if (gdbarch
->register_size
== -1)
1653 internal_error ("gdbarch: gdbarch_register_size invalid");
1654 if (gdbarch_debug
>= 2)
1655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1656 return gdbarch
->register_size
;
1660 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1663 gdbarch
->register_size
= register_size
;
1667 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1669 if (gdbarch
->register_bytes
== -1)
1670 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1671 if (gdbarch_debug
>= 2)
1672 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1673 return gdbarch
->register_bytes
;
1677 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1680 gdbarch
->register_bytes
= register_bytes
;
1684 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1686 if (gdbarch
->register_byte
== 0)
1687 internal_error ("gdbarch: gdbarch_register_byte invalid");
1688 if (gdbarch_debug
>= 2)
1689 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1690 return gdbarch
->register_byte (reg_nr
);
1694 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1695 gdbarch_register_byte_ftype register_byte
)
1697 gdbarch
->register_byte
= register_byte
;
1701 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1703 if (gdbarch
->register_raw_size
== 0)
1704 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1705 if (gdbarch_debug
>= 2)
1706 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1707 return gdbarch
->register_raw_size (reg_nr
);
1711 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1712 gdbarch_register_raw_size_ftype register_raw_size
)
1714 gdbarch
->register_raw_size
= register_raw_size
;
1718 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1720 if (gdbarch
->max_register_raw_size
== -1)
1721 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1722 if (gdbarch_debug
>= 2)
1723 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1724 return gdbarch
->max_register_raw_size
;
1728 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1729 int max_register_raw_size
)
1731 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1735 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1737 if (gdbarch
->register_virtual_size
== 0)
1738 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1739 if (gdbarch_debug
>= 2)
1740 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1741 return gdbarch
->register_virtual_size (reg_nr
);
1745 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1746 gdbarch_register_virtual_size_ftype register_virtual_size
)
1748 gdbarch
->register_virtual_size
= register_virtual_size
;
1752 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1754 if (gdbarch
->max_register_virtual_size
== -1)
1755 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1756 if (gdbarch_debug
>= 2)
1757 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1758 return gdbarch
->max_register_virtual_size
;
1762 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1763 int max_register_virtual_size
)
1765 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1769 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1771 if (gdbarch
->register_virtual_type
== 0)
1772 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1773 if (gdbarch_debug
>= 2)
1774 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1775 return gdbarch
->register_virtual_type (reg_nr
);
1779 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1780 gdbarch_register_virtual_type_ftype register_virtual_type
)
1782 gdbarch
->register_virtual_type
= register_virtual_type
;
1786 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1788 if (gdbarch
->use_generic_dummy_frames
== -1)
1789 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1790 if (gdbarch_debug
>= 2)
1791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1792 return gdbarch
->use_generic_dummy_frames
;
1796 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1797 int use_generic_dummy_frames
)
1799 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1803 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1805 if (gdbarch
->call_dummy_location
== 0)
1806 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1807 if (gdbarch_debug
>= 2)
1808 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1809 return gdbarch
->call_dummy_location
;
1813 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1814 int call_dummy_location
)
1816 gdbarch
->call_dummy_location
= call_dummy_location
;
1820 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1822 if (gdbarch
->call_dummy_address
== 0)
1823 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1824 if (gdbarch_debug
>= 2)
1825 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1826 return gdbarch
->call_dummy_address ();
1830 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1831 gdbarch_call_dummy_address_ftype call_dummy_address
)
1833 gdbarch
->call_dummy_address
= call_dummy_address
;
1837 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1839 if (gdbarch
->call_dummy_start_offset
== -1)
1840 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1841 if (gdbarch_debug
>= 2)
1842 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1843 return gdbarch
->call_dummy_start_offset
;
1847 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1848 CORE_ADDR call_dummy_start_offset
)
1850 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1854 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1856 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1857 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1858 if (gdbarch_debug
>= 2)
1859 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1860 return gdbarch
->call_dummy_breakpoint_offset
;
1864 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1865 CORE_ADDR call_dummy_breakpoint_offset
)
1867 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1871 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1873 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1874 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1875 if (gdbarch_debug
>= 2)
1876 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1877 return gdbarch
->call_dummy_breakpoint_offset_p
;
1881 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1882 int call_dummy_breakpoint_offset_p
)
1884 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1888 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1890 if (gdbarch
->call_dummy_length
== -1)
1891 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1892 if (gdbarch_debug
>= 2)
1893 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1894 return gdbarch
->call_dummy_length
;
1898 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1899 int call_dummy_length
)
1901 gdbarch
->call_dummy_length
= call_dummy_length
;
1905 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1907 if (gdbarch
->pc_in_call_dummy
== 0)
1908 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1909 if (gdbarch_debug
>= 2)
1910 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1911 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1915 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1916 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1918 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1922 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1924 if (gdbarch
->call_dummy_p
== -1)
1925 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1926 if (gdbarch_debug
>= 2)
1927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1928 return gdbarch
->call_dummy_p
;
1932 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1935 gdbarch
->call_dummy_p
= call_dummy_p
;
1939 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1941 /* Skip verify of call_dummy_words, invalid_p == 0 */
1942 if (gdbarch_debug
>= 2)
1943 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1944 return gdbarch
->call_dummy_words
;
1948 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1949 LONGEST
* call_dummy_words
)
1951 gdbarch
->call_dummy_words
= call_dummy_words
;
1955 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1957 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1958 if (gdbarch_debug
>= 2)
1959 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1960 return gdbarch
->sizeof_call_dummy_words
;
1964 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1965 int sizeof_call_dummy_words
)
1967 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1971 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1973 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1974 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1975 if (gdbarch_debug
>= 2)
1976 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1977 return gdbarch
->call_dummy_stack_adjust_p
;
1981 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1982 int call_dummy_stack_adjust_p
)
1984 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1988 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1990 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1991 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1992 if (gdbarch_debug
>= 2)
1993 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1994 return gdbarch
->call_dummy_stack_adjust
;
1998 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1999 int call_dummy_stack_adjust
)
2001 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
2005 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
)
2007 if (gdbarch
->fix_call_dummy
== 0)
2008 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
2009 if (gdbarch_debug
>= 2)
2010 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
2011 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
2015 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
2016 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
2018 gdbarch
->fix_call_dummy
= fix_call_dummy
;
2022 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2024 if (gdbarch_debug
>= 2)
2025 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2026 return gdbarch
->believe_pcc_promotion
;
2030 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2031 int believe_pcc_promotion
)
2033 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2037 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
2039 if (gdbarch_debug
>= 2)
2040 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
2041 return gdbarch
->believe_pcc_promotion_type
;
2045 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
2046 int believe_pcc_promotion_type
)
2048 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
2052 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
2054 if (gdbarch
->coerce_float_to_double
== 0)
2055 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
2056 if (gdbarch_debug
>= 2)
2057 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
2058 return gdbarch
->coerce_float_to_double (formal
, actual
);
2062 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
2063 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
2065 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
2069 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
)
2071 if (gdbarch
->get_saved_register
== 0)
2072 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
2073 if (gdbarch_debug
>= 2)
2074 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
2075 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
2079 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
2080 gdbarch_get_saved_register_ftype get_saved_register
)
2082 gdbarch
->get_saved_register
= get_saved_register
;
2086 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
2088 if (gdbarch
->register_convertible
== 0)
2089 internal_error ("gdbarch: gdbarch_register_convertible invalid");
2090 if (gdbarch_debug
>= 2)
2091 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
2092 return gdbarch
->register_convertible (nr
);
2096 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
2097 gdbarch_register_convertible_ftype register_convertible
)
2099 gdbarch
->register_convertible
= register_convertible
;
2103 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
2105 if (gdbarch
->register_convert_to_virtual
== 0)
2106 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
2107 if (gdbarch_debug
>= 2)
2108 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
2109 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
2113 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
2114 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
2116 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
2120 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
2122 if (gdbarch
->register_convert_to_raw
== 0)
2123 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
2124 if (gdbarch_debug
>= 2)
2125 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
2126 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
2130 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
2131 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
2133 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
2137 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
)
2139 if (gdbarch
->pointer_to_address
== 0)
2140 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
2141 if (gdbarch_debug
>= 2)
2142 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2143 return gdbarch
->pointer_to_address (type
, buf
);
2147 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2148 gdbarch_pointer_to_address_ftype pointer_to_address
)
2150 gdbarch
->pointer_to_address
= pointer_to_address
;
2154 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
, CORE_ADDR addr
)
2156 if (gdbarch
->address_to_pointer
== 0)
2157 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
2158 if (gdbarch_debug
>= 2)
2159 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2160 gdbarch
->address_to_pointer (type
, buf
, addr
);
2164 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2165 gdbarch_address_to_pointer_ftype address_to_pointer
)
2167 gdbarch
->address_to_pointer
= address_to_pointer
;
2171 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
2173 if (gdbarch
->return_value_on_stack
== 0)
2174 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
2175 if (gdbarch_debug
>= 2)
2176 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
2177 return gdbarch
->return_value_on_stack (type
);
2181 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
2182 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
2184 gdbarch
->return_value_on_stack
= return_value_on_stack
;
2188 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
2190 if (gdbarch
->extract_return_value
== 0)
2191 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
2192 if (gdbarch_debug
>= 2)
2193 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2194 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
2198 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2199 gdbarch_extract_return_value_ftype extract_return_value
)
2201 gdbarch
->extract_return_value
= extract_return_value
;
2205 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2207 if (gdbarch
->push_arguments
== 0)
2208 internal_error ("gdbarch: gdbarch_push_arguments invalid");
2209 if (gdbarch_debug
>= 2)
2210 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
2211 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
2215 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
2216 gdbarch_push_arguments_ftype push_arguments
)
2218 gdbarch
->push_arguments
= push_arguments
;
2222 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
2224 if (gdbarch
->push_dummy_frame
== 0)
2225 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
2226 if (gdbarch_debug
>= 2)
2227 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
2228 gdbarch
->push_dummy_frame ();
2232 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
2233 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
2235 gdbarch
->push_dummy_frame
= push_dummy_frame
;
2239 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
2241 if (gdbarch
->push_return_address
== 0)
2242 internal_error ("gdbarch: gdbarch_push_return_address invalid");
2243 if (gdbarch_debug
>= 2)
2244 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
2245 return gdbarch
->push_return_address (pc
, sp
);
2249 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
2250 gdbarch_push_return_address_ftype push_return_address
)
2252 gdbarch
->push_return_address
= push_return_address
;
2256 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
2258 if (gdbarch
->pop_frame
== 0)
2259 internal_error ("gdbarch: gdbarch_pop_frame invalid");
2260 if (gdbarch_debug
>= 2)
2261 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
2262 gdbarch
->pop_frame ();
2266 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
2267 gdbarch_pop_frame_ftype pop_frame
)
2269 gdbarch
->pop_frame
= pop_frame
;
2273 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2275 if (gdbarch
->d10v_make_daddr
== 0)
2276 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2277 if (gdbarch_debug
>= 2)
2278 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
2279 return gdbarch
->d10v_make_daddr (x
);
2283 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
2284 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
2286 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
2290 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2292 if (gdbarch
->d10v_make_iaddr
== 0)
2293 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2294 if (gdbarch_debug
>= 2)
2295 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2296 return gdbarch
->d10v_make_iaddr (x
);
2300 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2301 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2303 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2307 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2309 if (gdbarch
->d10v_daddr_p
== 0)
2310 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2311 if (gdbarch_debug
>= 2)
2312 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2313 return gdbarch
->d10v_daddr_p (x
);
2317 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2318 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2320 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2324 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2326 if (gdbarch
->d10v_iaddr_p
== 0)
2327 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2328 if (gdbarch_debug
>= 2)
2329 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2330 return gdbarch
->d10v_iaddr_p (x
);
2334 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2335 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2337 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2341 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2343 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2344 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2345 if (gdbarch_debug
>= 2)
2346 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2347 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2351 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2352 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2354 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2358 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2360 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2361 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2362 if (gdbarch_debug
>= 2)
2363 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2364 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2368 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2369 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2371 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2375 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2377 if (gdbarch
->store_struct_return
== 0)
2378 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2379 if (gdbarch_debug
>= 2)
2380 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2381 gdbarch
->store_struct_return (addr
, sp
);
2385 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2386 gdbarch_store_struct_return_ftype store_struct_return
)
2388 gdbarch
->store_struct_return
= store_struct_return
;
2392 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2394 if (gdbarch
->store_return_value
== 0)
2395 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2396 if (gdbarch_debug
>= 2)
2397 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2398 gdbarch
->store_return_value (type
, valbuf
);
2402 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2403 gdbarch_store_return_value_ftype store_return_value
)
2405 gdbarch
->store_return_value
= store_return_value
;
2409 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2411 if (gdbarch
->extract_struct_value_address
== 0)
2412 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2413 if (gdbarch_debug
>= 2)
2414 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2415 return gdbarch
->extract_struct_value_address (regbuf
);
2419 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2420 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2422 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2426 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2428 if (gdbarch
->use_struct_convention
== 0)
2429 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2430 if (gdbarch_debug
>= 2)
2431 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2432 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2436 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2437 gdbarch_use_struct_convention_ftype use_struct_convention
)
2439 gdbarch
->use_struct_convention
= use_struct_convention
;
2443 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2445 if (gdbarch
->frame_init_saved_regs
== 0)
2446 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2447 if (gdbarch_debug
>= 2)
2448 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2449 gdbarch
->frame_init_saved_regs (frame
);
2453 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2454 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2456 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2460 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2462 if (gdbarch
->init_extra_frame_info
== 0)
2463 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2464 if (gdbarch_debug
>= 2)
2465 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2466 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2470 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2471 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2473 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2477 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2479 if (gdbarch
->skip_prologue
== 0)
2480 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2481 if (gdbarch_debug
>= 2)
2482 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2483 return gdbarch
->skip_prologue (ip
);
2487 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2488 gdbarch_skip_prologue_ftype skip_prologue
)
2490 gdbarch
->skip_prologue
= skip_prologue
;
2494 gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2496 if (gdbarch
->prologue_frameless_p
== 0)
2497 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
2498 if (gdbarch_debug
>= 2)
2499 fprintf_unfiltered (gdb_stdlog
, "gdbarch_prologue_frameless_p called\n");
2500 return gdbarch
->prologue_frameless_p (ip
);
2504 set_gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
,
2505 gdbarch_prologue_frameless_p_ftype prologue_frameless_p
)
2507 gdbarch
->prologue_frameless_p
= prologue_frameless_p
;
2511 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2513 if (gdbarch
->inner_than
== 0)
2514 internal_error ("gdbarch: gdbarch_inner_than invalid");
2515 if (gdbarch_debug
>= 2)
2516 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2517 return gdbarch
->inner_than (lhs
, rhs
);
2521 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2522 gdbarch_inner_than_ftype inner_than
)
2524 gdbarch
->inner_than
= inner_than
;
2528 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2530 if (gdbarch
->breakpoint_from_pc
== 0)
2531 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2532 if (gdbarch_debug
>= 2)
2533 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2534 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2538 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2539 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2541 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2545 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2547 if (gdbarch
->memory_insert_breakpoint
== 0)
2548 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2549 if (gdbarch_debug
>= 2)
2550 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2551 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2555 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2556 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2558 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2562 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2564 if (gdbarch
->memory_remove_breakpoint
== 0)
2565 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2566 if (gdbarch_debug
>= 2)
2567 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2568 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2572 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2573 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2575 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2579 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2581 if (gdbarch
->decr_pc_after_break
== -1)
2582 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2583 if (gdbarch_debug
>= 2)
2584 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2585 return gdbarch
->decr_pc_after_break
;
2589 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2590 CORE_ADDR decr_pc_after_break
)
2592 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2596 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2598 if (gdbarch
->function_start_offset
== -1)
2599 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2600 if (gdbarch_debug
>= 2)
2601 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2602 return gdbarch
->function_start_offset
;
2606 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2607 CORE_ADDR function_start_offset
)
2609 gdbarch
->function_start_offset
= function_start_offset
;
2613 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2615 if (gdbarch
->remote_translate_xfer_address
== 0)
2616 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2617 if (gdbarch_debug
>= 2)
2618 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2619 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2623 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2624 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2626 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2630 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2632 if (gdbarch
->frame_args_skip
== -1)
2633 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2634 if (gdbarch_debug
>= 2)
2635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2636 return gdbarch
->frame_args_skip
;
2640 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2641 CORE_ADDR frame_args_skip
)
2643 gdbarch
->frame_args_skip
= frame_args_skip
;
2647 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2649 if (gdbarch
->frameless_function_invocation
== 0)
2650 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2651 if (gdbarch_debug
>= 2)
2652 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2653 return gdbarch
->frameless_function_invocation (fi
);
2657 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2658 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2660 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2664 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2666 if (gdbarch
->frame_chain
== 0)
2667 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2668 if (gdbarch_debug
>= 2)
2669 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2670 return gdbarch
->frame_chain (frame
);
2674 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2675 gdbarch_frame_chain_ftype frame_chain
)
2677 gdbarch
->frame_chain
= frame_chain
;
2681 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2683 if (gdbarch
->frame_chain_valid
== 0)
2684 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2685 if (gdbarch_debug
>= 2)
2686 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2687 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2691 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2692 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2694 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2698 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2700 if (gdbarch
->frame_saved_pc
== 0)
2701 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2702 if (gdbarch_debug
>= 2)
2703 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2704 return gdbarch
->frame_saved_pc (fi
);
2708 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2709 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2711 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2715 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2717 if (gdbarch
->frame_args_address
== 0)
2718 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2719 if (gdbarch_debug
>= 2)
2720 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2721 return gdbarch
->frame_args_address (fi
);
2725 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2726 gdbarch_frame_args_address_ftype frame_args_address
)
2728 gdbarch
->frame_args_address
= frame_args_address
;
2732 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2734 if (gdbarch
->frame_locals_address
== 0)
2735 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2736 if (gdbarch_debug
>= 2)
2737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2738 return gdbarch
->frame_locals_address (fi
);
2742 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2743 gdbarch_frame_locals_address_ftype frame_locals_address
)
2745 gdbarch
->frame_locals_address
= frame_locals_address
;
2749 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2751 if (gdbarch
->saved_pc_after_call
== 0)
2752 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2753 if (gdbarch_debug
>= 2)
2754 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2755 return gdbarch
->saved_pc_after_call (frame
);
2759 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2760 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2762 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2766 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2768 if (gdbarch
->frame_num_args
== 0)
2769 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2770 if (gdbarch_debug
>= 2)
2771 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2772 return gdbarch
->frame_num_args (frame
);
2776 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2777 gdbarch_frame_num_args_ftype frame_num_args
)
2779 gdbarch
->frame_num_args
= frame_num_args
;
2783 gdbarch_stack_align_p (struct gdbarch
*gdbarch
)
2785 return gdbarch
->stack_align
!= 0;
2789 gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2791 if (gdbarch
->stack_align
== 0)
2792 internal_error ("gdbarch: gdbarch_stack_align invalid");
2793 if (gdbarch_debug
>= 2)
2794 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stack_align called\n");
2795 return gdbarch
->stack_align (sp
);
2799 set_gdbarch_stack_align (struct gdbarch
*gdbarch
,
2800 gdbarch_stack_align_ftype stack_align
)
2802 gdbarch
->stack_align
= stack_align
;
2806 gdbarch_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
2808 return gdbarch
->reg_struct_has_addr
!= 0;
2812 gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
2814 if (gdbarch
->reg_struct_has_addr
== 0)
2815 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
2816 if (gdbarch_debug
>= 2)
2817 fprintf_unfiltered (gdb_stdlog
, "gdbarch_reg_struct_has_addr called\n");
2818 return gdbarch
->reg_struct_has_addr (gcc_p
, type
);
2822 set_gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
,
2823 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr
)
2825 gdbarch
->reg_struct_has_addr
= reg_struct_has_addr
;
2829 gdbarch_save_dummy_frame_tos_p (struct gdbarch
*gdbarch
)
2831 return gdbarch
->save_dummy_frame_tos
!= 0;
2835 gdbarch_save_dummy_frame_tos (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2837 if (gdbarch
->save_dummy_frame_tos
== 0)
2838 internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid");
2839 if (gdbarch_debug
>= 2)
2840 fprintf_unfiltered (gdb_stdlog
, "gdbarch_save_dummy_frame_tos called\n");
2841 gdbarch
->save_dummy_frame_tos (sp
);
2845 set_gdbarch_save_dummy_frame_tos (struct gdbarch
*gdbarch
,
2846 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos
)
2848 gdbarch
->save_dummy_frame_tos
= save_dummy_frame_tos
;
2851 const struct floatformat
*
2852 gdbarch_float_format (struct gdbarch
*gdbarch
)
2854 if (gdbarch_debug
>= 2)
2855 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
2856 return gdbarch
->float_format
;
2860 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
2861 const struct floatformat
* float_format
)
2863 gdbarch
->float_format
= float_format
;
2866 const struct floatformat
*
2867 gdbarch_double_format (struct gdbarch
*gdbarch
)
2869 if (gdbarch_debug
>= 2)
2870 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
2871 return gdbarch
->double_format
;
2875 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
2876 const struct floatformat
* double_format
)
2878 gdbarch
->double_format
= double_format
;
2881 const struct floatformat
*
2882 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
2884 if (gdbarch_debug
>= 2)
2885 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
2886 return gdbarch
->long_double_format
;
2890 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
2891 const struct floatformat
* long_double_format
)
2893 gdbarch
->long_double_format
= long_double_format
;
2897 /* Keep a registrary of per-architecture data-pointers required by GDB
2905 struct gdbarch_data_registration
2907 gdbarch_data_ftype
*init
;
2908 struct gdbarch_data
*data
;
2909 struct gdbarch_data_registration
*next
;
2912 struct gdbarch_data_registrary
2915 struct gdbarch_data_registration
*registrations
;
2918 struct gdbarch_data_registrary gdbarch_data_registrary
=
2923 struct gdbarch_data
*
2924 register_gdbarch_data (gdbarch_data_ftype
*init
)
2926 struct gdbarch_data_registration
**curr
;
2927 for (curr
= &gdbarch_data_registrary
.registrations
;
2929 curr
= &(*curr
)->next
);
2930 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2931 (*curr
)->next
= NULL
;
2932 (*curr
)->init
= init
;
2933 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2934 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2935 return (*curr
)->data
;
2939 /* Walk through all the registered users initializing each in turn. */
2942 init_gdbarch_data (struct gdbarch
*gdbarch
)
2944 struct gdbarch_data_registration
*rego
;
2945 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2946 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2947 for (rego
= gdbarch_data_registrary
.registrations
;
2951 if (rego
->data
->index
< gdbarch
->nr_data
)
2952 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2957 /* Return the current value of the specified per-architecture
2962 struct gdbarch_data
*data
;
2964 if (data
->index
>= current_gdbarch
->nr_data
)
2965 internal_error ("gdbarch_data: request for non-existant data.");
2966 return current_gdbarch
->data
[data
->index
];
2971 /* Keep a registrary of swaped data required by GDB modules. */
2976 struct gdbarch_swap_registration
*source
;
2977 struct gdbarch_swap
*next
;
2980 struct gdbarch_swap_registration
2983 unsigned long sizeof_data
;
2984 gdbarch_swap_ftype
*init
;
2985 struct gdbarch_swap_registration
*next
;
2988 struct gdbarch_swap_registrary
2991 struct gdbarch_swap_registration
*registrations
;
2994 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
3000 register_gdbarch_swap (void *data
,
3001 unsigned long sizeof_data
,
3002 gdbarch_swap_ftype
*init
)
3004 struct gdbarch_swap_registration
**rego
;
3005 for (rego
= &gdbarch_swap_registrary
.registrations
;
3007 rego
= &(*rego
)->next
);
3008 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
3009 (*rego
)->next
= NULL
;
3010 (*rego
)->init
= init
;
3011 (*rego
)->data
= data
;
3012 (*rego
)->sizeof_data
= sizeof_data
;
3017 init_gdbarch_swap (struct gdbarch
*gdbarch
)
3019 struct gdbarch_swap_registration
*rego
;
3020 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
3021 for (rego
= gdbarch_swap_registrary
.registrations
;
3025 if (rego
->data
!= NULL
)
3027 (*curr
) = XMALLOC (struct gdbarch_swap
);
3028 (*curr
)->source
= rego
;
3029 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
3030 (*curr
)->next
= NULL
;
3031 memset (rego
->data
, 0, rego
->sizeof_data
);
3032 curr
= &(*curr
)->next
;
3034 if (rego
->init
!= NULL
)
3040 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
3042 struct gdbarch_swap
*curr
;
3043 for (curr
= gdbarch
->swap
;
3046 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
3050 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
3052 struct gdbarch_swap
*curr
;
3053 for (curr
= gdbarch
->swap
;
3056 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
3060 /* Keep a registrary of the architectures known by GDB. */
3062 struct gdbarch_init_registration
3064 enum bfd_architecture bfd_architecture
;
3065 gdbarch_init_ftype
*init
;
3066 struct gdbarch_list
*arches
;
3067 struct gdbarch_init_registration
*next
;
3070 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
3073 append_name (const char ***buf
, int *nr
, const char *name
)
3075 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3081 gdbarch_printable_names (void)
3085 /* Accumulate a list of names based on the registed list of
3087 enum bfd_architecture a
;
3089 const char **arches
= NULL
;
3090 struct gdbarch_init_registration
*rego
;
3091 for (rego
= gdbarch_init_registrary
;
3095 const struct bfd_arch_info
*ap
;
3096 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3098 internal_error ("gdbarch_architecture_names: multi-arch unknown");
3101 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3106 append_name (&arches
, &nr_arches
, NULL
);
3110 /* Just return all the architectures that BFD knows. Assume that
3111 the legacy architecture framework supports them. */
3112 return bfd_arch_list ();
3117 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3118 gdbarch_init_ftype
*init
)
3120 struct gdbarch_init_registration
**curr
;
3121 const struct bfd_arch_info
*bfd_arch_info
;
3122 /* Check that BFD reconizes this architecture */
3123 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3124 if (bfd_arch_info
== NULL
)
3126 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
3128 /* Check that we haven't seen this architecture before */
3129 for (curr
= &gdbarch_init_registrary
;
3131 curr
= &(*curr
)->next
)
3133 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3134 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
3135 bfd_arch_info
->printable_name
);
3139 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3140 bfd_arch_info
->printable_name
,
3143 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
3144 (*curr
)->bfd_architecture
= bfd_architecture
;
3145 (*curr
)->init
= init
;
3146 (*curr
)->arches
= NULL
;
3147 (*curr
)->next
= NULL
;
3151 /* Look for an architecture using gdbarch_info. Base search on only
3152 BFD_ARCH_INFO and BYTE_ORDER. */
3154 struct gdbarch_list
*
3155 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3156 const struct gdbarch_info
*info
)
3158 for (; arches
!= NULL
; arches
= arches
->next
)
3160 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3162 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3170 /* Update the current architecture. Return ZERO if the update request
3174 gdbarch_update (struct gdbarch_info info
)
3176 struct gdbarch
*new_gdbarch
;
3177 struct gdbarch_list
**list
;
3178 struct gdbarch_init_registration
*rego
;
3180 /* Fill in any missing bits. Most important is the bfd_architecture
3181 which is used to select the target architecture. */
3182 if (info
.bfd_architecture
== bfd_arch_unknown
)
3184 if (info
.bfd_arch_info
!= NULL
)
3185 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
3186 else if (info
.abfd
!= NULL
)
3187 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
3188 /* FIXME - should query BFD for its default architecture. */
3190 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
3192 if (info
.bfd_arch_info
== NULL
)
3194 if (target_architecture_auto
&& info
.abfd
!= NULL
)
3195 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
3197 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
3199 if (info
.byte_order
== 0)
3201 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
3202 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
3203 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
3206 info
.byte_order
= current_gdbarch
->byte_order
;
3207 /* FIXME - should query BFD for its default byte-order. */
3209 /* A default for abfd? */
3211 /* Find the target that knows about this architecture. */
3212 for (rego
= gdbarch_init_registrary
;
3213 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
3218 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
3224 fprintf_unfiltered (gdb_stdlog
,
3225 "gdbarch_update: info.bfd_architecture %d (%s)\n",
3226 info
.bfd_architecture
,
3227 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
3228 fprintf_unfiltered (gdb_stdlog
,
3229 "gdbarch_update: info.bfd_arch_info %s\n",
3230 (info
.bfd_arch_info
!= NULL
3231 ? info
.bfd_arch_info
->printable_name
3233 fprintf_unfiltered (gdb_stdlog
,
3234 "gdbarch_update: info.byte_order %d (%s)\n",
3236 (info
.byte_order
== BIG_ENDIAN
? "big"
3237 : info
.byte_order
== LITTLE_ENDIAN
? "little"
3239 fprintf_unfiltered (gdb_stdlog
,
3240 "gdbarch_update: info.abfd 0x%lx\n",
3242 fprintf_unfiltered (gdb_stdlog
,
3243 "gdbarch_update: info.tdep_info 0x%lx\n",
3244 (long) info
.tdep_info
);
3247 /* Ask the target for a replacement architecture. */
3248 new_gdbarch
= rego
->init (info
, rego
->arches
);
3250 /* Did the target like it? No. Reject the change. */
3251 if (new_gdbarch
== NULL
)
3254 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
3258 /* Did the architecture change? No. Do nothing. */
3259 if (current_gdbarch
== new_gdbarch
)
3262 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
3264 new_gdbarch
->bfd_arch_info
->printable_name
);
3268 /* Swap all data belonging to the old target out */
3269 swapout_gdbarch_swap (current_gdbarch
);
3271 /* Is this a pre-existing architecture? Yes. Swap it in. */
3272 for (list
= ®o
->arches
;
3274 list
= &(*list
)->next
)
3276 if ((*list
)->gdbarch
== new_gdbarch
)
3279 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
3281 new_gdbarch
->bfd_arch_info
->printable_name
);
3282 current_gdbarch
= new_gdbarch
;
3283 swapin_gdbarch_swap (new_gdbarch
);
3288 /* Append this new architecture to this targets list. */
3289 (*list
) = XMALLOC (struct gdbarch_list
);
3290 (*list
)->next
= NULL
;
3291 (*list
)->gdbarch
= new_gdbarch
;
3293 /* Switch to this new architecture. Dump it out. */
3294 current_gdbarch
= new_gdbarch
;
3297 fprintf_unfiltered (gdb_stdlog
,
3298 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
3300 new_gdbarch
->bfd_arch_info
->printable_name
);
3304 /* Check that the newly installed architecture is valid. */
3305 verify_gdbarch (new_gdbarch
);
3307 /* Initialize the per-architecture memory (swap) areas.
3308 CURRENT_GDBARCH must be update before these modules are
3310 init_gdbarch_swap (new_gdbarch
);
3312 /* Initialize the per-architecture data-pointer of all parties that
3313 registered an interest in this architecture. CURRENT_GDBARCH
3314 must be updated before these modules are called. */
3315 init_gdbarch_data (new_gdbarch
);
3324 /* Pointer to the target-dependent disassembly function. */
3325 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3326 disassemble_info tm_print_insn_info
;
3329 extern void _initialize_gdbarch (void);
3332 _initialize_gdbarch ()
3334 struct cmd_list_element
*c
;
3336 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3337 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3338 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3339 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3340 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3342 add_show_from_set (add_set_cmd ("arch",
3345 (char *)&gdbarch_debug
,
3346 "Set architecture debugging.\n\
3347 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3349 c
= add_set_cmd ("archdebug",
3352 (char *)&gdbarch_debug
,
3353 "Set architecture debugging.\n\
3354 When non-zero, architecture debugging is enabled.", &setlist
);
3356 deprecate_cmd (c
, "set debug arch");
3357 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");