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 */
62 /* Static function declarations */
64 static void verify_gdbarch (struct gdbarch
*gdbarch
);
65 static void init_gdbarch_data (struct gdbarch
*);
66 static void init_gdbarch_swap (struct gdbarch
*);
67 static void swapout_gdbarch_swap (struct gdbarch
*);
68 static void swapin_gdbarch_swap (struct gdbarch
*);
70 /* Convenience macro for allocting typesafe memory. */
73 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
77 /* Non-zero if we want to trace architecture code. */
80 #define GDBARCH_DEBUG 0
82 int gdbarch_debug
= GDBARCH_DEBUG
;
85 /* Maintain the struct gdbarch object */
89 /* basic architectural information */
90 const struct bfd_arch_info
* bfd_arch_info
;
93 /* target specific vector. */
94 struct gdbarch_tdep
*tdep
;
96 /* per-architecture data-pointers */
100 /* per-architecture swap-regions */
101 struct gdbarch_swap
*swap
;
103 /* Multi-arch values.
105 When extending this structure you must:
109 Declare set/get functions and define the corresponding
112 gdbarch_alloc(): If zero/NULL is not a suitable default,
113 initialize the new field.
115 verify_gdbarch(): Confirm that the target updated the field
118 gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
121 ``startup_gdbarch()'': Append an initial value to the static
122 variable (base values on the host's c-type system).
124 get_gdbarch(): Implement the set/get functions (probably using
125 the macro's as shortcuts).
139 gdbarch_read_pc_ftype
*read_pc
;
140 gdbarch_write_pc_ftype
*write_pc
;
141 gdbarch_read_fp_ftype
*read_fp
;
142 gdbarch_write_fp_ftype
*write_fp
;
143 gdbarch_read_sp_ftype
*read_sp
;
144 gdbarch_write_sp_ftype
*write_sp
;
152 gdbarch_register_name_ftype
*register_name
;
155 gdbarch_register_byte_ftype
*register_byte
;
156 gdbarch_register_raw_size_ftype
*register_raw_size
;
157 int max_register_raw_size
;
158 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
159 int max_register_virtual_size
;
160 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
161 int use_generic_dummy_frames
;
162 int call_dummy_location
;
163 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
164 CORE_ADDR call_dummy_start_offset
;
165 CORE_ADDR call_dummy_breakpoint_offset
;
166 int call_dummy_breakpoint_offset_p
;
167 int call_dummy_length
;
168 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
170 LONGEST
* call_dummy_words
;
171 int sizeof_call_dummy_words
;
172 int call_dummy_stack_adjust_p
;
173 int call_dummy_stack_adjust
;
174 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
175 int believe_pcc_promotion
;
176 int believe_pcc_promotion_type
;
177 gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
;
178 gdbarch_get_saved_register_ftype
*get_saved_register
;
179 gdbarch_register_convertible_ftype
*register_convertible
;
180 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
181 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
182 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
183 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
184 gdbarch_return_value_on_stack_ftype
*return_value_on_stack
;
185 gdbarch_extract_return_value_ftype
*extract_return_value
;
186 gdbarch_push_arguments_ftype
*push_arguments
;
187 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
188 gdbarch_push_return_address_ftype
*push_return_address
;
189 gdbarch_pop_frame_ftype
*pop_frame
;
190 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
191 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
192 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
193 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
194 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
195 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
196 gdbarch_store_struct_return_ftype
*store_struct_return
;
197 gdbarch_store_return_value_ftype
*store_return_value
;
198 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
199 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
200 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
201 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
202 gdbarch_skip_prologue_ftype
*skip_prologue
;
203 gdbarch_prologue_frameless_p_ftype
*prologue_frameless_p
;
204 gdbarch_inner_than_ftype
*inner_than
;
205 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
206 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
207 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
208 CORE_ADDR decr_pc_after_break
;
209 CORE_ADDR function_start_offset
;
210 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
211 CORE_ADDR frame_args_skip
;
212 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
213 gdbarch_frame_chain_ftype
*frame_chain
;
214 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
215 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
216 gdbarch_frame_args_address_ftype
*frame_args_address
;
217 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
218 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
219 gdbarch_frame_num_args_ftype
*frame_num_args
;
220 gdbarch_stack_align_ftype
*stack_align
;
221 gdbarch_reg_struct_has_addr_ftype
*reg_struct_has_addr
;
225 /* The default architecture uses host values (for want of a better
228 extern const struct bfd_arch_info bfd_default_arch_struct
;
230 struct gdbarch startup_gdbarch
= {
231 /* basic architecture information */
232 &bfd_default_arch_struct
,
234 /* target specific vector */
236 /*per-architecture data-pointers and swap regions */
238 /* Multi-arch values */
244 8 * sizeof (LONGEST
),
247 8 * sizeof (long double),
288 generic_get_saved_register
,
332 /* startup_gdbarch() */
334 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
337 /* Create a new ``struct gdbarch'' based in information provided by
338 ``struct gdbarch_info''. */
341 gdbarch_alloc (const struct gdbarch_info
*info
,
342 struct gdbarch_tdep
*tdep
)
344 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
345 memset (gdbarch
, 0, sizeof (*gdbarch
));
347 gdbarch
->tdep
= tdep
;
349 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
350 gdbarch
->byte_order
= info
->byte_order
;
352 /* Force the explicit initialization of these. */
353 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
354 gdbarch
->num_regs
= -1;
355 gdbarch
->sp_regnum
= -1;
356 gdbarch
->fp_regnum
= -1;
357 gdbarch
->pc_regnum
= -1;
358 gdbarch
->fp0_regnum
= -1;
359 gdbarch
->npc_regnum
= -1;
360 gdbarch
->nnpc_regnum
= -1;
361 gdbarch
->register_name
= legacy_register_name
;
362 gdbarch
->register_size
= -1;
363 gdbarch
->register_bytes
= -1;
364 gdbarch
->max_register_raw_size
= -1;
365 gdbarch
->max_register_virtual_size
= -1;
366 gdbarch
->use_generic_dummy_frames
= -1;
367 gdbarch
->call_dummy_start_offset
= -1;
368 gdbarch
->call_dummy_breakpoint_offset
= -1;
369 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
370 gdbarch
->call_dummy_length
= -1;
371 gdbarch
->call_dummy_p
= -1;
372 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
373 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
374 gdbarch
->call_dummy_stack_adjust_p
= -1;
375 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
376 gdbarch
->register_convertible
= generic_register_convertible_not
;
377 gdbarch
->pointer_to_address
= generic_pointer_to_address
;
378 gdbarch
->address_to_pointer
= generic_address_to_pointer
;
379 gdbarch
->return_value_on_stack
= generic_return_value_on_stack_not
;
380 gdbarch
->prologue_frameless_p
= generic_prologue_frameless_p
;
381 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
382 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
383 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
384 gdbarch
->decr_pc_after_break
= -1;
385 gdbarch
->function_start_offset
= -1;
386 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
387 gdbarch
->frame_args_skip
= -1;
388 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
389 /* gdbarch_alloc() */
395 /* Free a gdbarch struct. This should never happen in normal
396 operation --- once you've created a gdbarch, you keep it around.
397 However, if an architecture's init function encounters an error
398 building the structure, it may need to clean up a partially
399 constructed gdbarch. */
401 gdbarch_free (struct gdbarch
*arch
)
403 /* At the moment, this is trivial. */
408 /* Ensure that all values in a GDBARCH are reasonable. */
411 verify_gdbarch (struct gdbarch
*gdbarch
)
413 /* Only perform sanity checks on a multi-arch target. */
414 if (GDB_MULTI_ARCH
<= 0)
417 if (gdbarch
->byte_order
== 0)
418 internal_error ("verify_gdbarch: byte-order unset");
419 if (gdbarch
->bfd_arch_info
== NULL
)
420 internal_error ("verify_gdbarch: bfd_arch_info unset");
421 /* Check those that need to be defined for the given multi-arch level. */
422 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
423 if ((GDB_MULTI_ARCH
>= 1)
424 && (gdbarch
->ptr_bit
== 0))
425 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
426 if ((GDB_MULTI_ARCH
>= 1)
427 && (gdbarch
->short_bit
== 0))
428 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
429 if ((GDB_MULTI_ARCH
>= 1)
430 && (gdbarch
->int_bit
== 0))
431 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
432 if ((GDB_MULTI_ARCH
>= 1)
433 && (gdbarch
->long_bit
== 0))
434 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
435 if ((GDB_MULTI_ARCH
>= 1)
436 && (gdbarch
->long_long_bit
== 0))
437 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
438 if ((GDB_MULTI_ARCH
>= 1)
439 && (gdbarch
->float_bit
== 0))
440 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
441 if ((GDB_MULTI_ARCH
>= 1)
442 && (gdbarch
->double_bit
== 0))
443 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
444 if ((GDB_MULTI_ARCH
>= 1)
445 && (gdbarch
->long_double_bit
== 0))
446 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
447 /* Skip verify of ieee_float, invalid_p == 0 */
448 if ((GDB_MULTI_ARCH
>= 1)
449 && (gdbarch
->read_pc
== 0))
450 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
451 if ((GDB_MULTI_ARCH
>= 1)
452 && (gdbarch
->write_pc
== 0))
453 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
454 if ((GDB_MULTI_ARCH
>= 1)
455 && (gdbarch
->read_fp
== 0))
456 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
457 if ((GDB_MULTI_ARCH
>= 1)
458 && (gdbarch
->write_fp
== 0))
459 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
460 if ((GDB_MULTI_ARCH
>= 1)
461 && (gdbarch
->read_sp
== 0))
462 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
463 if ((GDB_MULTI_ARCH
>= 1)
464 && (gdbarch
->write_sp
== 0))
465 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
466 if ((GDB_MULTI_ARCH
>= 2)
467 && (gdbarch
->num_regs
== -1))
468 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
469 if ((GDB_MULTI_ARCH
>= 2)
470 && (gdbarch
->sp_regnum
== -1))
471 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
472 if ((GDB_MULTI_ARCH
>= 2)
473 && (gdbarch
->fp_regnum
== -1))
474 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
475 if ((GDB_MULTI_ARCH
>= 2)
476 && (gdbarch
->pc_regnum
== -1))
477 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
478 /* Skip verify of fp0_regnum, invalid_p == 0 */
479 /* Skip verify of npc_regnum, invalid_p == 0 */
480 /* Skip verify of nnpc_regnum, invalid_p == 0 */
481 /* Skip verify of register_name, invalid_p == 0 */
482 if ((GDB_MULTI_ARCH
>= 2)
483 && (gdbarch
->register_size
== -1))
484 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
485 if ((GDB_MULTI_ARCH
>= 2)
486 && (gdbarch
->register_bytes
== -1))
487 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
488 if ((GDB_MULTI_ARCH
>= 2)
489 && (gdbarch
->register_byte
== 0))
490 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
491 if ((GDB_MULTI_ARCH
>= 2)
492 && (gdbarch
->register_raw_size
== 0))
493 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
494 if ((GDB_MULTI_ARCH
>= 2)
495 && (gdbarch
->max_register_raw_size
== -1))
496 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
497 if ((GDB_MULTI_ARCH
>= 2)
498 && (gdbarch
->register_virtual_size
== 0))
499 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
500 if ((GDB_MULTI_ARCH
>= 2)
501 && (gdbarch
->max_register_virtual_size
== -1))
502 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
503 if ((GDB_MULTI_ARCH
>= 2)
504 && (gdbarch
->register_virtual_type
== 0))
505 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
506 if ((GDB_MULTI_ARCH
>= 1)
507 && (gdbarch
->use_generic_dummy_frames
== -1))
508 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
509 if ((GDB_MULTI_ARCH
>= 2)
510 && (gdbarch
->call_dummy_location
== 0))
511 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
512 if ((GDB_MULTI_ARCH
>= 2)
513 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
514 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
515 if ((GDB_MULTI_ARCH
>= 2)
516 && (gdbarch
->call_dummy_start_offset
== -1))
517 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
518 if ((GDB_MULTI_ARCH
>= 2)
519 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
520 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
521 if ((GDB_MULTI_ARCH
>= 1)
522 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
523 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
524 if ((GDB_MULTI_ARCH
>= 2)
525 && (gdbarch
->call_dummy_length
== -1))
526 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
527 if ((GDB_MULTI_ARCH
>= 2)
528 && (gdbarch
->pc_in_call_dummy
== 0))
529 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
530 if ((GDB_MULTI_ARCH
>= 1)
531 && (gdbarch
->call_dummy_p
== -1))
532 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
533 /* Skip verify of call_dummy_words, invalid_p == 0 */
534 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
535 if ((GDB_MULTI_ARCH
>= 1)
536 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
537 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
538 if ((GDB_MULTI_ARCH
>= 2)
539 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
540 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
541 if ((GDB_MULTI_ARCH
>= 2)
542 && (gdbarch
->fix_call_dummy
== 0))
543 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
544 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
545 if ((GDB_MULTI_ARCH
>= 1)
546 && (gdbarch
->get_saved_register
== 0))
547 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
548 /* Skip verify of register_convertible, invalid_p == 0 */
549 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
550 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
551 /* Skip verify of pointer_to_address, invalid_p == 0 */
552 /* Skip verify of address_to_pointer, invalid_p == 0 */
553 /* Skip verify of return_value_on_stack, invalid_p == 0 */
554 if ((GDB_MULTI_ARCH
>= 2)
555 && (gdbarch
->extract_return_value
== 0))
556 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
557 if ((GDB_MULTI_ARCH
>= 1)
558 && (gdbarch
->push_arguments
== 0))
559 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
560 if ((GDB_MULTI_ARCH
>= 2)
561 && (gdbarch
->push_dummy_frame
== 0))
562 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
563 if ((GDB_MULTI_ARCH
>= 1)
564 && (gdbarch
->push_return_address
== 0))
565 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
566 if ((GDB_MULTI_ARCH
>= 2)
567 && (gdbarch
->pop_frame
== 0))
568 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
569 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
570 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
571 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
572 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
573 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
574 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
575 if ((GDB_MULTI_ARCH
>= 2)
576 && (gdbarch
->store_struct_return
== 0))
577 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
578 if ((GDB_MULTI_ARCH
>= 2)
579 && (gdbarch
->store_return_value
== 0))
580 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
581 if ((GDB_MULTI_ARCH
>= 2)
582 && (gdbarch
->extract_struct_value_address
== 0))
583 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
584 if ((GDB_MULTI_ARCH
>= 2)
585 && (gdbarch
->use_struct_convention
== 0))
586 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
587 if ((GDB_MULTI_ARCH
>= 2)
588 && (gdbarch
->frame_init_saved_regs
== 0))
589 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
590 if ((GDB_MULTI_ARCH
>= 2)
591 && (gdbarch
->init_extra_frame_info
== 0))
592 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
593 if ((GDB_MULTI_ARCH
>= 2)
594 && (gdbarch
->skip_prologue
== 0))
595 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
596 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
597 if ((GDB_MULTI_ARCH
>= 2)
598 && (gdbarch
->inner_than
== 0))
599 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
600 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
601 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
602 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
603 if ((GDB_MULTI_ARCH
>= 2)
604 && (gdbarch
->decr_pc_after_break
== -1))
605 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
606 if ((GDB_MULTI_ARCH
>= 2)
607 && (gdbarch
->function_start_offset
== -1))
608 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
609 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
610 if ((GDB_MULTI_ARCH
>= 2)
611 && (gdbarch
->frame_args_skip
== -1))
612 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
613 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
614 if ((GDB_MULTI_ARCH
>= 2)
615 && (gdbarch
->frame_chain
== 0))
616 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
617 if ((GDB_MULTI_ARCH
>= 1)
618 && (gdbarch
->frame_chain_valid
== 0))
619 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
620 if ((GDB_MULTI_ARCH
>= 2)
621 && (gdbarch
->frame_saved_pc
== 0))
622 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
623 if ((GDB_MULTI_ARCH
>= 2)
624 && (gdbarch
->frame_args_address
== 0))
625 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
626 if ((GDB_MULTI_ARCH
>= 2)
627 && (gdbarch
->frame_locals_address
== 0))
628 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
629 if ((GDB_MULTI_ARCH
>= 2)
630 && (gdbarch
->saved_pc_after_call
== 0))
631 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
632 if ((GDB_MULTI_ARCH
>= 2)
633 && (gdbarch
->frame_num_args
== 0))
634 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
635 /* Skip verify of stack_align, has predicate */
636 /* Skip verify of reg_struct_has_addr, has predicate */
640 /* Print out the details of the current architecture. */
645 #ifdef TARGET_ARCHITECTURE
646 if (TARGET_ARCHITECTURE
!= NULL
)
647 fprintf_unfiltered (gdb_stdlog
,
648 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
649 TARGET_ARCHITECTURE
->printable_name
);
651 #ifdef TARGET_BYTE_ORDER
652 fprintf_unfiltered (gdb_stdlog
,
653 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
654 (long) TARGET_BYTE_ORDER
);
656 #ifdef TARGET_BFD_VMA_BIT
657 fprintf_unfiltered (gdb_stdlog
,
658 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
659 (long) TARGET_BFD_VMA_BIT
);
661 #ifdef TARGET_PTR_BIT
662 fprintf_unfiltered (gdb_stdlog
,
663 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
664 (long) TARGET_PTR_BIT
);
666 #ifdef TARGET_SHORT_BIT
667 fprintf_unfiltered (gdb_stdlog
,
668 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
669 (long) TARGET_SHORT_BIT
);
671 #ifdef TARGET_INT_BIT
672 fprintf_unfiltered (gdb_stdlog
,
673 "gdbarch_update: TARGET_INT_BIT = %ld\n",
674 (long) TARGET_INT_BIT
);
676 #ifdef TARGET_LONG_BIT
677 fprintf_unfiltered (gdb_stdlog
,
678 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
679 (long) TARGET_LONG_BIT
);
681 #ifdef TARGET_LONG_LONG_BIT
682 fprintf_unfiltered (gdb_stdlog
,
683 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
684 (long) TARGET_LONG_LONG_BIT
);
686 #ifdef TARGET_FLOAT_BIT
687 fprintf_unfiltered (gdb_stdlog
,
688 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
689 (long) TARGET_FLOAT_BIT
);
691 #ifdef TARGET_DOUBLE_BIT
692 fprintf_unfiltered (gdb_stdlog
,
693 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
694 (long) TARGET_DOUBLE_BIT
);
696 #ifdef TARGET_LONG_DOUBLE_BIT
697 fprintf_unfiltered (gdb_stdlog
,
698 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
699 (long) TARGET_LONG_DOUBLE_BIT
);
702 fprintf_unfiltered (gdb_stdlog
,
703 "gdbarch_update: IEEE_FLOAT = %ld\n",
706 #ifdef TARGET_READ_PC
707 fprintf_unfiltered (gdb_stdlog
,
708 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
709 (long) current_gdbarch
->read_pc
710 /*TARGET_READ_PC ()*/);
712 #ifdef TARGET_WRITE_PC
713 fprintf_unfiltered (gdb_stdlog
,
714 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
715 (long) current_gdbarch
->write_pc
716 /*TARGET_WRITE_PC ()*/);
718 #ifdef TARGET_READ_FP
719 fprintf_unfiltered (gdb_stdlog
,
720 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
721 (long) current_gdbarch
->read_fp
722 /*TARGET_READ_FP ()*/);
724 #ifdef TARGET_WRITE_FP
725 fprintf_unfiltered (gdb_stdlog
,
726 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
727 (long) current_gdbarch
->write_fp
728 /*TARGET_WRITE_FP ()*/);
730 #ifdef TARGET_READ_SP
731 fprintf_unfiltered (gdb_stdlog
,
732 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
733 (long) current_gdbarch
->read_sp
734 /*TARGET_READ_SP ()*/);
736 #ifdef TARGET_WRITE_SP
737 fprintf_unfiltered (gdb_stdlog
,
738 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
739 (long) current_gdbarch
->write_sp
740 /*TARGET_WRITE_SP ()*/);
743 fprintf_unfiltered (gdb_stdlog
,
744 "gdbarch_update: NUM_REGS = %ld\n",
748 fprintf_unfiltered (gdb_stdlog
,
749 "gdbarch_update: SP_REGNUM = %ld\n",
753 fprintf_unfiltered (gdb_stdlog
,
754 "gdbarch_update: FP_REGNUM = %ld\n",
758 fprintf_unfiltered (gdb_stdlog
,
759 "gdbarch_update: PC_REGNUM = %ld\n",
763 fprintf_unfiltered (gdb_stdlog
,
764 "gdbarch_update: FP0_REGNUM = %ld\n",
768 fprintf_unfiltered (gdb_stdlog
,
769 "gdbarch_update: NPC_REGNUM = %ld\n",
773 fprintf_unfiltered (gdb_stdlog
,
774 "gdbarch_update: NNPC_REGNUM = %ld\n",
778 fprintf_unfiltered (gdb_stdlog
,
779 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
780 (long) current_gdbarch
->register_name
781 /*REGISTER_NAME ()*/);
784 fprintf_unfiltered (gdb_stdlog
,
785 "gdbarch_update: REGISTER_SIZE = %ld\n",
786 (long) REGISTER_SIZE
);
788 #ifdef REGISTER_BYTES
789 fprintf_unfiltered (gdb_stdlog
,
790 "gdbarch_update: REGISTER_BYTES = %ld\n",
791 (long) REGISTER_BYTES
);
794 fprintf_unfiltered (gdb_stdlog
,
795 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
796 (long) current_gdbarch
->register_byte
797 /*REGISTER_BYTE ()*/);
799 #ifdef REGISTER_RAW_SIZE
800 fprintf_unfiltered (gdb_stdlog
,
801 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
802 (long) current_gdbarch
->register_raw_size
803 /*REGISTER_RAW_SIZE ()*/);
805 #ifdef MAX_REGISTER_RAW_SIZE
806 fprintf_unfiltered (gdb_stdlog
,
807 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
808 (long) MAX_REGISTER_RAW_SIZE
);
810 #ifdef REGISTER_VIRTUAL_SIZE
811 fprintf_unfiltered (gdb_stdlog
,
812 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
813 (long) current_gdbarch
->register_virtual_size
814 /*REGISTER_VIRTUAL_SIZE ()*/);
816 #ifdef MAX_REGISTER_VIRTUAL_SIZE
817 fprintf_unfiltered (gdb_stdlog
,
818 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
819 (long) MAX_REGISTER_VIRTUAL_SIZE
);
821 #ifdef REGISTER_VIRTUAL_TYPE
822 fprintf_unfiltered (gdb_stdlog
,
823 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
824 (long) current_gdbarch
->register_virtual_type
825 /*REGISTER_VIRTUAL_TYPE ()*/);
827 #ifdef USE_GENERIC_DUMMY_FRAMES
828 fprintf_unfiltered (gdb_stdlog
,
829 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
830 (long) USE_GENERIC_DUMMY_FRAMES
);
832 #ifdef CALL_DUMMY_LOCATION
833 fprintf_unfiltered (gdb_stdlog
,
834 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
835 (long) CALL_DUMMY_LOCATION
);
837 #ifdef CALL_DUMMY_ADDRESS
838 fprintf_unfiltered (gdb_stdlog
,
839 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
840 (long) current_gdbarch
->call_dummy_address
841 /*CALL_DUMMY_ADDRESS ()*/);
843 #ifdef CALL_DUMMY_START_OFFSET
844 fprintf_unfiltered (gdb_stdlog
,
845 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
846 (long) CALL_DUMMY_START_OFFSET
);
848 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
849 fprintf_unfiltered (gdb_stdlog
,
850 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
851 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
853 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
854 fprintf_unfiltered (gdb_stdlog
,
855 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
856 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
858 #ifdef CALL_DUMMY_LENGTH
859 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
860 fprintf_unfiltered (gdb_stdlog
,
861 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
862 (long) CALL_DUMMY_LENGTH
);
864 #ifdef PC_IN_CALL_DUMMY
865 fprintf_unfiltered (gdb_stdlog
,
866 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
867 (long) current_gdbarch
->pc_in_call_dummy
868 /*PC_IN_CALL_DUMMY ()*/);
871 fprintf_unfiltered (gdb_stdlog
,
872 "gdbarch_update: CALL_DUMMY_P = %ld\n",
873 (long) CALL_DUMMY_P
);
875 #ifdef CALL_DUMMY_WORDS
876 fprintf_unfiltered (gdb_stdlog
,
877 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
878 (long) CALL_DUMMY_WORDS
);
880 #ifdef SIZEOF_CALL_DUMMY_WORDS
881 fprintf_unfiltered (gdb_stdlog
,
882 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
883 (long) SIZEOF_CALL_DUMMY_WORDS
);
885 #ifdef CALL_DUMMY_STACK_ADJUST_P
886 fprintf_unfiltered (gdb_stdlog
,
887 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
888 (long) CALL_DUMMY_STACK_ADJUST_P
);
890 #ifdef CALL_DUMMY_STACK_ADJUST
891 if (CALL_DUMMY_STACK_ADJUST_P
)
892 fprintf_unfiltered (gdb_stdlog
,
893 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
894 (long) CALL_DUMMY_STACK_ADJUST
);
896 #ifdef FIX_CALL_DUMMY
897 fprintf_unfiltered (gdb_stdlog
,
898 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
899 (long) current_gdbarch
->fix_call_dummy
900 /*FIX_CALL_DUMMY ()*/);
902 #ifdef BELIEVE_PCC_PROMOTION
903 fprintf_unfiltered (gdb_stdlog
,
904 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
905 (long) BELIEVE_PCC_PROMOTION
);
907 #ifdef BELIEVE_PCC_PROMOTION_TYPE
908 fprintf_unfiltered (gdb_stdlog
,
909 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
910 (long) BELIEVE_PCC_PROMOTION_TYPE
);
912 #ifdef COERCE_FLOAT_TO_DOUBLE
913 fprintf_unfiltered (gdb_stdlog
,
914 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
915 (long) current_gdbarch
->coerce_float_to_double
916 /*COERCE_FLOAT_TO_DOUBLE ()*/);
918 #ifdef GET_SAVED_REGISTER
919 fprintf_unfiltered (gdb_stdlog
,
920 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
921 (long) current_gdbarch
->get_saved_register
922 /*GET_SAVED_REGISTER ()*/);
924 #ifdef REGISTER_CONVERTIBLE
925 fprintf_unfiltered (gdb_stdlog
,
926 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
927 (long) current_gdbarch
->register_convertible
928 /*REGISTER_CONVERTIBLE ()*/);
930 #ifdef REGISTER_CONVERT_TO_VIRTUAL
931 fprintf_unfiltered (gdb_stdlog
,
932 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
933 (long) current_gdbarch
->register_convert_to_virtual
934 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
936 #ifdef REGISTER_CONVERT_TO_RAW
937 fprintf_unfiltered (gdb_stdlog
,
938 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
939 (long) current_gdbarch
->register_convert_to_raw
940 /*REGISTER_CONVERT_TO_RAW ()*/);
942 #ifdef POINTER_TO_ADDRESS
943 fprintf_unfiltered (gdb_stdlog
,
944 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
945 (long) current_gdbarch
->pointer_to_address
946 /*POINTER_TO_ADDRESS ()*/);
948 #ifdef ADDRESS_TO_POINTER
949 fprintf_unfiltered (gdb_stdlog
,
950 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
951 (long) current_gdbarch
->address_to_pointer
952 /*ADDRESS_TO_POINTER ()*/);
954 #ifdef RETURN_VALUE_ON_STACK
955 fprintf_unfiltered (gdb_stdlog
,
956 "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n",
957 (long) current_gdbarch
->return_value_on_stack
958 /*RETURN_VALUE_ON_STACK ()*/);
960 #ifdef EXTRACT_RETURN_VALUE
961 fprintf_unfiltered (gdb_stdlog
,
962 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
963 (long) current_gdbarch
->extract_return_value
964 /*EXTRACT_RETURN_VALUE ()*/);
966 #ifdef PUSH_ARGUMENTS
967 fprintf_unfiltered (gdb_stdlog
,
968 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
969 (long) current_gdbarch
->push_arguments
970 /*PUSH_ARGUMENTS ()*/);
972 #ifdef PUSH_DUMMY_FRAME
973 fprintf_unfiltered (gdb_stdlog
,
974 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
975 (long) current_gdbarch
->push_dummy_frame
976 /*PUSH_DUMMY_FRAME ()*/);
978 #ifdef PUSH_RETURN_ADDRESS
979 fprintf_unfiltered (gdb_stdlog
,
980 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
981 (long) current_gdbarch
->push_return_address
982 /*PUSH_RETURN_ADDRESS ()*/);
985 fprintf_unfiltered (gdb_stdlog
,
986 "gdbarch_update: POP_FRAME = 0x%08lx\n",
987 (long) current_gdbarch
->pop_frame
990 #ifdef D10V_MAKE_DADDR
991 fprintf_unfiltered (gdb_stdlog
,
992 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
993 (long) current_gdbarch
->d10v_make_daddr
994 /*D10V_MAKE_DADDR ()*/);
996 #ifdef D10V_MAKE_IADDR
997 fprintf_unfiltered (gdb_stdlog
,
998 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
999 (long) current_gdbarch
->d10v_make_iaddr
1000 /*D10V_MAKE_IADDR ()*/);
1003 fprintf_unfiltered (gdb_stdlog
,
1004 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
1005 (long) current_gdbarch
->d10v_daddr_p
1006 /*D10V_DADDR_P ()*/);
1009 fprintf_unfiltered (gdb_stdlog
,
1010 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
1011 (long) current_gdbarch
->d10v_iaddr_p
1012 /*D10V_IADDR_P ()*/);
1014 #ifdef D10V_CONVERT_DADDR_TO_RAW
1015 fprintf_unfiltered (gdb_stdlog
,
1016 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1017 (long) current_gdbarch
->d10v_convert_daddr_to_raw
1018 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
1020 #ifdef D10V_CONVERT_IADDR_TO_RAW
1021 fprintf_unfiltered (gdb_stdlog
,
1022 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1023 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
1024 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
1026 #ifdef STORE_STRUCT_RETURN
1027 fprintf_unfiltered (gdb_stdlog
,
1028 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
1029 (long) current_gdbarch
->store_struct_return
1030 /*STORE_STRUCT_RETURN ()*/);
1032 #ifdef STORE_RETURN_VALUE
1033 fprintf_unfiltered (gdb_stdlog
,
1034 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
1035 (long) current_gdbarch
->store_return_value
1036 /*STORE_RETURN_VALUE ()*/);
1038 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1039 fprintf_unfiltered (gdb_stdlog
,
1040 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1041 (long) current_gdbarch
->extract_struct_value_address
1042 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1044 #ifdef USE_STRUCT_CONVENTION
1045 fprintf_unfiltered (gdb_stdlog
,
1046 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
1047 (long) current_gdbarch
->use_struct_convention
1048 /*USE_STRUCT_CONVENTION ()*/);
1050 #ifdef FRAME_INIT_SAVED_REGS
1051 fprintf_unfiltered (gdb_stdlog
,
1052 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1053 (long) current_gdbarch
->frame_init_saved_regs
1054 /*FRAME_INIT_SAVED_REGS ()*/);
1056 #ifdef INIT_EXTRA_FRAME_INFO
1057 fprintf_unfiltered (gdb_stdlog
,
1058 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1059 (long) current_gdbarch
->init_extra_frame_info
1060 /*INIT_EXTRA_FRAME_INFO ()*/);
1062 #ifdef SKIP_PROLOGUE
1063 fprintf_unfiltered (gdb_stdlog
,
1064 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
1065 (long) current_gdbarch
->skip_prologue
1066 /*SKIP_PROLOGUE ()*/);
1068 #ifdef PROLOGUE_FRAMELESS_P
1069 fprintf_unfiltered (gdb_stdlog
,
1070 "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1071 (long) current_gdbarch
->prologue_frameless_p
1072 /*PROLOGUE_FRAMELESS_P ()*/);
1075 fprintf_unfiltered (gdb_stdlog
,
1076 "gdbarch_update: INNER_THAN = 0x%08lx\n",
1077 (long) current_gdbarch
->inner_than
1080 #ifdef BREAKPOINT_FROM_PC
1081 fprintf_unfiltered (gdb_stdlog
,
1082 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
1083 (long) current_gdbarch
->breakpoint_from_pc
1084 /*BREAKPOINT_FROM_PC ()*/);
1086 #ifdef MEMORY_INSERT_BREAKPOINT
1087 fprintf_unfiltered (gdb_stdlog
,
1088 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1089 (long) current_gdbarch
->memory_insert_breakpoint
1090 /*MEMORY_INSERT_BREAKPOINT ()*/);
1092 #ifdef MEMORY_REMOVE_BREAKPOINT
1093 fprintf_unfiltered (gdb_stdlog
,
1094 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1095 (long) current_gdbarch
->memory_remove_breakpoint
1096 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1098 #ifdef DECR_PC_AFTER_BREAK
1099 fprintf_unfiltered (gdb_stdlog
,
1100 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
1101 (long) DECR_PC_AFTER_BREAK
);
1103 #ifdef FUNCTION_START_OFFSET
1104 fprintf_unfiltered (gdb_stdlog
,
1105 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
1106 (long) FUNCTION_START_OFFSET
);
1108 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1109 fprintf_unfiltered (gdb_stdlog
,
1110 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1111 (long) current_gdbarch
->remote_translate_xfer_address
1112 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1114 #ifdef FRAME_ARGS_SKIP
1115 fprintf_unfiltered (gdb_stdlog
,
1116 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
1117 (long) FRAME_ARGS_SKIP
);
1119 #ifdef FRAMELESS_FUNCTION_INVOCATION
1120 fprintf_unfiltered (gdb_stdlog
,
1121 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1122 (long) current_gdbarch
->frameless_function_invocation
1123 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1126 fprintf_unfiltered (gdb_stdlog
,
1127 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
1128 (long) current_gdbarch
->frame_chain
1129 /*FRAME_CHAIN ()*/);
1131 #ifdef FRAME_CHAIN_VALID
1132 fprintf_unfiltered (gdb_stdlog
,
1133 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
1134 (long) current_gdbarch
->frame_chain_valid
1135 /*FRAME_CHAIN_VALID ()*/);
1137 #ifdef FRAME_SAVED_PC
1138 fprintf_unfiltered (gdb_stdlog
,
1139 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
1140 (long) current_gdbarch
->frame_saved_pc
1141 /*FRAME_SAVED_PC ()*/);
1143 #ifdef FRAME_ARGS_ADDRESS
1144 fprintf_unfiltered (gdb_stdlog
,
1145 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1146 (long) current_gdbarch
->frame_args_address
1147 /*FRAME_ARGS_ADDRESS ()*/);
1149 #ifdef FRAME_LOCALS_ADDRESS
1150 fprintf_unfiltered (gdb_stdlog
,
1151 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1152 (long) current_gdbarch
->frame_locals_address
1153 /*FRAME_LOCALS_ADDRESS ()*/);
1155 #ifdef SAVED_PC_AFTER_CALL
1156 fprintf_unfiltered (gdb_stdlog
,
1157 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1158 (long) current_gdbarch
->saved_pc_after_call
1159 /*SAVED_PC_AFTER_CALL ()*/);
1161 #ifdef FRAME_NUM_ARGS
1162 fprintf_unfiltered (gdb_stdlog
,
1163 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
1164 (long) current_gdbarch
->frame_num_args
1165 /*FRAME_NUM_ARGS ()*/);
1168 fprintf_unfiltered (gdb_stdlog
,
1169 "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
1170 (long) current_gdbarch
->stack_align
1171 /*STACK_ALIGN ()*/);
1173 #ifdef REG_STRUCT_HAS_ADDR
1174 fprintf_unfiltered (gdb_stdlog
,
1175 "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1176 (long) current_gdbarch
->reg_struct_has_addr
1177 /*REG_STRUCT_HAS_ADDR ()*/);
1179 fprintf_unfiltered (gdb_stdlog
,
1180 "gdbarch_update: GDB_MULTI_ARCH = %d\n",
1184 struct gdbarch_tdep
*
1185 gdbarch_tdep (struct gdbarch
*gdbarch
)
1187 if (gdbarch_debug
>= 2)
1188 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1189 return gdbarch
->tdep
;
1193 const struct bfd_arch_info
*
1194 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1196 if (gdbarch_debug
>= 2)
1197 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1198 return gdbarch
->bfd_arch_info
;
1202 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1204 if (gdbarch_debug
>= 2)
1205 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1206 return gdbarch
->byte_order
;
1210 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1212 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1213 if (gdbarch_debug
>= 2)
1214 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1215 return gdbarch
->bfd_vma_bit
;
1219 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1222 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1226 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1228 if (gdbarch
->ptr_bit
== 0)
1229 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1230 if (gdbarch_debug
>= 2)
1231 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1232 return gdbarch
->ptr_bit
;
1236 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1239 gdbarch
->ptr_bit
= ptr_bit
;
1243 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1245 if (gdbarch
->short_bit
== 0)
1246 internal_error ("gdbarch: gdbarch_short_bit invalid");
1247 if (gdbarch_debug
>= 2)
1248 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1249 return gdbarch
->short_bit
;
1253 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1256 gdbarch
->short_bit
= short_bit
;
1260 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1262 if (gdbarch
->int_bit
== 0)
1263 internal_error ("gdbarch: gdbarch_int_bit invalid");
1264 if (gdbarch_debug
>= 2)
1265 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1266 return gdbarch
->int_bit
;
1270 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1273 gdbarch
->int_bit
= int_bit
;
1277 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1279 if (gdbarch
->long_bit
== 0)
1280 internal_error ("gdbarch: gdbarch_long_bit invalid");
1281 if (gdbarch_debug
>= 2)
1282 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1283 return gdbarch
->long_bit
;
1287 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1290 gdbarch
->long_bit
= long_bit
;
1294 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1296 if (gdbarch
->long_long_bit
== 0)
1297 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1298 if (gdbarch_debug
>= 2)
1299 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1300 return gdbarch
->long_long_bit
;
1304 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1307 gdbarch
->long_long_bit
= long_long_bit
;
1311 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1313 if (gdbarch
->float_bit
== 0)
1314 internal_error ("gdbarch: gdbarch_float_bit invalid");
1315 if (gdbarch_debug
>= 2)
1316 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1317 return gdbarch
->float_bit
;
1321 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1324 gdbarch
->float_bit
= float_bit
;
1328 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1330 if (gdbarch
->double_bit
== 0)
1331 internal_error ("gdbarch: gdbarch_double_bit invalid");
1332 if (gdbarch_debug
>= 2)
1333 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1334 return gdbarch
->double_bit
;
1338 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1341 gdbarch
->double_bit
= double_bit
;
1345 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1347 if (gdbarch
->long_double_bit
== 0)
1348 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1349 if (gdbarch_debug
>= 2)
1350 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1351 return gdbarch
->long_double_bit
;
1355 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1356 int long_double_bit
)
1358 gdbarch
->long_double_bit
= long_double_bit
;
1362 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1364 /* Skip verify of ieee_float, invalid_p == 0 */
1365 if (gdbarch_debug
>= 2)
1366 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1367 return gdbarch
->ieee_float
;
1371 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1374 gdbarch
->ieee_float
= ieee_float
;
1378 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1380 if (gdbarch
->read_pc
== 0)
1381 internal_error ("gdbarch: gdbarch_read_pc invalid");
1382 if (gdbarch_debug
>= 2)
1383 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1384 return gdbarch
->read_pc (pid
);
1388 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1389 gdbarch_read_pc_ftype read_pc
)
1391 gdbarch
->read_pc
= read_pc
;
1395 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1397 if (gdbarch
->write_pc
== 0)
1398 internal_error ("gdbarch: gdbarch_write_pc invalid");
1399 if (gdbarch_debug
>= 2)
1400 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1401 gdbarch
->write_pc (val
, pid
);
1405 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1406 gdbarch_write_pc_ftype write_pc
)
1408 gdbarch
->write_pc
= write_pc
;
1412 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1414 if (gdbarch
->read_fp
== 0)
1415 internal_error ("gdbarch: gdbarch_read_fp invalid");
1416 if (gdbarch_debug
>= 2)
1417 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1418 return gdbarch
->read_fp ();
1422 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1423 gdbarch_read_fp_ftype read_fp
)
1425 gdbarch
->read_fp
= read_fp
;
1429 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1431 if (gdbarch
->write_fp
== 0)
1432 internal_error ("gdbarch: gdbarch_write_fp invalid");
1433 if (gdbarch_debug
>= 2)
1434 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1435 gdbarch
->write_fp (val
);
1439 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1440 gdbarch_write_fp_ftype write_fp
)
1442 gdbarch
->write_fp
= write_fp
;
1446 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1448 if (gdbarch
->read_sp
== 0)
1449 internal_error ("gdbarch: gdbarch_read_sp invalid");
1450 if (gdbarch_debug
>= 2)
1451 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1452 return gdbarch
->read_sp ();
1456 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1457 gdbarch_read_sp_ftype read_sp
)
1459 gdbarch
->read_sp
= read_sp
;
1463 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1465 if (gdbarch
->write_sp
== 0)
1466 internal_error ("gdbarch: gdbarch_write_sp invalid");
1467 if (gdbarch_debug
>= 2)
1468 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1469 gdbarch
->write_sp (val
);
1473 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1474 gdbarch_write_sp_ftype write_sp
)
1476 gdbarch
->write_sp
= write_sp
;
1480 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1482 if (gdbarch
->num_regs
== -1)
1483 internal_error ("gdbarch: gdbarch_num_regs invalid");
1484 if (gdbarch_debug
>= 2)
1485 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1486 return gdbarch
->num_regs
;
1490 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1493 gdbarch
->num_regs
= num_regs
;
1497 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1499 if (gdbarch
->sp_regnum
== -1)
1500 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1501 if (gdbarch_debug
>= 2)
1502 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1503 return gdbarch
->sp_regnum
;
1507 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1510 gdbarch
->sp_regnum
= sp_regnum
;
1514 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1516 if (gdbarch
->fp_regnum
== -1)
1517 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1518 if (gdbarch_debug
>= 2)
1519 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1520 return gdbarch
->fp_regnum
;
1524 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1527 gdbarch
->fp_regnum
= fp_regnum
;
1531 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1533 if (gdbarch
->pc_regnum
== -1)
1534 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1535 if (gdbarch_debug
>= 2)
1536 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1537 return gdbarch
->pc_regnum
;
1541 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1544 gdbarch
->pc_regnum
= pc_regnum
;
1548 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1550 /* Skip verify of fp0_regnum, invalid_p == 0 */
1551 if (gdbarch_debug
>= 2)
1552 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1553 return gdbarch
->fp0_regnum
;
1557 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1560 gdbarch
->fp0_regnum
= fp0_regnum
;
1564 gdbarch_npc_regnum (struct gdbarch
*gdbarch
)
1566 /* Skip verify of npc_regnum, invalid_p == 0 */
1567 if (gdbarch_debug
>= 2)
1568 fprintf_unfiltered (gdb_stdlog
, "gdbarch_npc_regnum called\n");
1569 return gdbarch
->npc_regnum
;
1573 set_gdbarch_npc_regnum (struct gdbarch
*gdbarch
,
1576 gdbarch
->npc_regnum
= npc_regnum
;
1580 gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
)
1582 /* Skip verify of nnpc_regnum, invalid_p == 0 */
1583 if (gdbarch_debug
>= 2)
1584 fprintf_unfiltered (gdb_stdlog
, "gdbarch_nnpc_regnum called\n");
1585 return gdbarch
->nnpc_regnum
;
1589 set_gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
,
1592 gdbarch
->nnpc_regnum
= nnpc_regnum
;
1596 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1598 if (gdbarch
->register_name
== 0)
1599 internal_error ("gdbarch: gdbarch_register_name invalid");
1600 if (gdbarch_debug
>= 2)
1601 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1602 return gdbarch
->register_name (regnr
);
1606 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1607 gdbarch_register_name_ftype register_name
)
1609 gdbarch
->register_name
= register_name
;
1613 gdbarch_register_size (struct gdbarch
*gdbarch
)
1615 if (gdbarch
->register_size
== -1)
1616 internal_error ("gdbarch: gdbarch_register_size invalid");
1617 if (gdbarch_debug
>= 2)
1618 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1619 return gdbarch
->register_size
;
1623 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1626 gdbarch
->register_size
= register_size
;
1630 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1632 if (gdbarch
->register_bytes
== -1)
1633 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1634 if (gdbarch_debug
>= 2)
1635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1636 return gdbarch
->register_bytes
;
1640 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1643 gdbarch
->register_bytes
= register_bytes
;
1647 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1649 if (gdbarch
->register_byte
== 0)
1650 internal_error ("gdbarch: gdbarch_register_byte invalid");
1651 if (gdbarch_debug
>= 2)
1652 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1653 return gdbarch
->register_byte (reg_nr
);
1657 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1658 gdbarch_register_byte_ftype register_byte
)
1660 gdbarch
->register_byte
= register_byte
;
1664 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1666 if (gdbarch
->register_raw_size
== 0)
1667 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1668 if (gdbarch_debug
>= 2)
1669 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1670 return gdbarch
->register_raw_size (reg_nr
);
1674 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1675 gdbarch_register_raw_size_ftype register_raw_size
)
1677 gdbarch
->register_raw_size
= register_raw_size
;
1681 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1683 if (gdbarch
->max_register_raw_size
== -1)
1684 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1685 if (gdbarch_debug
>= 2)
1686 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1687 return gdbarch
->max_register_raw_size
;
1691 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1692 int max_register_raw_size
)
1694 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1698 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1700 if (gdbarch
->register_virtual_size
== 0)
1701 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1702 if (gdbarch_debug
>= 2)
1703 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1704 return gdbarch
->register_virtual_size (reg_nr
);
1708 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1709 gdbarch_register_virtual_size_ftype register_virtual_size
)
1711 gdbarch
->register_virtual_size
= register_virtual_size
;
1715 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1717 if (gdbarch
->max_register_virtual_size
== -1)
1718 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1719 if (gdbarch_debug
>= 2)
1720 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1721 return gdbarch
->max_register_virtual_size
;
1725 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1726 int max_register_virtual_size
)
1728 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1732 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1734 if (gdbarch
->register_virtual_type
== 0)
1735 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1736 if (gdbarch_debug
>= 2)
1737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1738 return gdbarch
->register_virtual_type (reg_nr
);
1742 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1743 gdbarch_register_virtual_type_ftype register_virtual_type
)
1745 gdbarch
->register_virtual_type
= register_virtual_type
;
1749 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1751 if (gdbarch
->use_generic_dummy_frames
== -1)
1752 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1753 if (gdbarch_debug
>= 2)
1754 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1755 return gdbarch
->use_generic_dummy_frames
;
1759 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1760 int use_generic_dummy_frames
)
1762 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1766 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1768 if (gdbarch
->call_dummy_location
== 0)
1769 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1770 if (gdbarch_debug
>= 2)
1771 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1772 return gdbarch
->call_dummy_location
;
1776 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1777 int call_dummy_location
)
1779 gdbarch
->call_dummy_location
= call_dummy_location
;
1783 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1785 if (gdbarch
->call_dummy_address
== 0)
1786 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1787 if (gdbarch_debug
>= 2)
1788 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1789 return gdbarch
->call_dummy_address ();
1793 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1794 gdbarch_call_dummy_address_ftype call_dummy_address
)
1796 gdbarch
->call_dummy_address
= call_dummy_address
;
1800 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1802 if (gdbarch
->call_dummy_start_offset
== -1)
1803 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1804 if (gdbarch_debug
>= 2)
1805 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1806 return gdbarch
->call_dummy_start_offset
;
1810 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1811 CORE_ADDR call_dummy_start_offset
)
1813 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1817 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1819 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1820 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1821 if (gdbarch_debug
>= 2)
1822 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1823 return gdbarch
->call_dummy_breakpoint_offset
;
1827 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1828 CORE_ADDR call_dummy_breakpoint_offset
)
1830 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1834 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1836 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1837 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1838 if (gdbarch_debug
>= 2)
1839 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1840 return gdbarch
->call_dummy_breakpoint_offset_p
;
1844 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1845 int call_dummy_breakpoint_offset_p
)
1847 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1851 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1853 if (gdbarch
->call_dummy_length
== -1)
1854 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1855 if (gdbarch_debug
>= 2)
1856 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1857 return gdbarch
->call_dummy_length
;
1861 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1862 int call_dummy_length
)
1864 gdbarch
->call_dummy_length
= call_dummy_length
;
1868 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1870 if (gdbarch
->pc_in_call_dummy
== 0)
1871 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1872 if (gdbarch_debug
>= 2)
1873 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1874 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1878 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1879 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1881 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1885 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1887 if (gdbarch
->call_dummy_p
== -1)
1888 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1889 if (gdbarch_debug
>= 2)
1890 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1891 return gdbarch
->call_dummy_p
;
1895 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1898 gdbarch
->call_dummy_p
= call_dummy_p
;
1902 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1904 /* Skip verify of call_dummy_words, invalid_p == 0 */
1905 if (gdbarch_debug
>= 2)
1906 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1907 return gdbarch
->call_dummy_words
;
1911 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1912 LONGEST
* call_dummy_words
)
1914 gdbarch
->call_dummy_words
= call_dummy_words
;
1918 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1920 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1921 if (gdbarch_debug
>= 2)
1922 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1923 return gdbarch
->sizeof_call_dummy_words
;
1927 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1928 int sizeof_call_dummy_words
)
1930 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1934 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1936 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1937 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1938 if (gdbarch_debug
>= 2)
1939 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1940 return gdbarch
->call_dummy_stack_adjust_p
;
1944 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1945 int call_dummy_stack_adjust_p
)
1947 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1951 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1953 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1954 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1955 if (gdbarch_debug
>= 2)
1956 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1957 return gdbarch
->call_dummy_stack_adjust
;
1961 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1962 int call_dummy_stack_adjust
)
1964 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1968 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
)
1970 if (gdbarch
->fix_call_dummy
== 0)
1971 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1972 if (gdbarch_debug
>= 2)
1973 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1974 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1978 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1979 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1981 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1985 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1987 if (gdbarch_debug
>= 2)
1988 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1989 return gdbarch
->believe_pcc_promotion
;
1993 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1994 int believe_pcc_promotion
)
1996 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2000 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
2002 if (gdbarch_debug
>= 2)
2003 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
2004 return gdbarch
->believe_pcc_promotion_type
;
2008 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
2009 int believe_pcc_promotion_type
)
2011 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
2015 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
2017 if (gdbarch
->coerce_float_to_double
== 0)
2018 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
2019 if (gdbarch_debug
>= 2)
2020 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
2021 return gdbarch
->coerce_float_to_double (formal
, actual
);
2025 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
2026 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
2028 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
2032 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
)
2034 if (gdbarch
->get_saved_register
== 0)
2035 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
2036 if (gdbarch_debug
>= 2)
2037 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
2038 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
2042 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
2043 gdbarch_get_saved_register_ftype get_saved_register
)
2045 gdbarch
->get_saved_register
= get_saved_register
;
2049 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
2051 if (gdbarch
->register_convertible
== 0)
2052 internal_error ("gdbarch: gdbarch_register_convertible invalid");
2053 if (gdbarch_debug
>= 2)
2054 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
2055 return gdbarch
->register_convertible (nr
);
2059 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
2060 gdbarch_register_convertible_ftype register_convertible
)
2062 gdbarch
->register_convertible
= register_convertible
;
2066 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
2068 if (gdbarch
->register_convert_to_virtual
== 0)
2069 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
2070 if (gdbarch_debug
>= 2)
2071 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
2072 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
2076 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
2077 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
2079 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
2083 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
2085 if (gdbarch
->register_convert_to_raw
== 0)
2086 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
2087 if (gdbarch_debug
>= 2)
2088 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
2089 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
2093 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
2094 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
2096 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
2100 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
2102 if (gdbarch
->pointer_to_address
== 0)
2103 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
2104 if (gdbarch_debug
>= 2)
2105 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2106 return gdbarch
->pointer_to_address (type
, buf
);
2110 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2111 gdbarch_pointer_to_address_ftype pointer_to_address
)
2113 gdbarch
->pointer_to_address
= pointer_to_address
;
2117 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
2119 if (gdbarch
->address_to_pointer
== 0)
2120 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
2121 if (gdbarch_debug
>= 2)
2122 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2123 gdbarch
->address_to_pointer (type
, buf
, addr
);
2127 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2128 gdbarch_address_to_pointer_ftype address_to_pointer
)
2130 gdbarch
->address_to_pointer
= address_to_pointer
;
2134 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
2136 if (gdbarch
->return_value_on_stack
== 0)
2137 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
2138 if (gdbarch_debug
>= 2)
2139 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
2140 return gdbarch
->return_value_on_stack (type
);
2144 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
2145 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
2147 gdbarch
->return_value_on_stack
= return_value_on_stack
;
2151 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
2153 if (gdbarch
->extract_return_value
== 0)
2154 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
2155 if (gdbarch_debug
>= 2)
2156 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2157 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
2161 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2162 gdbarch_extract_return_value_ftype extract_return_value
)
2164 gdbarch
->extract_return_value
= extract_return_value
;
2168 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2170 if (gdbarch
->push_arguments
== 0)
2171 internal_error ("gdbarch: gdbarch_push_arguments invalid");
2172 if (gdbarch_debug
>= 2)
2173 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
2174 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
2178 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
2179 gdbarch_push_arguments_ftype push_arguments
)
2181 gdbarch
->push_arguments
= push_arguments
;
2185 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
2187 if (gdbarch
->push_dummy_frame
== 0)
2188 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
2189 if (gdbarch_debug
>= 2)
2190 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
2191 gdbarch
->push_dummy_frame ();
2195 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
2196 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
2198 gdbarch
->push_dummy_frame
= push_dummy_frame
;
2202 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
2204 if (gdbarch
->push_return_address
== 0)
2205 internal_error ("gdbarch: gdbarch_push_return_address invalid");
2206 if (gdbarch_debug
>= 2)
2207 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
2208 return gdbarch
->push_return_address (pc
, sp
);
2212 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
2213 gdbarch_push_return_address_ftype push_return_address
)
2215 gdbarch
->push_return_address
= push_return_address
;
2219 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
2221 if (gdbarch
->pop_frame
== 0)
2222 internal_error ("gdbarch: gdbarch_pop_frame invalid");
2223 if (gdbarch_debug
>= 2)
2224 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
2225 gdbarch
->pop_frame ();
2229 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
2230 gdbarch_pop_frame_ftype pop_frame
)
2232 gdbarch
->pop_frame
= pop_frame
;
2236 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2238 if (gdbarch
->d10v_make_daddr
== 0)
2239 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2240 if (gdbarch_debug
>= 2)
2241 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
2242 return gdbarch
->d10v_make_daddr (x
);
2246 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
2247 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
2249 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
2253 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2255 if (gdbarch
->d10v_make_iaddr
== 0)
2256 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2257 if (gdbarch_debug
>= 2)
2258 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2259 return gdbarch
->d10v_make_iaddr (x
);
2263 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2264 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2266 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2270 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2272 if (gdbarch
->d10v_daddr_p
== 0)
2273 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2274 if (gdbarch_debug
>= 2)
2275 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2276 return gdbarch
->d10v_daddr_p (x
);
2280 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2281 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2283 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2287 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2289 if (gdbarch
->d10v_iaddr_p
== 0)
2290 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2291 if (gdbarch_debug
>= 2)
2292 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2293 return gdbarch
->d10v_iaddr_p (x
);
2297 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2298 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2300 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2304 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2306 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2307 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2308 if (gdbarch_debug
>= 2)
2309 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2310 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2314 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2315 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2317 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2321 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2323 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2324 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2325 if (gdbarch_debug
>= 2)
2326 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2327 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2331 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2332 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2334 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2338 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2340 if (gdbarch
->store_struct_return
== 0)
2341 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2342 if (gdbarch_debug
>= 2)
2343 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2344 gdbarch
->store_struct_return (addr
, sp
);
2348 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2349 gdbarch_store_struct_return_ftype store_struct_return
)
2351 gdbarch
->store_struct_return
= store_struct_return
;
2355 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2357 if (gdbarch
->store_return_value
== 0)
2358 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2359 if (gdbarch_debug
>= 2)
2360 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2361 gdbarch
->store_return_value (type
, valbuf
);
2365 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2366 gdbarch_store_return_value_ftype store_return_value
)
2368 gdbarch
->store_return_value
= store_return_value
;
2372 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2374 if (gdbarch
->extract_struct_value_address
== 0)
2375 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2376 if (gdbarch_debug
>= 2)
2377 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2378 return gdbarch
->extract_struct_value_address (regbuf
);
2382 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2383 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2385 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2389 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2391 if (gdbarch
->use_struct_convention
== 0)
2392 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2393 if (gdbarch_debug
>= 2)
2394 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2395 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2399 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2400 gdbarch_use_struct_convention_ftype use_struct_convention
)
2402 gdbarch
->use_struct_convention
= use_struct_convention
;
2406 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2408 if (gdbarch
->frame_init_saved_regs
== 0)
2409 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2410 if (gdbarch_debug
>= 2)
2411 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2412 gdbarch
->frame_init_saved_regs (frame
);
2416 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2417 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2419 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2423 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2425 if (gdbarch
->init_extra_frame_info
== 0)
2426 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2427 if (gdbarch_debug
>= 2)
2428 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2429 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2433 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2434 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2436 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2440 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2442 if (gdbarch
->skip_prologue
== 0)
2443 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2444 if (gdbarch_debug
>= 2)
2445 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2446 return gdbarch
->skip_prologue (ip
);
2450 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2451 gdbarch_skip_prologue_ftype skip_prologue
)
2453 gdbarch
->skip_prologue
= skip_prologue
;
2457 gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2459 if (gdbarch
->prologue_frameless_p
== 0)
2460 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
2461 if (gdbarch_debug
>= 2)
2462 fprintf_unfiltered (gdb_stdlog
, "gdbarch_prologue_frameless_p called\n");
2463 return gdbarch
->prologue_frameless_p (ip
);
2467 set_gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
,
2468 gdbarch_prologue_frameless_p_ftype prologue_frameless_p
)
2470 gdbarch
->prologue_frameless_p
= prologue_frameless_p
;
2474 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2476 if (gdbarch
->inner_than
== 0)
2477 internal_error ("gdbarch: gdbarch_inner_than invalid");
2478 if (gdbarch_debug
>= 2)
2479 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2480 return gdbarch
->inner_than (lhs
, rhs
);
2484 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2485 gdbarch_inner_than_ftype inner_than
)
2487 gdbarch
->inner_than
= inner_than
;
2491 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2493 if (gdbarch
->breakpoint_from_pc
== 0)
2494 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2495 if (gdbarch_debug
>= 2)
2496 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2497 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2501 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2502 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2504 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2508 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2510 if (gdbarch
->memory_insert_breakpoint
== 0)
2511 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2512 if (gdbarch_debug
>= 2)
2513 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2514 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2518 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2519 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2521 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2525 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2527 if (gdbarch
->memory_remove_breakpoint
== 0)
2528 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2529 if (gdbarch_debug
>= 2)
2530 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2531 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2535 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2536 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2538 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2542 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2544 if (gdbarch
->decr_pc_after_break
== -1)
2545 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2546 if (gdbarch_debug
>= 2)
2547 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2548 return gdbarch
->decr_pc_after_break
;
2552 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2553 CORE_ADDR decr_pc_after_break
)
2555 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2559 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2561 if (gdbarch
->function_start_offset
== -1)
2562 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2563 if (gdbarch_debug
>= 2)
2564 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2565 return gdbarch
->function_start_offset
;
2569 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2570 CORE_ADDR function_start_offset
)
2572 gdbarch
->function_start_offset
= function_start_offset
;
2576 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2578 if (gdbarch
->remote_translate_xfer_address
== 0)
2579 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2580 if (gdbarch_debug
>= 2)
2581 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2582 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2586 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2587 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2589 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2593 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2595 if (gdbarch
->frame_args_skip
== -1)
2596 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2597 if (gdbarch_debug
>= 2)
2598 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2599 return gdbarch
->frame_args_skip
;
2603 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2604 CORE_ADDR frame_args_skip
)
2606 gdbarch
->frame_args_skip
= frame_args_skip
;
2610 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2612 if (gdbarch
->frameless_function_invocation
== 0)
2613 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2614 if (gdbarch_debug
>= 2)
2615 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2616 return gdbarch
->frameless_function_invocation (fi
);
2620 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2621 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2623 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2627 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2629 if (gdbarch
->frame_chain
== 0)
2630 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2631 if (gdbarch_debug
>= 2)
2632 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2633 return gdbarch
->frame_chain (frame
);
2637 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2638 gdbarch_frame_chain_ftype frame_chain
)
2640 gdbarch
->frame_chain
= frame_chain
;
2644 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2646 if (gdbarch
->frame_chain_valid
== 0)
2647 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2648 if (gdbarch_debug
>= 2)
2649 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2650 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2654 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2655 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2657 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2661 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2663 if (gdbarch
->frame_saved_pc
== 0)
2664 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2665 if (gdbarch_debug
>= 2)
2666 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2667 return gdbarch
->frame_saved_pc (fi
);
2671 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2672 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2674 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2678 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2680 if (gdbarch
->frame_args_address
== 0)
2681 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2682 if (gdbarch_debug
>= 2)
2683 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2684 return gdbarch
->frame_args_address (fi
);
2688 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2689 gdbarch_frame_args_address_ftype frame_args_address
)
2691 gdbarch
->frame_args_address
= frame_args_address
;
2695 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2697 if (gdbarch
->frame_locals_address
== 0)
2698 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2699 if (gdbarch_debug
>= 2)
2700 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2701 return gdbarch
->frame_locals_address (fi
);
2705 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2706 gdbarch_frame_locals_address_ftype frame_locals_address
)
2708 gdbarch
->frame_locals_address
= frame_locals_address
;
2712 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2714 if (gdbarch
->saved_pc_after_call
== 0)
2715 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2716 if (gdbarch_debug
>= 2)
2717 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2718 return gdbarch
->saved_pc_after_call (frame
);
2722 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2723 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2725 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2729 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2731 if (gdbarch
->frame_num_args
== 0)
2732 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2733 if (gdbarch_debug
>= 2)
2734 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2735 return gdbarch
->frame_num_args (frame
);
2739 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2740 gdbarch_frame_num_args_ftype frame_num_args
)
2742 gdbarch
->frame_num_args
= frame_num_args
;
2746 gdbarch_stack_align_p (struct gdbarch
*gdbarch
)
2748 return gdbarch
->stack_align
!= 0;
2752 gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2754 if (gdbarch
->stack_align
== 0)
2755 internal_error ("gdbarch: gdbarch_stack_align invalid");
2756 if (gdbarch_debug
>= 2)
2757 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stack_align called\n");
2758 return gdbarch
->stack_align (sp
);
2762 set_gdbarch_stack_align (struct gdbarch
*gdbarch
,
2763 gdbarch_stack_align_ftype stack_align
)
2765 gdbarch
->stack_align
= stack_align
;
2769 gdbarch_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
2771 return gdbarch
->reg_struct_has_addr
!= 0;
2775 gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
2777 if (gdbarch
->reg_struct_has_addr
== 0)
2778 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
2779 if (gdbarch_debug
>= 2)
2780 fprintf_unfiltered (gdb_stdlog
, "gdbarch_reg_struct_has_addr called\n");
2781 return gdbarch
->reg_struct_has_addr (gcc_p
, type
);
2785 set_gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
,
2786 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr
)
2788 gdbarch
->reg_struct_has_addr
= reg_struct_has_addr
;
2792 /* Keep a registrary of per-architecture data-pointers required by GDB
2800 struct gdbarch_data_registration
2802 gdbarch_data_ftype
*init
;
2803 struct gdbarch_data
*data
;
2804 struct gdbarch_data_registration
*next
;
2807 struct gdbarch_data_registrary
2810 struct gdbarch_data_registration
*registrations
;
2813 struct gdbarch_data_registrary gdbarch_data_registrary
=
2818 struct gdbarch_data
*
2819 register_gdbarch_data (gdbarch_data_ftype
*init
)
2821 struct gdbarch_data_registration
**curr
;
2822 for (curr
= &gdbarch_data_registrary
.registrations
;
2824 curr
= &(*curr
)->next
);
2825 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2826 (*curr
)->next
= NULL
;
2827 (*curr
)->init
= init
;
2828 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2829 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2830 return (*curr
)->data
;
2834 /* Walk through all the registered users initializing each in turn. */
2837 init_gdbarch_data (struct gdbarch
*gdbarch
)
2839 struct gdbarch_data_registration
*rego
;
2840 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2841 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2842 for (rego
= gdbarch_data_registrary
.registrations
;
2846 if (rego
->data
->index
< gdbarch
->nr_data
)
2847 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2852 /* Return the current value of the specified per-architecture
2857 struct gdbarch_data
*data
;
2859 if (data
->index
>= current_gdbarch
->nr_data
)
2860 internal_error ("gdbarch_data: request for non-existant data.");
2861 return current_gdbarch
->data
[data
->index
];
2866 /* Keep a registrary of swaped data required by GDB modules. */
2871 struct gdbarch_swap_registration
*source
;
2872 struct gdbarch_swap
*next
;
2875 struct gdbarch_swap_registration
2878 unsigned long sizeof_data
;
2879 gdbarch_swap_ftype
*init
;
2880 struct gdbarch_swap_registration
*next
;
2883 struct gdbarch_swap_registrary
2886 struct gdbarch_swap_registration
*registrations
;
2889 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2895 register_gdbarch_swap (void *data
,
2896 unsigned long sizeof_data
,
2897 gdbarch_swap_ftype
*init
)
2899 struct gdbarch_swap_registration
**rego
;
2900 for (rego
= &gdbarch_swap_registrary
.registrations
;
2902 rego
= &(*rego
)->next
);
2903 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2904 (*rego
)->next
= NULL
;
2905 (*rego
)->init
= init
;
2906 (*rego
)->data
= data
;
2907 (*rego
)->sizeof_data
= sizeof_data
;
2912 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2914 struct gdbarch_swap_registration
*rego
;
2915 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2916 for (rego
= gdbarch_swap_registrary
.registrations
;
2920 if (rego
->data
!= NULL
)
2922 (*curr
) = XMALLOC (struct gdbarch_swap
);
2923 (*curr
)->source
= rego
;
2924 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2925 (*curr
)->next
= NULL
;
2926 memset (rego
->data
, 0, rego
->sizeof_data
);
2927 curr
= &(*curr
)->next
;
2929 if (rego
->init
!= NULL
)
2935 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2937 struct gdbarch_swap
*curr
;
2938 for (curr
= gdbarch
->swap
;
2941 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2945 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2947 struct gdbarch_swap
*curr
;
2948 for (curr
= gdbarch
->swap
;
2951 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2955 /* Keep a registrary of the architectures known by GDB. */
2957 struct gdbarch_init_registration
2959 enum bfd_architecture bfd_architecture
;
2960 gdbarch_init_ftype
*init
;
2961 struct gdbarch_list
*arches
;
2962 struct gdbarch_init_registration
*next
;
2965 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2968 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2969 gdbarch_init_ftype
*init
)
2971 struct gdbarch_init_registration
**curr
;
2972 const struct bfd_arch_info
*bfd_arch_info
;
2973 /* Check that BFD reconizes this architecture */
2974 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2975 if (bfd_arch_info
== NULL
)
2977 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2979 /* Check that we haven't seen this architecture before */
2980 for (curr
= &gdbarch_init_registrary
;
2982 curr
= &(*curr
)->next
)
2984 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2985 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2986 bfd_arch_info
->printable_name
);
2990 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2991 bfd_arch_info
->printable_name
,
2994 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2995 (*curr
)->bfd_architecture
= bfd_architecture
;
2996 (*curr
)->init
= init
;
2997 (*curr
)->arches
= NULL
;
2998 (*curr
)->next
= NULL
;
3003 /* Look for an architecture using gdbarch_info. Base search on only
3004 BFD_ARCH_INFO and BYTE_ORDER. */
3006 struct gdbarch_list
*
3007 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3008 const struct gdbarch_info
*info
)
3010 for (; arches
!= NULL
; arches
= arches
->next
)
3012 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3014 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3022 /* Update the current architecture. Return ZERO if the update request
3026 gdbarch_update (struct gdbarch_info info
)
3028 struct gdbarch
*new_gdbarch
;
3029 struct gdbarch_list
**list
;
3030 struct gdbarch_init_registration
*rego
;
3032 /* Fill in any missing bits. Most important is the bfd_architecture
3033 which is used to select the target architecture. */
3034 if (info
.bfd_architecture
== bfd_arch_unknown
)
3036 if (info
.bfd_arch_info
!= NULL
)
3037 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
3038 else if (info
.abfd
!= NULL
)
3039 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
3040 /* FIXME - should query BFD for its default architecture. */
3042 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
3044 if (info
.bfd_arch_info
== NULL
)
3046 if (target_architecture_auto
&& info
.abfd
!= NULL
)
3047 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
3049 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
3051 if (info
.byte_order
== 0)
3053 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
3054 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
3055 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
3058 info
.byte_order
= current_gdbarch
->byte_order
;
3059 /* FIXME - should query BFD for its default byte-order. */
3061 /* A default for abfd? */
3063 /* Find the target that knows about this architecture. */
3064 for (rego
= gdbarch_init_registrary
;
3065 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
3070 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
3076 fprintf_unfiltered (gdb_stdlog
,
3077 "gdbarch_update: info.bfd_architecture %d (%s)\n",
3078 info
.bfd_architecture
,
3079 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
3080 fprintf_unfiltered (gdb_stdlog
,
3081 "gdbarch_update: info.bfd_arch_info %s\n",
3082 (info
.bfd_arch_info
!= NULL
3083 ? info
.bfd_arch_info
->printable_name
3085 fprintf_unfiltered (gdb_stdlog
,
3086 "gdbarch_update: info.byte_order %d (%s)\n",
3088 (info
.byte_order
== BIG_ENDIAN
? "big"
3089 : info
.byte_order
== LITTLE_ENDIAN
? "little"
3091 fprintf_unfiltered (gdb_stdlog
,
3092 "gdbarch_update: info.abfd 0x%lx\n",
3094 fprintf_unfiltered (gdb_stdlog
,
3095 "gdbarch_update: info.tdep_info 0x%lx\n",
3096 (long) info
.tdep_info
);
3099 /* Ask the target for a replacement architecture. */
3100 new_gdbarch
= rego
->init (info
, rego
->arches
);
3102 /* Did the target like it? No. Reject the change. */
3103 if (new_gdbarch
== NULL
)
3106 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
3110 /* Did the architecture change? No. Do nothing. */
3111 if (current_gdbarch
== new_gdbarch
)
3114 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
3116 new_gdbarch
->bfd_arch_info
->printable_name
);
3120 /* Swap all data belonging to the old target out */
3121 swapout_gdbarch_swap (current_gdbarch
);
3123 /* Is this a pre-existing architecture? Yes. Swap it in. */
3124 for (list
= ®o
->arches
;
3126 list
= &(*list
)->next
)
3128 if ((*list
)->gdbarch
== new_gdbarch
)
3131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
3133 new_gdbarch
->bfd_arch_info
->printable_name
);
3134 current_gdbarch
= new_gdbarch
;
3135 swapin_gdbarch_swap (new_gdbarch
);
3140 /* Append this new architecture to this targets list. */
3141 (*list
) = XMALLOC (struct gdbarch_list
);
3142 (*list
)->next
= NULL
;
3143 (*list
)->gdbarch
= new_gdbarch
;
3145 /* Switch to this new architecture. Dump it out. */
3146 current_gdbarch
= new_gdbarch
;
3149 fprintf_unfiltered (gdb_stdlog
,
3150 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
3152 new_gdbarch
->bfd_arch_info
->printable_name
);
3156 /* Check that the newly installed architecture is valid. */
3157 verify_gdbarch (new_gdbarch
);
3159 /* Initialize the per-architecture memory (swap) areas.
3160 CURRENT_GDBARCH must be update before these modules are
3162 init_gdbarch_swap (new_gdbarch
);
3164 /* Initialize the per-architecture data-pointer of all parties that
3165 registered an interest in this architecture. CURRENT_GDBARCH
3166 must be updated before these modules are called. */
3167 init_gdbarch_data (new_gdbarch
);
3174 /* Functions to manipulate the endianness of the target. */
3176 #ifdef TARGET_BYTE_ORDER_SELECTABLE
3177 /* compat - Catch old targets that expect a selectable byte-order to
3178 default to BIG_ENDIAN */
3179 #ifndef TARGET_BYTE_ORDER_DEFAULT
3180 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
3183 #if !TARGET_BYTE_ORDER_SELECTABLE_P
3184 #ifndef TARGET_BYTE_ORDER_DEFAULT
3185 /* compat - Catch old non byte-order selectable targets that do not
3186 define TARGET_BYTE_ORDER_DEFAULT and instead expect
3187 TARGET_BYTE_ORDER to be used as the default. For targets that
3188 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
3189 below will get a strange compiler warning. */
3190 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
3193 #ifndef TARGET_BYTE_ORDER_DEFAULT
3194 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
3196 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
3197 int target_byte_order_auto
= 1;
3199 /* Chain containing the \"set endian\" commands. */
3200 static struct cmd_list_element
*endianlist
= NULL
;
3202 /* Called by ``show endian''. */
3204 show_endian (char *args
, int from_tty
)
3207 (TARGET_BYTE_ORDER_AUTO
3208 ? "The target endianness is set automatically (currently %s endian)\n"
3209 : "The target is assumed to be %s endian\n");
3210 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
3213 /* Called if the user enters ``set endian'' without an argument. */
3215 set_endian (char *args
, int from_tty
)
3217 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
3218 show_endian (args
, from_tty
);
3221 /* Called by ``set endian big''. */
3223 set_endian_big (char *args
, int from_tty
)
3225 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3227 target_byte_order
= BIG_ENDIAN
;
3228 target_byte_order_auto
= 0;
3231 struct gdbarch_info info
;
3232 memset (&info
, 0, sizeof info
);
3233 info
.byte_order
= BIG_ENDIAN
;
3234 gdbarch_update (info
);
3239 printf_unfiltered ("Byte order is not selectable.");
3240 show_endian (args
, from_tty
);
3244 /* Called by ``set endian little''. */
3246 set_endian_little (char *args
, int from_tty
)
3248 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3250 target_byte_order
= LITTLE_ENDIAN
;
3251 target_byte_order_auto
= 0;
3254 struct gdbarch_info info
;
3255 memset (&info
, 0, sizeof info
);
3256 info
.byte_order
= LITTLE_ENDIAN
;
3257 gdbarch_update (info
);
3262 printf_unfiltered ("Byte order is not selectable.");
3263 show_endian (args
, from_tty
);
3267 /* Called by ``set endian auto''. */
3269 set_endian_auto (char *args
, int from_tty
)
3271 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3273 target_byte_order_auto
= 1;
3277 printf_unfiltered ("Byte order is not selectable.");
3278 show_endian (args
, from_tty
);
3282 /* Set the endianness from a BFD. */
3284 set_endian_from_file (bfd
*abfd
)
3286 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3290 if (bfd_big_endian (abfd
))
3293 want
= LITTLE_ENDIAN
;
3294 if (TARGET_BYTE_ORDER_AUTO
)
3295 target_byte_order
= want
;
3296 else if (TARGET_BYTE_ORDER
!= want
)
3297 warning ("%s endian file does not match %s endian target.",
3298 want
== BIG_ENDIAN
? "big" : "little",
3299 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3303 if (bfd_big_endian (abfd
)
3304 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
3305 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
3306 warning ("%s endian file does not match %s endian target.",
3307 bfd_big_endian (abfd
) ? "big" : "little",
3308 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3314 /* Functions to manipulate the architecture of the target */
3316 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3318 int target_architecture_auto
= 1;
3319 extern const struct bfd_arch_info bfd_default_arch_struct
;
3320 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
3321 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
3323 static void show_endian (char *, int);
3324 static void set_endian (char *, int);
3325 static void set_endian_big (char *, int);
3326 static void set_endian_little (char *, int);
3327 static void set_endian_auto (char *, int);
3328 static void set_endian_from_file (bfd
*);
3329 static int arch_ok (const struct bfd_arch_info
*arch
);
3330 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3331 static void show_architecture (char *, int);
3332 static void set_architecture (char *, int);
3333 static void info_architecture (char *, int);
3334 static void set_architecture_from_file (bfd
*);
3336 /* Do the real work of changing the current architecture */
3339 arch_ok (const struct bfd_arch_info
*arch
)
3341 /* Should be performing the more basic check that the binary is
3342 compatible with GDB. */
3343 /* Check with the target that the architecture is valid. */
3344 return (target_architecture_hook
== NULL
3345 || target_architecture_hook (arch
));
3349 set_arch (const struct bfd_arch_info
*arch
,
3355 if (!arch_ok (arch
))
3356 warning ("Target may not support %s architecture",
3357 arch
->printable_name
);
3358 target_architecture
= arch
;
3360 case set_arch_manual
:
3361 if (!arch_ok (arch
))
3363 printf_unfiltered ("Target does not support `%s' architecture.\n",
3364 arch
->printable_name
);
3368 target_architecture_auto
= 0;
3369 target_architecture
= arch
;
3377 /* Called if the user enters ``show architecture'' without an argument. */
3379 show_architecture (char *args
, int from_tty
)
3382 arch
= TARGET_ARCHITECTURE
->printable_name
;
3383 if (target_architecture_auto
)
3384 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3386 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3389 /* Called if the user enters ``set architecture'' with or without an
3392 set_architecture (char *args
, int from_tty
)
3396 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3398 else if (strcmp (args
, "auto") == 0)
3400 target_architecture_auto
= 1;
3402 else if (GDB_MULTI_ARCH
)
3404 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3406 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3409 struct gdbarch_info info
;
3410 memset (&info
, 0, sizeof info
);
3411 info
.bfd_arch_info
= arch
;
3412 if (gdbarch_update (info
))
3413 target_architecture_auto
= 0;
3415 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3420 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3422 set_arch (arch
, set_arch_manual
);
3424 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3428 /* Called if the user enters ``info architecture'' without an argument. */
3430 info_architecture (char *args
, int from_tty
)
3432 enum bfd_architecture a
;
3435 if (gdbarch_init_registrary
!= NULL
)
3437 struct gdbarch_init_registration
*rego
;
3438 printf_filtered ("Available architectures are:\n");
3439 for (rego
= gdbarch_init_registrary
;
3443 const struct bfd_arch_info
*ap
;
3444 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3449 printf_filtered (" %s", ap
->printable_name
);
3453 printf_filtered ("\n");
3459 printf_filtered ("There are no available architectures.\n");
3463 printf_filtered ("Available architectures are:\n");
3464 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3466 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3471 printf_filtered (" %s", ap
->printable_name
);
3475 printf_filtered ("\n");
3480 /* Set the architecture from arch/machine */
3482 set_architecture_from_arch_mach (arch
, mach
)
3483 enum bfd_architecture arch
;
3486 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3488 set_arch (wanted
, set_arch_manual
);
3490 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3493 /* Set the architecture from a BFD */
3495 set_architecture_from_file (bfd
*abfd
)
3497 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3498 if (target_architecture_auto
)
3500 set_arch (wanted
, set_arch_auto
);
3502 else if (wanted
!= target_architecture
)
3504 warning ("%s architecture file may be incompatible with %s target.",
3505 wanted
->printable_name
,
3506 target_architecture
->printable_name
);
3511 /* Misc helper functions for targets. */
3514 frame_num_args_unknown (fi
)
3515 struct frame_info
*fi
;
3522 generic_register_convertible_not (num
)
3531 /* Pointer to the target-dependent disassembly function. */
3532 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3533 disassemble_info tm_print_insn_info
;
3537 /* Set the dynamic target-system-dependant parameters (architecture,
3538 byte-order) using information found in the BFD */
3541 set_gdbarch_from_file (abfd
)
3546 struct gdbarch_info info
;
3547 memset (&info
, 0, sizeof info
);
3549 gdbarch_update (info
);
3552 set_architecture_from_file (abfd
);
3553 set_endian_from_file (abfd
);
3557 /* Initialize the current architecture. */
3559 initialize_current_architecture ()
3563 struct gdbarch_init_registration
*rego
;
3564 const struct bfd_arch_info
*chosen
= NULL
;
3565 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3567 const struct bfd_arch_info
*ap
3568 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3570 /* Choose the first architecture alphabetically. */
3572 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3578 struct gdbarch_info info
;
3579 memset (&info
, 0, sizeof info
);
3580 info
.bfd_arch_info
= chosen
;
3581 gdbarch_update (info
);
3586 extern void _initialize_gdbarch (void);
3588 _initialize_gdbarch ()
3590 struct cmd_list_element
*c
;
3592 add_prefix_cmd ("endian", class_support
, set_endian
,
3593 "Set endianness of target.",
3594 &endianlist
, "set endian ", 0, &setlist
);
3595 add_cmd ("big", class_support
, set_endian_big
,
3596 "Set target as being big endian.", &endianlist
);
3597 add_cmd ("little", class_support
, set_endian_little
,
3598 "Set target as being little endian.", &endianlist
);
3599 add_cmd ("auto", class_support
, set_endian_auto
,
3600 "Select target endianness automatically.", &endianlist
);
3601 add_cmd ("endian", class_support
, show_endian
,
3602 "Show endianness of target.", &showlist
);
3604 add_cmd ("architecture", class_support
, set_architecture
,
3605 "Set architecture of target.", &setlist
);
3606 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3607 add_cmd ("architecture", class_support
, show_architecture
,
3608 "Show architecture of target.", &showlist
);
3609 add_cmd ("architecture", class_support
, info_architecture
,
3610 "List supported target architectures", &infolist
);
3612 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3613 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3614 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3615 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3616 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3618 add_show_from_set (add_set_cmd ("arch",
3621 (char *)&gdbarch_debug
,
3622 "Set architecture debugging.\n\
3623 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3625 c
= add_set_cmd ("archdebug",
3628 (char *)&gdbarch_debug
,
3629 "Set architecture debugging.\n\
3630 When non-zero, architecture debugging is enabled.", &setlist
);
3632 deprecate_cmd (c
, "set debug arch");
3633 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");