1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
4 Copyright 1998-1999, Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* This file was created with the aid of ``gdbarch.sh''.
25 The bourn shell script ``gdbarch.sh'' creates the files
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
30 If editing this file, please also run gdbarch.sh and merge any
31 changes into that script. Conversely, when makeing sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
37 #include "arch-utils.h"
41 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
43 /* Just include everything in sight so that the every old definition
44 of macro is visible. */
45 #include "gdb_string.h"
50 #include "breakpoint.h"
55 #include "gdbthread.h"
57 #include "symfile.h" /* for overlay functions */
62 /* Static function declarations */
64 static void verify_gdbarch (struct gdbarch
*gdbarch
);
65 static void init_gdbarch_data (struct gdbarch
*);
66 static void init_gdbarch_swap (struct gdbarch
*);
67 static void swapout_gdbarch_swap (struct gdbarch
*);
68 static void swapin_gdbarch_swap (struct gdbarch
*);
70 /* Convenience macro for allocting typesafe memory. */
73 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
77 /* Non-zero if we want to trace architecture code. */
80 #define GDBARCH_DEBUG 0
82 int gdbarch_debug
= GDBARCH_DEBUG
;
85 /* Maintain the struct gdbarch object */
89 /* basic architectural information */
90 const struct bfd_arch_info
* bfd_arch_info
;
93 /* target specific vector. */
94 struct gdbarch_tdep
*tdep
;
96 /* per-architecture data-pointers */
100 /* per-architecture swap-regions */
101 struct gdbarch_swap
*swap
;
103 /* Multi-arch values.
105 When extending this structure you must:
109 Declare set/get functions and define the corresponding
112 gdbarch_alloc(): If zero/NULL is not a suitable default,
113 initialize the new field.
115 verify_gdbarch(): Confirm that the target updated the field
118 gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
121 ``startup_gdbarch()'': Append an initial value to the static
122 variable (base values on the host's c-type system).
124 get_gdbarch(): Implement the set/get functions (probably using
125 the macro's as shortcuts).
139 gdbarch_read_pc_ftype
*read_pc
;
140 gdbarch_write_pc_ftype
*write_pc
;
141 gdbarch_read_fp_ftype
*read_fp
;
142 gdbarch_write_fp_ftype
*write_fp
;
143 gdbarch_read_sp_ftype
*read_sp
;
144 gdbarch_write_sp_ftype
*write_sp
;
152 gdbarch_register_name_ftype
*register_name
;
155 gdbarch_register_byte_ftype
*register_byte
;
156 gdbarch_register_raw_size_ftype
*register_raw_size
;
157 int max_register_raw_size
;
158 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
159 int max_register_virtual_size
;
160 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
161 int use_generic_dummy_frames
;
162 int call_dummy_location
;
163 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
164 CORE_ADDR call_dummy_start_offset
;
165 CORE_ADDR call_dummy_breakpoint_offset
;
166 int call_dummy_breakpoint_offset_p
;
167 int call_dummy_length
;
168 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
170 LONGEST
* call_dummy_words
;
171 int sizeof_call_dummy_words
;
172 int call_dummy_stack_adjust_p
;
173 int call_dummy_stack_adjust
;
174 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
175 int believe_pcc_promotion
;
176 int believe_pcc_promotion_type
;
177 gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
;
178 gdbarch_get_saved_register_ftype
*get_saved_register
;
179 gdbarch_register_convertible_ftype
*register_convertible
;
180 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
181 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
182 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
183 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
184 gdbarch_return_value_on_stack_ftype
*return_value_on_stack
;
185 gdbarch_extract_return_value_ftype
*extract_return_value
;
186 gdbarch_push_arguments_ftype
*push_arguments
;
187 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
188 gdbarch_push_return_address_ftype
*push_return_address
;
189 gdbarch_pop_frame_ftype
*pop_frame
;
190 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
191 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
192 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
193 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
194 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
195 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
196 gdbarch_store_struct_return_ftype
*store_struct_return
;
197 gdbarch_store_return_value_ftype
*store_return_value
;
198 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
199 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
200 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
201 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
202 gdbarch_skip_prologue_ftype
*skip_prologue
;
203 gdbarch_prologue_frameless_p_ftype
*prologue_frameless_p
;
204 gdbarch_inner_than_ftype
*inner_than
;
205 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
206 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
207 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
208 CORE_ADDR decr_pc_after_break
;
209 CORE_ADDR function_start_offset
;
210 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
211 CORE_ADDR frame_args_skip
;
212 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
213 gdbarch_frame_chain_ftype
*frame_chain
;
214 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
215 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
216 gdbarch_frame_args_address_ftype
*frame_args_address
;
217 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
218 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
219 gdbarch_frame_num_args_ftype
*frame_num_args
;
220 gdbarch_stack_align_ftype
*stack_align
;
221 gdbarch_reg_struct_has_addr_ftype
*reg_struct_has_addr
;
222 gdbarch_save_dummy_frame_tos_ftype
*save_dummy_frame_tos
;
226 /* The default architecture uses host values (for want of a better
229 extern const struct bfd_arch_info bfd_default_arch_struct
;
231 struct gdbarch startup_gdbarch
= {
232 /* basic architecture information */
233 &bfd_default_arch_struct
,
235 /* target specific vector */
237 /*per-architecture data-pointers and swap regions */
239 /* Multi-arch values */
245 8 * sizeof (LONGEST
),
248 8 * sizeof (long double),
289 generic_get_saved_register
,
334 /* startup_gdbarch() */
336 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
339 /* Create a new ``struct gdbarch'' based in information provided by
340 ``struct gdbarch_info''. */
343 gdbarch_alloc (const struct gdbarch_info
*info
,
344 struct gdbarch_tdep
*tdep
)
346 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
347 memset (gdbarch
, 0, sizeof (*gdbarch
));
349 gdbarch
->tdep
= tdep
;
351 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
352 gdbarch
->byte_order
= info
->byte_order
;
354 /* Force the explicit initialization of these. */
355 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
356 gdbarch
->num_regs
= -1;
357 gdbarch
->sp_regnum
= -1;
358 gdbarch
->fp_regnum
= -1;
359 gdbarch
->pc_regnum
= -1;
360 gdbarch
->fp0_regnum
= -1;
361 gdbarch
->npc_regnum
= -1;
362 gdbarch
->nnpc_regnum
= -1;
363 gdbarch
->register_name
= legacy_register_name
;
364 gdbarch
->register_size
= -1;
365 gdbarch
->register_bytes
= -1;
366 gdbarch
->max_register_raw_size
= -1;
367 gdbarch
->max_register_virtual_size
= -1;
368 gdbarch
->use_generic_dummy_frames
= -1;
369 gdbarch
->call_dummy_start_offset
= -1;
370 gdbarch
->call_dummy_breakpoint_offset
= -1;
371 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
372 gdbarch
->call_dummy_length
= -1;
373 gdbarch
->call_dummy_p
= -1;
374 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
375 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
376 gdbarch
->call_dummy_stack_adjust_p
= -1;
377 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
378 gdbarch
->register_convertible
= generic_register_convertible_not
;
379 gdbarch
->pointer_to_address
= generic_pointer_to_address
;
380 gdbarch
->address_to_pointer
= generic_address_to_pointer
;
381 gdbarch
->return_value_on_stack
= generic_return_value_on_stack_not
;
382 gdbarch
->prologue_frameless_p
= generic_prologue_frameless_p
;
383 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
384 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
385 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
386 gdbarch
->decr_pc_after_break
= -1;
387 gdbarch
->function_start_offset
= -1;
388 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
389 gdbarch
->frame_args_skip
= -1;
390 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
391 /* gdbarch_alloc() */
397 /* Free a gdbarch struct. This should never happen in normal
398 operation --- once you've created a gdbarch, you keep it around.
399 However, if an architecture's init function encounters an error
400 building the structure, it may need to clean up a partially
401 constructed gdbarch. */
403 gdbarch_free (struct gdbarch
*arch
)
405 /* At the moment, this is trivial. */
410 /* Ensure that all values in a GDBARCH are reasonable. */
413 verify_gdbarch (struct gdbarch
*gdbarch
)
415 /* Only perform sanity checks on a multi-arch target. */
416 if (GDB_MULTI_ARCH
<= 0)
419 if (gdbarch
->byte_order
== 0)
420 internal_error ("verify_gdbarch: byte-order unset");
421 if (gdbarch
->bfd_arch_info
== NULL
)
422 internal_error ("verify_gdbarch: bfd_arch_info unset");
423 /* Check those that need to be defined for the given multi-arch level. */
424 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
425 if ((GDB_MULTI_ARCH
>= 1)
426 && (gdbarch
->ptr_bit
== 0))
427 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
428 if ((GDB_MULTI_ARCH
>= 1)
429 && (gdbarch
->short_bit
== 0))
430 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
431 if ((GDB_MULTI_ARCH
>= 1)
432 && (gdbarch
->int_bit
== 0))
433 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
434 if ((GDB_MULTI_ARCH
>= 1)
435 && (gdbarch
->long_bit
== 0))
436 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
437 if ((GDB_MULTI_ARCH
>= 1)
438 && (gdbarch
->long_long_bit
== 0))
439 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
440 if ((GDB_MULTI_ARCH
>= 1)
441 && (gdbarch
->float_bit
== 0))
442 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
443 if ((GDB_MULTI_ARCH
>= 1)
444 && (gdbarch
->double_bit
== 0))
445 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
446 if ((GDB_MULTI_ARCH
>= 1)
447 && (gdbarch
->long_double_bit
== 0))
448 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
449 /* Skip verify of ieee_float, invalid_p == 0 */
450 if ((GDB_MULTI_ARCH
>= 1)
451 && (gdbarch
->read_pc
== 0))
452 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
453 if ((GDB_MULTI_ARCH
>= 1)
454 && (gdbarch
->write_pc
== 0))
455 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
456 if ((GDB_MULTI_ARCH
>= 1)
457 && (gdbarch
->read_fp
== 0))
458 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
459 if ((GDB_MULTI_ARCH
>= 1)
460 && (gdbarch
->write_fp
== 0))
461 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
462 if ((GDB_MULTI_ARCH
>= 1)
463 && (gdbarch
->read_sp
== 0))
464 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
465 if ((GDB_MULTI_ARCH
>= 1)
466 && (gdbarch
->write_sp
== 0))
467 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
468 if ((GDB_MULTI_ARCH
>= 2)
469 && (gdbarch
->num_regs
== -1))
470 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
471 if ((GDB_MULTI_ARCH
>= 2)
472 && (gdbarch
->sp_regnum
== -1))
473 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
474 if ((GDB_MULTI_ARCH
>= 2)
475 && (gdbarch
->fp_regnum
== -1))
476 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
477 if ((GDB_MULTI_ARCH
>= 2)
478 && (gdbarch
->pc_regnum
== -1))
479 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
480 /* Skip verify of fp0_regnum, invalid_p == 0 */
481 /* Skip verify of npc_regnum, invalid_p == 0 */
482 /* Skip verify of nnpc_regnum, invalid_p == 0 */
483 /* Skip verify of register_name, invalid_p == 0 */
484 if ((GDB_MULTI_ARCH
>= 2)
485 && (gdbarch
->register_size
== -1))
486 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
487 if ((GDB_MULTI_ARCH
>= 2)
488 && (gdbarch
->register_bytes
== -1))
489 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
490 if ((GDB_MULTI_ARCH
>= 2)
491 && (gdbarch
->register_byte
== 0))
492 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
493 if ((GDB_MULTI_ARCH
>= 2)
494 && (gdbarch
->register_raw_size
== 0))
495 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
496 if ((GDB_MULTI_ARCH
>= 2)
497 && (gdbarch
->max_register_raw_size
== -1))
498 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
499 if ((GDB_MULTI_ARCH
>= 2)
500 && (gdbarch
->register_virtual_size
== 0))
501 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
502 if ((GDB_MULTI_ARCH
>= 2)
503 && (gdbarch
->max_register_virtual_size
== -1))
504 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
505 if ((GDB_MULTI_ARCH
>= 2)
506 && (gdbarch
->register_virtual_type
== 0))
507 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
508 if ((GDB_MULTI_ARCH
>= 1)
509 && (gdbarch
->use_generic_dummy_frames
== -1))
510 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
511 if ((GDB_MULTI_ARCH
>= 2)
512 && (gdbarch
->call_dummy_location
== 0))
513 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
514 if ((GDB_MULTI_ARCH
>= 2)
515 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
516 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
517 if ((GDB_MULTI_ARCH
>= 2)
518 && (gdbarch
->call_dummy_start_offset
== -1))
519 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
520 if ((GDB_MULTI_ARCH
>= 2)
521 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
522 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
523 if ((GDB_MULTI_ARCH
>= 1)
524 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
525 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
526 if ((GDB_MULTI_ARCH
>= 2)
527 && (gdbarch
->call_dummy_length
== -1))
528 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
529 if ((GDB_MULTI_ARCH
>= 2)
530 && (gdbarch
->pc_in_call_dummy
== 0))
531 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
532 if ((GDB_MULTI_ARCH
>= 1)
533 && (gdbarch
->call_dummy_p
== -1))
534 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
535 /* Skip verify of call_dummy_words, invalid_p == 0 */
536 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
537 if ((GDB_MULTI_ARCH
>= 1)
538 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
539 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
540 if ((GDB_MULTI_ARCH
>= 2)
541 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
542 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
543 if ((GDB_MULTI_ARCH
>= 2)
544 && (gdbarch
->fix_call_dummy
== 0))
545 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
546 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
547 if ((GDB_MULTI_ARCH
>= 1)
548 && (gdbarch
->get_saved_register
== 0))
549 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
550 /* Skip verify of register_convertible, invalid_p == 0 */
551 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
552 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
553 /* Skip verify of pointer_to_address, invalid_p == 0 */
554 /* Skip verify of address_to_pointer, invalid_p == 0 */
555 /* Skip verify of return_value_on_stack, invalid_p == 0 */
556 if ((GDB_MULTI_ARCH
>= 2)
557 && (gdbarch
->extract_return_value
== 0))
558 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
559 if ((GDB_MULTI_ARCH
>= 1)
560 && (gdbarch
->push_arguments
== 0))
561 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
562 if ((GDB_MULTI_ARCH
>= 2)
563 && (gdbarch
->push_dummy_frame
== 0))
564 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
565 if ((GDB_MULTI_ARCH
>= 1)
566 && (gdbarch
->push_return_address
== 0))
567 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
568 if ((GDB_MULTI_ARCH
>= 2)
569 && (gdbarch
->pop_frame
== 0))
570 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
571 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
572 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
573 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
574 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
575 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
576 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
577 if ((GDB_MULTI_ARCH
>= 2)
578 && (gdbarch
->store_struct_return
== 0))
579 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
580 if ((GDB_MULTI_ARCH
>= 2)
581 && (gdbarch
->store_return_value
== 0))
582 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
583 if ((GDB_MULTI_ARCH
>= 2)
584 && (gdbarch
->extract_struct_value_address
== 0))
585 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
586 if ((GDB_MULTI_ARCH
>= 2)
587 && (gdbarch
->use_struct_convention
== 0))
588 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
589 if ((GDB_MULTI_ARCH
>= 2)
590 && (gdbarch
->frame_init_saved_regs
== 0))
591 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
592 if ((GDB_MULTI_ARCH
>= 2)
593 && (gdbarch
->init_extra_frame_info
== 0))
594 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
595 if ((GDB_MULTI_ARCH
>= 2)
596 && (gdbarch
->skip_prologue
== 0))
597 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
598 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
599 if ((GDB_MULTI_ARCH
>= 2)
600 && (gdbarch
->inner_than
== 0))
601 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
602 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
603 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
604 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
605 if ((GDB_MULTI_ARCH
>= 2)
606 && (gdbarch
->decr_pc_after_break
== -1))
607 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
608 if ((GDB_MULTI_ARCH
>= 2)
609 && (gdbarch
->function_start_offset
== -1))
610 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
611 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
612 if ((GDB_MULTI_ARCH
>= 2)
613 && (gdbarch
->frame_args_skip
== -1))
614 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
615 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
616 if ((GDB_MULTI_ARCH
>= 2)
617 && (gdbarch
->frame_chain
== 0))
618 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
619 if ((GDB_MULTI_ARCH
>= 1)
620 && (gdbarch
->frame_chain_valid
== 0))
621 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
622 if ((GDB_MULTI_ARCH
>= 2)
623 && (gdbarch
->frame_saved_pc
== 0))
624 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
625 if ((GDB_MULTI_ARCH
>= 2)
626 && (gdbarch
->frame_args_address
== 0))
627 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
628 if ((GDB_MULTI_ARCH
>= 2)
629 && (gdbarch
->frame_locals_address
== 0))
630 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
631 if ((GDB_MULTI_ARCH
>= 2)
632 && (gdbarch
->saved_pc_after_call
== 0))
633 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
634 if ((GDB_MULTI_ARCH
>= 2)
635 && (gdbarch
->frame_num_args
== 0))
636 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
637 /* Skip verify of stack_align, has predicate */
638 /* Skip verify of reg_struct_has_addr, has predicate */
639 /* Skip verify of save_dummy_frame_tos, has predicate */
643 /* Print out the details of the current architecture. */
648 #ifdef TARGET_ARCHITECTURE
649 if (TARGET_ARCHITECTURE
!= NULL
)
650 fprintf_unfiltered (gdb_stdlog
,
651 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
652 TARGET_ARCHITECTURE
->printable_name
);
654 #ifdef TARGET_BYTE_ORDER
655 fprintf_unfiltered (gdb_stdlog
,
656 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
657 (long) TARGET_BYTE_ORDER
);
659 #ifdef TARGET_BFD_VMA_BIT
660 fprintf_unfiltered (gdb_stdlog
,
661 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
662 (long) TARGET_BFD_VMA_BIT
);
664 #ifdef TARGET_PTR_BIT
665 fprintf_unfiltered (gdb_stdlog
,
666 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
667 (long) TARGET_PTR_BIT
);
669 #ifdef TARGET_SHORT_BIT
670 fprintf_unfiltered (gdb_stdlog
,
671 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
672 (long) TARGET_SHORT_BIT
);
674 #ifdef TARGET_INT_BIT
675 fprintf_unfiltered (gdb_stdlog
,
676 "gdbarch_update: TARGET_INT_BIT = %ld\n",
677 (long) TARGET_INT_BIT
);
679 #ifdef TARGET_LONG_BIT
680 fprintf_unfiltered (gdb_stdlog
,
681 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
682 (long) TARGET_LONG_BIT
);
684 #ifdef TARGET_LONG_LONG_BIT
685 fprintf_unfiltered (gdb_stdlog
,
686 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
687 (long) TARGET_LONG_LONG_BIT
);
689 #ifdef TARGET_FLOAT_BIT
690 fprintf_unfiltered (gdb_stdlog
,
691 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
692 (long) TARGET_FLOAT_BIT
);
694 #ifdef TARGET_DOUBLE_BIT
695 fprintf_unfiltered (gdb_stdlog
,
696 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
697 (long) TARGET_DOUBLE_BIT
);
699 #ifdef TARGET_LONG_DOUBLE_BIT
700 fprintf_unfiltered (gdb_stdlog
,
701 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
702 (long) TARGET_LONG_DOUBLE_BIT
);
705 fprintf_unfiltered (gdb_stdlog
,
706 "gdbarch_update: IEEE_FLOAT = %ld\n",
709 #ifdef TARGET_READ_PC
710 fprintf_unfiltered (gdb_stdlog
,
711 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
712 (long) current_gdbarch
->read_pc
713 /*TARGET_READ_PC ()*/);
715 #ifdef TARGET_WRITE_PC
716 fprintf_unfiltered (gdb_stdlog
,
717 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
718 (long) current_gdbarch
->write_pc
719 /*TARGET_WRITE_PC ()*/);
721 #ifdef TARGET_READ_FP
722 fprintf_unfiltered (gdb_stdlog
,
723 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
724 (long) current_gdbarch
->read_fp
725 /*TARGET_READ_FP ()*/);
727 #ifdef TARGET_WRITE_FP
728 fprintf_unfiltered (gdb_stdlog
,
729 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
730 (long) current_gdbarch
->write_fp
731 /*TARGET_WRITE_FP ()*/);
733 #ifdef TARGET_READ_SP
734 fprintf_unfiltered (gdb_stdlog
,
735 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
736 (long) current_gdbarch
->read_sp
737 /*TARGET_READ_SP ()*/);
739 #ifdef TARGET_WRITE_SP
740 fprintf_unfiltered (gdb_stdlog
,
741 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
742 (long) current_gdbarch
->write_sp
743 /*TARGET_WRITE_SP ()*/);
746 fprintf_unfiltered (gdb_stdlog
,
747 "gdbarch_update: NUM_REGS = %ld\n",
751 fprintf_unfiltered (gdb_stdlog
,
752 "gdbarch_update: SP_REGNUM = %ld\n",
756 fprintf_unfiltered (gdb_stdlog
,
757 "gdbarch_update: FP_REGNUM = %ld\n",
761 fprintf_unfiltered (gdb_stdlog
,
762 "gdbarch_update: PC_REGNUM = %ld\n",
766 fprintf_unfiltered (gdb_stdlog
,
767 "gdbarch_update: FP0_REGNUM = %ld\n",
771 fprintf_unfiltered (gdb_stdlog
,
772 "gdbarch_update: NPC_REGNUM = %ld\n",
776 fprintf_unfiltered (gdb_stdlog
,
777 "gdbarch_update: NNPC_REGNUM = %ld\n",
781 fprintf_unfiltered (gdb_stdlog
,
782 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
783 (long) current_gdbarch
->register_name
784 /*REGISTER_NAME ()*/);
787 fprintf_unfiltered (gdb_stdlog
,
788 "gdbarch_update: REGISTER_SIZE = %ld\n",
789 (long) REGISTER_SIZE
);
791 #ifdef REGISTER_BYTES
792 fprintf_unfiltered (gdb_stdlog
,
793 "gdbarch_update: REGISTER_BYTES = %ld\n",
794 (long) REGISTER_BYTES
);
797 fprintf_unfiltered (gdb_stdlog
,
798 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
799 (long) current_gdbarch
->register_byte
800 /*REGISTER_BYTE ()*/);
802 #ifdef REGISTER_RAW_SIZE
803 fprintf_unfiltered (gdb_stdlog
,
804 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
805 (long) current_gdbarch
->register_raw_size
806 /*REGISTER_RAW_SIZE ()*/);
808 #ifdef MAX_REGISTER_RAW_SIZE
809 fprintf_unfiltered (gdb_stdlog
,
810 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
811 (long) MAX_REGISTER_RAW_SIZE
);
813 #ifdef REGISTER_VIRTUAL_SIZE
814 fprintf_unfiltered (gdb_stdlog
,
815 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
816 (long) current_gdbarch
->register_virtual_size
817 /*REGISTER_VIRTUAL_SIZE ()*/);
819 #ifdef MAX_REGISTER_VIRTUAL_SIZE
820 fprintf_unfiltered (gdb_stdlog
,
821 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
822 (long) MAX_REGISTER_VIRTUAL_SIZE
);
824 #ifdef REGISTER_VIRTUAL_TYPE
825 fprintf_unfiltered (gdb_stdlog
,
826 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
827 (long) current_gdbarch
->register_virtual_type
828 /*REGISTER_VIRTUAL_TYPE ()*/);
830 #ifdef USE_GENERIC_DUMMY_FRAMES
831 fprintf_unfiltered (gdb_stdlog
,
832 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
833 (long) USE_GENERIC_DUMMY_FRAMES
);
835 #ifdef CALL_DUMMY_LOCATION
836 fprintf_unfiltered (gdb_stdlog
,
837 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
838 (long) CALL_DUMMY_LOCATION
);
840 #ifdef CALL_DUMMY_ADDRESS
841 fprintf_unfiltered (gdb_stdlog
,
842 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
843 (long) current_gdbarch
->call_dummy_address
844 /*CALL_DUMMY_ADDRESS ()*/);
846 #ifdef CALL_DUMMY_START_OFFSET
847 fprintf_unfiltered (gdb_stdlog
,
848 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
849 (long) CALL_DUMMY_START_OFFSET
);
851 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
852 fprintf_unfiltered (gdb_stdlog
,
853 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
854 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
856 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
857 fprintf_unfiltered (gdb_stdlog
,
858 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
859 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
861 #ifdef CALL_DUMMY_LENGTH
862 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
863 fprintf_unfiltered (gdb_stdlog
,
864 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
865 (long) CALL_DUMMY_LENGTH
);
867 #ifdef PC_IN_CALL_DUMMY
868 fprintf_unfiltered (gdb_stdlog
,
869 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
870 (long) current_gdbarch
->pc_in_call_dummy
871 /*PC_IN_CALL_DUMMY ()*/);
874 fprintf_unfiltered (gdb_stdlog
,
875 "gdbarch_update: CALL_DUMMY_P = %ld\n",
876 (long) CALL_DUMMY_P
);
878 #ifdef CALL_DUMMY_WORDS
879 fprintf_unfiltered (gdb_stdlog
,
880 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
881 (long) CALL_DUMMY_WORDS
);
883 #ifdef SIZEOF_CALL_DUMMY_WORDS
884 fprintf_unfiltered (gdb_stdlog
,
885 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
886 (long) SIZEOF_CALL_DUMMY_WORDS
);
888 #ifdef CALL_DUMMY_STACK_ADJUST_P
889 fprintf_unfiltered (gdb_stdlog
,
890 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
891 (long) CALL_DUMMY_STACK_ADJUST_P
);
893 #ifdef CALL_DUMMY_STACK_ADJUST
894 if (CALL_DUMMY_STACK_ADJUST_P
)
895 fprintf_unfiltered (gdb_stdlog
,
896 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
897 (long) CALL_DUMMY_STACK_ADJUST
);
899 #ifdef FIX_CALL_DUMMY
900 fprintf_unfiltered (gdb_stdlog
,
901 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
902 (long) current_gdbarch
->fix_call_dummy
903 /*FIX_CALL_DUMMY ()*/);
905 #ifdef BELIEVE_PCC_PROMOTION
906 fprintf_unfiltered (gdb_stdlog
,
907 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
908 (long) BELIEVE_PCC_PROMOTION
);
910 #ifdef BELIEVE_PCC_PROMOTION_TYPE
911 fprintf_unfiltered (gdb_stdlog
,
912 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
913 (long) BELIEVE_PCC_PROMOTION_TYPE
);
915 #ifdef COERCE_FLOAT_TO_DOUBLE
916 fprintf_unfiltered (gdb_stdlog
,
917 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
918 (long) current_gdbarch
->coerce_float_to_double
919 /*COERCE_FLOAT_TO_DOUBLE ()*/);
921 #ifdef GET_SAVED_REGISTER
922 fprintf_unfiltered (gdb_stdlog
,
923 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
924 (long) current_gdbarch
->get_saved_register
925 /*GET_SAVED_REGISTER ()*/);
927 #ifdef REGISTER_CONVERTIBLE
928 fprintf_unfiltered (gdb_stdlog
,
929 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
930 (long) current_gdbarch
->register_convertible
931 /*REGISTER_CONVERTIBLE ()*/);
933 #ifdef REGISTER_CONVERT_TO_VIRTUAL
934 fprintf_unfiltered (gdb_stdlog
,
935 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
936 (long) current_gdbarch
->register_convert_to_virtual
937 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
939 #ifdef REGISTER_CONVERT_TO_RAW
940 fprintf_unfiltered (gdb_stdlog
,
941 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
942 (long) current_gdbarch
->register_convert_to_raw
943 /*REGISTER_CONVERT_TO_RAW ()*/);
945 #ifdef POINTER_TO_ADDRESS
946 fprintf_unfiltered (gdb_stdlog
,
947 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
948 (long) current_gdbarch
->pointer_to_address
949 /*POINTER_TO_ADDRESS ()*/);
951 #ifdef ADDRESS_TO_POINTER
952 fprintf_unfiltered (gdb_stdlog
,
953 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
954 (long) current_gdbarch
->address_to_pointer
955 /*ADDRESS_TO_POINTER ()*/);
957 #ifdef RETURN_VALUE_ON_STACK
958 fprintf_unfiltered (gdb_stdlog
,
959 "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n",
960 (long) current_gdbarch
->return_value_on_stack
961 /*RETURN_VALUE_ON_STACK ()*/);
963 #ifdef EXTRACT_RETURN_VALUE
964 fprintf_unfiltered (gdb_stdlog
,
965 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
966 (long) current_gdbarch
->extract_return_value
967 /*EXTRACT_RETURN_VALUE ()*/);
969 #ifdef PUSH_ARGUMENTS
970 fprintf_unfiltered (gdb_stdlog
,
971 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
972 (long) current_gdbarch
->push_arguments
973 /*PUSH_ARGUMENTS ()*/);
975 #ifdef PUSH_DUMMY_FRAME
976 fprintf_unfiltered (gdb_stdlog
,
977 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
978 (long) current_gdbarch
->push_dummy_frame
979 /*PUSH_DUMMY_FRAME ()*/);
981 #ifdef PUSH_RETURN_ADDRESS
982 fprintf_unfiltered (gdb_stdlog
,
983 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
984 (long) current_gdbarch
->push_return_address
985 /*PUSH_RETURN_ADDRESS ()*/);
988 fprintf_unfiltered (gdb_stdlog
,
989 "gdbarch_update: POP_FRAME = 0x%08lx\n",
990 (long) current_gdbarch
->pop_frame
993 #ifdef D10V_MAKE_DADDR
994 fprintf_unfiltered (gdb_stdlog
,
995 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
996 (long) current_gdbarch
->d10v_make_daddr
997 /*D10V_MAKE_DADDR ()*/);
999 #ifdef D10V_MAKE_IADDR
1000 fprintf_unfiltered (gdb_stdlog
,
1001 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
1002 (long) current_gdbarch
->d10v_make_iaddr
1003 /*D10V_MAKE_IADDR ()*/);
1006 fprintf_unfiltered (gdb_stdlog
,
1007 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
1008 (long) current_gdbarch
->d10v_daddr_p
1009 /*D10V_DADDR_P ()*/);
1012 fprintf_unfiltered (gdb_stdlog
,
1013 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
1014 (long) current_gdbarch
->d10v_iaddr_p
1015 /*D10V_IADDR_P ()*/);
1017 #ifdef D10V_CONVERT_DADDR_TO_RAW
1018 fprintf_unfiltered (gdb_stdlog
,
1019 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1020 (long) current_gdbarch
->d10v_convert_daddr_to_raw
1021 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
1023 #ifdef D10V_CONVERT_IADDR_TO_RAW
1024 fprintf_unfiltered (gdb_stdlog
,
1025 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1026 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
1027 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
1029 #ifdef STORE_STRUCT_RETURN
1030 fprintf_unfiltered (gdb_stdlog
,
1031 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
1032 (long) current_gdbarch
->store_struct_return
1033 /*STORE_STRUCT_RETURN ()*/);
1035 #ifdef STORE_RETURN_VALUE
1036 fprintf_unfiltered (gdb_stdlog
,
1037 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
1038 (long) current_gdbarch
->store_return_value
1039 /*STORE_RETURN_VALUE ()*/);
1041 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1042 fprintf_unfiltered (gdb_stdlog
,
1043 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1044 (long) current_gdbarch
->extract_struct_value_address
1045 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1047 #ifdef USE_STRUCT_CONVENTION
1048 fprintf_unfiltered (gdb_stdlog
,
1049 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
1050 (long) current_gdbarch
->use_struct_convention
1051 /*USE_STRUCT_CONVENTION ()*/);
1053 #ifdef FRAME_INIT_SAVED_REGS
1054 fprintf_unfiltered (gdb_stdlog
,
1055 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1056 (long) current_gdbarch
->frame_init_saved_regs
1057 /*FRAME_INIT_SAVED_REGS ()*/);
1059 #ifdef INIT_EXTRA_FRAME_INFO
1060 fprintf_unfiltered (gdb_stdlog
,
1061 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1062 (long) current_gdbarch
->init_extra_frame_info
1063 /*INIT_EXTRA_FRAME_INFO ()*/);
1065 #ifdef SKIP_PROLOGUE
1066 fprintf_unfiltered (gdb_stdlog
,
1067 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
1068 (long) current_gdbarch
->skip_prologue
1069 /*SKIP_PROLOGUE ()*/);
1071 #ifdef PROLOGUE_FRAMELESS_P
1072 fprintf_unfiltered (gdb_stdlog
,
1073 "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1074 (long) current_gdbarch
->prologue_frameless_p
1075 /*PROLOGUE_FRAMELESS_P ()*/);
1078 fprintf_unfiltered (gdb_stdlog
,
1079 "gdbarch_update: INNER_THAN = 0x%08lx\n",
1080 (long) current_gdbarch
->inner_than
1083 #ifdef BREAKPOINT_FROM_PC
1084 fprintf_unfiltered (gdb_stdlog
,
1085 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
1086 (long) current_gdbarch
->breakpoint_from_pc
1087 /*BREAKPOINT_FROM_PC ()*/);
1089 #ifdef MEMORY_INSERT_BREAKPOINT
1090 fprintf_unfiltered (gdb_stdlog
,
1091 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1092 (long) current_gdbarch
->memory_insert_breakpoint
1093 /*MEMORY_INSERT_BREAKPOINT ()*/);
1095 #ifdef MEMORY_REMOVE_BREAKPOINT
1096 fprintf_unfiltered (gdb_stdlog
,
1097 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1098 (long) current_gdbarch
->memory_remove_breakpoint
1099 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1101 #ifdef DECR_PC_AFTER_BREAK
1102 fprintf_unfiltered (gdb_stdlog
,
1103 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
1104 (long) DECR_PC_AFTER_BREAK
);
1106 #ifdef FUNCTION_START_OFFSET
1107 fprintf_unfiltered (gdb_stdlog
,
1108 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
1109 (long) FUNCTION_START_OFFSET
);
1111 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1112 fprintf_unfiltered (gdb_stdlog
,
1113 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1114 (long) current_gdbarch
->remote_translate_xfer_address
1115 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1117 #ifdef FRAME_ARGS_SKIP
1118 fprintf_unfiltered (gdb_stdlog
,
1119 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
1120 (long) FRAME_ARGS_SKIP
);
1122 #ifdef FRAMELESS_FUNCTION_INVOCATION
1123 fprintf_unfiltered (gdb_stdlog
,
1124 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1125 (long) current_gdbarch
->frameless_function_invocation
1126 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1129 fprintf_unfiltered (gdb_stdlog
,
1130 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
1131 (long) current_gdbarch
->frame_chain
1132 /*FRAME_CHAIN ()*/);
1134 #ifdef FRAME_CHAIN_VALID
1135 fprintf_unfiltered (gdb_stdlog
,
1136 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
1137 (long) current_gdbarch
->frame_chain_valid
1138 /*FRAME_CHAIN_VALID ()*/);
1140 #ifdef FRAME_SAVED_PC
1141 fprintf_unfiltered (gdb_stdlog
,
1142 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
1143 (long) current_gdbarch
->frame_saved_pc
1144 /*FRAME_SAVED_PC ()*/);
1146 #ifdef FRAME_ARGS_ADDRESS
1147 fprintf_unfiltered (gdb_stdlog
,
1148 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1149 (long) current_gdbarch
->frame_args_address
1150 /*FRAME_ARGS_ADDRESS ()*/);
1152 #ifdef FRAME_LOCALS_ADDRESS
1153 fprintf_unfiltered (gdb_stdlog
,
1154 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1155 (long) current_gdbarch
->frame_locals_address
1156 /*FRAME_LOCALS_ADDRESS ()*/);
1158 #ifdef SAVED_PC_AFTER_CALL
1159 fprintf_unfiltered (gdb_stdlog
,
1160 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1161 (long) current_gdbarch
->saved_pc_after_call
1162 /*SAVED_PC_AFTER_CALL ()*/);
1164 #ifdef FRAME_NUM_ARGS
1165 fprintf_unfiltered (gdb_stdlog
,
1166 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
1167 (long) current_gdbarch
->frame_num_args
1168 /*FRAME_NUM_ARGS ()*/);
1171 fprintf_unfiltered (gdb_stdlog
,
1172 "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
1173 (long) current_gdbarch
->stack_align
1174 /*STACK_ALIGN ()*/);
1176 #ifdef REG_STRUCT_HAS_ADDR
1177 fprintf_unfiltered (gdb_stdlog
,
1178 "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1179 (long) current_gdbarch
->reg_struct_has_addr
1180 /*REG_STRUCT_HAS_ADDR ()*/);
1182 #ifdef SAVE_DUMMY_FRAME_TOS
1183 fprintf_unfiltered (gdb_stdlog
,
1184 "gdbarch_update: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
1185 (long) current_gdbarch
->save_dummy_frame_tos
1186 /*SAVE_DUMMY_FRAME_TOS ()*/);
1188 fprintf_unfiltered (gdb_stdlog
,
1189 "gdbarch_update: GDB_MULTI_ARCH = %d\n",
1193 struct gdbarch_tdep
*
1194 gdbarch_tdep (struct gdbarch
*gdbarch
)
1196 if (gdbarch_debug
>= 2)
1197 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1198 return gdbarch
->tdep
;
1202 const struct bfd_arch_info
*
1203 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1205 if (gdbarch_debug
>= 2)
1206 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1207 return gdbarch
->bfd_arch_info
;
1211 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1213 if (gdbarch_debug
>= 2)
1214 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1215 return gdbarch
->byte_order
;
1219 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1221 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1222 if (gdbarch_debug
>= 2)
1223 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1224 return gdbarch
->bfd_vma_bit
;
1228 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1231 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1235 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1237 if (gdbarch
->ptr_bit
== 0)
1238 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1239 if (gdbarch_debug
>= 2)
1240 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1241 return gdbarch
->ptr_bit
;
1245 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1248 gdbarch
->ptr_bit
= ptr_bit
;
1252 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1254 if (gdbarch
->short_bit
== 0)
1255 internal_error ("gdbarch: gdbarch_short_bit invalid");
1256 if (gdbarch_debug
>= 2)
1257 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1258 return gdbarch
->short_bit
;
1262 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1265 gdbarch
->short_bit
= short_bit
;
1269 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1271 if (gdbarch
->int_bit
== 0)
1272 internal_error ("gdbarch: gdbarch_int_bit invalid");
1273 if (gdbarch_debug
>= 2)
1274 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1275 return gdbarch
->int_bit
;
1279 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1282 gdbarch
->int_bit
= int_bit
;
1286 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1288 if (gdbarch
->long_bit
== 0)
1289 internal_error ("gdbarch: gdbarch_long_bit invalid");
1290 if (gdbarch_debug
>= 2)
1291 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1292 return gdbarch
->long_bit
;
1296 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1299 gdbarch
->long_bit
= long_bit
;
1303 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1305 if (gdbarch
->long_long_bit
== 0)
1306 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1307 if (gdbarch_debug
>= 2)
1308 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1309 return gdbarch
->long_long_bit
;
1313 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1316 gdbarch
->long_long_bit
= long_long_bit
;
1320 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1322 if (gdbarch
->float_bit
== 0)
1323 internal_error ("gdbarch: gdbarch_float_bit invalid");
1324 if (gdbarch_debug
>= 2)
1325 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1326 return gdbarch
->float_bit
;
1330 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1333 gdbarch
->float_bit
= float_bit
;
1337 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1339 if (gdbarch
->double_bit
== 0)
1340 internal_error ("gdbarch: gdbarch_double_bit invalid");
1341 if (gdbarch_debug
>= 2)
1342 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1343 return gdbarch
->double_bit
;
1347 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1350 gdbarch
->double_bit
= double_bit
;
1354 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1356 if (gdbarch
->long_double_bit
== 0)
1357 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1358 if (gdbarch_debug
>= 2)
1359 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1360 return gdbarch
->long_double_bit
;
1364 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1365 int long_double_bit
)
1367 gdbarch
->long_double_bit
= long_double_bit
;
1371 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1373 /* Skip verify of ieee_float, invalid_p == 0 */
1374 if (gdbarch_debug
>= 2)
1375 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1376 return gdbarch
->ieee_float
;
1380 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1383 gdbarch
->ieee_float
= ieee_float
;
1387 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1389 if (gdbarch
->read_pc
== 0)
1390 internal_error ("gdbarch: gdbarch_read_pc invalid");
1391 if (gdbarch_debug
>= 2)
1392 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1393 return gdbarch
->read_pc (pid
);
1397 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1398 gdbarch_read_pc_ftype read_pc
)
1400 gdbarch
->read_pc
= read_pc
;
1404 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1406 if (gdbarch
->write_pc
== 0)
1407 internal_error ("gdbarch: gdbarch_write_pc invalid");
1408 if (gdbarch_debug
>= 2)
1409 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1410 gdbarch
->write_pc (val
, pid
);
1414 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1415 gdbarch_write_pc_ftype write_pc
)
1417 gdbarch
->write_pc
= write_pc
;
1421 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1423 if (gdbarch
->read_fp
== 0)
1424 internal_error ("gdbarch: gdbarch_read_fp invalid");
1425 if (gdbarch_debug
>= 2)
1426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1427 return gdbarch
->read_fp ();
1431 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1432 gdbarch_read_fp_ftype read_fp
)
1434 gdbarch
->read_fp
= read_fp
;
1438 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1440 if (gdbarch
->write_fp
== 0)
1441 internal_error ("gdbarch: gdbarch_write_fp invalid");
1442 if (gdbarch_debug
>= 2)
1443 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1444 gdbarch
->write_fp (val
);
1448 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1449 gdbarch_write_fp_ftype write_fp
)
1451 gdbarch
->write_fp
= write_fp
;
1455 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1457 if (gdbarch
->read_sp
== 0)
1458 internal_error ("gdbarch: gdbarch_read_sp invalid");
1459 if (gdbarch_debug
>= 2)
1460 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1461 return gdbarch
->read_sp ();
1465 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1466 gdbarch_read_sp_ftype read_sp
)
1468 gdbarch
->read_sp
= read_sp
;
1472 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1474 if (gdbarch
->write_sp
== 0)
1475 internal_error ("gdbarch: gdbarch_write_sp invalid");
1476 if (gdbarch_debug
>= 2)
1477 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1478 gdbarch
->write_sp (val
);
1482 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1483 gdbarch_write_sp_ftype write_sp
)
1485 gdbarch
->write_sp
= write_sp
;
1489 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1491 if (gdbarch
->num_regs
== -1)
1492 internal_error ("gdbarch: gdbarch_num_regs invalid");
1493 if (gdbarch_debug
>= 2)
1494 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1495 return gdbarch
->num_regs
;
1499 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1502 gdbarch
->num_regs
= num_regs
;
1506 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1508 if (gdbarch
->sp_regnum
== -1)
1509 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1510 if (gdbarch_debug
>= 2)
1511 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1512 return gdbarch
->sp_regnum
;
1516 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1519 gdbarch
->sp_regnum
= sp_regnum
;
1523 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1525 if (gdbarch
->fp_regnum
== -1)
1526 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1527 if (gdbarch_debug
>= 2)
1528 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1529 return gdbarch
->fp_regnum
;
1533 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1536 gdbarch
->fp_regnum
= fp_regnum
;
1540 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1542 if (gdbarch
->pc_regnum
== -1)
1543 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1544 if (gdbarch_debug
>= 2)
1545 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1546 return gdbarch
->pc_regnum
;
1550 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1553 gdbarch
->pc_regnum
= pc_regnum
;
1557 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1559 /* Skip verify of fp0_regnum, invalid_p == 0 */
1560 if (gdbarch_debug
>= 2)
1561 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1562 return gdbarch
->fp0_regnum
;
1566 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1569 gdbarch
->fp0_regnum
= fp0_regnum
;
1573 gdbarch_npc_regnum (struct gdbarch
*gdbarch
)
1575 /* Skip verify of npc_regnum, invalid_p == 0 */
1576 if (gdbarch_debug
>= 2)
1577 fprintf_unfiltered (gdb_stdlog
, "gdbarch_npc_regnum called\n");
1578 return gdbarch
->npc_regnum
;
1582 set_gdbarch_npc_regnum (struct gdbarch
*gdbarch
,
1585 gdbarch
->npc_regnum
= npc_regnum
;
1589 gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
)
1591 /* Skip verify of nnpc_regnum, invalid_p == 0 */
1592 if (gdbarch_debug
>= 2)
1593 fprintf_unfiltered (gdb_stdlog
, "gdbarch_nnpc_regnum called\n");
1594 return gdbarch
->nnpc_regnum
;
1598 set_gdbarch_nnpc_regnum (struct gdbarch
*gdbarch
,
1601 gdbarch
->nnpc_regnum
= nnpc_regnum
;
1605 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1607 if (gdbarch
->register_name
== 0)
1608 internal_error ("gdbarch: gdbarch_register_name invalid");
1609 if (gdbarch_debug
>= 2)
1610 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1611 return gdbarch
->register_name (regnr
);
1615 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1616 gdbarch_register_name_ftype register_name
)
1618 gdbarch
->register_name
= register_name
;
1622 gdbarch_register_size (struct gdbarch
*gdbarch
)
1624 if (gdbarch
->register_size
== -1)
1625 internal_error ("gdbarch: gdbarch_register_size invalid");
1626 if (gdbarch_debug
>= 2)
1627 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1628 return gdbarch
->register_size
;
1632 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1635 gdbarch
->register_size
= register_size
;
1639 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1641 if (gdbarch
->register_bytes
== -1)
1642 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1643 if (gdbarch_debug
>= 2)
1644 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1645 return gdbarch
->register_bytes
;
1649 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1652 gdbarch
->register_bytes
= register_bytes
;
1656 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1658 if (gdbarch
->register_byte
== 0)
1659 internal_error ("gdbarch: gdbarch_register_byte invalid");
1660 if (gdbarch_debug
>= 2)
1661 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1662 return gdbarch
->register_byte (reg_nr
);
1666 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1667 gdbarch_register_byte_ftype register_byte
)
1669 gdbarch
->register_byte
= register_byte
;
1673 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1675 if (gdbarch
->register_raw_size
== 0)
1676 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1677 if (gdbarch_debug
>= 2)
1678 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1679 return gdbarch
->register_raw_size (reg_nr
);
1683 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1684 gdbarch_register_raw_size_ftype register_raw_size
)
1686 gdbarch
->register_raw_size
= register_raw_size
;
1690 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1692 if (gdbarch
->max_register_raw_size
== -1)
1693 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1694 if (gdbarch_debug
>= 2)
1695 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1696 return gdbarch
->max_register_raw_size
;
1700 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1701 int max_register_raw_size
)
1703 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1707 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1709 if (gdbarch
->register_virtual_size
== 0)
1710 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1711 if (gdbarch_debug
>= 2)
1712 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1713 return gdbarch
->register_virtual_size (reg_nr
);
1717 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1718 gdbarch_register_virtual_size_ftype register_virtual_size
)
1720 gdbarch
->register_virtual_size
= register_virtual_size
;
1724 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1726 if (gdbarch
->max_register_virtual_size
== -1)
1727 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1728 if (gdbarch_debug
>= 2)
1729 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1730 return gdbarch
->max_register_virtual_size
;
1734 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1735 int max_register_virtual_size
)
1737 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1741 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1743 if (gdbarch
->register_virtual_type
== 0)
1744 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1745 if (gdbarch_debug
>= 2)
1746 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1747 return gdbarch
->register_virtual_type (reg_nr
);
1751 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1752 gdbarch_register_virtual_type_ftype register_virtual_type
)
1754 gdbarch
->register_virtual_type
= register_virtual_type
;
1758 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1760 if (gdbarch
->use_generic_dummy_frames
== -1)
1761 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1762 if (gdbarch_debug
>= 2)
1763 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1764 return gdbarch
->use_generic_dummy_frames
;
1768 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1769 int use_generic_dummy_frames
)
1771 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1775 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1777 if (gdbarch
->call_dummy_location
== 0)
1778 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1779 if (gdbarch_debug
>= 2)
1780 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1781 return gdbarch
->call_dummy_location
;
1785 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1786 int call_dummy_location
)
1788 gdbarch
->call_dummy_location
= call_dummy_location
;
1792 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1794 if (gdbarch
->call_dummy_address
== 0)
1795 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1796 if (gdbarch_debug
>= 2)
1797 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1798 return gdbarch
->call_dummy_address ();
1802 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1803 gdbarch_call_dummy_address_ftype call_dummy_address
)
1805 gdbarch
->call_dummy_address
= call_dummy_address
;
1809 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1811 if (gdbarch
->call_dummy_start_offset
== -1)
1812 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1813 if (gdbarch_debug
>= 2)
1814 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1815 return gdbarch
->call_dummy_start_offset
;
1819 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1820 CORE_ADDR call_dummy_start_offset
)
1822 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1826 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1828 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1829 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1830 if (gdbarch_debug
>= 2)
1831 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1832 return gdbarch
->call_dummy_breakpoint_offset
;
1836 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1837 CORE_ADDR call_dummy_breakpoint_offset
)
1839 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1843 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1845 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1846 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1847 if (gdbarch_debug
>= 2)
1848 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1849 return gdbarch
->call_dummy_breakpoint_offset_p
;
1853 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1854 int call_dummy_breakpoint_offset_p
)
1856 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1860 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1862 if (gdbarch
->call_dummy_length
== -1)
1863 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1864 if (gdbarch_debug
>= 2)
1865 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1866 return gdbarch
->call_dummy_length
;
1870 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1871 int call_dummy_length
)
1873 gdbarch
->call_dummy_length
= call_dummy_length
;
1877 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1879 if (gdbarch
->pc_in_call_dummy
== 0)
1880 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1881 if (gdbarch_debug
>= 2)
1882 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1883 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1887 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1888 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1890 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1894 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1896 if (gdbarch
->call_dummy_p
== -1)
1897 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1898 if (gdbarch_debug
>= 2)
1899 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1900 return gdbarch
->call_dummy_p
;
1904 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1907 gdbarch
->call_dummy_p
= call_dummy_p
;
1911 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1913 /* Skip verify of call_dummy_words, invalid_p == 0 */
1914 if (gdbarch_debug
>= 2)
1915 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1916 return gdbarch
->call_dummy_words
;
1920 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1921 LONGEST
* call_dummy_words
)
1923 gdbarch
->call_dummy_words
= call_dummy_words
;
1927 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1929 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1930 if (gdbarch_debug
>= 2)
1931 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1932 return gdbarch
->sizeof_call_dummy_words
;
1936 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1937 int sizeof_call_dummy_words
)
1939 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1943 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1945 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1946 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1947 if (gdbarch_debug
>= 2)
1948 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1949 return gdbarch
->call_dummy_stack_adjust_p
;
1953 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1954 int call_dummy_stack_adjust_p
)
1956 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1960 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1962 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1963 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1964 if (gdbarch_debug
>= 2)
1965 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1966 return gdbarch
->call_dummy_stack_adjust
;
1970 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1971 int call_dummy_stack_adjust
)
1973 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1977 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
)
1979 if (gdbarch
->fix_call_dummy
== 0)
1980 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1981 if (gdbarch_debug
>= 2)
1982 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1983 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1987 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1988 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1990 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1994 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1996 if (gdbarch_debug
>= 2)
1997 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1998 return gdbarch
->believe_pcc_promotion
;
2002 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2003 int believe_pcc_promotion
)
2005 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2009 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
2011 if (gdbarch_debug
>= 2)
2012 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
2013 return gdbarch
->believe_pcc_promotion_type
;
2017 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
2018 int believe_pcc_promotion_type
)
2020 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
2024 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
2026 if (gdbarch
->coerce_float_to_double
== 0)
2027 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
2028 if (gdbarch_debug
>= 2)
2029 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
2030 return gdbarch
->coerce_float_to_double (formal
, actual
);
2034 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
2035 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
2037 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
2041 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
)
2043 if (gdbarch
->get_saved_register
== 0)
2044 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
2045 if (gdbarch_debug
>= 2)
2046 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
2047 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
2051 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
2052 gdbarch_get_saved_register_ftype get_saved_register
)
2054 gdbarch
->get_saved_register
= get_saved_register
;
2058 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
2060 if (gdbarch
->register_convertible
== 0)
2061 internal_error ("gdbarch: gdbarch_register_convertible invalid");
2062 if (gdbarch_debug
>= 2)
2063 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
2064 return gdbarch
->register_convertible (nr
);
2068 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
2069 gdbarch_register_convertible_ftype register_convertible
)
2071 gdbarch
->register_convertible
= register_convertible
;
2075 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
2077 if (gdbarch
->register_convert_to_virtual
== 0)
2078 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
2079 if (gdbarch_debug
>= 2)
2080 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
2081 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
2085 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
2086 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
2088 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
2092 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
2094 if (gdbarch
->register_convert_to_raw
== 0)
2095 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
2096 if (gdbarch_debug
>= 2)
2097 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
2098 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
2102 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
2103 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
2105 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
2109 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
2111 if (gdbarch
->pointer_to_address
== 0)
2112 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
2113 if (gdbarch_debug
>= 2)
2114 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2115 return gdbarch
->pointer_to_address (type
, buf
);
2119 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2120 gdbarch_pointer_to_address_ftype pointer_to_address
)
2122 gdbarch
->pointer_to_address
= pointer_to_address
;
2126 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
2128 if (gdbarch
->address_to_pointer
== 0)
2129 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
2130 if (gdbarch_debug
>= 2)
2131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2132 gdbarch
->address_to_pointer (type
, buf
, addr
);
2136 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2137 gdbarch_address_to_pointer_ftype address_to_pointer
)
2139 gdbarch
->address_to_pointer
= address_to_pointer
;
2143 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
2145 if (gdbarch
->return_value_on_stack
== 0)
2146 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
2147 if (gdbarch_debug
>= 2)
2148 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
2149 return gdbarch
->return_value_on_stack (type
);
2153 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
2154 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
2156 gdbarch
->return_value_on_stack
= return_value_on_stack
;
2160 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
2162 if (gdbarch
->extract_return_value
== 0)
2163 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
2164 if (gdbarch_debug
>= 2)
2165 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2166 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
2170 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2171 gdbarch_extract_return_value_ftype extract_return_value
)
2173 gdbarch
->extract_return_value
= extract_return_value
;
2177 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2179 if (gdbarch
->push_arguments
== 0)
2180 internal_error ("gdbarch: gdbarch_push_arguments invalid");
2181 if (gdbarch_debug
>= 2)
2182 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
2183 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
2187 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
2188 gdbarch_push_arguments_ftype push_arguments
)
2190 gdbarch
->push_arguments
= push_arguments
;
2194 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
2196 if (gdbarch
->push_dummy_frame
== 0)
2197 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
2198 if (gdbarch_debug
>= 2)
2199 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
2200 gdbarch
->push_dummy_frame ();
2204 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
2205 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
2207 gdbarch
->push_dummy_frame
= push_dummy_frame
;
2211 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
2213 if (gdbarch
->push_return_address
== 0)
2214 internal_error ("gdbarch: gdbarch_push_return_address invalid");
2215 if (gdbarch_debug
>= 2)
2216 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
2217 return gdbarch
->push_return_address (pc
, sp
);
2221 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
2222 gdbarch_push_return_address_ftype push_return_address
)
2224 gdbarch
->push_return_address
= push_return_address
;
2228 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
2230 if (gdbarch
->pop_frame
== 0)
2231 internal_error ("gdbarch: gdbarch_pop_frame invalid");
2232 if (gdbarch_debug
>= 2)
2233 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
2234 gdbarch
->pop_frame ();
2238 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
2239 gdbarch_pop_frame_ftype pop_frame
)
2241 gdbarch
->pop_frame
= pop_frame
;
2245 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2247 if (gdbarch
->d10v_make_daddr
== 0)
2248 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
2249 if (gdbarch_debug
>= 2)
2250 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
2251 return gdbarch
->d10v_make_daddr (x
);
2255 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
2256 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
2258 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
2262 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2264 if (gdbarch
->d10v_make_iaddr
== 0)
2265 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2266 if (gdbarch_debug
>= 2)
2267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2268 return gdbarch
->d10v_make_iaddr (x
);
2272 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2273 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2275 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2279 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2281 if (gdbarch
->d10v_daddr_p
== 0)
2282 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2283 if (gdbarch_debug
>= 2)
2284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2285 return gdbarch
->d10v_daddr_p (x
);
2289 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2290 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2292 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2296 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2298 if (gdbarch
->d10v_iaddr_p
== 0)
2299 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2300 if (gdbarch_debug
>= 2)
2301 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2302 return gdbarch
->d10v_iaddr_p (x
);
2306 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2307 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2309 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2313 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2315 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2316 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2317 if (gdbarch_debug
>= 2)
2318 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2319 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2323 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2324 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2326 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2330 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2332 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2333 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2334 if (gdbarch_debug
>= 2)
2335 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2336 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2340 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2341 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2343 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2347 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2349 if (gdbarch
->store_struct_return
== 0)
2350 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2351 if (gdbarch_debug
>= 2)
2352 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2353 gdbarch
->store_struct_return (addr
, sp
);
2357 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2358 gdbarch_store_struct_return_ftype store_struct_return
)
2360 gdbarch
->store_struct_return
= store_struct_return
;
2364 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2366 if (gdbarch
->store_return_value
== 0)
2367 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2368 if (gdbarch_debug
>= 2)
2369 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2370 gdbarch
->store_return_value (type
, valbuf
);
2374 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2375 gdbarch_store_return_value_ftype store_return_value
)
2377 gdbarch
->store_return_value
= store_return_value
;
2381 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2383 if (gdbarch
->extract_struct_value_address
== 0)
2384 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2385 if (gdbarch_debug
>= 2)
2386 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2387 return gdbarch
->extract_struct_value_address (regbuf
);
2391 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2392 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2394 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2398 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2400 if (gdbarch
->use_struct_convention
== 0)
2401 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2402 if (gdbarch_debug
>= 2)
2403 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2404 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2408 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2409 gdbarch_use_struct_convention_ftype use_struct_convention
)
2411 gdbarch
->use_struct_convention
= use_struct_convention
;
2415 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2417 if (gdbarch
->frame_init_saved_regs
== 0)
2418 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2419 if (gdbarch_debug
>= 2)
2420 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2421 gdbarch
->frame_init_saved_regs (frame
);
2425 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2426 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2428 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2432 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2434 if (gdbarch
->init_extra_frame_info
== 0)
2435 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2436 if (gdbarch_debug
>= 2)
2437 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2438 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2442 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2443 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2445 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2449 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2451 if (gdbarch
->skip_prologue
== 0)
2452 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2453 if (gdbarch_debug
>= 2)
2454 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2455 return gdbarch
->skip_prologue (ip
);
2459 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2460 gdbarch_skip_prologue_ftype skip_prologue
)
2462 gdbarch
->skip_prologue
= skip_prologue
;
2466 gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2468 if (gdbarch
->prologue_frameless_p
== 0)
2469 internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
2470 if (gdbarch_debug
>= 2)
2471 fprintf_unfiltered (gdb_stdlog
, "gdbarch_prologue_frameless_p called\n");
2472 return gdbarch
->prologue_frameless_p (ip
);
2476 set_gdbarch_prologue_frameless_p (struct gdbarch
*gdbarch
,
2477 gdbarch_prologue_frameless_p_ftype prologue_frameless_p
)
2479 gdbarch
->prologue_frameless_p
= prologue_frameless_p
;
2483 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2485 if (gdbarch
->inner_than
== 0)
2486 internal_error ("gdbarch: gdbarch_inner_than invalid");
2487 if (gdbarch_debug
>= 2)
2488 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2489 return gdbarch
->inner_than (lhs
, rhs
);
2493 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2494 gdbarch_inner_than_ftype inner_than
)
2496 gdbarch
->inner_than
= inner_than
;
2500 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2502 if (gdbarch
->breakpoint_from_pc
== 0)
2503 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2504 if (gdbarch_debug
>= 2)
2505 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2506 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2510 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2511 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2513 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2517 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2519 if (gdbarch
->memory_insert_breakpoint
== 0)
2520 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2521 if (gdbarch_debug
>= 2)
2522 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2523 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2527 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2528 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2530 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2534 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2536 if (gdbarch
->memory_remove_breakpoint
== 0)
2537 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2538 if (gdbarch_debug
>= 2)
2539 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2540 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2544 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2545 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2547 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2551 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2553 if (gdbarch
->decr_pc_after_break
== -1)
2554 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2555 if (gdbarch_debug
>= 2)
2556 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2557 return gdbarch
->decr_pc_after_break
;
2561 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2562 CORE_ADDR decr_pc_after_break
)
2564 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2568 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2570 if (gdbarch
->function_start_offset
== -1)
2571 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2572 if (gdbarch_debug
>= 2)
2573 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2574 return gdbarch
->function_start_offset
;
2578 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2579 CORE_ADDR function_start_offset
)
2581 gdbarch
->function_start_offset
= function_start_offset
;
2585 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2587 if (gdbarch
->remote_translate_xfer_address
== 0)
2588 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2589 if (gdbarch_debug
>= 2)
2590 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2591 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2595 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2596 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2598 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2602 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2604 if (gdbarch
->frame_args_skip
== -1)
2605 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2606 if (gdbarch_debug
>= 2)
2607 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2608 return gdbarch
->frame_args_skip
;
2612 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2613 CORE_ADDR frame_args_skip
)
2615 gdbarch
->frame_args_skip
= frame_args_skip
;
2619 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2621 if (gdbarch
->frameless_function_invocation
== 0)
2622 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2623 if (gdbarch_debug
>= 2)
2624 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2625 return gdbarch
->frameless_function_invocation (fi
);
2629 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2630 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2632 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2636 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2638 if (gdbarch
->frame_chain
== 0)
2639 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2640 if (gdbarch_debug
>= 2)
2641 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2642 return gdbarch
->frame_chain (frame
);
2646 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2647 gdbarch_frame_chain_ftype frame_chain
)
2649 gdbarch
->frame_chain
= frame_chain
;
2653 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2655 if (gdbarch
->frame_chain_valid
== 0)
2656 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2657 if (gdbarch_debug
>= 2)
2658 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2659 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2663 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2664 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2666 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2670 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2672 if (gdbarch
->frame_saved_pc
== 0)
2673 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2674 if (gdbarch_debug
>= 2)
2675 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2676 return gdbarch
->frame_saved_pc (fi
);
2680 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2681 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2683 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2687 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2689 if (gdbarch
->frame_args_address
== 0)
2690 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2691 if (gdbarch_debug
>= 2)
2692 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2693 return gdbarch
->frame_args_address (fi
);
2697 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2698 gdbarch_frame_args_address_ftype frame_args_address
)
2700 gdbarch
->frame_args_address
= frame_args_address
;
2704 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2706 if (gdbarch
->frame_locals_address
== 0)
2707 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2708 if (gdbarch_debug
>= 2)
2709 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2710 return gdbarch
->frame_locals_address (fi
);
2714 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2715 gdbarch_frame_locals_address_ftype frame_locals_address
)
2717 gdbarch
->frame_locals_address
= frame_locals_address
;
2721 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2723 if (gdbarch
->saved_pc_after_call
== 0)
2724 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2725 if (gdbarch_debug
>= 2)
2726 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2727 return gdbarch
->saved_pc_after_call (frame
);
2731 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2732 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2734 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2738 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2740 if (gdbarch
->frame_num_args
== 0)
2741 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2742 if (gdbarch_debug
>= 2)
2743 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2744 return gdbarch
->frame_num_args (frame
);
2748 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2749 gdbarch_frame_num_args_ftype frame_num_args
)
2751 gdbarch
->frame_num_args
= frame_num_args
;
2755 gdbarch_stack_align_p (struct gdbarch
*gdbarch
)
2757 return gdbarch
->stack_align
!= 0;
2761 gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2763 if (gdbarch
->stack_align
== 0)
2764 internal_error ("gdbarch: gdbarch_stack_align invalid");
2765 if (gdbarch_debug
>= 2)
2766 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stack_align called\n");
2767 return gdbarch
->stack_align (sp
);
2771 set_gdbarch_stack_align (struct gdbarch
*gdbarch
,
2772 gdbarch_stack_align_ftype stack_align
)
2774 gdbarch
->stack_align
= stack_align
;
2778 gdbarch_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
2780 return gdbarch
->reg_struct_has_addr
!= 0;
2784 gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
2786 if (gdbarch
->reg_struct_has_addr
== 0)
2787 internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid");
2788 if (gdbarch_debug
>= 2)
2789 fprintf_unfiltered (gdb_stdlog
, "gdbarch_reg_struct_has_addr called\n");
2790 return gdbarch
->reg_struct_has_addr (gcc_p
, type
);
2794 set_gdbarch_reg_struct_has_addr (struct gdbarch
*gdbarch
,
2795 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr
)
2797 gdbarch
->reg_struct_has_addr
= reg_struct_has_addr
;
2801 gdbarch_save_dummy_frame_tos_p (struct gdbarch
*gdbarch
)
2803 return gdbarch
->save_dummy_frame_tos
!= 0;
2807 gdbarch_save_dummy_frame_tos (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2809 if (gdbarch
->save_dummy_frame_tos
== 0)
2810 internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid");
2811 if (gdbarch_debug
>= 2)
2812 fprintf_unfiltered (gdb_stdlog
, "gdbarch_save_dummy_frame_tos called\n");
2813 gdbarch
->save_dummy_frame_tos (sp
);
2817 set_gdbarch_save_dummy_frame_tos (struct gdbarch
*gdbarch
,
2818 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos
)
2820 gdbarch
->save_dummy_frame_tos
= save_dummy_frame_tos
;
2824 /* Keep a registrary of per-architecture data-pointers required by GDB
2832 struct gdbarch_data_registration
2834 gdbarch_data_ftype
*init
;
2835 struct gdbarch_data
*data
;
2836 struct gdbarch_data_registration
*next
;
2839 struct gdbarch_data_registrary
2842 struct gdbarch_data_registration
*registrations
;
2845 struct gdbarch_data_registrary gdbarch_data_registrary
=
2850 struct gdbarch_data
*
2851 register_gdbarch_data (gdbarch_data_ftype
*init
)
2853 struct gdbarch_data_registration
**curr
;
2854 for (curr
= &gdbarch_data_registrary
.registrations
;
2856 curr
= &(*curr
)->next
);
2857 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2858 (*curr
)->next
= NULL
;
2859 (*curr
)->init
= init
;
2860 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2861 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2862 return (*curr
)->data
;
2866 /* Walk through all the registered users initializing each in turn. */
2869 init_gdbarch_data (struct gdbarch
*gdbarch
)
2871 struct gdbarch_data_registration
*rego
;
2872 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2873 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2874 for (rego
= gdbarch_data_registrary
.registrations
;
2878 if (rego
->data
->index
< gdbarch
->nr_data
)
2879 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2884 /* Return the current value of the specified per-architecture
2889 struct gdbarch_data
*data
;
2891 if (data
->index
>= current_gdbarch
->nr_data
)
2892 internal_error ("gdbarch_data: request for non-existant data.");
2893 return current_gdbarch
->data
[data
->index
];
2898 /* Keep a registrary of swaped data required by GDB modules. */
2903 struct gdbarch_swap_registration
*source
;
2904 struct gdbarch_swap
*next
;
2907 struct gdbarch_swap_registration
2910 unsigned long sizeof_data
;
2911 gdbarch_swap_ftype
*init
;
2912 struct gdbarch_swap_registration
*next
;
2915 struct gdbarch_swap_registrary
2918 struct gdbarch_swap_registration
*registrations
;
2921 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2927 register_gdbarch_swap (void *data
,
2928 unsigned long sizeof_data
,
2929 gdbarch_swap_ftype
*init
)
2931 struct gdbarch_swap_registration
**rego
;
2932 for (rego
= &gdbarch_swap_registrary
.registrations
;
2934 rego
= &(*rego
)->next
);
2935 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2936 (*rego
)->next
= NULL
;
2937 (*rego
)->init
= init
;
2938 (*rego
)->data
= data
;
2939 (*rego
)->sizeof_data
= sizeof_data
;
2944 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2946 struct gdbarch_swap_registration
*rego
;
2947 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2948 for (rego
= gdbarch_swap_registrary
.registrations
;
2952 if (rego
->data
!= NULL
)
2954 (*curr
) = XMALLOC (struct gdbarch_swap
);
2955 (*curr
)->source
= rego
;
2956 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2957 (*curr
)->next
= NULL
;
2958 memset (rego
->data
, 0, rego
->sizeof_data
);
2959 curr
= &(*curr
)->next
;
2961 if (rego
->init
!= NULL
)
2967 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2969 struct gdbarch_swap
*curr
;
2970 for (curr
= gdbarch
->swap
;
2973 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2977 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2979 struct gdbarch_swap
*curr
;
2980 for (curr
= gdbarch
->swap
;
2983 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2987 /* Keep a registrary of the architectures known by GDB. */
2989 struct gdbarch_init_registration
2991 enum bfd_architecture bfd_architecture
;
2992 gdbarch_init_ftype
*init
;
2993 struct gdbarch_list
*arches
;
2994 struct gdbarch_init_registration
*next
;
2997 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
3000 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3001 gdbarch_init_ftype
*init
)
3003 struct gdbarch_init_registration
**curr
;
3004 const struct bfd_arch_info
*bfd_arch_info
;
3005 /* Check that BFD reconizes this architecture */
3006 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3007 if (bfd_arch_info
== NULL
)
3009 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
3011 /* Check that we haven't seen this architecture before */
3012 for (curr
= &gdbarch_init_registrary
;
3014 curr
= &(*curr
)->next
)
3016 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3017 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
3018 bfd_arch_info
->printable_name
);
3022 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3023 bfd_arch_info
->printable_name
,
3026 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
3027 (*curr
)->bfd_architecture
= bfd_architecture
;
3028 (*curr
)->init
= init
;
3029 (*curr
)->arches
= NULL
;
3030 (*curr
)->next
= NULL
;
3035 /* Look for an architecture using gdbarch_info. Base search on only
3036 BFD_ARCH_INFO and BYTE_ORDER. */
3038 struct gdbarch_list
*
3039 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3040 const struct gdbarch_info
*info
)
3042 for (; arches
!= NULL
; arches
= arches
->next
)
3044 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3046 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3054 /* Update the current architecture. Return ZERO if the update request
3058 gdbarch_update (struct gdbarch_info info
)
3060 struct gdbarch
*new_gdbarch
;
3061 struct gdbarch_list
**list
;
3062 struct gdbarch_init_registration
*rego
;
3064 /* Fill in any missing bits. Most important is the bfd_architecture
3065 which is used to select the target architecture. */
3066 if (info
.bfd_architecture
== bfd_arch_unknown
)
3068 if (info
.bfd_arch_info
!= NULL
)
3069 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
3070 else if (info
.abfd
!= NULL
)
3071 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
3072 /* FIXME - should query BFD for its default architecture. */
3074 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
3076 if (info
.bfd_arch_info
== NULL
)
3078 if (target_architecture_auto
&& info
.abfd
!= NULL
)
3079 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
3081 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
3083 if (info
.byte_order
== 0)
3085 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
3086 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
3087 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
3090 info
.byte_order
= current_gdbarch
->byte_order
;
3091 /* FIXME - should query BFD for its default byte-order. */
3093 /* A default for abfd? */
3095 /* Find the target that knows about this architecture. */
3096 for (rego
= gdbarch_init_registrary
;
3097 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
3102 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
3108 fprintf_unfiltered (gdb_stdlog
,
3109 "gdbarch_update: info.bfd_architecture %d (%s)\n",
3110 info
.bfd_architecture
,
3111 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
3112 fprintf_unfiltered (gdb_stdlog
,
3113 "gdbarch_update: info.bfd_arch_info %s\n",
3114 (info
.bfd_arch_info
!= NULL
3115 ? info
.bfd_arch_info
->printable_name
3117 fprintf_unfiltered (gdb_stdlog
,
3118 "gdbarch_update: info.byte_order %d (%s)\n",
3120 (info
.byte_order
== BIG_ENDIAN
? "big"
3121 : info
.byte_order
== LITTLE_ENDIAN
? "little"
3123 fprintf_unfiltered (gdb_stdlog
,
3124 "gdbarch_update: info.abfd 0x%lx\n",
3126 fprintf_unfiltered (gdb_stdlog
,
3127 "gdbarch_update: info.tdep_info 0x%lx\n",
3128 (long) info
.tdep_info
);
3131 /* Ask the target for a replacement architecture. */
3132 new_gdbarch
= rego
->init (info
, rego
->arches
);
3134 /* Did the target like it? No. Reject the change. */
3135 if (new_gdbarch
== NULL
)
3138 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
3142 /* Did the architecture change? No. Do nothing. */
3143 if (current_gdbarch
== new_gdbarch
)
3146 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
3148 new_gdbarch
->bfd_arch_info
->printable_name
);
3152 /* Swap all data belonging to the old target out */
3153 swapout_gdbarch_swap (current_gdbarch
);
3155 /* Is this a pre-existing architecture? Yes. Swap it in. */
3156 for (list
= ®o
->arches
;
3158 list
= &(*list
)->next
)
3160 if ((*list
)->gdbarch
== new_gdbarch
)
3163 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
3165 new_gdbarch
->bfd_arch_info
->printable_name
);
3166 current_gdbarch
= new_gdbarch
;
3167 swapin_gdbarch_swap (new_gdbarch
);
3172 /* Append this new architecture to this targets list. */
3173 (*list
) = XMALLOC (struct gdbarch_list
);
3174 (*list
)->next
= NULL
;
3175 (*list
)->gdbarch
= new_gdbarch
;
3177 /* Switch to this new architecture. Dump it out. */
3178 current_gdbarch
= new_gdbarch
;
3181 fprintf_unfiltered (gdb_stdlog
,
3182 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
3184 new_gdbarch
->bfd_arch_info
->printable_name
);
3188 /* Check that the newly installed architecture is valid. */
3189 verify_gdbarch (new_gdbarch
);
3191 /* Initialize the per-architecture memory (swap) areas.
3192 CURRENT_GDBARCH must be update before these modules are
3194 init_gdbarch_swap (new_gdbarch
);
3196 /* Initialize the per-architecture data-pointer of all parties that
3197 registered an interest in this architecture. CURRENT_GDBARCH
3198 must be updated before these modules are called. */
3199 init_gdbarch_data (new_gdbarch
);
3206 /* Functions to manipulate the endianness of the target. */
3208 #ifdef TARGET_BYTE_ORDER_SELECTABLE
3209 /* compat - Catch old targets that expect a selectable byte-order to
3210 default to BIG_ENDIAN */
3211 #ifndef TARGET_BYTE_ORDER_DEFAULT
3212 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
3215 #if !TARGET_BYTE_ORDER_SELECTABLE_P
3216 #ifndef TARGET_BYTE_ORDER_DEFAULT
3217 /* compat - Catch old non byte-order selectable targets that do not
3218 define TARGET_BYTE_ORDER_DEFAULT and instead expect
3219 TARGET_BYTE_ORDER to be used as the default. For targets that
3220 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
3221 below will get a strange compiler warning. */
3222 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
3225 #ifndef TARGET_BYTE_ORDER_DEFAULT
3226 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
3228 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
3229 int target_byte_order_auto
= 1;
3231 /* Chain containing the \"set endian\" commands. */
3232 static struct cmd_list_element
*endianlist
= NULL
;
3234 /* Called by ``show endian''. */
3236 show_endian (char *args
, int from_tty
)
3239 (TARGET_BYTE_ORDER_AUTO
3240 ? "The target endianness is set automatically (currently %s endian)\n"
3241 : "The target is assumed to be %s endian\n");
3242 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
3245 /* Called if the user enters ``set endian'' without an argument. */
3247 set_endian (char *args
, int from_tty
)
3249 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
3250 show_endian (args
, from_tty
);
3253 /* Called by ``set endian big''. */
3255 set_endian_big (char *args
, int from_tty
)
3257 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3259 target_byte_order
= BIG_ENDIAN
;
3260 target_byte_order_auto
= 0;
3263 struct gdbarch_info info
;
3264 memset (&info
, 0, sizeof info
);
3265 info
.byte_order
= BIG_ENDIAN
;
3266 gdbarch_update (info
);
3271 printf_unfiltered ("Byte order is not selectable.");
3272 show_endian (args
, from_tty
);
3276 /* Called by ``set endian little''. */
3278 set_endian_little (char *args
, int from_tty
)
3280 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3282 target_byte_order
= LITTLE_ENDIAN
;
3283 target_byte_order_auto
= 0;
3286 struct gdbarch_info info
;
3287 memset (&info
, 0, sizeof info
);
3288 info
.byte_order
= LITTLE_ENDIAN
;
3289 gdbarch_update (info
);
3294 printf_unfiltered ("Byte order is not selectable.");
3295 show_endian (args
, from_tty
);
3299 /* Called by ``set endian auto''. */
3301 set_endian_auto (char *args
, int from_tty
)
3303 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3305 target_byte_order_auto
= 1;
3309 printf_unfiltered ("Byte order is not selectable.");
3310 show_endian (args
, from_tty
);
3314 /* Set the endianness from a BFD. */
3316 set_endian_from_file (bfd
*abfd
)
3318 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3322 if (bfd_big_endian (abfd
))
3325 want
= LITTLE_ENDIAN
;
3326 if (TARGET_BYTE_ORDER_AUTO
)
3327 target_byte_order
= want
;
3328 else if (TARGET_BYTE_ORDER
!= want
)
3329 warning ("%s endian file does not match %s endian target.",
3330 want
== BIG_ENDIAN
? "big" : "little",
3331 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3335 if (bfd_big_endian (abfd
)
3336 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
3337 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
3338 warning ("%s endian file does not match %s endian target.",
3339 bfd_big_endian (abfd
) ? "big" : "little",
3340 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3346 /* Functions to manipulate the architecture of the target */
3348 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3350 int target_architecture_auto
= 1;
3351 extern const struct bfd_arch_info bfd_default_arch_struct
;
3352 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
3353 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
3355 static void show_endian (char *, int);
3356 static void set_endian (char *, int);
3357 static void set_endian_big (char *, int);
3358 static void set_endian_little (char *, int);
3359 static void set_endian_auto (char *, int);
3360 static void set_endian_from_file (bfd
*);
3361 static int arch_ok (const struct bfd_arch_info
*arch
);
3362 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3363 static void show_architecture (char *, int);
3364 static void set_architecture (char *, int);
3365 static void info_architecture (char *, int);
3366 static void set_architecture_from_file (bfd
*);
3368 /* Do the real work of changing the current architecture */
3371 arch_ok (const struct bfd_arch_info
*arch
)
3373 /* Should be performing the more basic check that the binary is
3374 compatible with GDB. */
3375 /* Check with the target that the architecture is valid. */
3376 return (target_architecture_hook
== NULL
3377 || target_architecture_hook (arch
));
3381 set_arch (const struct bfd_arch_info
*arch
,
3387 if (!arch_ok (arch
))
3388 warning ("Target may not support %s architecture",
3389 arch
->printable_name
);
3390 target_architecture
= arch
;
3392 case set_arch_manual
:
3393 if (!arch_ok (arch
))
3395 printf_unfiltered ("Target does not support `%s' architecture.\n",
3396 arch
->printable_name
);
3400 target_architecture_auto
= 0;
3401 target_architecture
= arch
;
3409 /* Called if the user enters ``show architecture'' without an argument. */
3411 show_architecture (char *args
, int from_tty
)
3414 arch
= TARGET_ARCHITECTURE
->printable_name
;
3415 if (target_architecture_auto
)
3416 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3418 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3421 /* Called if the user enters ``set architecture'' with or without an
3424 set_architecture (char *args
, int from_tty
)
3428 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3430 else if (strcmp (args
, "auto") == 0)
3432 target_architecture_auto
= 1;
3434 else if (GDB_MULTI_ARCH
)
3436 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3438 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3441 struct gdbarch_info info
;
3442 memset (&info
, 0, sizeof info
);
3443 info
.bfd_arch_info
= arch
;
3444 if (gdbarch_update (info
))
3445 target_architecture_auto
= 0;
3447 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3452 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3454 set_arch (arch
, set_arch_manual
);
3456 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3460 /* Called if the user enters ``info architecture'' without an argument. */
3462 info_architecture (char *args
, int from_tty
)
3464 enum bfd_architecture a
;
3467 if (gdbarch_init_registrary
!= NULL
)
3469 struct gdbarch_init_registration
*rego
;
3470 printf_filtered ("Available architectures are:\n");
3471 for (rego
= gdbarch_init_registrary
;
3475 const struct bfd_arch_info
*ap
;
3476 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3481 printf_filtered (" %s", ap
->printable_name
);
3485 printf_filtered ("\n");
3491 printf_filtered ("There are no available architectures.\n");
3495 printf_filtered ("Available architectures are:\n");
3496 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3498 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3503 printf_filtered (" %s", ap
->printable_name
);
3507 printf_filtered ("\n");
3512 /* Set the architecture from arch/machine */
3514 set_architecture_from_arch_mach (arch
, mach
)
3515 enum bfd_architecture arch
;
3518 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3520 set_arch (wanted
, set_arch_manual
);
3522 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3525 /* Set the architecture from a BFD */
3527 set_architecture_from_file (bfd
*abfd
)
3529 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3530 if (target_architecture_auto
)
3532 set_arch (wanted
, set_arch_auto
);
3534 else if (wanted
!= target_architecture
)
3536 warning ("%s architecture file may be incompatible with %s target.",
3537 wanted
->printable_name
,
3538 target_architecture
->printable_name
);
3543 /* Misc helper functions for targets. */
3546 frame_num_args_unknown (fi
)
3547 struct frame_info
*fi
;
3554 generic_register_convertible_not (num
)
3563 /* Pointer to the target-dependent disassembly function. */
3564 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3565 disassemble_info tm_print_insn_info
;
3569 /* Set the dynamic target-system-dependant parameters (architecture,
3570 byte-order) using information found in the BFD */
3573 set_gdbarch_from_file (abfd
)
3578 struct gdbarch_info info
;
3579 memset (&info
, 0, sizeof info
);
3581 gdbarch_update (info
);
3584 set_architecture_from_file (abfd
);
3585 set_endian_from_file (abfd
);
3589 /* Initialize the current architecture. */
3591 initialize_current_architecture ()
3595 struct gdbarch_init_registration
*rego
;
3596 const struct bfd_arch_info
*chosen
= NULL
;
3597 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3599 const struct bfd_arch_info
*ap
3600 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3602 /* Choose the first architecture alphabetically. */
3604 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3610 struct gdbarch_info info
;
3611 memset (&info
, 0, sizeof info
);
3612 info
.bfd_arch_info
= chosen
;
3613 gdbarch_update (info
);
3618 extern void _initialize_gdbarch (void);
3620 _initialize_gdbarch ()
3622 struct cmd_list_element
*c
;
3624 add_prefix_cmd ("endian", class_support
, set_endian
,
3625 "Set endianness of target.",
3626 &endianlist
, "set endian ", 0, &setlist
);
3627 add_cmd ("big", class_support
, set_endian_big
,
3628 "Set target as being big endian.", &endianlist
);
3629 add_cmd ("little", class_support
, set_endian_little
,
3630 "Set target as being little endian.", &endianlist
);
3631 add_cmd ("auto", class_support
, set_endian_auto
,
3632 "Select target endianness automatically.", &endianlist
);
3633 add_cmd ("endian", class_support
, show_endian
,
3634 "Show endianness of target.", &showlist
);
3636 add_cmd ("architecture", class_support
, set_architecture
,
3637 "Set architecture of target.", &setlist
);
3638 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3639 add_cmd ("architecture", class_support
, show_architecture
,
3640 "Show architecture of target.", &showlist
);
3641 add_cmd ("architecture", class_support
, info_architecture
,
3642 "List supported target architectures", &infolist
);
3644 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3645 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3646 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3647 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3648 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3650 add_show_from_set (add_set_cmd ("arch",
3653 (char *)&gdbarch_debug
,
3654 "Set architecture debugging.\n\
3655 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3657 c
= add_set_cmd ("archdebug",
3660 (char *)&gdbarch_debug
,
3661 "Set architecture debugging.\n\
3662 When non-zero, architecture debugging is enabled.", &setlist
);
3664 deprecate_cmd (c
, "set debug arch");
3665 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");