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
;
151 gdbarch_register_name_ftype
*register_name
;
154 gdbarch_register_byte_ftype
*register_byte
;
155 gdbarch_register_raw_size_ftype
*register_raw_size
;
156 int max_register_raw_size
;
157 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
158 int max_register_virtual_size
;
159 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
160 int use_generic_dummy_frames
;
161 int call_dummy_location
;
162 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
163 CORE_ADDR call_dummy_start_offset
;
164 CORE_ADDR call_dummy_breakpoint_offset
;
165 int call_dummy_breakpoint_offset_p
;
166 int call_dummy_length
;
167 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
169 LONGEST
* call_dummy_words
;
170 int sizeof_call_dummy_words
;
171 int call_dummy_stack_adjust_p
;
172 int call_dummy_stack_adjust
;
173 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
174 int believe_pcc_promotion
;
175 int believe_pcc_promotion_type
;
176 gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
;
177 gdbarch_get_saved_register_ftype
*get_saved_register
;
178 gdbarch_register_convertible_ftype
*register_convertible
;
179 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
180 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
181 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
182 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
183 gdbarch_return_value_on_stack_ftype
*return_value_on_stack
;
184 gdbarch_extract_return_value_ftype
*extract_return_value
;
185 gdbarch_push_arguments_ftype
*push_arguments
;
186 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
187 gdbarch_push_return_address_ftype
*push_return_address
;
188 gdbarch_pop_frame_ftype
*pop_frame
;
189 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
190 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
191 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
192 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
193 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
194 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
195 gdbarch_store_struct_return_ftype
*store_struct_return
;
196 gdbarch_store_return_value_ftype
*store_return_value
;
197 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
198 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
199 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
200 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
201 gdbarch_skip_prologue_ftype
*skip_prologue
;
202 gdbarch_prologue_frameless_p_ftype
*prologue_frameless_p
;
203 gdbarch_inner_than_ftype
*inner_than
;
204 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
205 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
206 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
207 CORE_ADDR decr_pc_after_break
;
208 CORE_ADDR function_start_offset
;
209 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
210 CORE_ADDR frame_args_skip
;
211 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
212 gdbarch_frame_chain_ftype
*frame_chain
;
213 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
214 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
215 gdbarch_frame_args_address_ftype
*frame_args_address
;
216 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
217 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
218 gdbarch_frame_num_args_ftype
*frame_num_args
;
219 gdbarch_stack_align_ftype
*stack_align
;
220 gdbarch_reg_struct_has_addr_ftype
*reg_struct_has_addr
;
224 /* The default architecture uses host values (for want of a better
227 extern const struct bfd_arch_info bfd_default_arch_struct
;
229 struct gdbarch startup_gdbarch
= {
230 /* basic architecture information */
231 &bfd_default_arch_struct
,
233 /* target specific vector */
235 /*per-architecture data-pointers and swap regions */
237 /* Multi-arch values */
243 8 * sizeof (LONGEST
),
246 8 * sizeof (long double),
286 generic_get_saved_register
,
330 /* startup_gdbarch() */
332 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
335 /* Create a new ``struct gdbarch'' based in information provided by
336 ``struct gdbarch_info''. */
339 gdbarch_alloc (const struct gdbarch_info
*info
,
340 struct gdbarch_tdep
*tdep
)
342 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
343 memset (gdbarch
, 0, sizeof (*gdbarch
));
345 gdbarch
->tdep
= tdep
;
347 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
348 gdbarch
->byte_order
= info
->byte_order
;
350 /* Force the explicit initialization of these. */
351 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
352 gdbarch
->num_regs
= -1;
353 gdbarch
->sp_regnum
= -1;
354 gdbarch
->fp_regnum
= -1;
355 gdbarch
->pc_regnum
= -1;
356 gdbarch
->npc_regnum
= -1;
357 gdbarch
->nnpc_regnum
= -1;
358 gdbarch
->register_name
= legacy_register_name
;
359 gdbarch
->register_size
= -1;
360 gdbarch
->register_bytes
= -1;
361 gdbarch
->max_register_raw_size
= -1;
362 gdbarch
->max_register_virtual_size
= -1;
363 gdbarch
->use_generic_dummy_frames
= -1;
364 gdbarch
->call_dummy_start_offset
= -1;
365 gdbarch
->call_dummy_breakpoint_offset
= -1;
366 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
367 gdbarch
->call_dummy_length
= -1;
368 gdbarch
->call_dummy_p
= -1;
369 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
370 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
371 gdbarch
->call_dummy_stack_adjust_p
= -1;
372 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
373 gdbarch
->register_convertible
= generic_register_convertible_not
;
374 gdbarch
->pointer_to_address
= generic_pointer_to_address
;
375 gdbarch
->address_to_pointer
= generic_address_to_pointer
;
376 gdbarch
->return_value_on_stack
= generic_return_value_on_stack_not
;
377 gdbarch
->prologue_frameless_p
= generic_prologue_frameless_p
;
378 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
379 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
380 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
381 gdbarch
->decr_pc_after_break
= -1;
382 gdbarch
->function_start_offset
= -1;
383 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
384 gdbarch
->frame_args_skip
= -1;
385 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
386 /* gdbarch_alloc() */
392 /* Free a gdbarch struct. This should never happen in normal
393 operation --- once you've created a gdbarch, you keep it around.
394 However, if an architecture's init function encounters an error
395 building the structure, it may need to clean up a partially
396 constructed gdbarch. */
398 gdbarch_free (struct gdbarch
*arch
)
400 /* At the moment, this is trivial. */
405 /* Ensure that all values in a GDBARCH are reasonable. */
408 verify_gdbarch (struct gdbarch
*gdbarch
)
410 /* Only perform sanity checks on a multi-arch target. */
411 if (GDB_MULTI_ARCH
<= 0)
414 if (gdbarch
->byte_order
== 0)
415 internal_error ("verify_gdbarch: byte-order unset");
416 if (gdbarch
->bfd_arch_info
== NULL
)
417 internal_error ("verify_gdbarch: bfd_arch_info unset");
418 /* Check those that need to be defined for the given multi-arch level. */
419 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
420 if ((GDB_MULTI_ARCH
>= 1)
421 && (gdbarch
->ptr_bit
== 0))
422 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
423 if ((GDB_MULTI_ARCH
>= 1)
424 && (gdbarch
->short_bit
== 0))
425 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
426 if ((GDB_MULTI_ARCH
>= 1)
427 && (gdbarch
->int_bit
== 0))
428 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
429 if ((GDB_MULTI_ARCH
>= 1)
430 && (gdbarch
->long_bit
== 0))
431 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
432 if ((GDB_MULTI_ARCH
>= 1)
433 && (gdbarch
->long_long_bit
== 0))
434 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
435 if ((GDB_MULTI_ARCH
>= 1)
436 && (gdbarch
->float_bit
== 0))
437 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
438 if ((GDB_MULTI_ARCH
>= 1)
439 && (gdbarch
->double_bit
== 0))
440 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
441 if ((GDB_MULTI_ARCH
>= 1)
442 && (gdbarch
->long_double_bit
== 0))
443 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
444 /* Skip verify of ieee_float, invalid_p == 0 */
445 if ((GDB_MULTI_ARCH
>= 1)
446 && (gdbarch
->read_pc
== 0))
447 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
448 if ((GDB_MULTI_ARCH
>= 1)
449 && (gdbarch
->write_pc
== 0))
450 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
451 if ((GDB_MULTI_ARCH
>= 1)
452 && (gdbarch
->read_fp
== 0))
453 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
454 if ((GDB_MULTI_ARCH
>= 1)
455 && (gdbarch
->write_fp
== 0))
456 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
457 if ((GDB_MULTI_ARCH
>= 1)
458 && (gdbarch
->read_sp
== 0))
459 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
460 if ((GDB_MULTI_ARCH
>= 1)
461 && (gdbarch
->write_sp
== 0))
462 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
463 if ((GDB_MULTI_ARCH
>= 2)
464 && (gdbarch
->num_regs
== -1))
465 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
466 if ((GDB_MULTI_ARCH
>= 2)
467 && (gdbarch
->sp_regnum
== -1))
468 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
469 if ((GDB_MULTI_ARCH
>= 2)
470 && (gdbarch
->fp_regnum
== -1))
471 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
472 if ((GDB_MULTI_ARCH
>= 2)
473 && (gdbarch
->pc_regnum
== -1))
474 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
475 /* Skip verify of npc_regnum, invalid_p == 0 */
476 /* Skip verify of nnpc_regnum, invalid_p == 0 */
477 /* Skip verify of register_name, invalid_p == 0 */
478 if ((GDB_MULTI_ARCH
>= 2)
479 && (gdbarch
->register_size
== -1))
480 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
481 if ((GDB_MULTI_ARCH
>= 2)
482 && (gdbarch
->register_bytes
== -1))
483 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
484 if ((GDB_MULTI_ARCH
>= 2)
485 && (gdbarch
->register_byte
== 0))
486 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
487 if ((GDB_MULTI_ARCH
>= 2)
488 && (gdbarch
->register_raw_size
== 0))
489 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
490 if ((GDB_MULTI_ARCH
>= 2)
491 && (gdbarch
->max_register_raw_size
== -1))
492 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
493 if ((GDB_MULTI_ARCH
>= 2)
494 && (gdbarch
->register_virtual_size
== 0))
495 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
496 if ((GDB_MULTI_ARCH
>= 2)
497 && (gdbarch
->max_register_virtual_size
== -1))
498 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
499 if ((GDB_MULTI_ARCH
>= 2)
500 && (gdbarch
->register_virtual_type
== 0))
501 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
502 if ((GDB_MULTI_ARCH
>= 1)
503 && (gdbarch
->use_generic_dummy_frames
== -1))
504 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
505 if ((GDB_MULTI_ARCH
>= 2)
506 && (gdbarch
->call_dummy_location
== 0))
507 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
508 if ((GDB_MULTI_ARCH
>= 2)
509 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
510 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
511 if ((GDB_MULTI_ARCH
>= 2)
512 && (gdbarch
->call_dummy_start_offset
== -1))
513 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
514 if ((GDB_MULTI_ARCH
>= 2)
515 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
516 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
517 if ((GDB_MULTI_ARCH
>= 1)
518 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
519 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
520 if ((GDB_MULTI_ARCH
>= 2)
521 && (gdbarch
->call_dummy_length
== -1))
522 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
523 if ((GDB_MULTI_ARCH
>= 2)
524 && (gdbarch
->pc_in_call_dummy
== 0))
525 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
526 if ((GDB_MULTI_ARCH
>= 1)
527 && (gdbarch
->call_dummy_p
== -1))
528 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
529 /* Skip verify of call_dummy_words, invalid_p == 0 */
530 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
531 if ((GDB_MULTI_ARCH
>= 1)
532 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
533 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
534 if ((GDB_MULTI_ARCH
>= 2)
535 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
536 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
537 if ((GDB_MULTI_ARCH
>= 2)
538 && (gdbarch
->fix_call_dummy
== 0))
539 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
540 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
541 if ((GDB_MULTI_ARCH
>= 1)
542 && (gdbarch
->get_saved_register
== 0))
543 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
544 /* Skip verify of register_convertible, invalid_p == 0 */
545 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
546 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
547 /* Skip verify of pointer_to_address, invalid_p == 0 */
548 /* Skip verify of address_to_pointer, invalid_p == 0 */
549 /* Skip verify of return_value_on_stack, invalid_p == 0 */
550 if ((GDB_MULTI_ARCH
>= 2)
551 && (gdbarch
->extract_return_value
== 0))
552 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
553 if ((GDB_MULTI_ARCH
>= 1)
554 && (gdbarch
->push_arguments
== 0))
555 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
556 if ((GDB_MULTI_ARCH
>= 2)
557 && (gdbarch
->push_dummy_frame
== 0))
558 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
559 if ((GDB_MULTI_ARCH
>= 1)
560 && (gdbarch
->push_return_address
== 0))
561 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
562 if ((GDB_MULTI_ARCH
>= 2)
563 && (gdbarch
->pop_frame
== 0))
564 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
565 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
566 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
567 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
568 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
569 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
570 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
571 if ((GDB_MULTI_ARCH
>= 2)
572 && (gdbarch
->store_struct_return
== 0))
573 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
574 if ((GDB_MULTI_ARCH
>= 2)
575 && (gdbarch
->store_return_value
== 0))
576 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
577 if ((GDB_MULTI_ARCH
>= 2)
578 && (gdbarch
->extract_struct_value_address
== 0))
579 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
580 if ((GDB_MULTI_ARCH
>= 2)
581 && (gdbarch
->use_struct_convention
== 0))
582 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
583 if ((GDB_MULTI_ARCH
>= 2)
584 && (gdbarch
->frame_init_saved_regs
== 0))
585 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
586 if ((GDB_MULTI_ARCH
>= 2)
587 && (gdbarch
->init_extra_frame_info
== 0))
588 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
589 if ((GDB_MULTI_ARCH
>= 2)
590 && (gdbarch
->skip_prologue
== 0))
591 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
592 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
593 if ((GDB_MULTI_ARCH
>= 2)
594 && (gdbarch
->inner_than
== 0))
595 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
596 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
597 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
598 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
599 if ((GDB_MULTI_ARCH
>= 2)
600 && (gdbarch
->decr_pc_after_break
== -1))
601 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
602 if ((GDB_MULTI_ARCH
>= 2)
603 && (gdbarch
->function_start_offset
== -1))
604 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
605 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
606 if ((GDB_MULTI_ARCH
>= 2)
607 && (gdbarch
->frame_args_skip
== -1))
608 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
609 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
610 if ((GDB_MULTI_ARCH
>= 2)
611 && (gdbarch
->frame_chain
== 0))
612 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
613 if ((GDB_MULTI_ARCH
>= 1)
614 && (gdbarch
->frame_chain_valid
== 0))
615 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
616 if ((GDB_MULTI_ARCH
>= 2)
617 && (gdbarch
->frame_saved_pc
== 0))
618 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
619 if ((GDB_MULTI_ARCH
>= 2)
620 && (gdbarch
->frame_args_address
== 0))
621 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
622 if ((GDB_MULTI_ARCH
>= 2)
623 && (gdbarch
->frame_locals_address
== 0))
624 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
625 if ((GDB_MULTI_ARCH
>= 2)
626 && (gdbarch
->saved_pc_after_call
== 0))
627 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
628 if ((GDB_MULTI_ARCH
>= 2)
629 && (gdbarch
->frame_num_args
== 0))
630 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
631 /* Skip verify of stack_align, has predicate */
632 /* Skip verify of reg_struct_has_addr, has predicate */
636 /* Print out the details of the current architecture. */
641 if (TARGET_ARCHITECTURE
!= NULL
)
642 fprintf_unfiltered (gdb_stdlog
,
643 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
644 TARGET_ARCHITECTURE
->printable_name
);
645 fprintf_unfiltered (gdb_stdlog
,
646 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
647 (long) TARGET_BYTE_ORDER
);
648 fprintf_unfiltered (gdb_stdlog
,
649 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
650 (long) TARGET_BFD_VMA_BIT
);
651 fprintf_unfiltered (gdb_stdlog
,
652 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
653 (long) TARGET_PTR_BIT
);
654 fprintf_unfiltered (gdb_stdlog
,
655 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
656 (long) TARGET_SHORT_BIT
);
657 fprintf_unfiltered (gdb_stdlog
,
658 "gdbarch_update: TARGET_INT_BIT = %ld\n",
659 (long) TARGET_INT_BIT
);
660 fprintf_unfiltered (gdb_stdlog
,
661 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
662 (long) TARGET_LONG_BIT
);
663 fprintf_unfiltered (gdb_stdlog
,
664 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
665 (long) TARGET_LONG_LONG_BIT
);
666 fprintf_unfiltered (gdb_stdlog
,
667 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
668 (long) TARGET_FLOAT_BIT
);
669 fprintf_unfiltered (gdb_stdlog
,
670 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
671 (long) TARGET_DOUBLE_BIT
);
672 fprintf_unfiltered (gdb_stdlog
,
673 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
674 (long) TARGET_LONG_DOUBLE_BIT
);
675 fprintf_unfiltered (gdb_stdlog
,
676 "gdbarch_update: IEEE_FLOAT = %ld\n",
678 fprintf_unfiltered (gdb_stdlog
,
679 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
680 (long) current_gdbarch
->read_pc
681 /*TARGET_READ_PC ()*/);
682 fprintf_unfiltered (gdb_stdlog
,
683 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
684 (long) current_gdbarch
->write_pc
685 /*TARGET_WRITE_PC ()*/);
686 fprintf_unfiltered (gdb_stdlog
,
687 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
688 (long) current_gdbarch
->read_fp
689 /*TARGET_READ_FP ()*/);
690 fprintf_unfiltered (gdb_stdlog
,
691 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
692 (long) current_gdbarch
->write_fp
693 /*TARGET_WRITE_FP ()*/);
694 fprintf_unfiltered (gdb_stdlog
,
695 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
696 (long) current_gdbarch
->read_sp
697 /*TARGET_READ_SP ()*/);
698 fprintf_unfiltered (gdb_stdlog
,
699 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
700 (long) current_gdbarch
->write_sp
701 /*TARGET_WRITE_SP ()*/);
702 fprintf_unfiltered (gdb_stdlog
,
703 "gdbarch_update: NUM_REGS = %ld\n",
705 fprintf_unfiltered (gdb_stdlog
,
706 "gdbarch_update: SP_REGNUM = %ld\n",
708 fprintf_unfiltered (gdb_stdlog
,
709 "gdbarch_update: FP_REGNUM = %ld\n",
711 fprintf_unfiltered (gdb_stdlog
,
712 "gdbarch_update: PC_REGNUM = %ld\n",
714 fprintf_unfiltered (gdb_stdlog
,
715 "gdbarch_update: NPC_REGNUM = %ld\n",
717 fprintf_unfiltered (gdb_stdlog
,
718 "gdbarch_update: NNPC_REGNUM = %ld\n",
720 fprintf_unfiltered (gdb_stdlog
,
721 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
722 (long) current_gdbarch
->register_name
723 /*REGISTER_NAME ()*/);
724 fprintf_unfiltered (gdb_stdlog
,
725 "gdbarch_update: REGISTER_SIZE = %ld\n",
726 (long) REGISTER_SIZE
);
727 fprintf_unfiltered (gdb_stdlog
,
728 "gdbarch_update: REGISTER_BYTES = %ld\n",
729 (long) REGISTER_BYTES
);
730 fprintf_unfiltered (gdb_stdlog
,
731 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
732 (long) current_gdbarch
->register_byte
733 /*REGISTER_BYTE ()*/);
734 fprintf_unfiltered (gdb_stdlog
,
735 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
736 (long) current_gdbarch
->register_raw_size
737 /*REGISTER_RAW_SIZE ()*/);
738 fprintf_unfiltered (gdb_stdlog
,
739 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
740 (long) MAX_REGISTER_RAW_SIZE
);
741 fprintf_unfiltered (gdb_stdlog
,
742 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
743 (long) current_gdbarch
->register_virtual_size
744 /*REGISTER_VIRTUAL_SIZE ()*/);
745 fprintf_unfiltered (gdb_stdlog
,
746 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
747 (long) MAX_REGISTER_VIRTUAL_SIZE
);
748 fprintf_unfiltered (gdb_stdlog
,
749 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
750 (long) current_gdbarch
->register_virtual_type
751 /*REGISTER_VIRTUAL_TYPE ()*/);
752 fprintf_unfiltered (gdb_stdlog
,
753 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
754 (long) USE_GENERIC_DUMMY_FRAMES
);
755 fprintf_unfiltered (gdb_stdlog
,
756 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
757 (long) CALL_DUMMY_LOCATION
);
758 fprintf_unfiltered (gdb_stdlog
,
759 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
760 (long) current_gdbarch
->call_dummy_address
761 /*CALL_DUMMY_ADDRESS ()*/);
762 fprintf_unfiltered (gdb_stdlog
,
763 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
764 (long) CALL_DUMMY_START_OFFSET
);
765 fprintf_unfiltered (gdb_stdlog
,
766 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
767 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
768 fprintf_unfiltered (gdb_stdlog
,
769 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
770 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
771 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
772 fprintf_unfiltered (gdb_stdlog
,
773 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
774 (long) CALL_DUMMY_LENGTH
);
775 fprintf_unfiltered (gdb_stdlog
,
776 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
777 (long) current_gdbarch
->pc_in_call_dummy
778 /*PC_IN_CALL_DUMMY ()*/);
779 fprintf_unfiltered (gdb_stdlog
,
780 "gdbarch_update: CALL_DUMMY_P = %ld\n",
781 (long) CALL_DUMMY_P
);
782 fprintf_unfiltered (gdb_stdlog
,
783 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
784 (long) CALL_DUMMY_WORDS
);
785 fprintf_unfiltered (gdb_stdlog
,
786 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
787 (long) SIZEOF_CALL_DUMMY_WORDS
);
788 fprintf_unfiltered (gdb_stdlog
,
789 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
790 (long) CALL_DUMMY_STACK_ADJUST_P
);
791 if (CALL_DUMMY_STACK_ADJUST_P
)
792 fprintf_unfiltered (gdb_stdlog
,
793 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
794 (long) CALL_DUMMY_STACK_ADJUST
);
795 fprintf_unfiltered (gdb_stdlog
,
796 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
797 (long) current_gdbarch
->fix_call_dummy
798 /*FIX_CALL_DUMMY ()*/);
799 #ifdef BELIEVE_PCC_PROMOTION
800 fprintf_unfiltered (gdb_stdlog
,
801 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
802 (long) BELIEVE_PCC_PROMOTION
);
804 #ifdef BELIEVE_PCC_PROMOTION_TYPE
805 fprintf_unfiltered (gdb_stdlog
,
806 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
807 (long) BELIEVE_PCC_PROMOTION_TYPE
);
809 fprintf_unfiltered (gdb_stdlog
,
810 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
811 (long) current_gdbarch
->coerce_float_to_double
812 /*COERCE_FLOAT_TO_DOUBLE ()*/);
813 fprintf_unfiltered (gdb_stdlog
,
814 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
815 (long) current_gdbarch
->get_saved_register
816 /*GET_SAVED_REGISTER ()*/);
817 fprintf_unfiltered (gdb_stdlog
,
818 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
819 (long) current_gdbarch
->register_convertible
820 /*REGISTER_CONVERTIBLE ()*/);
821 fprintf_unfiltered (gdb_stdlog
,
822 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
823 (long) current_gdbarch
->register_convert_to_virtual
824 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
825 fprintf_unfiltered (gdb_stdlog
,
826 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
827 (long) current_gdbarch
->register_convert_to_raw
828 /*REGISTER_CONVERT_TO_RAW ()*/);
829 fprintf_unfiltered (gdb_stdlog
,
830 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
831 (long) current_gdbarch
->pointer_to_address
832 /*POINTER_TO_ADDRESS ()*/);
833 fprintf_unfiltered (gdb_stdlog
,
834 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
835 (long) current_gdbarch
->address_to_pointer
836 /*ADDRESS_TO_POINTER ()*/);
837 fprintf_unfiltered (gdb_stdlog
,
838 "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n",
839 (long) current_gdbarch
->return_value_on_stack
840 /*RETURN_VALUE_ON_STACK ()*/);
841 fprintf_unfiltered (gdb_stdlog
,
842 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
843 (long) current_gdbarch
->extract_return_value
844 /*EXTRACT_RETURN_VALUE ()*/);
845 fprintf_unfiltered (gdb_stdlog
,
846 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
847 (long) current_gdbarch
->push_arguments
848 /*PUSH_ARGUMENTS ()*/);
849 fprintf_unfiltered (gdb_stdlog
,
850 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
851 (long) current_gdbarch
->push_dummy_frame
852 /*PUSH_DUMMY_FRAME ()*/);
853 fprintf_unfiltered (gdb_stdlog
,
854 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
855 (long) current_gdbarch
->push_return_address
856 /*PUSH_RETURN_ADDRESS ()*/);
857 fprintf_unfiltered (gdb_stdlog
,
858 "gdbarch_update: POP_FRAME = 0x%08lx\n",
859 (long) current_gdbarch
->pop_frame
861 fprintf_unfiltered (gdb_stdlog
,
862 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
863 (long) current_gdbarch
->d10v_make_daddr
864 /*D10V_MAKE_DADDR ()*/);
865 fprintf_unfiltered (gdb_stdlog
,
866 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
867 (long) current_gdbarch
->d10v_make_iaddr
868 /*D10V_MAKE_IADDR ()*/);
869 fprintf_unfiltered (gdb_stdlog
,
870 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
871 (long) current_gdbarch
->d10v_daddr_p
872 /*D10V_DADDR_P ()*/);
873 fprintf_unfiltered (gdb_stdlog
,
874 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
875 (long) current_gdbarch
->d10v_iaddr_p
876 /*D10V_IADDR_P ()*/);
877 fprintf_unfiltered (gdb_stdlog
,
878 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
879 (long) current_gdbarch
->d10v_convert_daddr_to_raw
880 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
881 fprintf_unfiltered (gdb_stdlog
,
882 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
883 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
884 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
885 fprintf_unfiltered (gdb_stdlog
,
886 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
887 (long) current_gdbarch
->store_struct_return
888 /*STORE_STRUCT_RETURN ()*/);
889 fprintf_unfiltered (gdb_stdlog
,
890 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
891 (long) current_gdbarch
->store_return_value
892 /*STORE_RETURN_VALUE ()*/);
893 fprintf_unfiltered (gdb_stdlog
,
894 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
895 (long) current_gdbarch
->extract_struct_value_address
896 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
897 fprintf_unfiltered (gdb_stdlog
,
898 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
899 (long) current_gdbarch
->use_struct_convention
900 /*USE_STRUCT_CONVENTION ()*/);
901 fprintf_unfiltered (gdb_stdlog
,
902 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
903 (long) current_gdbarch
->frame_init_saved_regs
904 /*FRAME_INIT_SAVED_REGS ()*/);
905 fprintf_unfiltered (gdb_stdlog
,
906 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
907 (long) current_gdbarch
->init_extra_frame_info
908 /*INIT_EXTRA_FRAME_INFO ()*/);
909 fprintf_unfiltered (gdb_stdlog
,
910 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
911 (long) current_gdbarch
->skip_prologue
912 /*SKIP_PROLOGUE ()*/);
913 fprintf_unfiltered (gdb_stdlog
,
914 "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
915 (long) current_gdbarch
->prologue_frameless_p
916 /*PROLOGUE_FRAMELESS_P ()*/);
917 fprintf_unfiltered (gdb_stdlog
,
918 "gdbarch_update: INNER_THAN = 0x%08lx\n",
919 (long) current_gdbarch
->inner_than
921 fprintf_unfiltered (gdb_stdlog
,
922 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
923 (long) current_gdbarch
->breakpoint_from_pc
924 /*BREAKPOINT_FROM_PC ()*/);
925 fprintf_unfiltered (gdb_stdlog
,
926 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
927 (long) current_gdbarch
->memory_insert_breakpoint
928 /*MEMORY_INSERT_BREAKPOINT ()*/);
929 fprintf_unfiltered (gdb_stdlog
,
930 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
931 (long) current_gdbarch
->memory_remove_breakpoint
932 /*MEMORY_REMOVE_BREAKPOINT ()*/);
933 fprintf_unfiltered (gdb_stdlog
,
934 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
935 (long) DECR_PC_AFTER_BREAK
);
936 fprintf_unfiltered (gdb_stdlog
,
937 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
938 (long) FUNCTION_START_OFFSET
);
939 fprintf_unfiltered (gdb_stdlog
,
940 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
941 (long) current_gdbarch
->remote_translate_xfer_address
942 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
943 fprintf_unfiltered (gdb_stdlog
,
944 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
945 (long) FRAME_ARGS_SKIP
);
946 fprintf_unfiltered (gdb_stdlog
,
947 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
948 (long) current_gdbarch
->frameless_function_invocation
949 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
950 fprintf_unfiltered (gdb_stdlog
,
951 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
952 (long) current_gdbarch
->frame_chain
954 fprintf_unfiltered (gdb_stdlog
,
955 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
956 (long) current_gdbarch
->frame_chain_valid
957 /*FRAME_CHAIN_VALID ()*/);
958 fprintf_unfiltered (gdb_stdlog
,
959 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
960 (long) current_gdbarch
->frame_saved_pc
961 /*FRAME_SAVED_PC ()*/);
962 fprintf_unfiltered (gdb_stdlog
,
963 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
964 (long) current_gdbarch
->frame_args_address
965 /*FRAME_ARGS_ADDRESS ()*/);
966 fprintf_unfiltered (gdb_stdlog
,
967 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
968 (long) current_gdbarch
->frame_locals_address
969 /*FRAME_LOCALS_ADDRESS ()*/);
970 fprintf_unfiltered (gdb_stdlog
,
971 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
972 (long) current_gdbarch
->saved_pc_after_call
973 /*SAVED_PC_AFTER_CALL ()*/);
974 fprintf_unfiltered (gdb_stdlog
,
975 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
976 (long) current_gdbarch
->frame_num_args
977 /*FRAME_NUM_ARGS ()*/);
978 fprintf_unfiltered (gdb_stdlog
,
979 "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
980 (long) current_gdbarch
->stack_align
982 fprintf_unfiltered (gdb_stdlog
,
983 "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
984 (long) current_gdbarch
->reg_struct_has_addr
985 /*REG_STRUCT_HAS_ADDR ()*/);
988 struct gdbarch_tdep
*
989 gdbarch_tdep (struct gdbarch
*gdbarch
)
991 if (gdbarch_debug
>= 2)
992 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
993 return gdbarch
->tdep
;
997 const struct bfd_arch_info
*
998 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1000 if (gdbarch_debug
>= 2)
1001 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1002 return gdbarch
->bfd_arch_info
;
1006 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1008 if (gdbarch_debug
>= 2)
1009 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1010 return gdbarch
->byte_order
;
1014 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1016 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1017 if (gdbarch_debug
>= 2)
1018 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1019 return gdbarch
->bfd_vma_bit
;
1023 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1026 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1030 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1032 if (gdbarch
->ptr_bit
== 0)
1033 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1034 if (gdbarch_debug
>= 2)
1035 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1036 return gdbarch
->ptr_bit
;
1040 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1043 gdbarch
->ptr_bit
= ptr_bit
;
1047 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1049 if (gdbarch
->short_bit
== 0)
1050 internal_error ("gdbarch: gdbarch_short_bit invalid");
1051 if (gdbarch_debug
>= 2)
1052 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1053 return gdbarch
->short_bit
;
1057 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1060 gdbarch
->short_bit
= short_bit
;
1064 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1066 if (gdbarch
->int_bit
== 0)
1067 internal_error ("gdbarch: gdbarch_int_bit invalid");
1068 if (gdbarch_debug
>= 2)
1069 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1070 return gdbarch
->int_bit
;
1074 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1077 gdbarch
->int_bit
= int_bit
;
1081 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1083 if (gdbarch
->long_bit
== 0)
1084 internal_error ("gdbarch: gdbarch_long_bit invalid");
1085 if (gdbarch_debug
>= 2)
1086 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1087 return gdbarch
->long_bit
;
1091 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1094 gdbarch
->long_bit
= long_bit
;
1098 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1100 if (gdbarch
->long_long_bit
== 0)
1101 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1102 if (gdbarch_debug
>= 2)
1103 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1104 return gdbarch
->long_long_bit
;
1108 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1111 gdbarch
->long_long_bit
= long_long_bit
;
1115 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1117 if (gdbarch
->float_bit
== 0)
1118 internal_error ("gdbarch: gdbarch_float_bit invalid");
1119 if (gdbarch_debug
>= 2)
1120 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1121 return gdbarch
->float_bit
;
1125 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1128 gdbarch
->float_bit
= float_bit
;
1132 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1134 if (gdbarch
->double_bit
== 0)
1135 internal_error ("gdbarch: gdbarch_double_bit invalid");
1136 if (gdbarch_debug
>= 2)
1137 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1138 return gdbarch
->double_bit
;
1142 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1145 gdbarch
->double_bit
= double_bit
;
1149 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1151 if (gdbarch
->long_double_bit
== 0)
1152 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1153 if (gdbarch_debug
>= 2)
1154 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1155 return gdbarch
->long_double_bit
;
1159 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1160 int long_double_bit
)
1162 gdbarch
->long_double_bit
= long_double_bit
;
1166 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1168 /* Skip verify of ieee_float, invalid_p == 0 */
1169 if (gdbarch_debug
>= 2)
1170 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1171 return gdbarch
->ieee_float
;
1175 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1178 gdbarch
->ieee_float
= ieee_float
;
1182 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1184 if (gdbarch
->read_pc
== 0)
1185 internal_error ("gdbarch: gdbarch_read_pc invalid");
1186 if (gdbarch_debug
>= 2)
1187 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1188 return gdbarch
->read_pc (pid
);
1192 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1193 gdbarch_read_pc_ftype read_pc
)
1195 gdbarch
->read_pc
= read_pc
;
1199 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1201 if (gdbarch
->write_pc
== 0)
1202 internal_error ("gdbarch: gdbarch_write_pc invalid");
1203 if (gdbarch_debug
>= 2)
1204 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1205 gdbarch
->write_pc (val
, pid
);
1209 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1210 gdbarch_write_pc_ftype write_pc
)
1212 gdbarch
->write_pc
= write_pc
;
1216 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1218 if (gdbarch
->read_fp
== 0)
1219 internal_error ("gdbarch: gdbarch_read_fp invalid");
1220 if (gdbarch_debug
>= 2)
1221 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1222 return gdbarch
->read_fp ();
1226 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1227 gdbarch_read_fp_ftype read_fp
)
1229 gdbarch
->read_fp
= read_fp
;
1233 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1235 if (gdbarch
->write_fp
== 0)
1236 internal_error ("gdbarch: gdbarch_write_fp invalid");
1237 if (gdbarch_debug
>= 2)
1238 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1239 gdbarch
->write_fp (val
);
1243 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1244 gdbarch_write_fp_ftype write_fp
)
1246 gdbarch
->write_fp
= write_fp
;
1250 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1252 if (gdbarch
->read_sp
== 0)
1253 internal_error ("gdbarch: gdbarch_read_sp invalid");
1254 if (gdbarch_debug
>= 2)
1255 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1256 return gdbarch
->read_sp ();
1260 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1261 gdbarch_read_sp_ftype read_sp
)
1263 gdbarch
->read_sp
= read_sp
;
1267 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1269 if (gdbarch
->write_sp
== 0)
1270 internal_error ("gdbarch: gdbarch_write_sp invalid");
1271 if (gdbarch_debug
>= 2)
1272 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1273 gdbarch
->write_sp (val
);
1277 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1278 gdbarch_write_sp_ftype write_sp
)
1280 gdbarch
->write_sp
= write_sp
;
1284 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1286 if (gdbarch
->num_regs
== -1)
1287 internal_error ("gdbarch: gdbarch_num_regs invalid");
1288 if (gdbarch_debug
>= 2)
1289 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1290 return gdbarch
->num_regs
;
1294 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1297 gdbarch
->num_regs
= num_regs
;
1301 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1303 if (gdbarch
->sp_regnum
== -1)
1304 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1305 if (gdbarch_debug
>= 2)
1306 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1307 return gdbarch
->sp_regnum
;
1311 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1314 gdbarch
->sp_regnum
= sp_regnum
;
1318 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1320 if (gdbarch
->fp_regnum
== -1)
1321 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1322 if (gdbarch_debug
>= 2)
1323 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1324 return gdbarch
->fp_regnum
;
1328 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1331 gdbarch
->fp_regnum
= fp_regnum
;
1335 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1337 if (gdbarch
->pc_regnum
== -1)
1338 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1339 if (gdbarch_debug
>= 2)
1340 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1341 return gdbarch
->pc_regnum
;
1345 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1348 gdbarch
->pc_regnum
= pc_regnum
;
1352 gdbarch_npc_regnum (struct gdbarch
*gdbarch
)
1354 /* Skip verify of npc_regnum, invalid_p == 0 */
1355 if (gdbarch_debug
>= 2)
1356 fprintf_unfiltered (gdb_stdlog
, "gdbarch_npc_regnum called\n");
1357 return gdbarch
->npc_regnum
;
1361 set_gdbarch_npc_regnum (struct gdbarch
*gdbarch
,
1364 gdbarch
->npc_regnum
= npc_regnum
;
1368 gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
)
1370 /* Skip verify of nnpc_regnum, invalid_p == 0 */
1371 if (gdbarch_debug
>= 2)
1372 fprintf_unfiltered (gdb_stdlog
, "gdbarch_nnpc_regnum called\n");
1373 return gdbarch
->nnpc_regnum
;
1377 set_gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
,
1380 gdbarch
->nnpc_regnum
= nnpc_regnum
;
1384 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1386 if (gdbarch
->register_name
== 0)
1387 internal_error ("gdbarch: gdbarch_register_name invalid");
1388 if (gdbarch_debug
>= 2)
1389 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1390 return gdbarch
->register_name (regnr
);
1394 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1395 gdbarch_register_name_ftype register_name
)
1397 gdbarch
->register_name
= register_name
;
1401 gdbarch_register_size (struct gdbarch
*gdbarch
)
1403 if (gdbarch
->register_size
== -1)
1404 internal_error ("gdbarch: gdbarch_register_size invalid");
1405 if (gdbarch_debug
>= 2)
1406 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1407 return gdbarch
->register_size
;
1411 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1414 gdbarch
->register_size
= register_size
;
1418 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1420 if (gdbarch
->register_bytes
== -1)
1421 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1422 if (gdbarch_debug
>= 2)
1423 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1424 return gdbarch
->register_bytes
;
1428 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1431 gdbarch
->register_bytes
= register_bytes
;
1435 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1437 if (gdbarch
->register_byte
== 0)
1438 internal_error ("gdbarch: gdbarch_register_byte invalid");
1439 if (gdbarch_debug
>= 2)
1440 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1441 return gdbarch
->register_byte (reg_nr
);
1445 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1446 gdbarch_register_byte_ftype register_byte
)
1448 gdbarch
->register_byte
= register_byte
;
1452 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1454 if (gdbarch
->register_raw_size
== 0)
1455 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1456 if (gdbarch_debug
>= 2)
1457 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1458 return gdbarch
->register_raw_size (reg_nr
);
1462 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1463 gdbarch_register_raw_size_ftype register_raw_size
)
1465 gdbarch
->register_raw_size
= register_raw_size
;
1469 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1471 if (gdbarch
->max_register_raw_size
== -1)
1472 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1473 if (gdbarch_debug
>= 2)
1474 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1475 return gdbarch
->max_register_raw_size
;
1479 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1480 int max_register_raw_size
)
1482 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1486 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1488 if (gdbarch
->register_virtual_size
== 0)
1489 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1490 if (gdbarch_debug
>= 2)
1491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1492 return gdbarch
->register_virtual_size (reg_nr
);
1496 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1497 gdbarch_register_virtual_size_ftype register_virtual_size
)
1499 gdbarch
->register_virtual_size
= register_virtual_size
;
1503 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1505 if (gdbarch
->max_register_virtual_size
== -1)
1506 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1507 if (gdbarch_debug
>= 2)
1508 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1509 return gdbarch
->max_register_virtual_size
;
1513 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1514 int max_register_virtual_size
)
1516 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1520 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1522 if (gdbarch
->register_virtual_type
== 0)
1523 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1524 if (gdbarch_debug
>= 2)
1525 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1526 return gdbarch
->register_virtual_type (reg_nr
);
1530 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1531 gdbarch_register_virtual_type_ftype register_virtual_type
)
1533 gdbarch
->register_virtual_type
= register_virtual_type
;
1537 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1539 if (gdbarch
->use_generic_dummy_frames
== -1)
1540 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1541 if (gdbarch_debug
>= 2)
1542 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1543 return gdbarch
->use_generic_dummy_frames
;
1547 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1548 int use_generic_dummy_frames
)
1550 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1554 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1556 if (gdbarch
->call_dummy_location
== 0)
1557 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1558 if (gdbarch_debug
>= 2)
1559 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1560 return gdbarch
->call_dummy_location
;
1564 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1565 int call_dummy_location
)
1567 gdbarch
->call_dummy_location
= call_dummy_location
;
1571 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1573 if (gdbarch
->call_dummy_address
== 0)
1574 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1575 if (gdbarch_debug
>= 2)
1576 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1577 return gdbarch
->call_dummy_address ();
1581 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1582 gdbarch_call_dummy_address_ftype call_dummy_address
)
1584 gdbarch
->call_dummy_address
= call_dummy_address
;
1588 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1590 if (gdbarch
->call_dummy_start_offset
== -1)
1591 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1592 if (gdbarch_debug
>= 2)
1593 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1594 return gdbarch
->call_dummy_start_offset
;
1598 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1599 CORE_ADDR call_dummy_start_offset
)
1601 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1605 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1607 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1608 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1609 if (gdbarch_debug
>= 2)
1610 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1611 return gdbarch
->call_dummy_breakpoint_offset
;
1615 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1616 CORE_ADDR call_dummy_breakpoint_offset
)
1618 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1622 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1624 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1625 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1626 if (gdbarch_debug
>= 2)
1627 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1628 return gdbarch
->call_dummy_breakpoint_offset_p
;
1632 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1633 int call_dummy_breakpoint_offset_p
)
1635 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1639 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1641 if (gdbarch
->call_dummy_length
== -1)
1642 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1643 if (gdbarch_debug
>= 2)
1644 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1645 return gdbarch
->call_dummy_length
;
1649 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1650 int call_dummy_length
)
1652 gdbarch
->call_dummy_length
= call_dummy_length
;
1656 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1658 if (gdbarch
->pc_in_call_dummy
== 0)
1659 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1660 if (gdbarch_debug
>= 2)
1661 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1662 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1666 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1667 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1669 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1673 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1675 if (gdbarch
->call_dummy_p
== -1)
1676 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1677 if (gdbarch_debug
>= 2)
1678 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1679 return gdbarch
->call_dummy_p
;
1683 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1686 gdbarch
->call_dummy_p
= call_dummy_p
;
1690 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1692 /* Skip verify of call_dummy_words, invalid_p == 0 */
1693 if (gdbarch_debug
>= 2)
1694 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1695 return gdbarch
->call_dummy_words
;
1699 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1700 LONGEST
* call_dummy_words
)
1702 gdbarch
->call_dummy_words
= call_dummy_words
;
1706 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1708 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1709 if (gdbarch_debug
>= 2)
1710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1711 return gdbarch
->sizeof_call_dummy_words
;
1715 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1716 int sizeof_call_dummy_words
)
1718 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1722 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1724 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1725 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1726 if (gdbarch_debug
>= 2)
1727 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1728 return gdbarch
->call_dummy_stack_adjust_p
;
1732 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1733 int call_dummy_stack_adjust_p
)
1735 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1739 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1741 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1742 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1743 if (gdbarch_debug
>= 2)
1744 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1745 return gdbarch
->call_dummy_stack_adjust
;
1749 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1750 int call_dummy_stack_adjust
)
1752 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1756 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
)
1758 if (gdbarch
->fix_call_dummy
== 0)
1759 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1760 if (gdbarch_debug
>= 2)
1761 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1762 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1766 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1767 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1769 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1773 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1775 if (gdbarch_debug
>= 2)
1776 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1777 return gdbarch
->believe_pcc_promotion
;
1781 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1782 int believe_pcc_promotion
)
1784 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1788 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1790 if (gdbarch_debug
>= 2)
1791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1792 return gdbarch
->believe_pcc_promotion_type
;
1796 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1797 int believe_pcc_promotion_type
)
1799 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1803 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
1805 if (gdbarch
->coerce_float_to_double
== 0)
1806 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1807 if (gdbarch_debug
>= 2)
1808 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
1809 return gdbarch
->coerce_float_to_double (formal
, actual
);
1813 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
1814 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
1816 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
1820 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
)
1822 if (gdbarch
->get_saved_register
== 0)
1823 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1824 if (gdbarch_debug
>= 2)
1825 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1826 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1830 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1831 gdbarch_get_saved_register_ftype get_saved_register
)
1833 gdbarch
->get_saved_register
= get_saved_register
;
1837 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1839 if (gdbarch
->register_convertible
== 0)
1840 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1841 if (gdbarch_debug
>= 2)
1842 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1843 return gdbarch
->register_convertible (nr
);
1847 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1848 gdbarch_register_convertible_ftype register_convertible
)
1850 gdbarch
->register_convertible
= register_convertible
;
1854 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1856 if (gdbarch
->register_convert_to_virtual
== 0)
1857 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1858 if (gdbarch_debug
>= 2)
1859 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1860 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1864 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1865 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1867 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1871 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1873 if (gdbarch
->register_convert_to_raw
== 0)
1874 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1875 if (gdbarch_debug
>= 2)
1876 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1877 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1881 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1882 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1884 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1888 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
1890 if (gdbarch
->pointer_to_address
== 0)
1891 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
1892 if (gdbarch_debug
>= 2)
1893 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
1894 return gdbarch
->pointer_to_address (type
, buf
);
1898 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
1899 gdbarch_pointer_to_address_ftype pointer_to_address
)
1901 gdbarch
->pointer_to_address
= pointer_to_address
;
1905 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
1907 if (gdbarch
->address_to_pointer
== 0)
1908 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
1909 if (gdbarch_debug
>= 2)
1910 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
1911 gdbarch
->address_to_pointer (type
, buf
, addr
);
1915 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
1916 gdbarch_address_to_pointer_ftype address_to_pointer
)
1918 gdbarch
->address_to_pointer
= address_to_pointer
;
1922 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
1924 if (gdbarch
->return_value_on_stack
== 0)
1925 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
1926 if (gdbarch_debug
>= 2)
1927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
1928 return gdbarch
->return_value_on_stack (type
);
1932 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
1933 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
1935 gdbarch
->return_value_on_stack
= return_value_on_stack
;
1939 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1941 if (gdbarch
->extract_return_value
== 0)
1942 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1943 if (gdbarch_debug
>= 2)
1944 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1945 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1949 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1950 gdbarch_extract_return_value_ftype extract_return_value
)
1952 gdbarch
->extract_return_value
= extract_return_value
;
1956 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1958 if (gdbarch
->push_arguments
== 0)
1959 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1960 if (gdbarch_debug
>= 2)
1961 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1962 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1966 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1967 gdbarch_push_arguments_ftype push_arguments
)
1969 gdbarch
->push_arguments
= push_arguments
;
1973 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1975 if (gdbarch
->push_dummy_frame
== 0)
1976 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1977 if (gdbarch_debug
>= 2)
1978 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1979 gdbarch
->push_dummy_frame ();
1983 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
1984 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
1986 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1990 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1992 if (gdbarch
->push_return_address
== 0)
1993 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1994 if (gdbarch_debug
>= 2)
1995 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1996 return gdbarch
->push_return_address (pc
, sp
);
2000 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
2001 gdbarch_push_return_address_ftype push_return_address
)
2003 gdbarch
->push_return_address
= push_return_address
;
2007 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
2009 if (gdbarch
->pop_frame
== 0)
2010 internal_error ("gdbarch: gdbarch_pop_frame invalid");
2011 if (gdbarch_debug
>= 2)
2012 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
2013 gdbarch
->pop_frame ();
2017 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
2018 gdbarch_pop_frame_ftype pop_frame
)
2020 gdbarch
->pop_frame
= pop_frame
;
2024 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2026 if (gdbarch
->d10v_make_daddr
== 0)
2027 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2028 if (gdbarch_debug
>= 2)
2029 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
2030 return gdbarch
->d10v_make_daddr (x
);
2034 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
2035 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
2037 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
2041 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2043 if (gdbarch
->d10v_make_iaddr
== 0)
2044 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2045 if (gdbarch_debug
>= 2)
2046 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2047 return gdbarch
->d10v_make_iaddr (x
);
2051 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2052 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2054 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2058 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2060 if (gdbarch
->d10v_daddr_p
== 0)
2061 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2062 if (gdbarch_debug
>= 2)
2063 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2064 return gdbarch
->d10v_daddr_p (x
);
2068 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2069 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2071 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2075 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2077 if (gdbarch
->d10v_iaddr_p
== 0)
2078 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2079 if (gdbarch_debug
>= 2)
2080 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2081 return gdbarch
->d10v_iaddr_p (x
);
2085 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2086 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2088 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2092 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2094 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2095 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2096 if (gdbarch_debug
>= 2)
2097 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2098 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2102 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2103 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2105 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2109 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2111 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2112 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2113 if (gdbarch_debug
>= 2)
2114 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2115 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2119 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2120 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2122 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2126 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2128 if (gdbarch
->store_struct_return
== 0)
2129 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2130 if (gdbarch_debug
>= 2)
2131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2132 gdbarch
->store_struct_return (addr
, sp
);
2136 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2137 gdbarch_store_struct_return_ftype store_struct_return
)
2139 gdbarch
->store_struct_return
= store_struct_return
;
2143 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2145 if (gdbarch
->store_return_value
== 0)
2146 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2147 if (gdbarch_debug
>= 2)
2148 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2149 gdbarch
->store_return_value (type
, valbuf
);
2153 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2154 gdbarch_store_return_value_ftype store_return_value
)
2156 gdbarch
->store_return_value
= store_return_value
;
2160 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2162 if (gdbarch
->extract_struct_value_address
== 0)
2163 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2164 if (gdbarch_debug
>= 2)
2165 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2166 return gdbarch
->extract_struct_value_address (regbuf
);
2170 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2171 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2173 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2177 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2179 if (gdbarch
->use_struct_convention
== 0)
2180 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2181 if (gdbarch_debug
>= 2)
2182 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2183 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2187 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2188 gdbarch_use_struct_convention_ftype use_struct_convention
)
2190 gdbarch
->use_struct_convention
= use_struct_convention
;
2194 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2196 if (gdbarch
->frame_init_saved_regs
== 0)
2197 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2198 if (gdbarch_debug
>= 2)
2199 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2200 gdbarch
->frame_init_saved_regs (frame
);
2204 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2205 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2207 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2211 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2213 if (gdbarch
->init_extra_frame_info
== 0)
2214 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2215 if (gdbarch_debug
>= 2)
2216 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2217 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2221 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2222 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2224 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2228 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2230 if (gdbarch
->skip_prologue
== 0)
2231 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2232 if (gdbarch_debug
>= 2)
2233 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2234 return gdbarch
->skip_prologue (ip
);
2238 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2239 gdbarch_skip_prologue_ftype skip_prologue
)
2241 gdbarch
->skip_prologue
= skip_prologue
;
2245 gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2247 if (gdbarch
->prologue_frameless_p
== 0)
2248 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
2249 if (gdbarch_debug
>= 2)
2250 fprintf_unfiltered (gdb_stdlog
, "gdbarch_prologue_frameless_p called\n");
2251 return gdbarch
->prologue_frameless_p (ip
);
2255 set_gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
,
2256 gdbarch_prologue_frameless_p_ftype prologue_frameless_p
)
2258 gdbarch
->prologue_frameless_p
= prologue_frameless_p
;
2262 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2264 if (gdbarch
->inner_than
== 0)
2265 internal_error ("gdbarch: gdbarch_inner_than invalid");
2266 if (gdbarch_debug
>= 2)
2267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2268 return gdbarch
->inner_than (lhs
, rhs
);
2272 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2273 gdbarch_inner_than_ftype inner_than
)
2275 gdbarch
->inner_than
= inner_than
;
2279 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2281 if (gdbarch
->breakpoint_from_pc
== 0)
2282 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2283 if (gdbarch_debug
>= 2)
2284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2285 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2289 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2290 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2292 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2296 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2298 if (gdbarch
->memory_insert_breakpoint
== 0)
2299 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2300 if (gdbarch_debug
>= 2)
2301 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2302 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2306 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2307 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2309 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2313 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2315 if (gdbarch
->memory_remove_breakpoint
== 0)
2316 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2317 if (gdbarch_debug
>= 2)
2318 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2319 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2323 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2324 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2326 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2330 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2332 if (gdbarch
->decr_pc_after_break
== -1)
2333 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2334 if (gdbarch_debug
>= 2)
2335 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2336 return gdbarch
->decr_pc_after_break
;
2340 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2341 CORE_ADDR decr_pc_after_break
)
2343 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2347 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2349 if (gdbarch
->function_start_offset
== -1)
2350 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2351 if (gdbarch_debug
>= 2)
2352 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2353 return gdbarch
->function_start_offset
;
2357 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2358 CORE_ADDR function_start_offset
)
2360 gdbarch
->function_start_offset
= function_start_offset
;
2364 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2366 if (gdbarch
->remote_translate_xfer_address
== 0)
2367 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2368 if (gdbarch_debug
>= 2)
2369 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2370 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2374 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2375 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2377 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2381 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2383 if (gdbarch
->frame_args_skip
== -1)
2384 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2385 if (gdbarch_debug
>= 2)
2386 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2387 return gdbarch
->frame_args_skip
;
2391 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2392 CORE_ADDR frame_args_skip
)
2394 gdbarch
->frame_args_skip
= frame_args_skip
;
2398 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2400 if (gdbarch
->frameless_function_invocation
== 0)
2401 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2402 if (gdbarch_debug
>= 2)
2403 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2404 return gdbarch
->frameless_function_invocation (fi
);
2408 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2409 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2411 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2415 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2417 if (gdbarch
->frame_chain
== 0)
2418 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2419 if (gdbarch_debug
>= 2)
2420 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2421 return gdbarch
->frame_chain (frame
);
2425 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2426 gdbarch_frame_chain_ftype frame_chain
)
2428 gdbarch
->frame_chain
= frame_chain
;
2432 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2434 if (gdbarch
->frame_chain_valid
== 0)
2435 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2436 if (gdbarch_debug
>= 2)
2437 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2438 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2442 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2443 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2445 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2449 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2451 if (gdbarch
->frame_saved_pc
== 0)
2452 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2453 if (gdbarch_debug
>= 2)
2454 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2455 return gdbarch
->frame_saved_pc (fi
);
2459 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2460 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2462 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2466 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2468 if (gdbarch
->frame_args_address
== 0)
2469 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2470 if (gdbarch_debug
>= 2)
2471 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2472 return gdbarch
->frame_args_address (fi
);
2476 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2477 gdbarch_frame_args_address_ftype frame_args_address
)
2479 gdbarch
->frame_args_address
= frame_args_address
;
2483 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2485 if (gdbarch
->frame_locals_address
== 0)
2486 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2487 if (gdbarch_debug
>= 2)
2488 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2489 return gdbarch
->frame_locals_address (fi
);
2493 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2494 gdbarch_frame_locals_address_ftype frame_locals_address
)
2496 gdbarch
->frame_locals_address
= frame_locals_address
;
2500 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2502 if (gdbarch
->saved_pc_after_call
== 0)
2503 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2504 if (gdbarch_debug
>= 2)
2505 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2506 return gdbarch
->saved_pc_after_call (frame
);
2510 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2511 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2513 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2517 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2519 if (gdbarch
->frame_num_args
== 0)
2520 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2521 if (gdbarch_debug
>= 2)
2522 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2523 return gdbarch
->frame_num_args (frame
);
2527 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2528 gdbarch_frame_num_args_ftype frame_num_args
)
2530 gdbarch
->frame_num_args
= frame_num_args
;
2534 gdbarch_stack_align_p (struct gdbarch
*gdbarch
)
2536 return gdbarch
->stack_align
!= 0;
2540 gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2542 if (gdbarch
->stack_align
== 0)
2543 internal_error ("gdbarch: gdbarch_stack_align invalid");
2544 if (gdbarch_debug
>= 2)
2545 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stack_align called\n");
2546 return gdbarch
->stack_align (sp
);
2550 set_gdbarch_stack_align (struct gdbarch
*gdbarch
,
2551 gdbarch_stack_align_ftype stack_align
)
2553 gdbarch
->stack_align
= stack_align
;
2557 gdbarch_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
2559 return gdbarch
->reg_struct_has_addr
!= 0;
2563 gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
2565 if (gdbarch
->reg_struct_has_addr
== 0)
2566 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
2567 if (gdbarch_debug
>= 2)
2568 fprintf_unfiltered (gdb_stdlog
, "gdbarch_reg_struct_has_addr called\n");
2569 return gdbarch
->reg_struct_has_addr (gcc_p
, type
);
2573 set_gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
,
2574 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr
)
2576 gdbarch
->reg_struct_has_addr
= reg_struct_has_addr
;
2580 /* Keep a registrary of per-architecture data-pointers required by GDB
2588 struct gdbarch_data_registration
2590 gdbarch_data_ftype
*init
;
2591 struct gdbarch_data
*data
;
2592 struct gdbarch_data_registration
*next
;
2595 struct gdbarch_data_registrary
2598 struct gdbarch_data_registration
*registrations
;
2601 struct gdbarch_data_registrary gdbarch_data_registrary
=
2606 struct gdbarch_data
*
2607 register_gdbarch_data (gdbarch_data_ftype
*init
)
2609 struct gdbarch_data_registration
**curr
;
2610 for (curr
= &gdbarch_data_registrary
.registrations
;
2612 curr
= &(*curr
)->next
);
2613 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2614 (*curr
)->next
= NULL
;
2615 (*curr
)->init
= init
;
2616 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2617 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2618 return (*curr
)->data
;
2622 /* Walk through all the registered users initializing each in turn. */
2625 init_gdbarch_data (struct gdbarch
*gdbarch
)
2627 struct gdbarch_data_registration
*rego
;
2628 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2629 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2630 for (rego
= gdbarch_data_registrary
.registrations
;
2634 if (rego
->data
->index
< gdbarch
->nr_data
)
2635 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2640 /* Return the current value of the specified per-architecture
2645 struct gdbarch_data
*data
;
2647 if (data
->index
>= current_gdbarch
->nr_data
)
2648 internal_error ("gdbarch_data: request for non-existant data.");
2649 return current_gdbarch
->data
[data
->index
];
2654 /* Keep a registrary of swaped data required by GDB modules. */
2659 struct gdbarch_swap_registration
*source
;
2660 struct gdbarch_swap
*next
;
2663 struct gdbarch_swap_registration
2666 unsigned long sizeof_data
;
2667 gdbarch_swap_ftype
*init
;
2668 struct gdbarch_swap_registration
*next
;
2671 struct gdbarch_swap_registrary
2674 struct gdbarch_swap_registration
*registrations
;
2677 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2683 register_gdbarch_swap (void *data
,
2684 unsigned long sizeof_data
,
2685 gdbarch_swap_ftype
*init
)
2687 struct gdbarch_swap_registration
**rego
;
2688 for (rego
= &gdbarch_swap_registrary
.registrations
;
2690 rego
= &(*rego
)->next
);
2691 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2692 (*rego
)->next
= NULL
;
2693 (*rego
)->init
= init
;
2694 (*rego
)->data
= data
;
2695 (*rego
)->sizeof_data
= sizeof_data
;
2700 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2702 struct gdbarch_swap_registration
*rego
;
2703 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2704 for (rego
= gdbarch_swap_registrary
.registrations
;
2708 if (rego
->data
!= NULL
)
2710 (*curr
) = XMALLOC (struct gdbarch_swap
);
2711 (*curr
)->source
= rego
;
2712 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2713 (*curr
)->next
= NULL
;
2714 memset (rego
->data
, 0, rego
->sizeof_data
);
2715 curr
= &(*curr
)->next
;
2717 if (rego
->init
!= NULL
)
2723 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2725 struct gdbarch_swap
*curr
;
2726 for (curr
= gdbarch
->swap
;
2729 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2733 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2735 struct gdbarch_swap
*curr
;
2736 for (curr
= gdbarch
->swap
;
2739 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2743 /* Keep a registrary of the architectures known by GDB. */
2745 struct gdbarch_init_registration
2747 enum bfd_architecture bfd_architecture
;
2748 gdbarch_init_ftype
*init
;
2749 struct gdbarch_list
*arches
;
2750 struct gdbarch_init_registration
*next
;
2753 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2756 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2757 gdbarch_init_ftype
*init
)
2759 struct gdbarch_init_registration
**curr
;
2760 const struct bfd_arch_info
*bfd_arch_info
;
2761 /* Check that BFD reconizes this architecture */
2762 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2763 if (bfd_arch_info
== NULL
)
2765 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2767 /* Check that we haven't seen this architecture before */
2768 for (curr
= &gdbarch_init_registrary
;
2770 curr
= &(*curr
)->next
)
2772 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2773 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2774 bfd_arch_info
->printable_name
);
2778 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2779 bfd_arch_info
->printable_name
,
2782 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2783 (*curr
)->bfd_architecture
= bfd_architecture
;
2784 (*curr
)->init
= init
;
2785 (*curr
)->arches
= NULL
;
2786 (*curr
)->next
= NULL
;
2791 /* Look for an architecture using gdbarch_info. Base search on only
2792 BFD_ARCH_INFO and BYTE_ORDER. */
2794 struct gdbarch_list
*
2795 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2796 const struct gdbarch_info
*info
)
2798 for (; arches
!= NULL
; arches
= arches
->next
)
2800 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2802 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2810 /* Update the current architecture. Return ZERO if the update request
2814 gdbarch_update (struct gdbarch_info info
)
2816 struct gdbarch
*new_gdbarch
;
2817 struct gdbarch_list
**list
;
2818 struct gdbarch_init_registration
*rego
;
2820 /* Fill in any missing bits. Most important is the bfd_architecture
2821 which is used to select the target architecture. */
2822 if (info
.bfd_architecture
== bfd_arch_unknown
)
2824 if (info
.bfd_arch_info
!= NULL
)
2825 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2826 else if (info
.abfd
!= NULL
)
2827 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2828 /* FIXME - should query BFD for its default architecture. */
2830 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2832 if (info
.bfd_arch_info
== NULL
)
2834 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2835 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2837 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2839 if (info
.byte_order
== 0)
2841 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2842 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2843 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2846 info
.byte_order
= current_gdbarch
->byte_order
;
2847 /* FIXME - should query BFD for its default byte-order. */
2849 /* A default for abfd? */
2851 /* Find the target that knows about this architecture. */
2852 for (rego
= gdbarch_init_registrary
;
2853 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2858 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2864 fprintf_unfiltered (gdb_stdlog
,
2865 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2866 info
.bfd_architecture
,
2867 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2868 fprintf_unfiltered (gdb_stdlog
,
2869 "gdbarch_update: info.bfd_arch_info %s\n",
2870 (info
.bfd_arch_info
!= NULL
2871 ? info
.bfd_arch_info
->printable_name
2873 fprintf_unfiltered (gdb_stdlog
,
2874 "gdbarch_update: info.byte_order %d (%s)\n",
2876 (info
.byte_order
== BIG_ENDIAN
? "big"
2877 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2879 fprintf_unfiltered (gdb_stdlog
,
2880 "gdbarch_update: info.abfd 0x%lx\n",
2882 fprintf_unfiltered (gdb_stdlog
,
2883 "gdbarch_update: info.tdep_info 0x%lx\n",
2884 (long) info
.tdep_info
);
2887 /* Ask the target for a replacement architecture. */
2888 new_gdbarch
= rego
->init (info
, rego
->arches
);
2890 /* Did the target like it? No. Reject the change. */
2891 if (new_gdbarch
== NULL
)
2894 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2898 /* Did the architecture change? No. Do nothing. */
2899 if (current_gdbarch
== new_gdbarch
)
2902 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2904 new_gdbarch
->bfd_arch_info
->printable_name
);
2908 /* Swap all data belonging to the old target out */
2909 swapout_gdbarch_swap (current_gdbarch
);
2911 /* Is this a pre-existing architecture? Yes. Swap it in. */
2912 for (list
= ®o
->arches
;
2914 list
= &(*list
)->next
)
2916 if ((*list
)->gdbarch
== new_gdbarch
)
2919 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2921 new_gdbarch
->bfd_arch_info
->printable_name
);
2922 current_gdbarch
= new_gdbarch
;
2923 swapin_gdbarch_swap (new_gdbarch
);
2928 /* Append this new architecture to this targets list. */
2929 (*list
) = XMALLOC (struct gdbarch_list
);
2930 (*list
)->next
= NULL
;
2931 (*list
)->gdbarch
= new_gdbarch
;
2933 /* Switch to this new architecture. Dump it out. */
2934 current_gdbarch
= new_gdbarch
;
2937 fprintf_unfiltered (gdb_stdlog
,
2938 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2940 new_gdbarch
->bfd_arch_info
->printable_name
);
2944 /* Check that the newly installed architecture is valid. */
2945 verify_gdbarch (new_gdbarch
);
2947 /* Initialize the per-architecture memory (swap) areas.
2948 CURRENT_GDBARCH must be update before these modules are
2950 init_gdbarch_swap (new_gdbarch
);
2952 /* Initialize the per-architecture data-pointer of all parties that
2953 registered an interest in this architecture. CURRENT_GDBARCH
2954 must be updated before these modules are called. */
2955 init_gdbarch_data (new_gdbarch
);
2962 /* Functions to manipulate the endianness of the target. */
2964 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2965 /* compat - Catch old targets that expect a selectable byte-order to
2966 default to BIG_ENDIAN */
2967 #ifndef TARGET_BYTE_ORDER_DEFAULT
2968 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2971 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2972 #ifndef TARGET_BYTE_ORDER_DEFAULT
2973 /* compat - Catch old non byte-order selectable targets that do not
2974 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2975 TARGET_BYTE_ORDER to be used as the default. For targets that
2976 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2977 below will get a strange compiler warning. */
2978 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2981 #ifndef TARGET_BYTE_ORDER_DEFAULT
2982 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2984 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2985 int target_byte_order_auto
= 1;
2987 /* Chain containing the \"set endian\" commands. */
2988 static struct cmd_list_element
*endianlist
= NULL
;
2990 /* Called by ``show endian''. */
2992 show_endian (char *args
, int from_tty
)
2995 (TARGET_BYTE_ORDER_AUTO
2996 ? "The target endianness is set automatically (currently %s endian)\n"
2997 : "The target is assumed to be %s endian\n");
2998 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
3001 /* Called if the user enters ``set endian'' without an argument. */
3003 set_endian (char *args
, int from_tty
)
3005 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
3006 show_endian (args
, from_tty
);
3009 /* Called by ``set endian big''. */
3011 set_endian_big (char *args
, int from_tty
)
3013 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3015 target_byte_order
= BIG_ENDIAN
;
3016 target_byte_order_auto
= 0;
3019 struct gdbarch_info info
;
3020 memset (&info
, 0, sizeof info
);
3021 info
.byte_order
= BIG_ENDIAN
;
3022 gdbarch_update (info
);
3027 printf_unfiltered ("Byte order is not selectable.");
3028 show_endian (args
, from_tty
);
3032 /* Called by ``set endian little''. */
3034 set_endian_little (char *args
, int from_tty
)
3036 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3038 target_byte_order
= LITTLE_ENDIAN
;
3039 target_byte_order_auto
= 0;
3042 struct gdbarch_info info
;
3043 memset (&info
, 0, sizeof info
);
3044 info
.byte_order
= LITTLE_ENDIAN
;
3045 gdbarch_update (info
);
3050 printf_unfiltered ("Byte order is not selectable.");
3051 show_endian (args
, from_tty
);
3055 /* Called by ``set endian auto''. */
3057 set_endian_auto (char *args
, int from_tty
)
3059 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3061 target_byte_order_auto
= 1;
3065 printf_unfiltered ("Byte order is not selectable.");
3066 show_endian (args
, from_tty
);
3070 /* Set the endianness from a BFD. */
3072 set_endian_from_file (bfd
*abfd
)
3074 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3078 if (bfd_big_endian (abfd
))
3081 want
= LITTLE_ENDIAN
;
3082 if (TARGET_BYTE_ORDER_AUTO
)
3083 target_byte_order
= want
;
3084 else if (TARGET_BYTE_ORDER
!= want
)
3085 warning ("%s endian file does not match %s endian target.",
3086 want
== BIG_ENDIAN
? "big" : "little",
3087 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3091 if (bfd_big_endian (abfd
)
3092 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
3093 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
3094 warning ("%s endian file does not match %s endian target.",
3095 bfd_big_endian (abfd
) ? "big" : "little",
3096 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3102 /* Functions to manipulate the architecture of the target */
3104 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3106 int target_architecture_auto
= 1;
3107 extern const struct bfd_arch_info bfd_default_arch_struct
;
3108 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
3109 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
3111 static void show_endian (char *, int);
3112 static void set_endian (char *, int);
3113 static void set_endian_big (char *, int);
3114 static void set_endian_little (char *, int);
3115 static void set_endian_auto (char *, int);
3116 static void set_endian_from_file (bfd
*);
3117 static int arch_ok (const struct bfd_arch_info
*arch
);
3118 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3119 static void show_architecture (char *, int);
3120 static void set_architecture (char *, int);
3121 static void info_architecture (char *, int);
3122 static void set_architecture_from_file (bfd
*);
3124 /* Do the real work of changing the current architecture */
3127 arch_ok (const struct bfd_arch_info
*arch
)
3129 /* Should be performing the more basic check that the binary is
3130 compatible with GDB. */
3131 /* Check with the target that the architecture is valid. */
3132 return (target_architecture_hook
== NULL
3133 || target_architecture_hook (arch
));
3137 set_arch (const struct bfd_arch_info
*arch
,
3143 if (!arch_ok (arch
))
3144 warning ("Target may not support %s architecture",
3145 arch
->printable_name
);
3146 target_architecture
= arch
;
3148 case set_arch_manual
:
3149 if (!arch_ok (arch
))
3151 printf_unfiltered ("Target does not support `%s' architecture.\n",
3152 arch
->printable_name
);
3156 target_architecture_auto
= 0;
3157 target_architecture
= arch
;
3165 /* Called if the user enters ``show architecture'' without an argument. */
3167 show_architecture (char *args
, int from_tty
)
3170 arch
= TARGET_ARCHITECTURE
->printable_name
;
3171 if (target_architecture_auto
)
3172 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3174 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3177 /* Called if the user enters ``set architecture'' with or without an
3180 set_architecture (char *args
, int from_tty
)
3184 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3186 else if (strcmp (args
, "auto") == 0)
3188 target_architecture_auto
= 1;
3190 else if (GDB_MULTI_ARCH
)
3192 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3194 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3197 struct gdbarch_info info
;
3198 memset (&info
, 0, sizeof info
);
3199 info
.bfd_arch_info
= arch
;
3200 if (gdbarch_update (info
))
3201 target_architecture_auto
= 0;
3203 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3208 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3210 set_arch (arch
, set_arch_manual
);
3212 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3216 /* Called if the user enters ``info architecture'' without an argument. */
3218 info_architecture (char *args
, int from_tty
)
3220 enum bfd_architecture a
;
3223 if (gdbarch_init_registrary
!= NULL
)
3225 struct gdbarch_init_registration
*rego
;
3226 printf_filtered ("Available architectures are:\n");
3227 for (rego
= gdbarch_init_registrary
;
3231 const struct bfd_arch_info
*ap
;
3232 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3237 printf_filtered (" %s", ap
->printable_name
);
3241 printf_filtered ("\n");
3247 printf_filtered ("There are no available architectures.\n");
3251 printf_filtered ("Available architectures are:\n");
3252 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3254 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3259 printf_filtered (" %s", ap
->printable_name
);
3263 printf_filtered ("\n");
3268 /* Set the architecture from arch/machine */
3270 set_architecture_from_arch_mach (arch
, mach
)
3271 enum bfd_architecture arch
;
3274 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3276 set_arch (wanted
, set_arch_manual
);
3278 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3281 /* Set the architecture from a BFD */
3283 set_architecture_from_file (bfd
*abfd
)
3285 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3286 if (target_architecture_auto
)
3288 set_arch (wanted
, set_arch_auto
);
3290 else if (wanted
!= target_architecture
)
3292 warning ("%s architecture file may be incompatible with %s target.",
3293 wanted
->printable_name
,
3294 target_architecture
->printable_name
);
3299 /* Misc helper functions for targets. */
3302 frame_num_args_unknown (fi
)
3303 struct frame_info
*fi
;
3310 generic_register_convertible_not (num
)
3319 /* Pointer to the target-dependent disassembly function. */
3320 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3321 disassemble_info tm_print_insn_info
;
3325 /* Set the dynamic target-system-dependant parameters (architecture,
3326 byte-order) using information found in the BFD */
3329 set_gdbarch_from_file (abfd
)
3334 struct gdbarch_info info
;
3335 memset (&info
, 0, sizeof info
);
3337 gdbarch_update (info
);
3340 set_architecture_from_file (abfd
);
3341 set_endian_from_file (abfd
);
3345 /* Initialize the current architecture. */
3347 initialize_current_architecture ()
3351 struct gdbarch_init_registration
*rego
;
3352 const struct bfd_arch_info
*chosen
= NULL
;
3353 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3355 const struct bfd_arch_info
*ap
3356 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3358 /* Choose the first architecture alphabetically. */
3360 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3366 struct gdbarch_info info
;
3367 memset (&info
, 0, sizeof info
);
3368 info
.bfd_arch_info
= chosen
;
3369 gdbarch_update (info
);
3374 extern void _initialize_gdbarch (void);
3376 _initialize_gdbarch ()
3378 struct cmd_list_element
*c
;
3380 add_prefix_cmd ("endian", class_support
, set_endian
,
3381 "Set endianness of target.",
3382 &endianlist
, "set endian ", 0, &setlist
);
3383 add_cmd ("big", class_support
, set_endian_big
,
3384 "Set target as being big endian.", &endianlist
);
3385 add_cmd ("little", class_support
, set_endian_little
,
3386 "Set target as being little endian.", &endianlist
);
3387 add_cmd ("auto", class_support
, set_endian_auto
,
3388 "Select target endianness automatically.", &endianlist
);
3389 add_cmd ("endian", class_support
, show_endian
,
3390 "Show endianness of target.", &showlist
);
3392 add_cmd ("architecture", class_support
, set_architecture
,
3393 "Set architecture of target.", &setlist
);
3394 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3395 add_cmd ("architecture", class_support
, show_architecture
,
3396 "Show architecture of target.", &showlist
);
3397 add_cmd ("architecture", class_support
, info_architecture
,
3398 "List supported target architectures", &infolist
);
3400 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3401 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3402 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3403 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3404 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3406 add_show_from_set (add_set_cmd ("arch",
3409 (char *)&gdbarch_debug
,
3410 "Set architecture debugging.\n\
3411 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3413 c
= add_set_cmd ("archdebug",
3416 (char *)&gdbarch_debug
,
3417 "Set architecture debugging.\n\
3418 When non-zero, architecture debugging is enabled.", &setlist
);
3420 deprecate_cmd (c
, "set debug arch");
3421 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");