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 if (TARGET_ARCHITECTURE
!= NULL
)
646 fprintf_unfiltered (gdb_stdlog
,
647 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
648 TARGET_ARCHITECTURE
->printable_name
);
649 fprintf_unfiltered (gdb_stdlog
,
650 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
651 (long) TARGET_BYTE_ORDER
);
652 fprintf_unfiltered (gdb_stdlog
,
653 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
654 (long) TARGET_BFD_VMA_BIT
);
655 fprintf_unfiltered (gdb_stdlog
,
656 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
657 (long) TARGET_PTR_BIT
);
658 fprintf_unfiltered (gdb_stdlog
,
659 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
660 (long) TARGET_SHORT_BIT
);
661 fprintf_unfiltered (gdb_stdlog
,
662 "gdbarch_update: TARGET_INT_BIT = %ld\n",
663 (long) TARGET_INT_BIT
);
664 fprintf_unfiltered (gdb_stdlog
,
665 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
666 (long) TARGET_LONG_BIT
);
667 fprintf_unfiltered (gdb_stdlog
,
668 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
669 (long) TARGET_LONG_LONG_BIT
);
670 fprintf_unfiltered (gdb_stdlog
,
671 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
672 (long) TARGET_FLOAT_BIT
);
673 fprintf_unfiltered (gdb_stdlog
,
674 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
675 (long) TARGET_DOUBLE_BIT
);
676 fprintf_unfiltered (gdb_stdlog
,
677 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
678 (long) TARGET_LONG_DOUBLE_BIT
);
679 fprintf_unfiltered (gdb_stdlog
,
680 "gdbarch_update: IEEE_FLOAT = %ld\n",
682 fprintf_unfiltered (gdb_stdlog
,
683 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
684 (long) current_gdbarch
->read_pc
685 /*TARGET_READ_PC ()*/);
686 fprintf_unfiltered (gdb_stdlog
,
687 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
688 (long) current_gdbarch
->write_pc
689 /*TARGET_WRITE_PC ()*/);
690 fprintf_unfiltered (gdb_stdlog
,
691 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
692 (long) current_gdbarch
->read_fp
693 /*TARGET_READ_FP ()*/);
694 fprintf_unfiltered (gdb_stdlog
,
695 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
696 (long) current_gdbarch
->write_fp
697 /*TARGET_WRITE_FP ()*/);
698 fprintf_unfiltered (gdb_stdlog
,
699 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
700 (long) current_gdbarch
->read_sp
701 /*TARGET_READ_SP ()*/);
702 fprintf_unfiltered (gdb_stdlog
,
703 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
704 (long) current_gdbarch
->write_sp
705 /*TARGET_WRITE_SP ()*/);
706 fprintf_unfiltered (gdb_stdlog
,
707 "gdbarch_update: NUM_REGS = %ld\n",
709 fprintf_unfiltered (gdb_stdlog
,
710 "gdbarch_update: SP_REGNUM = %ld\n",
712 fprintf_unfiltered (gdb_stdlog
,
713 "gdbarch_update: FP_REGNUM = %ld\n",
715 fprintf_unfiltered (gdb_stdlog
,
716 "gdbarch_update: PC_REGNUM = %ld\n",
718 fprintf_unfiltered (gdb_stdlog
,
719 "gdbarch_update: FP0_REGNUM = %ld\n",
721 fprintf_unfiltered (gdb_stdlog
,
722 "gdbarch_update: NPC_REGNUM = %ld\n",
724 fprintf_unfiltered (gdb_stdlog
,
725 "gdbarch_update: NNPC_REGNUM = %ld\n",
727 fprintf_unfiltered (gdb_stdlog
,
728 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
729 (long) current_gdbarch
->register_name
730 /*REGISTER_NAME ()*/);
731 fprintf_unfiltered (gdb_stdlog
,
732 "gdbarch_update: REGISTER_SIZE = %ld\n",
733 (long) REGISTER_SIZE
);
734 fprintf_unfiltered (gdb_stdlog
,
735 "gdbarch_update: REGISTER_BYTES = %ld\n",
736 (long) REGISTER_BYTES
);
737 fprintf_unfiltered (gdb_stdlog
,
738 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
739 (long) current_gdbarch
->register_byte
740 /*REGISTER_BYTE ()*/);
741 fprintf_unfiltered (gdb_stdlog
,
742 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
743 (long) current_gdbarch
->register_raw_size
744 /*REGISTER_RAW_SIZE ()*/);
745 fprintf_unfiltered (gdb_stdlog
,
746 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
747 (long) MAX_REGISTER_RAW_SIZE
);
748 fprintf_unfiltered (gdb_stdlog
,
749 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
750 (long) current_gdbarch
->register_virtual_size
751 /*REGISTER_VIRTUAL_SIZE ()*/);
752 fprintf_unfiltered (gdb_stdlog
,
753 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
754 (long) MAX_REGISTER_VIRTUAL_SIZE
);
755 fprintf_unfiltered (gdb_stdlog
,
756 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
757 (long) current_gdbarch
->register_virtual_type
758 /*REGISTER_VIRTUAL_TYPE ()*/);
759 fprintf_unfiltered (gdb_stdlog
,
760 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
761 (long) USE_GENERIC_DUMMY_FRAMES
);
762 fprintf_unfiltered (gdb_stdlog
,
763 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
764 (long) CALL_DUMMY_LOCATION
);
765 fprintf_unfiltered (gdb_stdlog
,
766 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
767 (long) current_gdbarch
->call_dummy_address
768 /*CALL_DUMMY_ADDRESS ()*/);
769 fprintf_unfiltered (gdb_stdlog
,
770 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
771 (long) CALL_DUMMY_START_OFFSET
);
772 fprintf_unfiltered (gdb_stdlog
,
773 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
774 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
775 fprintf_unfiltered (gdb_stdlog
,
776 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
777 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
778 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
779 fprintf_unfiltered (gdb_stdlog
,
780 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
781 (long) CALL_DUMMY_LENGTH
);
782 fprintf_unfiltered (gdb_stdlog
,
783 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
784 (long) current_gdbarch
->pc_in_call_dummy
785 /*PC_IN_CALL_DUMMY ()*/);
786 fprintf_unfiltered (gdb_stdlog
,
787 "gdbarch_update: CALL_DUMMY_P = %ld\n",
788 (long) CALL_DUMMY_P
);
789 fprintf_unfiltered (gdb_stdlog
,
790 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
791 (long) CALL_DUMMY_WORDS
);
792 fprintf_unfiltered (gdb_stdlog
,
793 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
794 (long) SIZEOF_CALL_DUMMY_WORDS
);
795 fprintf_unfiltered (gdb_stdlog
,
796 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
797 (long) CALL_DUMMY_STACK_ADJUST_P
);
798 if (CALL_DUMMY_STACK_ADJUST_P
)
799 fprintf_unfiltered (gdb_stdlog
,
800 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
801 (long) CALL_DUMMY_STACK_ADJUST
);
802 fprintf_unfiltered (gdb_stdlog
,
803 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
804 (long) current_gdbarch
->fix_call_dummy
805 /*FIX_CALL_DUMMY ()*/);
806 #ifdef BELIEVE_PCC_PROMOTION
807 fprintf_unfiltered (gdb_stdlog
,
808 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
809 (long) BELIEVE_PCC_PROMOTION
);
811 #ifdef BELIEVE_PCC_PROMOTION_TYPE
812 fprintf_unfiltered (gdb_stdlog
,
813 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
814 (long) BELIEVE_PCC_PROMOTION_TYPE
);
816 fprintf_unfiltered (gdb_stdlog
,
817 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
818 (long) current_gdbarch
->coerce_float_to_double
819 /*COERCE_FLOAT_TO_DOUBLE ()*/);
820 fprintf_unfiltered (gdb_stdlog
,
821 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
822 (long) current_gdbarch
->get_saved_register
823 /*GET_SAVED_REGISTER ()*/);
824 fprintf_unfiltered (gdb_stdlog
,
825 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
826 (long) current_gdbarch
->register_convertible
827 /*REGISTER_CONVERTIBLE ()*/);
828 fprintf_unfiltered (gdb_stdlog
,
829 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
830 (long) current_gdbarch
->register_convert_to_virtual
831 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
832 fprintf_unfiltered (gdb_stdlog
,
833 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
834 (long) current_gdbarch
->register_convert_to_raw
835 /*REGISTER_CONVERT_TO_RAW ()*/);
836 fprintf_unfiltered (gdb_stdlog
,
837 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
838 (long) current_gdbarch
->pointer_to_address
839 /*POINTER_TO_ADDRESS ()*/);
840 fprintf_unfiltered (gdb_stdlog
,
841 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
842 (long) current_gdbarch
->address_to_pointer
843 /*ADDRESS_TO_POINTER ()*/);
844 fprintf_unfiltered (gdb_stdlog
,
845 "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n",
846 (long) current_gdbarch
->return_value_on_stack
847 /*RETURN_VALUE_ON_STACK ()*/);
848 fprintf_unfiltered (gdb_stdlog
,
849 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
850 (long) current_gdbarch
->extract_return_value
851 /*EXTRACT_RETURN_VALUE ()*/);
852 fprintf_unfiltered (gdb_stdlog
,
853 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
854 (long) current_gdbarch
->push_arguments
855 /*PUSH_ARGUMENTS ()*/);
856 fprintf_unfiltered (gdb_stdlog
,
857 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
858 (long) current_gdbarch
->push_dummy_frame
859 /*PUSH_DUMMY_FRAME ()*/);
860 fprintf_unfiltered (gdb_stdlog
,
861 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
862 (long) current_gdbarch
->push_return_address
863 /*PUSH_RETURN_ADDRESS ()*/);
864 fprintf_unfiltered (gdb_stdlog
,
865 "gdbarch_update: POP_FRAME = 0x%08lx\n",
866 (long) current_gdbarch
->pop_frame
868 fprintf_unfiltered (gdb_stdlog
,
869 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
870 (long) current_gdbarch
->d10v_make_daddr
871 /*D10V_MAKE_DADDR ()*/);
872 fprintf_unfiltered (gdb_stdlog
,
873 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
874 (long) current_gdbarch
->d10v_make_iaddr
875 /*D10V_MAKE_IADDR ()*/);
876 fprintf_unfiltered (gdb_stdlog
,
877 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
878 (long) current_gdbarch
->d10v_daddr_p
879 /*D10V_DADDR_P ()*/);
880 fprintf_unfiltered (gdb_stdlog
,
881 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
882 (long) current_gdbarch
->d10v_iaddr_p
883 /*D10V_IADDR_P ()*/);
884 fprintf_unfiltered (gdb_stdlog
,
885 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
886 (long) current_gdbarch
->d10v_convert_daddr_to_raw
887 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
888 fprintf_unfiltered (gdb_stdlog
,
889 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
890 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
891 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
892 fprintf_unfiltered (gdb_stdlog
,
893 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
894 (long) current_gdbarch
->store_struct_return
895 /*STORE_STRUCT_RETURN ()*/);
896 fprintf_unfiltered (gdb_stdlog
,
897 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
898 (long) current_gdbarch
->store_return_value
899 /*STORE_RETURN_VALUE ()*/);
900 fprintf_unfiltered (gdb_stdlog
,
901 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
902 (long) current_gdbarch
->extract_struct_value_address
903 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
904 fprintf_unfiltered (gdb_stdlog
,
905 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
906 (long) current_gdbarch
->use_struct_convention
907 /*USE_STRUCT_CONVENTION ()*/);
908 fprintf_unfiltered (gdb_stdlog
,
909 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
910 (long) current_gdbarch
->frame_init_saved_regs
911 /*FRAME_INIT_SAVED_REGS ()*/);
912 fprintf_unfiltered (gdb_stdlog
,
913 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
914 (long) current_gdbarch
->init_extra_frame_info
915 /*INIT_EXTRA_FRAME_INFO ()*/);
916 fprintf_unfiltered (gdb_stdlog
,
917 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
918 (long) current_gdbarch
->skip_prologue
919 /*SKIP_PROLOGUE ()*/);
920 fprintf_unfiltered (gdb_stdlog
,
921 "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
922 (long) current_gdbarch
->prologue_frameless_p
923 /*PROLOGUE_FRAMELESS_P ()*/);
924 fprintf_unfiltered (gdb_stdlog
,
925 "gdbarch_update: INNER_THAN = 0x%08lx\n",
926 (long) current_gdbarch
->inner_than
928 fprintf_unfiltered (gdb_stdlog
,
929 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
930 (long) current_gdbarch
->breakpoint_from_pc
931 /*BREAKPOINT_FROM_PC ()*/);
932 fprintf_unfiltered (gdb_stdlog
,
933 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
934 (long) current_gdbarch
->memory_insert_breakpoint
935 /*MEMORY_INSERT_BREAKPOINT ()*/);
936 fprintf_unfiltered (gdb_stdlog
,
937 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
938 (long) current_gdbarch
->memory_remove_breakpoint
939 /*MEMORY_REMOVE_BREAKPOINT ()*/);
940 fprintf_unfiltered (gdb_stdlog
,
941 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
942 (long) DECR_PC_AFTER_BREAK
);
943 fprintf_unfiltered (gdb_stdlog
,
944 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
945 (long) FUNCTION_START_OFFSET
);
946 fprintf_unfiltered (gdb_stdlog
,
947 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
948 (long) current_gdbarch
->remote_translate_xfer_address
949 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
950 fprintf_unfiltered (gdb_stdlog
,
951 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
952 (long) FRAME_ARGS_SKIP
);
953 fprintf_unfiltered (gdb_stdlog
,
954 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
955 (long) current_gdbarch
->frameless_function_invocation
956 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
957 fprintf_unfiltered (gdb_stdlog
,
958 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
959 (long) current_gdbarch
->frame_chain
961 fprintf_unfiltered (gdb_stdlog
,
962 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
963 (long) current_gdbarch
->frame_chain_valid
964 /*FRAME_CHAIN_VALID ()*/);
965 fprintf_unfiltered (gdb_stdlog
,
966 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
967 (long) current_gdbarch
->frame_saved_pc
968 /*FRAME_SAVED_PC ()*/);
969 fprintf_unfiltered (gdb_stdlog
,
970 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
971 (long) current_gdbarch
->frame_args_address
972 /*FRAME_ARGS_ADDRESS ()*/);
973 fprintf_unfiltered (gdb_stdlog
,
974 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
975 (long) current_gdbarch
->frame_locals_address
976 /*FRAME_LOCALS_ADDRESS ()*/);
977 fprintf_unfiltered (gdb_stdlog
,
978 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
979 (long) current_gdbarch
->saved_pc_after_call
980 /*SAVED_PC_AFTER_CALL ()*/);
981 fprintf_unfiltered (gdb_stdlog
,
982 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
983 (long) current_gdbarch
->frame_num_args
984 /*FRAME_NUM_ARGS ()*/);
985 fprintf_unfiltered (gdb_stdlog
,
986 "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
987 (long) current_gdbarch
->stack_align
989 fprintf_unfiltered (gdb_stdlog
,
990 "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
991 (long) current_gdbarch
->reg_struct_has_addr
992 /*REG_STRUCT_HAS_ADDR ()*/);
995 struct gdbarch_tdep
*
996 gdbarch_tdep (struct gdbarch
*gdbarch
)
998 if (gdbarch_debug
>= 2)
999 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1000 return gdbarch
->tdep
;
1004 const struct bfd_arch_info
*
1005 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1007 if (gdbarch_debug
>= 2)
1008 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1009 return gdbarch
->bfd_arch_info
;
1013 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1015 if (gdbarch_debug
>= 2)
1016 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1017 return gdbarch
->byte_order
;
1021 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1023 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1024 if (gdbarch_debug
>= 2)
1025 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1026 return gdbarch
->bfd_vma_bit
;
1030 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1033 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1037 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1039 if (gdbarch
->ptr_bit
== 0)
1040 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1041 if (gdbarch_debug
>= 2)
1042 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1043 return gdbarch
->ptr_bit
;
1047 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1050 gdbarch
->ptr_bit
= ptr_bit
;
1054 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1056 if (gdbarch
->short_bit
== 0)
1057 internal_error ("gdbarch: gdbarch_short_bit invalid");
1058 if (gdbarch_debug
>= 2)
1059 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1060 return gdbarch
->short_bit
;
1064 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1067 gdbarch
->short_bit
= short_bit
;
1071 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1073 if (gdbarch
->int_bit
== 0)
1074 internal_error ("gdbarch: gdbarch_int_bit invalid");
1075 if (gdbarch_debug
>= 2)
1076 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1077 return gdbarch
->int_bit
;
1081 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1084 gdbarch
->int_bit
= int_bit
;
1088 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1090 if (gdbarch
->long_bit
== 0)
1091 internal_error ("gdbarch: gdbarch_long_bit invalid");
1092 if (gdbarch_debug
>= 2)
1093 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1094 return gdbarch
->long_bit
;
1098 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1101 gdbarch
->long_bit
= long_bit
;
1105 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1107 if (gdbarch
->long_long_bit
== 0)
1108 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1109 if (gdbarch_debug
>= 2)
1110 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1111 return gdbarch
->long_long_bit
;
1115 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1118 gdbarch
->long_long_bit
= long_long_bit
;
1122 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1124 if (gdbarch
->float_bit
== 0)
1125 internal_error ("gdbarch: gdbarch_float_bit invalid");
1126 if (gdbarch_debug
>= 2)
1127 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1128 return gdbarch
->float_bit
;
1132 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1135 gdbarch
->float_bit
= float_bit
;
1139 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1141 if (gdbarch
->double_bit
== 0)
1142 internal_error ("gdbarch: gdbarch_double_bit invalid");
1143 if (gdbarch_debug
>= 2)
1144 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1145 return gdbarch
->double_bit
;
1149 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1152 gdbarch
->double_bit
= double_bit
;
1156 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1158 if (gdbarch
->long_double_bit
== 0)
1159 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1160 if (gdbarch_debug
>= 2)
1161 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1162 return gdbarch
->long_double_bit
;
1166 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1167 int long_double_bit
)
1169 gdbarch
->long_double_bit
= long_double_bit
;
1173 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1175 /* Skip verify of ieee_float, invalid_p == 0 */
1176 if (gdbarch_debug
>= 2)
1177 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1178 return gdbarch
->ieee_float
;
1182 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1185 gdbarch
->ieee_float
= ieee_float
;
1189 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1191 if (gdbarch
->read_pc
== 0)
1192 internal_error ("gdbarch: gdbarch_read_pc invalid");
1193 if (gdbarch_debug
>= 2)
1194 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1195 return gdbarch
->read_pc (pid
);
1199 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1200 gdbarch_read_pc_ftype read_pc
)
1202 gdbarch
->read_pc
= read_pc
;
1206 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1208 if (gdbarch
->write_pc
== 0)
1209 internal_error ("gdbarch: gdbarch_write_pc invalid");
1210 if (gdbarch_debug
>= 2)
1211 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1212 gdbarch
->write_pc (val
, pid
);
1216 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1217 gdbarch_write_pc_ftype write_pc
)
1219 gdbarch
->write_pc
= write_pc
;
1223 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1225 if (gdbarch
->read_fp
== 0)
1226 internal_error ("gdbarch: gdbarch_read_fp invalid");
1227 if (gdbarch_debug
>= 2)
1228 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1229 return gdbarch
->read_fp ();
1233 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1234 gdbarch_read_fp_ftype read_fp
)
1236 gdbarch
->read_fp
= read_fp
;
1240 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1242 if (gdbarch
->write_fp
== 0)
1243 internal_error ("gdbarch: gdbarch_write_fp invalid");
1244 if (gdbarch_debug
>= 2)
1245 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1246 gdbarch
->write_fp (val
);
1250 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1251 gdbarch_write_fp_ftype write_fp
)
1253 gdbarch
->write_fp
= write_fp
;
1257 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1259 if (gdbarch
->read_sp
== 0)
1260 internal_error ("gdbarch: gdbarch_read_sp invalid");
1261 if (gdbarch_debug
>= 2)
1262 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1263 return gdbarch
->read_sp ();
1267 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1268 gdbarch_read_sp_ftype read_sp
)
1270 gdbarch
->read_sp
= read_sp
;
1274 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1276 if (gdbarch
->write_sp
== 0)
1277 internal_error ("gdbarch: gdbarch_write_sp invalid");
1278 if (gdbarch_debug
>= 2)
1279 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1280 gdbarch
->write_sp (val
);
1284 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1285 gdbarch_write_sp_ftype write_sp
)
1287 gdbarch
->write_sp
= write_sp
;
1291 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1293 if (gdbarch
->num_regs
== -1)
1294 internal_error ("gdbarch: gdbarch_num_regs invalid");
1295 if (gdbarch_debug
>= 2)
1296 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1297 return gdbarch
->num_regs
;
1301 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1304 gdbarch
->num_regs
= num_regs
;
1308 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1310 if (gdbarch
->sp_regnum
== -1)
1311 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1312 if (gdbarch_debug
>= 2)
1313 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1314 return gdbarch
->sp_regnum
;
1318 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1321 gdbarch
->sp_regnum
= sp_regnum
;
1325 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1327 if (gdbarch
->fp_regnum
== -1)
1328 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1329 if (gdbarch_debug
>= 2)
1330 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1331 return gdbarch
->fp_regnum
;
1335 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1338 gdbarch
->fp_regnum
= fp_regnum
;
1342 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1344 if (gdbarch
->pc_regnum
== -1)
1345 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1346 if (gdbarch_debug
>= 2)
1347 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1348 return gdbarch
->pc_regnum
;
1352 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1355 gdbarch
->pc_regnum
= pc_regnum
;
1359 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1361 /* Skip verify of fp0_regnum, invalid_p == 0 */
1362 if (gdbarch_debug
>= 2)
1363 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1364 return gdbarch
->fp0_regnum
;
1368 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1371 gdbarch
->fp0_regnum
= fp0_regnum
;
1375 gdbarch_npc_regnum (struct gdbarch
*gdbarch
)
1377 /* Skip verify of npc_regnum, invalid_p == 0 */
1378 if (gdbarch_debug
>= 2)
1379 fprintf_unfiltered (gdb_stdlog
, "gdbarch_npc_regnum called\n");
1380 return gdbarch
->npc_regnum
;
1384 set_gdbarch_npc_regnum (struct gdbarch
*gdbarch
,
1387 gdbarch
->npc_regnum
= npc_regnum
;
1391 gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
)
1393 /* Skip verify of nnpc_regnum, invalid_p == 0 */
1394 if (gdbarch_debug
>= 2)
1395 fprintf_unfiltered (gdb_stdlog
, "gdbarch_nnpc_regnum called\n");
1396 return gdbarch
->nnpc_regnum
;
1400 set_gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
,
1403 gdbarch
->nnpc_regnum
= nnpc_regnum
;
1407 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1409 if (gdbarch
->register_name
== 0)
1410 internal_error ("gdbarch: gdbarch_register_name invalid");
1411 if (gdbarch_debug
>= 2)
1412 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1413 return gdbarch
->register_name (regnr
);
1417 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1418 gdbarch_register_name_ftype register_name
)
1420 gdbarch
->register_name
= register_name
;
1424 gdbarch_register_size (struct gdbarch
*gdbarch
)
1426 if (gdbarch
->register_size
== -1)
1427 internal_error ("gdbarch: gdbarch_register_size invalid");
1428 if (gdbarch_debug
>= 2)
1429 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1430 return gdbarch
->register_size
;
1434 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1437 gdbarch
->register_size
= register_size
;
1441 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1443 if (gdbarch
->register_bytes
== -1)
1444 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1445 if (gdbarch_debug
>= 2)
1446 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1447 return gdbarch
->register_bytes
;
1451 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1454 gdbarch
->register_bytes
= register_bytes
;
1458 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1460 if (gdbarch
->register_byte
== 0)
1461 internal_error ("gdbarch: gdbarch_register_byte invalid");
1462 if (gdbarch_debug
>= 2)
1463 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1464 return gdbarch
->register_byte (reg_nr
);
1468 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1469 gdbarch_register_byte_ftype register_byte
)
1471 gdbarch
->register_byte
= register_byte
;
1475 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1477 if (gdbarch
->register_raw_size
== 0)
1478 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1479 if (gdbarch_debug
>= 2)
1480 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1481 return gdbarch
->register_raw_size (reg_nr
);
1485 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1486 gdbarch_register_raw_size_ftype register_raw_size
)
1488 gdbarch
->register_raw_size
= register_raw_size
;
1492 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1494 if (gdbarch
->max_register_raw_size
== -1)
1495 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1496 if (gdbarch_debug
>= 2)
1497 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1498 return gdbarch
->max_register_raw_size
;
1502 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1503 int max_register_raw_size
)
1505 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1509 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1511 if (gdbarch
->register_virtual_size
== 0)
1512 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1513 if (gdbarch_debug
>= 2)
1514 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1515 return gdbarch
->register_virtual_size (reg_nr
);
1519 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1520 gdbarch_register_virtual_size_ftype register_virtual_size
)
1522 gdbarch
->register_virtual_size
= register_virtual_size
;
1526 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1528 if (gdbarch
->max_register_virtual_size
== -1)
1529 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1530 if (gdbarch_debug
>= 2)
1531 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1532 return gdbarch
->max_register_virtual_size
;
1536 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1537 int max_register_virtual_size
)
1539 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1543 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1545 if (gdbarch
->register_virtual_type
== 0)
1546 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1547 if (gdbarch_debug
>= 2)
1548 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1549 return gdbarch
->register_virtual_type (reg_nr
);
1553 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1554 gdbarch_register_virtual_type_ftype register_virtual_type
)
1556 gdbarch
->register_virtual_type
= register_virtual_type
;
1560 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1562 if (gdbarch
->use_generic_dummy_frames
== -1)
1563 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1564 if (gdbarch_debug
>= 2)
1565 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1566 return gdbarch
->use_generic_dummy_frames
;
1570 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1571 int use_generic_dummy_frames
)
1573 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1577 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1579 if (gdbarch
->call_dummy_location
== 0)
1580 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1581 if (gdbarch_debug
>= 2)
1582 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1583 return gdbarch
->call_dummy_location
;
1587 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1588 int call_dummy_location
)
1590 gdbarch
->call_dummy_location
= call_dummy_location
;
1594 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1596 if (gdbarch
->call_dummy_address
== 0)
1597 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1598 if (gdbarch_debug
>= 2)
1599 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1600 return gdbarch
->call_dummy_address ();
1604 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1605 gdbarch_call_dummy_address_ftype call_dummy_address
)
1607 gdbarch
->call_dummy_address
= call_dummy_address
;
1611 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1613 if (gdbarch
->call_dummy_start_offset
== -1)
1614 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1615 if (gdbarch_debug
>= 2)
1616 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1617 return gdbarch
->call_dummy_start_offset
;
1621 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1622 CORE_ADDR call_dummy_start_offset
)
1624 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1628 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1630 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1631 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1632 if (gdbarch_debug
>= 2)
1633 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1634 return gdbarch
->call_dummy_breakpoint_offset
;
1638 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1639 CORE_ADDR call_dummy_breakpoint_offset
)
1641 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1645 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1647 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1648 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1649 if (gdbarch_debug
>= 2)
1650 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1651 return gdbarch
->call_dummy_breakpoint_offset_p
;
1655 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1656 int call_dummy_breakpoint_offset_p
)
1658 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1662 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1664 if (gdbarch
->call_dummy_length
== -1)
1665 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1666 if (gdbarch_debug
>= 2)
1667 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1668 return gdbarch
->call_dummy_length
;
1672 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1673 int call_dummy_length
)
1675 gdbarch
->call_dummy_length
= call_dummy_length
;
1679 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1681 if (gdbarch
->pc_in_call_dummy
== 0)
1682 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1683 if (gdbarch_debug
>= 2)
1684 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1685 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1689 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1690 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1692 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1696 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1698 if (gdbarch
->call_dummy_p
== -1)
1699 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1700 if (gdbarch_debug
>= 2)
1701 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1702 return gdbarch
->call_dummy_p
;
1706 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1709 gdbarch
->call_dummy_p
= call_dummy_p
;
1713 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1715 /* Skip verify of call_dummy_words, invalid_p == 0 */
1716 if (gdbarch_debug
>= 2)
1717 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1718 return gdbarch
->call_dummy_words
;
1722 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1723 LONGEST
* call_dummy_words
)
1725 gdbarch
->call_dummy_words
= call_dummy_words
;
1729 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1731 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1732 if (gdbarch_debug
>= 2)
1733 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1734 return gdbarch
->sizeof_call_dummy_words
;
1738 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1739 int sizeof_call_dummy_words
)
1741 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1745 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1747 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1748 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1749 if (gdbarch_debug
>= 2)
1750 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1751 return gdbarch
->call_dummy_stack_adjust_p
;
1755 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1756 int call_dummy_stack_adjust_p
)
1758 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1762 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1764 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1765 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1766 if (gdbarch_debug
>= 2)
1767 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1768 return gdbarch
->call_dummy_stack_adjust
;
1772 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1773 int call_dummy_stack_adjust
)
1775 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1779 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
)
1781 if (gdbarch
->fix_call_dummy
== 0)
1782 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1783 if (gdbarch_debug
>= 2)
1784 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1785 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1789 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1790 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1792 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1796 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1798 if (gdbarch_debug
>= 2)
1799 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1800 return gdbarch
->believe_pcc_promotion
;
1804 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1805 int believe_pcc_promotion
)
1807 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1811 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1813 if (gdbarch_debug
>= 2)
1814 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1815 return gdbarch
->believe_pcc_promotion_type
;
1819 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1820 int believe_pcc_promotion_type
)
1822 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1826 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
1828 if (gdbarch
->coerce_float_to_double
== 0)
1829 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1830 if (gdbarch_debug
>= 2)
1831 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
1832 return gdbarch
->coerce_float_to_double (formal
, actual
);
1836 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
1837 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
1839 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
1843 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
)
1845 if (gdbarch
->get_saved_register
== 0)
1846 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1847 if (gdbarch_debug
>= 2)
1848 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1849 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1853 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1854 gdbarch_get_saved_register_ftype get_saved_register
)
1856 gdbarch
->get_saved_register
= get_saved_register
;
1860 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1862 if (gdbarch
->register_convertible
== 0)
1863 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1864 if (gdbarch_debug
>= 2)
1865 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1866 return gdbarch
->register_convertible (nr
);
1870 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1871 gdbarch_register_convertible_ftype register_convertible
)
1873 gdbarch
->register_convertible
= register_convertible
;
1877 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1879 if (gdbarch
->register_convert_to_virtual
== 0)
1880 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1881 if (gdbarch_debug
>= 2)
1882 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1883 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1887 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1888 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1890 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1894 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1896 if (gdbarch
->register_convert_to_raw
== 0)
1897 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1898 if (gdbarch_debug
>= 2)
1899 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1900 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1904 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1905 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1907 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1911 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
1913 if (gdbarch
->pointer_to_address
== 0)
1914 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
1915 if (gdbarch_debug
>= 2)
1916 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
1917 return gdbarch
->pointer_to_address (type
, buf
);
1921 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
1922 gdbarch_pointer_to_address_ftype pointer_to_address
)
1924 gdbarch
->pointer_to_address
= pointer_to_address
;
1928 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
1930 if (gdbarch
->address_to_pointer
== 0)
1931 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
1932 if (gdbarch_debug
>= 2)
1933 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
1934 gdbarch
->address_to_pointer (type
, buf
, addr
);
1938 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
1939 gdbarch_address_to_pointer_ftype address_to_pointer
)
1941 gdbarch
->address_to_pointer
= address_to_pointer
;
1945 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
1947 if (gdbarch
->return_value_on_stack
== 0)
1948 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
1949 if (gdbarch_debug
>= 2)
1950 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
1951 return gdbarch
->return_value_on_stack (type
);
1955 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
1956 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
1958 gdbarch
->return_value_on_stack
= return_value_on_stack
;
1962 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1964 if (gdbarch
->extract_return_value
== 0)
1965 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1966 if (gdbarch_debug
>= 2)
1967 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1968 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1972 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1973 gdbarch_extract_return_value_ftype extract_return_value
)
1975 gdbarch
->extract_return_value
= extract_return_value
;
1979 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1981 if (gdbarch
->push_arguments
== 0)
1982 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1983 if (gdbarch_debug
>= 2)
1984 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1985 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1989 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1990 gdbarch_push_arguments_ftype push_arguments
)
1992 gdbarch
->push_arguments
= push_arguments
;
1996 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1998 if (gdbarch
->push_dummy_frame
== 0)
1999 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
2000 if (gdbarch_debug
>= 2)
2001 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
2002 gdbarch
->push_dummy_frame ();
2006 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
2007 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
2009 gdbarch
->push_dummy_frame
= push_dummy_frame
;
2013 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
2015 if (gdbarch
->push_return_address
== 0)
2016 internal_error ("gdbarch: gdbarch_push_return_address invalid");
2017 if (gdbarch_debug
>= 2)
2018 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
2019 return gdbarch
->push_return_address (pc
, sp
);
2023 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
2024 gdbarch_push_return_address_ftype push_return_address
)
2026 gdbarch
->push_return_address
= push_return_address
;
2030 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
2032 if (gdbarch
->pop_frame
== 0)
2033 internal_error ("gdbarch: gdbarch_pop_frame invalid");
2034 if (gdbarch_debug
>= 2)
2035 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
2036 gdbarch
->pop_frame ();
2040 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
2041 gdbarch_pop_frame_ftype pop_frame
)
2043 gdbarch
->pop_frame
= pop_frame
;
2047 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2049 if (gdbarch
->d10v_make_daddr
== 0)
2050 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2051 if (gdbarch_debug
>= 2)
2052 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
2053 return gdbarch
->d10v_make_daddr (x
);
2057 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
2058 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
2060 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
2064 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2066 if (gdbarch
->d10v_make_iaddr
== 0)
2067 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2068 if (gdbarch_debug
>= 2)
2069 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2070 return gdbarch
->d10v_make_iaddr (x
);
2074 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2075 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2077 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2081 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2083 if (gdbarch
->d10v_daddr_p
== 0)
2084 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2085 if (gdbarch_debug
>= 2)
2086 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2087 return gdbarch
->d10v_daddr_p (x
);
2091 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2092 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2094 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2098 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2100 if (gdbarch
->d10v_iaddr_p
== 0)
2101 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2102 if (gdbarch_debug
>= 2)
2103 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2104 return gdbarch
->d10v_iaddr_p (x
);
2108 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2109 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2111 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2115 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2117 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2118 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2119 if (gdbarch_debug
>= 2)
2120 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2121 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2125 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2126 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2128 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2132 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2134 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2135 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2136 if (gdbarch_debug
>= 2)
2137 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2138 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2142 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2143 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2145 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2149 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2151 if (gdbarch
->store_struct_return
== 0)
2152 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2153 if (gdbarch_debug
>= 2)
2154 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2155 gdbarch
->store_struct_return (addr
, sp
);
2159 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2160 gdbarch_store_struct_return_ftype store_struct_return
)
2162 gdbarch
->store_struct_return
= store_struct_return
;
2166 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2168 if (gdbarch
->store_return_value
== 0)
2169 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2170 if (gdbarch_debug
>= 2)
2171 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2172 gdbarch
->store_return_value (type
, valbuf
);
2176 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2177 gdbarch_store_return_value_ftype store_return_value
)
2179 gdbarch
->store_return_value
= store_return_value
;
2183 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2185 if (gdbarch
->extract_struct_value_address
== 0)
2186 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2187 if (gdbarch_debug
>= 2)
2188 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2189 return gdbarch
->extract_struct_value_address (regbuf
);
2193 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2194 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2196 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2200 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2202 if (gdbarch
->use_struct_convention
== 0)
2203 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2204 if (gdbarch_debug
>= 2)
2205 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2206 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2210 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2211 gdbarch_use_struct_convention_ftype use_struct_convention
)
2213 gdbarch
->use_struct_convention
= use_struct_convention
;
2217 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2219 if (gdbarch
->frame_init_saved_regs
== 0)
2220 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2221 if (gdbarch_debug
>= 2)
2222 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2223 gdbarch
->frame_init_saved_regs (frame
);
2227 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2228 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2230 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2234 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2236 if (gdbarch
->init_extra_frame_info
== 0)
2237 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2238 if (gdbarch_debug
>= 2)
2239 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2240 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2244 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2245 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2247 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2251 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2253 if (gdbarch
->skip_prologue
== 0)
2254 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2255 if (gdbarch_debug
>= 2)
2256 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2257 return gdbarch
->skip_prologue (ip
);
2261 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2262 gdbarch_skip_prologue_ftype skip_prologue
)
2264 gdbarch
->skip_prologue
= skip_prologue
;
2268 gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2270 if (gdbarch
->prologue_frameless_p
== 0)
2271 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
2272 if (gdbarch_debug
>= 2)
2273 fprintf_unfiltered (gdb_stdlog
, "gdbarch_prologue_frameless_p called\n");
2274 return gdbarch
->prologue_frameless_p (ip
);
2278 set_gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
,
2279 gdbarch_prologue_frameless_p_ftype prologue_frameless_p
)
2281 gdbarch
->prologue_frameless_p
= prologue_frameless_p
;
2285 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2287 if (gdbarch
->inner_than
== 0)
2288 internal_error ("gdbarch: gdbarch_inner_than invalid");
2289 if (gdbarch_debug
>= 2)
2290 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2291 return gdbarch
->inner_than (lhs
, rhs
);
2295 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2296 gdbarch_inner_than_ftype inner_than
)
2298 gdbarch
->inner_than
= inner_than
;
2302 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2304 if (gdbarch
->breakpoint_from_pc
== 0)
2305 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2306 if (gdbarch_debug
>= 2)
2307 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2308 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2312 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2313 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2315 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2319 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2321 if (gdbarch
->memory_insert_breakpoint
== 0)
2322 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2323 if (gdbarch_debug
>= 2)
2324 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2325 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2329 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2330 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2332 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2336 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2338 if (gdbarch
->memory_remove_breakpoint
== 0)
2339 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2340 if (gdbarch_debug
>= 2)
2341 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2342 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2346 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2347 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2349 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2353 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2355 if (gdbarch
->decr_pc_after_break
== -1)
2356 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2357 if (gdbarch_debug
>= 2)
2358 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2359 return gdbarch
->decr_pc_after_break
;
2363 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2364 CORE_ADDR decr_pc_after_break
)
2366 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2370 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2372 if (gdbarch
->function_start_offset
== -1)
2373 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2374 if (gdbarch_debug
>= 2)
2375 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2376 return gdbarch
->function_start_offset
;
2380 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2381 CORE_ADDR function_start_offset
)
2383 gdbarch
->function_start_offset
= function_start_offset
;
2387 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2389 if (gdbarch
->remote_translate_xfer_address
== 0)
2390 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2391 if (gdbarch_debug
>= 2)
2392 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2393 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2397 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2398 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2400 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2404 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2406 if (gdbarch
->frame_args_skip
== -1)
2407 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2408 if (gdbarch_debug
>= 2)
2409 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2410 return gdbarch
->frame_args_skip
;
2414 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2415 CORE_ADDR frame_args_skip
)
2417 gdbarch
->frame_args_skip
= frame_args_skip
;
2421 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2423 if (gdbarch
->frameless_function_invocation
== 0)
2424 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2425 if (gdbarch_debug
>= 2)
2426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2427 return gdbarch
->frameless_function_invocation (fi
);
2431 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2432 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2434 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2438 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2440 if (gdbarch
->frame_chain
== 0)
2441 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2442 if (gdbarch_debug
>= 2)
2443 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2444 return gdbarch
->frame_chain (frame
);
2448 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2449 gdbarch_frame_chain_ftype frame_chain
)
2451 gdbarch
->frame_chain
= frame_chain
;
2455 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2457 if (gdbarch
->frame_chain_valid
== 0)
2458 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2459 if (gdbarch_debug
>= 2)
2460 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2461 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2465 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2466 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2468 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2472 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2474 if (gdbarch
->frame_saved_pc
== 0)
2475 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2476 if (gdbarch_debug
>= 2)
2477 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2478 return gdbarch
->frame_saved_pc (fi
);
2482 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2483 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2485 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2489 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2491 if (gdbarch
->frame_args_address
== 0)
2492 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2493 if (gdbarch_debug
>= 2)
2494 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2495 return gdbarch
->frame_args_address (fi
);
2499 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2500 gdbarch_frame_args_address_ftype frame_args_address
)
2502 gdbarch
->frame_args_address
= frame_args_address
;
2506 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2508 if (gdbarch
->frame_locals_address
== 0)
2509 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2510 if (gdbarch_debug
>= 2)
2511 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2512 return gdbarch
->frame_locals_address (fi
);
2516 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2517 gdbarch_frame_locals_address_ftype frame_locals_address
)
2519 gdbarch
->frame_locals_address
= frame_locals_address
;
2523 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2525 if (gdbarch
->saved_pc_after_call
== 0)
2526 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2527 if (gdbarch_debug
>= 2)
2528 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2529 return gdbarch
->saved_pc_after_call (frame
);
2533 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2534 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2536 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2540 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2542 if (gdbarch
->frame_num_args
== 0)
2543 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2544 if (gdbarch_debug
>= 2)
2545 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2546 return gdbarch
->frame_num_args (frame
);
2550 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2551 gdbarch_frame_num_args_ftype frame_num_args
)
2553 gdbarch
->frame_num_args
= frame_num_args
;
2557 gdbarch_stack_align_p (struct gdbarch
*gdbarch
)
2559 return gdbarch
->stack_align
!= 0;
2563 gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2565 if (gdbarch
->stack_align
== 0)
2566 internal_error ("gdbarch: gdbarch_stack_align invalid");
2567 if (gdbarch_debug
>= 2)
2568 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stack_align called\n");
2569 return gdbarch
->stack_align (sp
);
2573 set_gdbarch_stack_align (struct gdbarch
*gdbarch
,
2574 gdbarch_stack_align_ftype stack_align
)
2576 gdbarch
->stack_align
= stack_align
;
2580 gdbarch_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
2582 return gdbarch
->reg_struct_has_addr
!= 0;
2586 gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
2588 if (gdbarch
->reg_struct_has_addr
== 0)
2589 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
2590 if (gdbarch_debug
>= 2)
2591 fprintf_unfiltered (gdb_stdlog
, "gdbarch_reg_struct_has_addr called\n");
2592 return gdbarch
->reg_struct_has_addr (gcc_p
, type
);
2596 set_gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
,
2597 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr
)
2599 gdbarch
->reg_struct_has_addr
= reg_struct_has_addr
;
2603 /* Keep a registrary of per-architecture data-pointers required by GDB
2611 struct gdbarch_data_registration
2613 gdbarch_data_ftype
*init
;
2614 struct gdbarch_data
*data
;
2615 struct gdbarch_data_registration
*next
;
2618 struct gdbarch_data_registrary
2621 struct gdbarch_data_registration
*registrations
;
2624 struct gdbarch_data_registrary gdbarch_data_registrary
=
2629 struct gdbarch_data
*
2630 register_gdbarch_data (gdbarch_data_ftype
*init
)
2632 struct gdbarch_data_registration
**curr
;
2633 for (curr
= &gdbarch_data_registrary
.registrations
;
2635 curr
= &(*curr
)->next
);
2636 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2637 (*curr
)->next
= NULL
;
2638 (*curr
)->init
= init
;
2639 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2640 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2641 return (*curr
)->data
;
2645 /* Walk through all the registered users initializing each in turn. */
2648 init_gdbarch_data (struct gdbarch
*gdbarch
)
2650 struct gdbarch_data_registration
*rego
;
2651 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2652 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2653 for (rego
= gdbarch_data_registrary
.registrations
;
2657 if (rego
->data
->index
< gdbarch
->nr_data
)
2658 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2663 /* Return the current value of the specified per-architecture
2668 struct gdbarch_data
*data
;
2670 if (data
->index
>= current_gdbarch
->nr_data
)
2671 internal_error ("gdbarch_data: request for non-existant data.");
2672 return current_gdbarch
->data
[data
->index
];
2677 /* Keep a registrary of swaped data required by GDB modules. */
2682 struct gdbarch_swap_registration
*source
;
2683 struct gdbarch_swap
*next
;
2686 struct gdbarch_swap_registration
2689 unsigned long sizeof_data
;
2690 gdbarch_swap_ftype
*init
;
2691 struct gdbarch_swap_registration
*next
;
2694 struct gdbarch_swap_registrary
2697 struct gdbarch_swap_registration
*registrations
;
2700 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2706 register_gdbarch_swap (void *data
,
2707 unsigned long sizeof_data
,
2708 gdbarch_swap_ftype
*init
)
2710 struct gdbarch_swap_registration
**rego
;
2711 for (rego
= &gdbarch_swap_registrary
.registrations
;
2713 rego
= &(*rego
)->next
);
2714 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2715 (*rego
)->next
= NULL
;
2716 (*rego
)->init
= init
;
2717 (*rego
)->data
= data
;
2718 (*rego
)->sizeof_data
= sizeof_data
;
2723 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2725 struct gdbarch_swap_registration
*rego
;
2726 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2727 for (rego
= gdbarch_swap_registrary
.registrations
;
2731 if (rego
->data
!= NULL
)
2733 (*curr
) = XMALLOC (struct gdbarch_swap
);
2734 (*curr
)->source
= rego
;
2735 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2736 (*curr
)->next
= NULL
;
2737 memset (rego
->data
, 0, rego
->sizeof_data
);
2738 curr
= &(*curr
)->next
;
2740 if (rego
->init
!= NULL
)
2746 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2748 struct gdbarch_swap
*curr
;
2749 for (curr
= gdbarch
->swap
;
2752 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2756 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2758 struct gdbarch_swap
*curr
;
2759 for (curr
= gdbarch
->swap
;
2762 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2766 /* Keep a registrary of the architectures known by GDB. */
2768 struct gdbarch_init_registration
2770 enum bfd_architecture bfd_architecture
;
2771 gdbarch_init_ftype
*init
;
2772 struct gdbarch_list
*arches
;
2773 struct gdbarch_init_registration
*next
;
2776 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2779 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2780 gdbarch_init_ftype
*init
)
2782 struct gdbarch_init_registration
**curr
;
2783 const struct bfd_arch_info
*bfd_arch_info
;
2784 /* Check that BFD reconizes this architecture */
2785 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2786 if (bfd_arch_info
== NULL
)
2788 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2790 /* Check that we haven't seen this architecture before */
2791 for (curr
= &gdbarch_init_registrary
;
2793 curr
= &(*curr
)->next
)
2795 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2796 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2797 bfd_arch_info
->printable_name
);
2801 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2802 bfd_arch_info
->printable_name
,
2805 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2806 (*curr
)->bfd_architecture
= bfd_architecture
;
2807 (*curr
)->init
= init
;
2808 (*curr
)->arches
= NULL
;
2809 (*curr
)->next
= NULL
;
2814 /* Look for an architecture using gdbarch_info. Base search on only
2815 BFD_ARCH_INFO and BYTE_ORDER. */
2817 struct gdbarch_list
*
2818 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2819 const struct gdbarch_info
*info
)
2821 for (; arches
!= NULL
; arches
= arches
->next
)
2823 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2825 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2833 /* Update the current architecture. Return ZERO if the update request
2837 gdbarch_update (struct gdbarch_info info
)
2839 struct gdbarch
*new_gdbarch
;
2840 struct gdbarch_list
**list
;
2841 struct gdbarch_init_registration
*rego
;
2843 /* Fill in any missing bits. Most important is the bfd_architecture
2844 which is used to select the target architecture. */
2845 if (info
.bfd_architecture
== bfd_arch_unknown
)
2847 if (info
.bfd_arch_info
!= NULL
)
2848 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2849 else if (info
.abfd
!= NULL
)
2850 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2851 /* FIXME - should query BFD for its default architecture. */
2853 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2855 if (info
.bfd_arch_info
== NULL
)
2857 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2858 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2860 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2862 if (info
.byte_order
== 0)
2864 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2865 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2866 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2869 info
.byte_order
= current_gdbarch
->byte_order
;
2870 /* FIXME - should query BFD for its default byte-order. */
2872 /* A default for abfd? */
2874 /* Find the target that knows about this architecture. */
2875 for (rego
= gdbarch_init_registrary
;
2876 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2881 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2887 fprintf_unfiltered (gdb_stdlog
,
2888 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2889 info
.bfd_architecture
,
2890 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2891 fprintf_unfiltered (gdb_stdlog
,
2892 "gdbarch_update: info.bfd_arch_info %s\n",
2893 (info
.bfd_arch_info
!= NULL
2894 ? info
.bfd_arch_info
->printable_name
2896 fprintf_unfiltered (gdb_stdlog
,
2897 "gdbarch_update: info.byte_order %d (%s)\n",
2899 (info
.byte_order
== BIG_ENDIAN
? "big"
2900 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2902 fprintf_unfiltered (gdb_stdlog
,
2903 "gdbarch_update: info.abfd 0x%lx\n",
2905 fprintf_unfiltered (gdb_stdlog
,
2906 "gdbarch_update: info.tdep_info 0x%lx\n",
2907 (long) info
.tdep_info
);
2910 /* Ask the target for a replacement architecture. */
2911 new_gdbarch
= rego
->init (info
, rego
->arches
);
2913 /* Did the target like it? No. Reject the change. */
2914 if (new_gdbarch
== NULL
)
2917 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2921 /* Did the architecture change? No. Do nothing. */
2922 if (current_gdbarch
== new_gdbarch
)
2925 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2927 new_gdbarch
->bfd_arch_info
->printable_name
);
2931 /* Swap all data belonging to the old target out */
2932 swapout_gdbarch_swap (current_gdbarch
);
2934 /* Is this a pre-existing architecture? Yes. Swap it in. */
2935 for (list
= ®o
->arches
;
2937 list
= &(*list
)->next
)
2939 if ((*list
)->gdbarch
== new_gdbarch
)
2942 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2944 new_gdbarch
->bfd_arch_info
->printable_name
);
2945 current_gdbarch
= new_gdbarch
;
2946 swapin_gdbarch_swap (new_gdbarch
);
2951 /* Append this new architecture to this targets list. */
2952 (*list
) = XMALLOC (struct gdbarch_list
);
2953 (*list
)->next
= NULL
;
2954 (*list
)->gdbarch
= new_gdbarch
;
2956 /* Switch to this new architecture. Dump it out. */
2957 current_gdbarch
= new_gdbarch
;
2960 fprintf_unfiltered (gdb_stdlog
,
2961 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2963 new_gdbarch
->bfd_arch_info
->printable_name
);
2967 /* Check that the newly installed architecture is valid. */
2968 verify_gdbarch (new_gdbarch
);
2970 /* Initialize the per-architecture memory (swap) areas.
2971 CURRENT_GDBARCH must be update before these modules are
2973 init_gdbarch_swap (new_gdbarch
);
2975 /* Initialize the per-architecture data-pointer of all parties that
2976 registered an interest in this architecture. CURRENT_GDBARCH
2977 must be updated before these modules are called. */
2978 init_gdbarch_data (new_gdbarch
);
2985 /* Functions to manipulate the endianness of the target. */
2987 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2988 /* compat - Catch old targets that expect a selectable byte-order to
2989 default to BIG_ENDIAN */
2990 #ifndef TARGET_BYTE_ORDER_DEFAULT
2991 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2994 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2995 #ifndef TARGET_BYTE_ORDER_DEFAULT
2996 /* compat - Catch old non byte-order selectable targets that do not
2997 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2998 TARGET_BYTE_ORDER to be used as the default. For targets that
2999 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
3000 below will get a strange compiler warning. */
3001 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
3004 #ifndef TARGET_BYTE_ORDER_DEFAULT
3005 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
3007 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
3008 int target_byte_order_auto
= 1;
3010 /* Chain containing the \"set endian\" commands. */
3011 static struct cmd_list_element
*endianlist
= NULL
;
3013 /* Called by ``show endian''. */
3015 show_endian (char *args
, int from_tty
)
3018 (TARGET_BYTE_ORDER_AUTO
3019 ? "The target endianness is set automatically (currently %s endian)\n"
3020 : "The target is assumed to be %s endian\n");
3021 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
3024 /* Called if the user enters ``set endian'' without an argument. */
3026 set_endian (char *args
, int from_tty
)
3028 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
3029 show_endian (args
, from_tty
);
3032 /* Called by ``set endian big''. */
3034 set_endian_big (char *args
, int from_tty
)
3036 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3038 target_byte_order
= BIG_ENDIAN
;
3039 target_byte_order_auto
= 0;
3042 struct gdbarch_info info
;
3043 memset (&info
, 0, sizeof info
);
3044 info
.byte_order
= BIG_ENDIAN
;
3045 gdbarch_update (info
);
3050 printf_unfiltered ("Byte order is not selectable.");
3051 show_endian (args
, from_tty
);
3055 /* Called by ``set endian little''. */
3057 set_endian_little (char *args
, int from_tty
)
3059 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3061 target_byte_order
= LITTLE_ENDIAN
;
3062 target_byte_order_auto
= 0;
3065 struct gdbarch_info info
;
3066 memset (&info
, 0, sizeof info
);
3067 info
.byte_order
= LITTLE_ENDIAN
;
3068 gdbarch_update (info
);
3073 printf_unfiltered ("Byte order is not selectable.");
3074 show_endian (args
, from_tty
);
3078 /* Called by ``set endian auto''. */
3080 set_endian_auto (char *args
, int from_tty
)
3082 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3084 target_byte_order_auto
= 1;
3088 printf_unfiltered ("Byte order is not selectable.");
3089 show_endian (args
, from_tty
);
3093 /* Set the endianness from a BFD. */
3095 set_endian_from_file (bfd
*abfd
)
3097 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3101 if (bfd_big_endian (abfd
))
3104 want
= LITTLE_ENDIAN
;
3105 if (TARGET_BYTE_ORDER_AUTO
)
3106 target_byte_order
= want
;
3107 else if (TARGET_BYTE_ORDER
!= want
)
3108 warning ("%s endian file does not match %s endian target.",
3109 want
== BIG_ENDIAN
? "big" : "little",
3110 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3114 if (bfd_big_endian (abfd
)
3115 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
3116 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
3117 warning ("%s endian file does not match %s endian target.",
3118 bfd_big_endian (abfd
) ? "big" : "little",
3119 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3125 /* Functions to manipulate the architecture of the target */
3127 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3129 int target_architecture_auto
= 1;
3130 extern const struct bfd_arch_info bfd_default_arch_struct
;
3131 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
3132 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
3134 static void show_endian (char *, int);
3135 static void set_endian (char *, int);
3136 static void set_endian_big (char *, int);
3137 static void set_endian_little (char *, int);
3138 static void set_endian_auto (char *, int);
3139 static void set_endian_from_file (bfd
*);
3140 static int arch_ok (const struct bfd_arch_info
*arch
);
3141 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3142 static void show_architecture (char *, int);
3143 static void set_architecture (char *, int);
3144 static void info_architecture (char *, int);
3145 static void set_architecture_from_file (bfd
*);
3147 /* Do the real work of changing the current architecture */
3150 arch_ok (const struct bfd_arch_info
*arch
)
3152 /* Should be performing the more basic check that the binary is
3153 compatible with GDB. */
3154 /* Check with the target that the architecture is valid. */
3155 return (target_architecture_hook
== NULL
3156 || target_architecture_hook (arch
));
3160 set_arch (const struct bfd_arch_info
*arch
,
3166 if (!arch_ok (arch
))
3167 warning ("Target may not support %s architecture",
3168 arch
->printable_name
);
3169 target_architecture
= arch
;
3171 case set_arch_manual
:
3172 if (!arch_ok (arch
))
3174 printf_unfiltered ("Target does not support `%s' architecture.\n",
3175 arch
->printable_name
);
3179 target_architecture_auto
= 0;
3180 target_architecture
= arch
;
3188 /* Called if the user enters ``show architecture'' without an argument. */
3190 show_architecture (char *args
, int from_tty
)
3193 arch
= TARGET_ARCHITECTURE
->printable_name
;
3194 if (target_architecture_auto
)
3195 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3197 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3200 /* Called if the user enters ``set architecture'' with or without an
3203 set_architecture (char *args
, int from_tty
)
3207 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3209 else if (strcmp (args
, "auto") == 0)
3211 target_architecture_auto
= 1;
3213 else if (GDB_MULTI_ARCH
)
3215 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3217 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3220 struct gdbarch_info info
;
3221 memset (&info
, 0, sizeof info
);
3222 info
.bfd_arch_info
= arch
;
3223 if (gdbarch_update (info
))
3224 target_architecture_auto
= 0;
3226 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3231 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3233 set_arch (arch
, set_arch_manual
);
3235 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3239 /* Called if the user enters ``info architecture'' without an argument. */
3241 info_architecture (char *args
, int from_tty
)
3243 enum bfd_architecture a
;
3246 if (gdbarch_init_registrary
!= NULL
)
3248 struct gdbarch_init_registration
*rego
;
3249 printf_filtered ("Available architectures are:\n");
3250 for (rego
= gdbarch_init_registrary
;
3254 const struct bfd_arch_info
*ap
;
3255 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3260 printf_filtered (" %s", ap
->printable_name
);
3264 printf_filtered ("\n");
3270 printf_filtered ("There are no available architectures.\n");
3274 printf_filtered ("Available architectures are:\n");
3275 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3277 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3282 printf_filtered (" %s", ap
->printable_name
);
3286 printf_filtered ("\n");
3291 /* Set the architecture from arch/machine */
3293 set_architecture_from_arch_mach (arch
, mach
)
3294 enum bfd_architecture arch
;
3297 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3299 set_arch (wanted
, set_arch_manual
);
3301 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3304 /* Set the architecture from a BFD */
3306 set_architecture_from_file (bfd
*abfd
)
3308 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3309 if (target_architecture_auto
)
3311 set_arch (wanted
, set_arch_auto
);
3313 else if (wanted
!= target_architecture
)
3315 warning ("%s architecture file may be incompatible with %s target.",
3316 wanted
->printable_name
,
3317 target_architecture
->printable_name
);
3322 /* Misc helper functions for targets. */
3325 frame_num_args_unknown (fi
)
3326 struct frame_info
*fi
;
3333 generic_register_convertible_not (num
)
3342 /* Pointer to the target-dependent disassembly function. */
3343 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3344 disassemble_info tm_print_insn_info
;
3348 /* Set the dynamic target-system-dependant parameters (architecture,
3349 byte-order) using information found in the BFD */
3352 set_gdbarch_from_file (abfd
)
3357 struct gdbarch_info info
;
3358 memset (&info
, 0, sizeof info
);
3360 gdbarch_update (info
);
3363 set_architecture_from_file (abfd
);
3364 set_endian_from_file (abfd
);
3368 /* Initialize the current architecture. */
3370 initialize_current_architecture ()
3374 struct gdbarch_init_registration
*rego
;
3375 const struct bfd_arch_info
*chosen
= NULL
;
3376 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3378 const struct bfd_arch_info
*ap
3379 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3381 /* Choose the first architecture alphabetically. */
3383 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3389 struct gdbarch_info info
;
3390 memset (&info
, 0, sizeof info
);
3391 info
.bfd_arch_info
= chosen
;
3392 gdbarch_update (info
);
3397 extern void _initialize_gdbarch (void);
3399 _initialize_gdbarch ()
3401 struct cmd_list_element
*c
;
3403 add_prefix_cmd ("endian", class_support
, set_endian
,
3404 "Set endianness of target.",
3405 &endianlist
, "set endian ", 0, &setlist
);
3406 add_cmd ("big", class_support
, set_endian_big
,
3407 "Set target as being big endian.", &endianlist
);
3408 add_cmd ("little", class_support
, set_endian_little
,
3409 "Set target as being little endian.", &endianlist
);
3410 add_cmd ("auto", class_support
, set_endian_auto
,
3411 "Select target endianness automatically.", &endianlist
);
3412 add_cmd ("endian", class_support
, show_endian
,
3413 "Show endianness of target.", &showlist
);
3415 add_cmd ("architecture", class_support
, set_architecture
,
3416 "Set architecture of target.", &setlist
);
3417 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3418 add_cmd ("architecture", class_support
, show_architecture
,
3419 "Show architecture of target.", &showlist
);
3420 add_cmd ("architecture", class_support
, info_architecture
,
3421 "List supported target architectures", &infolist
);
3423 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3424 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3425 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3426 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3427 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3429 add_show_from_set (add_set_cmd ("arch",
3432 (char *)&gdbarch_debug
,
3433 "Set architecture debugging.\n\
3434 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3436 c
= add_set_cmd ("archdebug",
3439 (char *)&gdbarch_debug
,
3440 "Set architecture debugging.\n\
3441 When non-zero, architecture debugging is enabled.", &setlist
);
3443 deprecate_cmd (c
, "set debug arch");
3444 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");