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
;
149 gdbarch_register_name_ftype
*register_name
;
152 gdbarch_register_byte_ftype
*register_byte
;
153 gdbarch_register_raw_size_ftype
*register_raw_size
;
154 int max_register_raw_size
;
155 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
156 int max_register_virtual_size
;
157 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
158 int use_generic_dummy_frames
;
159 int call_dummy_location
;
160 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
161 CORE_ADDR call_dummy_start_offset
;
162 CORE_ADDR call_dummy_breakpoint_offset
;
163 int call_dummy_breakpoint_offset_p
;
164 int call_dummy_length
;
165 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
167 LONGEST
* call_dummy_words
;
168 int sizeof_call_dummy_words
;
169 int call_dummy_stack_adjust_p
;
170 int call_dummy_stack_adjust
;
171 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
172 int believe_pcc_promotion
;
173 int believe_pcc_promotion_type
;
174 gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
;
175 gdbarch_get_saved_register_ftype
*get_saved_register
;
176 gdbarch_register_convertible_ftype
*register_convertible
;
177 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
178 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
179 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
180 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
181 gdbarch_return_value_on_stack_ftype
*return_value_on_stack
;
182 gdbarch_extract_return_value_ftype
*extract_return_value
;
183 gdbarch_push_arguments_ftype
*push_arguments
;
184 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
185 gdbarch_push_return_address_ftype
*push_return_address
;
186 gdbarch_pop_frame_ftype
*pop_frame
;
187 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
188 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
189 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
190 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
191 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
192 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
193 gdbarch_store_struct_return_ftype
*store_struct_return
;
194 gdbarch_store_return_value_ftype
*store_return_value
;
195 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
196 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
197 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
198 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
199 gdbarch_skip_prologue_ftype
*skip_prologue
;
200 gdbarch_inner_than_ftype
*inner_than
;
201 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
202 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
203 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
204 CORE_ADDR decr_pc_after_break
;
205 CORE_ADDR function_start_offset
;
206 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
207 CORE_ADDR frame_args_skip
;
208 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
209 gdbarch_frame_chain_ftype
*frame_chain
;
210 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
211 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
212 gdbarch_frame_args_address_ftype
*frame_args_address
;
213 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
214 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
215 gdbarch_frame_num_args_ftype
*frame_num_args
;
219 /* The default architecture uses host values (for want of a better
222 extern const struct bfd_arch_info bfd_default_arch_struct
;
224 struct gdbarch startup_gdbarch
= {
225 /* basic architecture information */
226 &bfd_default_arch_struct
,
228 /* target specific vector */
230 /*per-architecture data-pointers and swap regions */
232 /* Multi-arch values */
238 8 * sizeof (LONGEST
),
241 8 * sizeof (long double),
279 generic_get_saved_register
,
320 /* startup_gdbarch() */
322 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
325 /* Create a new ``struct gdbarch'' based in information provided by
326 ``struct gdbarch_info''. */
329 gdbarch_alloc (const struct gdbarch_info
*info
,
330 struct gdbarch_tdep
*tdep
)
332 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
333 memset (gdbarch
, 0, sizeof (*gdbarch
));
335 gdbarch
->tdep
= tdep
;
337 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
338 gdbarch
->byte_order
= info
->byte_order
;
340 /* Force the explicit initialization of these. */
341 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
342 gdbarch
->ieee_float
= 1;
343 gdbarch
->num_regs
= -1;
344 gdbarch
->sp_regnum
= -1;
345 gdbarch
->fp_regnum
= -1;
346 gdbarch
->pc_regnum
= -1;
347 gdbarch
->register_name
= legacy_register_name
;
348 gdbarch
->register_size
= -1;
349 gdbarch
->register_bytes
= -1;
350 gdbarch
->max_register_raw_size
= -1;
351 gdbarch
->max_register_virtual_size
= -1;
352 gdbarch
->use_generic_dummy_frames
= -1;
353 gdbarch
->call_dummy_start_offset
= -1;
354 gdbarch
->call_dummy_breakpoint_offset
= -1;
355 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
356 gdbarch
->call_dummy_length
= -1;
357 gdbarch
->call_dummy_p
= -1;
358 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
359 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
360 gdbarch
->call_dummy_stack_adjust_p
= -1;
361 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
362 gdbarch
->register_convertible
= generic_register_convertible_not
;
363 gdbarch
->pointer_to_address
= generic_pointer_to_address
;
364 gdbarch
->address_to_pointer
= generic_address_to_pointer
;
365 gdbarch
->return_value_on_stack
= generic_return_value_on_stack_not
;
366 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
367 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
368 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
369 gdbarch
->decr_pc_after_break
= -1;
370 gdbarch
->function_start_offset
= -1;
371 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
372 gdbarch
->frame_args_skip
= -1;
373 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
374 /* gdbarch_alloc() */
380 /* Free a gdbarch struct. This should never happen in normal
381 operation --- once you've created a gdbarch, you keep it around.
382 However, if an architecture's init function encounters an error
383 building the structure, it may need to clean up a partially
384 constructed gdbarch. */
386 gdbarch_free (struct gdbarch
*arch
)
388 /* At the moment, this is trivial. */
393 /* Ensure that all values in a GDBARCH are reasonable. */
396 verify_gdbarch (struct gdbarch
*gdbarch
)
398 /* Only perform sanity checks on a multi-arch target. */
399 if (GDB_MULTI_ARCH
<= 0)
402 if (gdbarch
->byte_order
== 0)
403 internal_error ("verify_gdbarch: byte-order unset");
404 if (gdbarch
->bfd_arch_info
== NULL
)
405 internal_error ("verify_gdbarch: bfd_arch_info unset");
406 /* Check those that need to be defined for the given multi-arch level. */
407 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
408 if ((GDB_MULTI_ARCH
>= 1)
409 && (gdbarch
->ptr_bit
== 0))
410 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
411 if ((GDB_MULTI_ARCH
>= 1)
412 && (gdbarch
->short_bit
== 0))
413 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
414 if ((GDB_MULTI_ARCH
>= 1)
415 && (gdbarch
->int_bit
== 0))
416 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
417 if ((GDB_MULTI_ARCH
>= 1)
418 && (gdbarch
->long_bit
== 0))
419 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
420 if ((GDB_MULTI_ARCH
>= 1)
421 && (gdbarch
->long_long_bit
== 0))
422 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
423 if ((GDB_MULTI_ARCH
>= 1)
424 && (gdbarch
->float_bit
== 0))
425 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
426 if ((GDB_MULTI_ARCH
>= 1)
427 && (gdbarch
->double_bit
== 0))
428 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
429 if ((GDB_MULTI_ARCH
>= 1)
430 && (gdbarch
->long_double_bit
== 0))
431 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
432 /* Skip verify of ieee_float, invalid_p == 0 */
433 if ((GDB_MULTI_ARCH
>= 1)
434 && (gdbarch
->read_pc
== 0))
435 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
436 if ((GDB_MULTI_ARCH
>= 1)
437 && (gdbarch
->write_pc
== 0))
438 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
439 if ((GDB_MULTI_ARCH
>= 1)
440 && (gdbarch
->read_fp
== 0))
441 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
442 if ((GDB_MULTI_ARCH
>= 1)
443 && (gdbarch
->write_fp
== 0))
444 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
445 if ((GDB_MULTI_ARCH
>= 1)
446 && (gdbarch
->read_sp
== 0))
447 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
448 if ((GDB_MULTI_ARCH
>= 1)
449 && (gdbarch
->write_sp
== 0))
450 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
451 if ((GDB_MULTI_ARCH
>= 2)
452 && (gdbarch
->num_regs
== -1))
453 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
454 if ((GDB_MULTI_ARCH
>= 2)
455 && (gdbarch
->sp_regnum
== -1))
456 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
457 if ((GDB_MULTI_ARCH
>= 2)
458 && (gdbarch
->fp_regnum
== -1))
459 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
460 if ((GDB_MULTI_ARCH
>= 2)
461 && (gdbarch
->pc_regnum
== -1))
462 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
463 /* Skip verify of register_name, invalid_p == 0 */
464 if ((GDB_MULTI_ARCH
>= 2)
465 && (gdbarch
->register_size
== -1))
466 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
467 if ((GDB_MULTI_ARCH
>= 2)
468 && (gdbarch
->register_bytes
== -1))
469 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
470 if ((GDB_MULTI_ARCH
>= 2)
471 && (gdbarch
->register_byte
== 0))
472 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
473 if ((GDB_MULTI_ARCH
>= 2)
474 && (gdbarch
->register_raw_size
== 0))
475 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
476 if ((GDB_MULTI_ARCH
>= 2)
477 && (gdbarch
->max_register_raw_size
== -1))
478 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
479 if ((GDB_MULTI_ARCH
>= 2)
480 && (gdbarch
->register_virtual_size
== 0))
481 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
482 if ((GDB_MULTI_ARCH
>= 2)
483 && (gdbarch
->max_register_virtual_size
== -1))
484 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
485 if ((GDB_MULTI_ARCH
>= 2)
486 && (gdbarch
->register_virtual_type
== 0))
487 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
488 if ((GDB_MULTI_ARCH
>= 1)
489 && (gdbarch
->use_generic_dummy_frames
== -1))
490 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
491 if ((GDB_MULTI_ARCH
>= 2)
492 && (gdbarch
->call_dummy_location
== 0))
493 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
494 if ((GDB_MULTI_ARCH
>= 2)
495 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
496 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
497 if ((GDB_MULTI_ARCH
>= 2)
498 && (gdbarch
->call_dummy_start_offset
== -1))
499 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
500 if ((GDB_MULTI_ARCH
>= 2)
501 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
502 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
503 if ((GDB_MULTI_ARCH
>= 1)
504 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
505 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
506 if ((GDB_MULTI_ARCH
>= 2)
507 && (gdbarch
->call_dummy_length
== -1))
508 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
509 if ((GDB_MULTI_ARCH
>= 2)
510 && (gdbarch
->pc_in_call_dummy
== 0))
511 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
512 if ((GDB_MULTI_ARCH
>= 1)
513 && (gdbarch
->call_dummy_p
== -1))
514 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
515 /* Skip verify of call_dummy_words, invalid_p == 0 */
516 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
517 if ((GDB_MULTI_ARCH
>= 1)
518 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
519 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
520 if ((GDB_MULTI_ARCH
>= 2)
521 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
522 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
523 if ((GDB_MULTI_ARCH
>= 2)
524 && (gdbarch
->fix_call_dummy
== 0))
525 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
526 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
527 if ((GDB_MULTI_ARCH
>= 1)
528 && (gdbarch
->get_saved_register
== 0))
529 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
530 /* Skip verify of register_convertible, invalid_p == 0 */
531 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
532 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
533 /* Skip verify of pointer_to_address, invalid_p == 0 */
534 /* Skip verify of address_to_pointer, invalid_p == 0 */
535 /* Skip verify of return_value_on_stack, invalid_p == 0 */
536 if ((GDB_MULTI_ARCH
>= 2)
537 && (gdbarch
->extract_return_value
== 0))
538 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
539 if ((GDB_MULTI_ARCH
>= 1)
540 && (gdbarch
->push_arguments
== 0))
541 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
542 if ((GDB_MULTI_ARCH
>= 2)
543 && (gdbarch
->push_dummy_frame
== 0))
544 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
545 if ((GDB_MULTI_ARCH
>= 1)
546 && (gdbarch
->push_return_address
== 0))
547 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
548 if ((GDB_MULTI_ARCH
>= 2)
549 && (gdbarch
->pop_frame
== 0))
550 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
551 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
552 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
553 if ((GDB_MULTI_ARCH
>= 2)
554 && (gdbarch
->d10v_daddr_p
== 0))
555 internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
556 if ((GDB_MULTI_ARCH
>= 2)
557 && (gdbarch
->d10v_iaddr_p
== 0))
558 internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
559 if ((GDB_MULTI_ARCH
>= 2)
560 && (gdbarch
->d10v_convert_daddr_to_raw
== 0))
561 internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
562 if ((GDB_MULTI_ARCH
>= 2)
563 && (gdbarch
->d10v_convert_iaddr_to_raw
== 0))
564 internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
565 if ((GDB_MULTI_ARCH
>= 2)
566 && (gdbarch
->store_struct_return
== 0))
567 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
568 if ((GDB_MULTI_ARCH
>= 2)
569 && (gdbarch
->store_return_value
== 0))
570 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
571 if ((GDB_MULTI_ARCH
>= 2)
572 && (gdbarch
->extract_struct_value_address
== 0))
573 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
574 if ((GDB_MULTI_ARCH
>= 2)
575 && (gdbarch
->use_struct_convention
== 0))
576 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
577 if ((GDB_MULTI_ARCH
>= 2)
578 && (gdbarch
->frame_init_saved_regs
== 0))
579 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
580 if ((GDB_MULTI_ARCH
>= 2)
581 && (gdbarch
->init_extra_frame_info
== 0))
582 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
583 if ((GDB_MULTI_ARCH
>= 2)
584 && (gdbarch
->skip_prologue
== 0))
585 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
586 if ((GDB_MULTI_ARCH
>= 2)
587 && (gdbarch
->inner_than
== 0))
588 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
589 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
590 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
591 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
592 if ((GDB_MULTI_ARCH
>= 2)
593 && (gdbarch
->decr_pc_after_break
== -1))
594 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
595 if ((GDB_MULTI_ARCH
>= 2)
596 && (gdbarch
->function_start_offset
== -1))
597 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
598 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
599 if ((GDB_MULTI_ARCH
>= 2)
600 && (gdbarch
->frame_args_skip
== -1))
601 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
602 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
603 if ((GDB_MULTI_ARCH
>= 2)
604 && (gdbarch
->frame_chain
== 0))
605 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
606 if ((GDB_MULTI_ARCH
>= 1)
607 && (gdbarch
->frame_chain_valid
== 0))
608 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
609 if ((GDB_MULTI_ARCH
>= 2)
610 && (gdbarch
->frame_saved_pc
== 0))
611 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
612 if ((GDB_MULTI_ARCH
>= 2)
613 && (gdbarch
->frame_args_address
== 0))
614 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
615 if ((GDB_MULTI_ARCH
>= 2)
616 && (gdbarch
->frame_locals_address
== 0))
617 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
618 if ((GDB_MULTI_ARCH
>= 2)
619 && (gdbarch
->saved_pc_after_call
== 0))
620 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
621 if ((GDB_MULTI_ARCH
>= 2)
622 && (gdbarch
->frame_num_args
== 0))
623 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
627 /* Print out the details of the current architecture. */
632 if (TARGET_ARCHITECTURE
!= NULL
)
633 fprintf_unfiltered (gdb_stdlog
,
634 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
635 TARGET_ARCHITECTURE
->printable_name
);
636 fprintf_unfiltered (gdb_stdlog
,
637 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
638 (long) TARGET_BYTE_ORDER
);
639 fprintf_unfiltered (gdb_stdlog
,
640 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
641 (long) TARGET_BFD_VMA_BIT
);
642 fprintf_unfiltered (gdb_stdlog
,
643 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
644 (long) TARGET_PTR_BIT
);
645 fprintf_unfiltered (gdb_stdlog
,
646 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
647 (long) TARGET_SHORT_BIT
);
648 fprintf_unfiltered (gdb_stdlog
,
649 "gdbarch_update: TARGET_INT_BIT = %ld\n",
650 (long) TARGET_INT_BIT
);
651 fprintf_unfiltered (gdb_stdlog
,
652 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
653 (long) TARGET_LONG_BIT
);
654 fprintf_unfiltered (gdb_stdlog
,
655 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
656 (long) TARGET_LONG_LONG_BIT
);
657 fprintf_unfiltered (gdb_stdlog
,
658 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
659 (long) TARGET_FLOAT_BIT
);
660 fprintf_unfiltered (gdb_stdlog
,
661 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
662 (long) TARGET_DOUBLE_BIT
);
663 fprintf_unfiltered (gdb_stdlog
,
664 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
665 (long) TARGET_LONG_DOUBLE_BIT
);
667 fprintf_unfiltered (gdb_stdlog
,
668 "gdbarch_update: IEEE_FLOAT = %ld\n",
671 fprintf_unfiltered (gdb_stdlog
,
672 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
673 (long) current_gdbarch
->read_pc
674 /*TARGET_READ_PC ()*/);
675 fprintf_unfiltered (gdb_stdlog
,
676 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
677 (long) current_gdbarch
->write_pc
678 /*TARGET_WRITE_PC ()*/);
679 fprintf_unfiltered (gdb_stdlog
,
680 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
681 (long) current_gdbarch
->read_fp
682 /*TARGET_READ_FP ()*/);
683 fprintf_unfiltered (gdb_stdlog
,
684 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
685 (long) current_gdbarch
->write_fp
686 /*TARGET_WRITE_FP ()*/);
687 fprintf_unfiltered (gdb_stdlog
,
688 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
689 (long) current_gdbarch
->read_sp
690 /*TARGET_READ_SP ()*/);
691 fprintf_unfiltered (gdb_stdlog
,
692 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
693 (long) current_gdbarch
->write_sp
694 /*TARGET_WRITE_SP ()*/);
695 fprintf_unfiltered (gdb_stdlog
,
696 "gdbarch_update: NUM_REGS = %ld\n",
698 fprintf_unfiltered (gdb_stdlog
,
699 "gdbarch_update: SP_REGNUM = %ld\n",
701 fprintf_unfiltered (gdb_stdlog
,
702 "gdbarch_update: FP_REGNUM = %ld\n",
704 fprintf_unfiltered (gdb_stdlog
,
705 "gdbarch_update: PC_REGNUM = %ld\n",
707 fprintf_unfiltered (gdb_stdlog
,
708 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
709 (long) current_gdbarch
->register_name
710 /*REGISTER_NAME ()*/);
711 fprintf_unfiltered (gdb_stdlog
,
712 "gdbarch_update: REGISTER_SIZE = %ld\n",
713 (long) REGISTER_SIZE
);
714 fprintf_unfiltered (gdb_stdlog
,
715 "gdbarch_update: REGISTER_BYTES = %ld\n",
716 (long) REGISTER_BYTES
);
717 fprintf_unfiltered (gdb_stdlog
,
718 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
719 (long) current_gdbarch
->register_byte
720 /*REGISTER_BYTE ()*/);
721 fprintf_unfiltered (gdb_stdlog
,
722 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
723 (long) current_gdbarch
->register_raw_size
724 /*REGISTER_RAW_SIZE ()*/);
725 fprintf_unfiltered (gdb_stdlog
,
726 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
727 (long) MAX_REGISTER_RAW_SIZE
);
728 fprintf_unfiltered (gdb_stdlog
,
729 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
730 (long) current_gdbarch
->register_virtual_size
731 /*REGISTER_VIRTUAL_SIZE ()*/);
732 fprintf_unfiltered (gdb_stdlog
,
733 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
734 (long) MAX_REGISTER_VIRTUAL_SIZE
);
735 fprintf_unfiltered (gdb_stdlog
,
736 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
737 (long) current_gdbarch
->register_virtual_type
738 /*REGISTER_VIRTUAL_TYPE ()*/);
739 fprintf_unfiltered (gdb_stdlog
,
740 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
741 (long) USE_GENERIC_DUMMY_FRAMES
);
742 fprintf_unfiltered (gdb_stdlog
,
743 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
744 (long) CALL_DUMMY_LOCATION
);
745 fprintf_unfiltered (gdb_stdlog
,
746 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
747 (long) current_gdbarch
->call_dummy_address
748 /*CALL_DUMMY_ADDRESS ()*/);
749 fprintf_unfiltered (gdb_stdlog
,
750 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
751 (long) CALL_DUMMY_START_OFFSET
);
752 fprintf_unfiltered (gdb_stdlog
,
753 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
754 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
755 fprintf_unfiltered (gdb_stdlog
,
756 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
757 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
758 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
759 fprintf_unfiltered (gdb_stdlog
,
760 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
761 (long) CALL_DUMMY_LENGTH
);
762 fprintf_unfiltered (gdb_stdlog
,
763 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
764 (long) current_gdbarch
->pc_in_call_dummy
765 /*PC_IN_CALL_DUMMY ()*/);
766 fprintf_unfiltered (gdb_stdlog
,
767 "gdbarch_update: CALL_DUMMY_P = %ld\n",
768 (long) CALL_DUMMY_P
);
769 fprintf_unfiltered (gdb_stdlog
,
770 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
771 (long) CALL_DUMMY_WORDS
);
772 fprintf_unfiltered (gdb_stdlog
,
773 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
774 (long) SIZEOF_CALL_DUMMY_WORDS
);
775 fprintf_unfiltered (gdb_stdlog
,
776 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
777 (long) CALL_DUMMY_STACK_ADJUST_P
);
778 if (CALL_DUMMY_STACK_ADJUST_P
)
779 fprintf_unfiltered (gdb_stdlog
,
780 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
781 (long) CALL_DUMMY_STACK_ADJUST
);
782 fprintf_unfiltered (gdb_stdlog
,
783 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
784 (long) current_gdbarch
->fix_call_dummy
785 /*FIX_CALL_DUMMY ()*/);
786 #ifdef BELIEVE_PCC_PROMOTION
787 fprintf_unfiltered (gdb_stdlog
,
788 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
789 (long) BELIEVE_PCC_PROMOTION
);
791 #ifdef BELIEVE_PCC_PROMOTION_TYPE
792 fprintf_unfiltered (gdb_stdlog
,
793 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
794 (long) BELIEVE_PCC_PROMOTION_TYPE
);
796 fprintf_unfiltered (gdb_stdlog
,
797 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
798 (long) current_gdbarch
->coerce_float_to_double
799 /*COERCE_FLOAT_TO_DOUBLE ()*/);
800 fprintf_unfiltered (gdb_stdlog
,
801 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
802 (long) current_gdbarch
->get_saved_register
803 /*GET_SAVED_REGISTER ()*/);
804 fprintf_unfiltered (gdb_stdlog
,
805 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
806 (long) current_gdbarch
->register_convertible
807 /*REGISTER_CONVERTIBLE ()*/);
808 fprintf_unfiltered (gdb_stdlog
,
809 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
810 (long) current_gdbarch
->register_convert_to_virtual
811 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
812 fprintf_unfiltered (gdb_stdlog
,
813 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
814 (long) current_gdbarch
->register_convert_to_raw
815 /*REGISTER_CONVERT_TO_RAW ()*/);
816 fprintf_unfiltered (gdb_stdlog
,
817 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
818 (long) current_gdbarch
->pointer_to_address
819 /*POINTER_TO_ADDRESS ()*/);
820 fprintf_unfiltered (gdb_stdlog
,
821 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
822 (long) current_gdbarch
->address_to_pointer
823 /*ADDRESS_TO_POINTER ()*/);
824 fprintf_unfiltered (gdb_stdlog
,
825 "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n",
826 (long) current_gdbarch
->return_value_on_stack
827 /*RETURN_VALUE_ON_STACK ()*/);
828 fprintf_unfiltered (gdb_stdlog
,
829 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
830 (long) current_gdbarch
->extract_return_value
831 /*EXTRACT_RETURN_VALUE ()*/);
832 fprintf_unfiltered (gdb_stdlog
,
833 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
834 (long) current_gdbarch
->push_arguments
835 /*PUSH_ARGUMENTS ()*/);
836 fprintf_unfiltered (gdb_stdlog
,
837 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
838 (long) current_gdbarch
->push_dummy_frame
839 /*PUSH_DUMMY_FRAME ()*/);
840 fprintf_unfiltered (gdb_stdlog
,
841 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
842 (long) current_gdbarch
->push_return_address
843 /*PUSH_RETURN_ADDRESS ()*/);
844 fprintf_unfiltered (gdb_stdlog
,
845 "gdbarch_update: POP_FRAME = 0x%08lx\n",
846 (long) current_gdbarch
->pop_frame
848 fprintf_unfiltered (gdb_stdlog
,
849 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
850 (long) current_gdbarch
->d10v_make_daddr
851 /*D10V_MAKE_DADDR ()*/);
852 fprintf_unfiltered (gdb_stdlog
,
853 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
854 (long) current_gdbarch
->d10v_make_iaddr
855 /*D10V_MAKE_IADDR ()*/);
856 fprintf_unfiltered (gdb_stdlog
,
857 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
858 (long) current_gdbarch
->d10v_daddr_p
859 /*D10V_DADDR_P ()*/);
860 fprintf_unfiltered (gdb_stdlog
,
861 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
862 (long) current_gdbarch
->d10v_iaddr_p
863 /*D10V_IADDR_P ()*/);
864 fprintf_unfiltered (gdb_stdlog
,
865 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
866 (long) current_gdbarch
->d10v_convert_daddr_to_raw
867 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
868 fprintf_unfiltered (gdb_stdlog
,
869 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
870 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
871 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
872 fprintf_unfiltered (gdb_stdlog
,
873 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
874 (long) current_gdbarch
->store_struct_return
875 /*STORE_STRUCT_RETURN ()*/);
876 fprintf_unfiltered (gdb_stdlog
,
877 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
878 (long) current_gdbarch
->store_return_value
879 /*STORE_RETURN_VALUE ()*/);
880 fprintf_unfiltered (gdb_stdlog
,
881 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
882 (long) current_gdbarch
->extract_struct_value_address
883 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
884 fprintf_unfiltered (gdb_stdlog
,
885 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
886 (long) current_gdbarch
->use_struct_convention
887 /*USE_STRUCT_CONVENTION ()*/);
888 fprintf_unfiltered (gdb_stdlog
,
889 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
890 (long) current_gdbarch
->frame_init_saved_regs
891 /*FRAME_INIT_SAVED_REGS ()*/);
892 fprintf_unfiltered (gdb_stdlog
,
893 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
894 (long) current_gdbarch
->init_extra_frame_info
895 /*INIT_EXTRA_FRAME_INFO ()*/);
896 fprintf_unfiltered (gdb_stdlog
,
897 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
898 (long) current_gdbarch
->skip_prologue
899 /*SKIP_PROLOGUE ()*/);
900 fprintf_unfiltered (gdb_stdlog
,
901 "gdbarch_update: INNER_THAN = 0x%08lx\n",
902 (long) current_gdbarch
->inner_than
904 fprintf_unfiltered (gdb_stdlog
,
905 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
906 (long) current_gdbarch
->breakpoint_from_pc
907 /*BREAKPOINT_FROM_PC ()*/);
908 fprintf_unfiltered (gdb_stdlog
,
909 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
910 (long) current_gdbarch
->memory_insert_breakpoint
911 /*MEMORY_INSERT_BREAKPOINT ()*/);
912 fprintf_unfiltered (gdb_stdlog
,
913 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
914 (long) current_gdbarch
->memory_remove_breakpoint
915 /*MEMORY_REMOVE_BREAKPOINT ()*/);
916 fprintf_unfiltered (gdb_stdlog
,
917 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
918 (long) DECR_PC_AFTER_BREAK
);
919 fprintf_unfiltered (gdb_stdlog
,
920 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
921 (long) FUNCTION_START_OFFSET
);
922 fprintf_unfiltered (gdb_stdlog
,
923 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
924 (long) current_gdbarch
->remote_translate_xfer_address
925 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
926 fprintf_unfiltered (gdb_stdlog
,
927 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
928 (long) FRAME_ARGS_SKIP
);
929 fprintf_unfiltered (gdb_stdlog
,
930 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
931 (long) current_gdbarch
->frameless_function_invocation
932 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
933 fprintf_unfiltered (gdb_stdlog
,
934 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
935 (long) current_gdbarch
->frame_chain
937 fprintf_unfiltered (gdb_stdlog
,
938 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
939 (long) current_gdbarch
->frame_chain_valid
940 /*FRAME_CHAIN_VALID ()*/);
941 fprintf_unfiltered (gdb_stdlog
,
942 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
943 (long) current_gdbarch
->frame_saved_pc
944 /*FRAME_SAVED_PC ()*/);
945 fprintf_unfiltered (gdb_stdlog
,
946 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
947 (long) current_gdbarch
->frame_args_address
948 /*FRAME_ARGS_ADDRESS ()*/);
949 fprintf_unfiltered (gdb_stdlog
,
950 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
951 (long) current_gdbarch
->frame_locals_address
952 /*FRAME_LOCALS_ADDRESS ()*/);
953 fprintf_unfiltered (gdb_stdlog
,
954 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
955 (long) current_gdbarch
->saved_pc_after_call
956 /*SAVED_PC_AFTER_CALL ()*/);
957 fprintf_unfiltered (gdb_stdlog
,
958 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
959 (long) current_gdbarch
->frame_num_args
960 /*FRAME_NUM_ARGS ()*/);
963 struct gdbarch_tdep
*
964 gdbarch_tdep (struct gdbarch
*gdbarch
)
966 if (gdbarch_debug
>= 2)
967 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
968 return gdbarch
->tdep
;
972 const struct bfd_arch_info
*
973 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
975 if (gdbarch_debug
>= 2)
976 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
977 return gdbarch
->bfd_arch_info
;
981 gdbarch_byte_order (struct gdbarch
*gdbarch
)
983 if (gdbarch_debug
>= 2)
984 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
985 return gdbarch
->byte_order
;
989 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
991 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
992 if (gdbarch_debug
>= 2)
993 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
994 return gdbarch
->bfd_vma_bit
;
998 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1001 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1005 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1007 if (gdbarch
->ptr_bit
== 0)
1008 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1009 if (gdbarch_debug
>= 2)
1010 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1011 return gdbarch
->ptr_bit
;
1015 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1018 gdbarch
->ptr_bit
= ptr_bit
;
1022 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1024 if (gdbarch
->short_bit
== 0)
1025 internal_error ("gdbarch: gdbarch_short_bit invalid");
1026 if (gdbarch_debug
>= 2)
1027 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1028 return gdbarch
->short_bit
;
1032 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1035 gdbarch
->short_bit
= short_bit
;
1039 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1041 if (gdbarch
->int_bit
== 0)
1042 internal_error ("gdbarch: gdbarch_int_bit invalid");
1043 if (gdbarch_debug
>= 2)
1044 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1045 return gdbarch
->int_bit
;
1049 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1052 gdbarch
->int_bit
= int_bit
;
1056 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1058 if (gdbarch
->long_bit
== 0)
1059 internal_error ("gdbarch: gdbarch_long_bit invalid");
1060 if (gdbarch_debug
>= 2)
1061 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1062 return gdbarch
->long_bit
;
1066 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1069 gdbarch
->long_bit
= long_bit
;
1073 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1075 if (gdbarch
->long_long_bit
== 0)
1076 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1077 if (gdbarch_debug
>= 2)
1078 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1079 return gdbarch
->long_long_bit
;
1083 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1086 gdbarch
->long_long_bit
= long_long_bit
;
1090 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1092 if (gdbarch
->float_bit
== 0)
1093 internal_error ("gdbarch: gdbarch_float_bit invalid");
1094 if (gdbarch_debug
>= 2)
1095 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1096 return gdbarch
->float_bit
;
1100 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1103 gdbarch
->float_bit
= float_bit
;
1107 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1109 if (gdbarch
->double_bit
== 0)
1110 internal_error ("gdbarch: gdbarch_double_bit invalid");
1111 if (gdbarch_debug
>= 2)
1112 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1113 return gdbarch
->double_bit
;
1117 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1120 gdbarch
->double_bit
= double_bit
;
1124 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1126 if (gdbarch
->long_double_bit
== 0)
1127 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1128 if (gdbarch_debug
>= 2)
1129 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1130 return gdbarch
->long_double_bit
;
1134 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1135 int long_double_bit
)
1137 gdbarch
->long_double_bit
= long_double_bit
;
1141 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1143 /* Skip verify of ieee_float, invalid_p == 0 */
1144 if (gdbarch_debug
>= 2)
1145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1146 return gdbarch
->ieee_float
;
1150 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1153 gdbarch
->ieee_float
= ieee_float
;
1157 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1159 if (gdbarch
->read_pc
== 0)
1160 internal_error ("gdbarch: gdbarch_read_pc invalid");
1161 if (gdbarch_debug
>= 2)
1162 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1163 return gdbarch
->read_pc (pid
);
1167 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1168 gdbarch_read_pc_ftype read_pc
)
1170 gdbarch
->read_pc
= read_pc
;
1174 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1176 if (gdbarch
->write_pc
== 0)
1177 internal_error ("gdbarch: gdbarch_write_pc invalid");
1178 if (gdbarch_debug
>= 2)
1179 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1180 gdbarch
->write_pc (val
, pid
);
1184 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1185 gdbarch_write_pc_ftype write_pc
)
1187 gdbarch
->write_pc
= write_pc
;
1191 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1193 if (gdbarch
->read_fp
== 0)
1194 internal_error ("gdbarch: gdbarch_read_fp invalid");
1195 if (gdbarch_debug
>= 2)
1196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1197 return gdbarch
->read_fp ();
1201 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1202 gdbarch_read_fp_ftype read_fp
)
1204 gdbarch
->read_fp
= read_fp
;
1208 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1210 if (gdbarch
->write_fp
== 0)
1211 internal_error ("gdbarch: gdbarch_write_fp invalid");
1212 if (gdbarch_debug
>= 2)
1213 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1214 gdbarch
->write_fp (val
);
1218 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1219 gdbarch_write_fp_ftype write_fp
)
1221 gdbarch
->write_fp
= write_fp
;
1225 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1227 if (gdbarch
->read_sp
== 0)
1228 internal_error ("gdbarch: gdbarch_read_sp invalid");
1229 if (gdbarch_debug
>= 2)
1230 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1231 return gdbarch
->read_sp ();
1235 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1236 gdbarch_read_sp_ftype read_sp
)
1238 gdbarch
->read_sp
= read_sp
;
1242 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1244 if (gdbarch
->write_sp
== 0)
1245 internal_error ("gdbarch: gdbarch_write_sp invalid");
1246 if (gdbarch_debug
>= 2)
1247 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1248 gdbarch
->write_sp (val
);
1252 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1253 gdbarch_write_sp_ftype write_sp
)
1255 gdbarch
->write_sp
= write_sp
;
1259 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1261 if (gdbarch
->num_regs
== -1)
1262 internal_error ("gdbarch: gdbarch_num_regs invalid");
1263 if (gdbarch_debug
>= 2)
1264 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1265 return gdbarch
->num_regs
;
1269 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1272 gdbarch
->num_regs
= num_regs
;
1276 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1278 if (gdbarch
->sp_regnum
== -1)
1279 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1280 if (gdbarch_debug
>= 2)
1281 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1282 return gdbarch
->sp_regnum
;
1286 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1289 gdbarch
->sp_regnum
= sp_regnum
;
1293 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1295 if (gdbarch
->fp_regnum
== -1)
1296 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1297 if (gdbarch_debug
>= 2)
1298 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1299 return gdbarch
->fp_regnum
;
1303 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1306 gdbarch
->fp_regnum
= fp_regnum
;
1310 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1312 if (gdbarch
->pc_regnum
== -1)
1313 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1314 if (gdbarch_debug
>= 2)
1315 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1316 return gdbarch
->pc_regnum
;
1320 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1323 gdbarch
->pc_regnum
= pc_regnum
;
1327 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1329 if (GDB_MULTI_ARCH
== 0)
1330 return legacy_register_name (regnr
);
1331 if (gdbarch
->register_name
== 0)
1332 internal_error ("gdbarch: gdbarch_register_name invalid");
1333 if (gdbarch_debug
>= 2)
1334 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1335 return gdbarch
->register_name (regnr
);
1339 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1340 gdbarch_register_name_ftype register_name
)
1342 gdbarch
->register_name
= register_name
;
1346 gdbarch_register_size (struct gdbarch
*gdbarch
)
1348 if (gdbarch
->register_size
== -1)
1349 internal_error ("gdbarch: gdbarch_register_size invalid");
1350 if (gdbarch_debug
>= 2)
1351 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1352 return gdbarch
->register_size
;
1356 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1359 gdbarch
->register_size
= register_size
;
1363 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1365 if (gdbarch
->register_bytes
== -1)
1366 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1367 if (gdbarch_debug
>= 2)
1368 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1369 return gdbarch
->register_bytes
;
1373 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1376 gdbarch
->register_bytes
= register_bytes
;
1380 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1382 if (gdbarch
->register_byte
== 0)
1383 internal_error ("gdbarch: gdbarch_register_byte invalid");
1384 if (gdbarch_debug
>= 2)
1385 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1386 return gdbarch
->register_byte (reg_nr
);
1390 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1391 gdbarch_register_byte_ftype register_byte
)
1393 gdbarch
->register_byte
= register_byte
;
1397 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1399 if (gdbarch
->register_raw_size
== 0)
1400 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1401 if (gdbarch_debug
>= 2)
1402 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1403 return gdbarch
->register_raw_size (reg_nr
);
1407 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1408 gdbarch_register_raw_size_ftype register_raw_size
)
1410 gdbarch
->register_raw_size
= register_raw_size
;
1414 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1416 if (gdbarch
->max_register_raw_size
== -1)
1417 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1418 if (gdbarch_debug
>= 2)
1419 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1420 return gdbarch
->max_register_raw_size
;
1424 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1425 int max_register_raw_size
)
1427 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1431 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1433 if (gdbarch
->register_virtual_size
== 0)
1434 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1435 if (gdbarch_debug
>= 2)
1436 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1437 return gdbarch
->register_virtual_size (reg_nr
);
1441 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1442 gdbarch_register_virtual_size_ftype register_virtual_size
)
1444 gdbarch
->register_virtual_size
= register_virtual_size
;
1448 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1450 if (gdbarch
->max_register_virtual_size
== -1)
1451 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1452 if (gdbarch_debug
>= 2)
1453 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1454 return gdbarch
->max_register_virtual_size
;
1458 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1459 int max_register_virtual_size
)
1461 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1465 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1467 if (gdbarch
->register_virtual_type
== 0)
1468 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1469 if (gdbarch_debug
>= 2)
1470 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1471 return gdbarch
->register_virtual_type (reg_nr
);
1475 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1476 gdbarch_register_virtual_type_ftype register_virtual_type
)
1478 gdbarch
->register_virtual_type
= register_virtual_type
;
1482 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1484 if (gdbarch
->use_generic_dummy_frames
== -1)
1485 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1486 if (gdbarch_debug
>= 2)
1487 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1488 return gdbarch
->use_generic_dummy_frames
;
1492 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1493 int use_generic_dummy_frames
)
1495 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1499 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1501 if (gdbarch
->call_dummy_location
== 0)
1502 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1503 if (gdbarch_debug
>= 2)
1504 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1505 return gdbarch
->call_dummy_location
;
1509 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1510 int call_dummy_location
)
1512 gdbarch
->call_dummy_location
= call_dummy_location
;
1516 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1518 if (gdbarch
->call_dummy_address
== 0)
1519 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1520 if (gdbarch_debug
>= 2)
1521 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1522 return gdbarch
->call_dummy_address ();
1526 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1527 gdbarch_call_dummy_address_ftype call_dummy_address
)
1529 gdbarch
->call_dummy_address
= call_dummy_address
;
1533 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1535 if (gdbarch
->call_dummy_start_offset
== -1)
1536 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1537 if (gdbarch_debug
>= 2)
1538 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1539 return gdbarch
->call_dummy_start_offset
;
1543 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1544 CORE_ADDR call_dummy_start_offset
)
1546 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1550 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1552 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1553 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1554 if (gdbarch_debug
>= 2)
1555 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1556 return gdbarch
->call_dummy_breakpoint_offset
;
1560 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1561 CORE_ADDR call_dummy_breakpoint_offset
)
1563 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1567 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1569 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1570 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1571 if (gdbarch_debug
>= 2)
1572 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1573 return gdbarch
->call_dummy_breakpoint_offset_p
;
1577 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1578 int call_dummy_breakpoint_offset_p
)
1580 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1584 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1586 if (gdbarch
->call_dummy_length
== -1)
1587 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1588 if (gdbarch_debug
>= 2)
1589 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1590 return gdbarch
->call_dummy_length
;
1594 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1595 int call_dummy_length
)
1597 gdbarch
->call_dummy_length
= call_dummy_length
;
1601 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1603 if (gdbarch
->pc_in_call_dummy
== 0)
1604 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1605 if (gdbarch_debug
>= 2)
1606 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1607 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1611 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1612 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1614 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1618 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1620 if (gdbarch
->call_dummy_p
== -1)
1621 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1622 if (gdbarch_debug
>= 2)
1623 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1624 return gdbarch
->call_dummy_p
;
1628 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1631 gdbarch
->call_dummy_p
= call_dummy_p
;
1635 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1637 /* Skip verify of call_dummy_words, invalid_p == 0 */
1638 if (gdbarch_debug
>= 2)
1639 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1640 return gdbarch
->call_dummy_words
;
1644 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1645 LONGEST
* call_dummy_words
)
1647 gdbarch
->call_dummy_words
= call_dummy_words
;
1651 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1653 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1654 if (gdbarch_debug
>= 2)
1655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1656 return gdbarch
->sizeof_call_dummy_words
;
1660 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1661 int sizeof_call_dummy_words
)
1663 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1667 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1669 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1670 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1671 if (gdbarch_debug
>= 2)
1672 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1673 return gdbarch
->call_dummy_stack_adjust_p
;
1677 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1678 int call_dummy_stack_adjust_p
)
1680 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1684 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1686 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1687 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1688 if (gdbarch_debug
>= 2)
1689 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1690 return gdbarch
->call_dummy_stack_adjust
;
1694 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1695 int call_dummy_stack_adjust
)
1697 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1701 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
)
1703 if (gdbarch
->fix_call_dummy
== 0)
1704 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1705 if (gdbarch_debug
>= 2)
1706 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1707 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1711 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1712 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1714 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1718 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1720 if (gdbarch_debug
>= 2)
1721 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1722 return gdbarch
->believe_pcc_promotion
;
1726 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1727 int believe_pcc_promotion
)
1729 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1733 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1735 if (gdbarch_debug
>= 2)
1736 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1737 return gdbarch
->believe_pcc_promotion_type
;
1741 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1742 int believe_pcc_promotion_type
)
1744 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1748 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
1750 if (GDB_MULTI_ARCH
== 0)
1751 return default_coerce_float_to_double (formal
, actual
);
1752 if (gdbarch
->coerce_float_to_double
== 0)
1753 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1754 if (gdbarch_debug
>= 2)
1755 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
1756 return gdbarch
->coerce_float_to_double (formal
, actual
);
1760 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
1761 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
1763 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
1767 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
)
1769 if (gdbarch
->get_saved_register
== 0)
1770 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1771 if (gdbarch_debug
>= 2)
1772 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1773 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1777 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1778 gdbarch_get_saved_register_ftype get_saved_register
)
1780 gdbarch
->get_saved_register
= get_saved_register
;
1784 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1786 if (GDB_MULTI_ARCH
== 0)
1787 return generic_register_convertible_not (nr
);
1788 if (gdbarch
->register_convertible
== 0)
1789 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1790 if (gdbarch_debug
>= 2)
1791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1792 return gdbarch
->register_convertible (nr
);
1796 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1797 gdbarch_register_convertible_ftype register_convertible
)
1799 gdbarch
->register_convertible
= register_convertible
;
1803 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1805 if (gdbarch
->register_convert_to_virtual
== 0)
1806 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1807 if (gdbarch_debug
>= 2)
1808 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1809 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1813 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1814 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1816 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1820 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1822 if (gdbarch
->register_convert_to_raw
== 0)
1823 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1824 if (gdbarch_debug
>= 2)
1825 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1826 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1830 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1831 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1833 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1837 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
1839 if (GDB_MULTI_ARCH
== 0)
1840 return generic_pointer_to_address (type
, buf
);
1841 if (gdbarch
->pointer_to_address
== 0)
1842 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
1843 if (gdbarch_debug
>= 2)
1844 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
1845 return gdbarch
->pointer_to_address (type
, buf
);
1849 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
1850 gdbarch_pointer_to_address_ftype pointer_to_address
)
1852 gdbarch
->pointer_to_address
= pointer_to_address
;
1856 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
1858 if (GDB_MULTI_ARCH
== 0)
1860 generic_address_to_pointer (type
, buf
, addr
);
1863 if (gdbarch
->address_to_pointer
== 0)
1864 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
1865 if (gdbarch_debug
>= 2)
1866 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
1867 gdbarch
->address_to_pointer (type
, buf
, addr
);
1871 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
1872 gdbarch_address_to_pointer_ftype address_to_pointer
)
1874 gdbarch
->address_to_pointer
= address_to_pointer
;
1878 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
1880 if (GDB_MULTI_ARCH
== 0)
1881 return generic_return_value_on_stack_not (type
);
1882 if (gdbarch
->return_value_on_stack
== 0)
1883 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
1884 if (gdbarch_debug
>= 2)
1885 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
1886 return gdbarch
->return_value_on_stack (type
);
1890 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
1891 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
1893 gdbarch
->return_value_on_stack
= return_value_on_stack
;
1897 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1899 if (gdbarch
->extract_return_value
== 0)
1900 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1901 if (gdbarch_debug
>= 2)
1902 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1903 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1907 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1908 gdbarch_extract_return_value_ftype extract_return_value
)
1910 gdbarch
->extract_return_value
= extract_return_value
;
1914 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1916 if (gdbarch
->push_arguments
== 0)
1917 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1918 if (gdbarch_debug
>= 2)
1919 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1920 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1924 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1925 gdbarch_push_arguments_ftype push_arguments
)
1927 gdbarch
->push_arguments
= push_arguments
;
1931 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1933 if (gdbarch
->push_dummy_frame
== 0)
1934 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1935 if (gdbarch_debug
>= 2)
1936 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1937 gdbarch
->push_dummy_frame ();
1941 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
1942 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
1944 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1948 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1950 if (gdbarch
->push_return_address
== 0)
1951 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1952 if (gdbarch_debug
>= 2)
1953 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1954 return gdbarch
->push_return_address (pc
, sp
);
1958 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
1959 gdbarch_push_return_address_ftype push_return_address
)
1961 gdbarch
->push_return_address
= push_return_address
;
1965 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
1967 if (gdbarch
->pop_frame
== 0)
1968 internal_error ("gdbarch: gdbarch_pop_frame invalid");
1969 if (gdbarch_debug
>= 2)
1970 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
1971 gdbarch
->pop_frame ();
1975 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
1976 gdbarch_pop_frame_ftype pop_frame
)
1978 gdbarch
->pop_frame
= pop_frame
;
1982 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1984 if (gdbarch
->d10v_make_daddr
== 0)
1985 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
1986 if (gdbarch_debug
>= 2)
1987 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
1988 return gdbarch
->d10v_make_daddr (x
);
1992 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
1993 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
1995 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
1999 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2001 if (gdbarch
->d10v_make_iaddr
== 0)
2002 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2003 if (gdbarch_debug
>= 2)
2004 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2005 return gdbarch
->d10v_make_iaddr (x
);
2009 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2010 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2012 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2016 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2018 if (gdbarch
->d10v_daddr_p
== 0)
2019 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2020 if (gdbarch_debug
>= 2)
2021 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2022 return gdbarch
->d10v_daddr_p (x
);
2026 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2027 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2029 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2033 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2035 if (gdbarch
->d10v_iaddr_p
== 0)
2036 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2037 if (gdbarch_debug
>= 2)
2038 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2039 return gdbarch
->d10v_iaddr_p (x
);
2043 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2044 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2046 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2050 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2052 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2053 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2054 if (gdbarch_debug
>= 2)
2055 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2056 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2060 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2061 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2063 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2067 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2069 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2070 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2071 if (gdbarch_debug
>= 2)
2072 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2073 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2077 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2078 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2080 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2084 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2086 if (gdbarch
->store_struct_return
== 0)
2087 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2088 if (gdbarch_debug
>= 2)
2089 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2090 gdbarch
->store_struct_return (addr
, sp
);
2094 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2095 gdbarch_store_struct_return_ftype store_struct_return
)
2097 gdbarch
->store_struct_return
= store_struct_return
;
2101 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2103 if (gdbarch
->store_return_value
== 0)
2104 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2105 if (gdbarch_debug
>= 2)
2106 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2107 gdbarch
->store_return_value (type
, valbuf
);
2111 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2112 gdbarch_store_return_value_ftype store_return_value
)
2114 gdbarch
->store_return_value
= store_return_value
;
2118 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2120 if (gdbarch
->extract_struct_value_address
== 0)
2121 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2122 if (gdbarch_debug
>= 2)
2123 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2124 return gdbarch
->extract_struct_value_address (regbuf
);
2128 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2129 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2131 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2135 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2137 if (gdbarch
->use_struct_convention
== 0)
2138 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2139 if (gdbarch_debug
>= 2)
2140 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2141 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2145 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2146 gdbarch_use_struct_convention_ftype use_struct_convention
)
2148 gdbarch
->use_struct_convention
= use_struct_convention
;
2152 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2154 if (gdbarch
->frame_init_saved_regs
== 0)
2155 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2156 if (gdbarch_debug
>= 2)
2157 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2158 gdbarch
->frame_init_saved_regs (frame
);
2162 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2163 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2165 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2169 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2171 if (gdbarch
->init_extra_frame_info
== 0)
2172 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2173 if (gdbarch_debug
>= 2)
2174 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2175 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2179 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2180 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2182 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2186 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2188 if (gdbarch
->skip_prologue
== 0)
2189 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2190 if (gdbarch_debug
>= 2)
2191 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2192 return gdbarch
->skip_prologue (ip
);
2196 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2197 gdbarch_skip_prologue_ftype skip_prologue
)
2199 gdbarch
->skip_prologue
= skip_prologue
;
2203 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2205 if (gdbarch
->inner_than
== 0)
2206 internal_error ("gdbarch: gdbarch_inner_than invalid");
2207 if (gdbarch_debug
>= 2)
2208 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2209 return gdbarch
->inner_than (lhs
, rhs
);
2213 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2214 gdbarch_inner_than_ftype inner_than
)
2216 gdbarch
->inner_than
= inner_than
;
2220 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2222 if (GDB_MULTI_ARCH
== 0)
2223 return legacy_breakpoint_from_pc (pcptr
, lenptr
);
2224 if (gdbarch
->breakpoint_from_pc
== 0)
2225 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2226 if (gdbarch_debug
>= 2)
2227 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2228 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2232 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2233 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2235 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2239 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2241 if (GDB_MULTI_ARCH
== 0)
2242 return default_memory_insert_breakpoint (addr
, contents_cache
);
2243 if (gdbarch
->memory_insert_breakpoint
== 0)
2244 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2245 if (gdbarch_debug
>= 2)
2246 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2247 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2251 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2252 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2254 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2258 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2260 if (GDB_MULTI_ARCH
== 0)
2261 return default_memory_remove_breakpoint (addr
, contents_cache
);
2262 if (gdbarch
->memory_remove_breakpoint
== 0)
2263 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2264 if (gdbarch_debug
>= 2)
2265 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2266 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2270 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2271 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2273 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2277 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2279 if (gdbarch
->decr_pc_after_break
== -1)
2280 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2281 if (gdbarch_debug
>= 2)
2282 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2283 return gdbarch
->decr_pc_after_break
;
2287 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2288 CORE_ADDR decr_pc_after_break
)
2290 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2294 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2296 if (gdbarch
->function_start_offset
== -1)
2297 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2298 if (gdbarch_debug
>= 2)
2299 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2300 return gdbarch
->function_start_offset
;
2304 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2305 CORE_ADDR function_start_offset
)
2307 gdbarch
->function_start_offset
= function_start_offset
;
2311 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2313 if (GDB_MULTI_ARCH
== 0)
2315 generic_remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2318 if (gdbarch
->remote_translate_xfer_address
== 0)
2319 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2320 if (gdbarch_debug
>= 2)
2321 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2322 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2326 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2327 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2329 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2333 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2335 if (gdbarch
->frame_args_skip
== -1)
2336 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2337 if (gdbarch_debug
>= 2)
2338 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2339 return gdbarch
->frame_args_skip
;
2343 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2344 CORE_ADDR frame_args_skip
)
2346 gdbarch
->frame_args_skip
= frame_args_skip
;
2350 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2352 if (GDB_MULTI_ARCH
== 0)
2353 return generic_frameless_function_invocation_not (fi
);
2354 if (gdbarch
->frameless_function_invocation
== 0)
2355 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2356 if (gdbarch_debug
>= 2)
2357 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2358 return gdbarch
->frameless_function_invocation (fi
);
2362 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2363 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2365 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2369 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2371 if (gdbarch
->frame_chain
== 0)
2372 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2373 if (gdbarch_debug
>= 2)
2374 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2375 return gdbarch
->frame_chain (frame
);
2379 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2380 gdbarch_frame_chain_ftype frame_chain
)
2382 gdbarch
->frame_chain
= frame_chain
;
2386 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2388 if (gdbarch
->frame_chain_valid
== 0)
2389 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2390 if (gdbarch_debug
>= 2)
2391 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2392 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2396 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2397 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2399 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2403 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2405 if (gdbarch
->frame_saved_pc
== 0)
2406 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2407 if (gdbarch_debug
>= 2)
2408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2409 return gdbarch
->frame_saved_pc (fi
);
2413 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2414 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2416 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2420 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2422 if (gdbarch
->frame_args_address
== 0)
2423 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2424 if (gdbarch_debug
>= 2)
2425 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2426 return gdbarch
->frame_args_address (fi
);
2430 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2431 gdbarch_frame_args_address_ftype frame_args_address
)
2433 gdbarch
->frame_args_address
= frame_args_address
;
2437 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2439 if (gdbarch
->frame_locals_address
== 0)
2440 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2441 if (gdbarch_debug
>= 2)
2442 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2443 return gdbarch
->frame_locals_address (fi
);
2447 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2448 gdbarch_frame_locals_address_ftype frame_locals_address
)
2450 gdbarch
->frame_locals_address
= frame_locals_address
;
2454 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2456 if (gdbarch
->saved_pc_after_call
== 0)
2457 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2458 if (gdbarch_debug
>= 2)
2459 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2460 return gdbarch
->saved_pc_after_call (frame
);
2464 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2465 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2467 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2471 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2473 if (gdbarch
->frame_num_args
== 0)
2474 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2475 if (gdbarch_debug
>= 2)
2476 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2477 return gdbarch
->frame_num_args (frame
);
2481 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2482 gdbarch_frame_num_args_ftype frame_num_args
)
2484 gdbarch
->frame_num_args
= frame_num_args
;
2488 /* Keep a registrary of per-architecture data-pointers required by GDB
2496 struct gdbarch_data_registration
2498 gdbarch_data_ftype
*init
;
2499 struct gdbarch_data
*data
;
2500 struct gdbarch_data_registration
*next
;
2503 struct gdbarch_data_registrary
2506 struct gdbarch_data_registration
*registrations
;
2509 struct gdbarch_data_registrary gdbarch_data_registrary
=
2514 struct gdbarch_data
*
2515 register_gdbarch_data (gdbarch_data_ftype
*init
)
2517 struct gdbarch_data_registration
**curr
;
2518 for (curr
= &gdbarch_data_registrary
.registrations
;
2520 curr
= &(*curr
)->next
);
2521 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2522 (*curr
)->next
= NULL
;
2523 (*curr
)->init
= init
;
2524 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2525 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2526 return (*curr
)->data
;
2530 /* Walk through all the registered users initializing each in turn. */
2533 init_gdbarch_data (struct gdbarch
*gdbarch
)
2535 struct gdbarch_data_registration
*rego
;
2536 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2537 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2538 for (rego
= gdbarch_data_registrary
.registrations
;
2542 if (rego
->data
->index
< gdbarch
->nr_data
)
2543 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2548 /* Return the current value of the specified per-architecture
2553 struct gdbarch_data
*data
;
2555 if (data
->index
>= current_gdbarch
->nr_data
)
2556 internal_error ("gdbarch_data: request for non-existant data.");
2557 return current_gdbarch
->data
[data
->index
];
2562 /* Keep a registrary of swaped data required by GDB modules. */
2567 struct gdbarch_swap_registration
*source
;
2568 struct gdbarch_swap
*next
;
2571 struct gdbarch_swap_registration
2574 unsigned long sizeof_data
;
2575 gdbarch_swap_ftype
*init
;
2576 struct gdbarch_swap_registration
*next
;
2579 struct gdbarch_swap_registrary
2582 struct gdbarch_swap_registration
*registrations
;
2585 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2591 register_gdbarch_swap (void *data
,
2592 unsigned long sizeof_data
,
2593 gdbarch_swap_ftype
*init
)
2595 struct gdbarch_swap_registration
**rego
;
2596 for (rego
= &gdbarch_swap_registrary
.registrations
;
2598 rego
= &(*rego
)->next
);
2599 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2600 (*rego
)->next
= NULL
;
2601 (*rego
)->init
= init
;
2602 (*rego
)->data
= data
;
2603 (*rego
)->sizeof_data
= sizeof_data
;
2608 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2610 struct gdbarch_swap_registration
*rego
;
2611 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2612 for (rego
= gdbarch_swap_registrary
.registrations
;
2616 if (rego
->data
!= NULL
)
2618 (*curr
) = XMALLOC (struct gdbarch_swap
);
2619 (*curr
)->source
= rego
;
2620 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2621 (*curr
)->next
= NULL
;
2622 memset (rego
->data
, 0, rego
->sizeof_data
);
2623 curr
= &(*curr
)->next
;
2625 if (rego
->init
!= NULL
)
2631 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2633 struct gdbarch_swap
*curr
;
2634 for (curr
= gdbarch
->swap
;
2637 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2641 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2643 struct gdbarch_swap
*curr
;
2644 for (curr
= gdbarch
->swap
;
2647 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2651 /* Keep a registrary of the architectures known by GDB. */
2653 struct gdbarch_init_registration
2655 enum bfd_architecture bfd_architecture
;
2656 gdbarch_init_ftype
*init
;
2657 struct gdbarch_list
*arches
;
2658 struct gdbarch_init_registration
*next
;
2661 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2664 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2665 gdbarch_init_ftype
*init
)
2667 struct gdbarch_init_registration
**curr
;
2668 const struct bfd_arch_info
*bfd_arch_info
;
2669 /* Check that BFD reconizes this architecture */
2670 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2671 if (bfd_arch_info
== NULL
)
2673 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2675 /* Check that we haven't seen this architecture before */
2676 for (curr
= &gdbarch_init_registrary
;
2678 curr
= &(*curr
)->next
)
2680 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2681 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2682 bfd_arch_info
->printable_name
);
2686 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2687 bfd_arch_info
->printable_name
,
2690 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2691 (*curr
)->bfd_architecture
= bfd_architecture
;
2692 (*curr
)->init
= init
;
2693 (*curr
)->arches
= NULL
;
2694 (*curr
)->next
= NULL
;
2699 /* Look for an architecture using gdbarch_info. Base search on only
2700 BFD_ARCH_INFO and BYTE_ORDER. */
2702 struct gdbarch_list
*
2703 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2704 const struct gdbarch_info
*info
)
2706 for (; arches
!= NULL
; arches
= arches
->next
)
2708 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2710 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2718 /* Update the current architecture. Return ZERO if the update request
2722 gdbarch_update (struct gdbarch_info info
)
2724 struct gdbarch
*new_gdbarch
;
2725 struct gdbarch_list
**list
;
2726 struct gdbarch_init_registration
*rego
;
2728 /* Fill in any missing bits. Most important is the bfd_architecture
2729 which is used to select the target architecture. */
2730 if (info
.bfd_architecture
== bfd_arch_unknown
)
2732 if (info
.bfd_arch_info
!= NULL
)
2733 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2734 else if (info
.abfd
!= NULL
)
2735 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2736 /* FIXME - should query BFD for its default architecture. */
2738 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2740 if (info
.bfd_arch_info
== NULL
)
2742 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2743 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2745 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2747 if (info
.byte_order
== 0)
2749 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2750 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2751 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2754 info
.byte_order
= current_gdbarch
->byte_order
;
2755 /* FIXME - should query BFD for its default byte-order. */
2757 /* A default for abfd? */
2759 /* Find the target that knows about this architecture. */
2760 for (rego
= gdbarch_init_registrary
;
2761 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2766 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2772 fprintf_unfiltered (gdb_stdlog
,
2773 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2774 info
.bfd_architecture
,
2775 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2776 fprintf_unfiltered (gdb_stdlog
,
2777 "gdbarch_update: info.bfd_arch_info %s\n",
2778 (info
.bfd_arch_info
!= NULL
2779 ? info
.bfd_arch_info
->printable_name
2781 fprintf_unfiltered (gdb_stdlog
,
2782 "gdbarch_update: info.byte_order %d (%s)\n",
2784 (info
.byte_order
== BIG_ENDIAN
? "big"
2785 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2787 fprintf_unfiltered (gdb_stdlog
,
2788 "gdbarch_update: info.abfd 0x%lx\n",
2790 fprintf_unfiltered (gdb_stdlog
,
2791 "gdbarch_update: info.tdep_info 0x%lx\n",
2792 (long) info
.tdep_info
);
2795 /* Ask the target for a replacement architecture. */
2796 new_gdbarch
= rego
->init (info
, rego
->arches
);
2798 /* Did the target like it? No. Reject the change. */
2799 if (new_gdbarch
== NULL
)
2802 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2806 /* Did the architecture change? No. Do nothing. */
2807 if (current_gdbarch
== new_gdbarch
)
2810 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2812 new_gdbarch
->bfd_arch_info
->printable_name
);
2816 /* Swap all data belonging to the old target out */
2817 swapout_gdbarch_swap (current_gdbarch
);
2819 /* Is this a pre-existing architecture? Yes. Swap it in. */
2820 for (list
= ®o
->arches
;
2822 list
= &(*list
)->next
)
2824 if ((*list
)->gdbarch
== new_gdbarch
)
2827 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2829 new_gdbarch
->bfd_arch_info
->printable_name
);
2830 current_gdbarch
= new_gdbarch
;
2831 swapin_gdbarch_swap (new_gdbarch
);
2836 /* Append this new architecture to this targets list. */
2837 (*list
) = XMALLOC (struct gdbarch_list
);
2838 (*list
)->next
= NULL
;
2839 (*list
)->gdbarch
= new_gdbarch
;
2841 /* Switch to this new architecture. Dump it out. */
2842 current_gdbarch
= new_gdbarch
;
2845 fprintf_unfiltered (gdb_stdlog
,
2846 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2848 new_gdbarch
->bfd_arch_info
->printable_name
);
2852 /* Check that the newly installed architecture is valid. */
2853 verify_gdbarch (new_gdbarch
);
2855 /* Initialize the per-architecture memory (swap) areas.
2856 CURRENT_GDBARCH must be update before these modules are
2858 init_gdbarch_swap (new_gdbarch
);
2860 /* Initialize the per-architecture data-pointer of all parties that
2861 registered an interest in this architecture. CURRENT_GDBARCH
2862 must be updated before these modules are called. */
2863 init_gdbarch_data (new_gdbarch
);
2870 /* Functions to manipulate the endianness of the target. */
2872 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2873 /* compat - Catch old targets that expect a selectable byte-order to
2874 default to BIG_ENDIAN */
2875 #ifndef TARGET_BYTE_ORDER_DEFAULT
2876 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2879 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2880 #ifndef TARGET_BYTE_ORDER_DEFAULT
2881 /* compat - Catch old non byte-order selectable targets that do not
2882 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2883 TARGET_BYTE_ORDER to be used as the default. For targets that
2884 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2885 below will get a strange compiler warning. */
2886 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2889 #ifndef TARGET_BYTE_ORDER_DEFAULT
2890 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2892 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2893 int target_byte_order_auto
= 1;
2895 /* Chain containing the \"set endian\" commands. */
2896 static struct cmd_list_element
*endianlist
= NULL
;
2898 /* Called by ``show endian''. */
2900 show_endian (char *args
, int from_tty
)
2903 (TARGET_BYTE_ORDER_AUTO
2904 ? "The target endianness is set automatically (currently %s endian)\n"
2905 : "The target is assumed to be %s endian\n");
2906 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
2909 /* Called if the user enters ``set endian'' without an argument. */
2911 set_endian (char *args
, int from_tty
)
2913 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2914 show_endian (args
, from_tty
);
2917 /* Called by ``set endian big''. */
2919 set_endian_big (char *args
, int from_tty
)
2921 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2923 target_byte_order
= BIG_ENDIAN
;
2924 target_byte_order_auto
= 0;
2927 struct gdbarch_info info
;
2928 memset (&info
, 0, sizeof info
);
2929 info
.byte_order
= BIG_ENDIAN
;
2930 gdbarch_update (info
);
2935 printf_unfiltered ("Byte order is not selectable.");
2936 show_endian (args
, from_tty
);
2940 /* Called by ``set endian little''. */
2942 set_endian_little (char *args
, int from_tty
)
2944 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2946 target_byte_order
= LITTLE_ENDIAN
;
2947 target_byte_order_auto
= 0;
2950 struct gdbarch_info info
;
2951 memset (&info
, 0, sizeof info
);
2952 info
.byte_order
= LITTLE_ENDIAN
;
2953 gdbarch_update (info
);
2958 printf_unfiltered ("Byte order is not selectable.");
2959 show_endian (args
, from_tty
);
2963 /* Called by ``set endian auto''. */
2965 set_endian_auto (char *args
, int from_tty
)
2967 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2969 target_byte_order_auto
= 1;
2973 printf_unfiltered ("Byte order is not selectable.");
2974 show_endian (args
, from_tty
);
2978 /* Set the endianness from a BFD. */
2980 set_endian_from_file (bfd
*abfd
)
2982 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2986 if (bfd_big_endian (abfd
))
2989 want
= LITTLE_ENDIAN
;
2990 if (TARGET_BYTE_ORDER_AUTO
)
2991 target_byte_order
= want
;
2992 else if (TARGET_BYTE_ORDER
!= want
)
2993 warning ("%s endian file does not match %s endian target.",
2994 want
== BIG_ENDIAN
? "big" : "little",
2995 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2999 if (bfd_big_endian (abfd
)
3000 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
3001 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
3002 warning ("%s endian file does not match %s endian target.",
3003 bfd_big_endian (abfd
) ? "big" : "little",
3004 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3010 /* Functions to manipulate the architecture of the target */
3012 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3014 int target_architecture_auto
= 1;
3015 extern const struct bfd_arch_info bfd_default_arch_struct
;
3016 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
3017 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
3019 static void show_endian (char *, int);
3020 static void set_endian (char *, int);
3021 static void set_endian_big (char *, int);
3022 static void set_endian_little (char *, int);
3023 static void set_endian_auto (char *, int);
3024 static void set_endian_from_file (bfd
*);
3025 static int arch_ok (const struct bfd_arch_info
*arch
);
3026 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3027 static void show_architecture (char *, int);
3028 static void set_architecture (char *, int);
3029 static void info_architecture (char *, int);
3030 static void set_architecture_from_file (bfd
*);
3032 /* Do the real work of changing the current architecture */
3035 arch_ok (const struct bfd_arch_info
*arch
)
3037 /* Should be performing the more basic check that the binary is
3038 compatible with GDB. */
3039 /* Check with the target that the architecture is valid. */
3040 return (target_architecture_hook
== NULL
3041 || target_architecture_hook (arch
));
3045 set_arch (const struct bfd_arch_info
*arch
,
3051 if (!arch_ok (arch
))
3052 warning ("Target may not support %s architecture",
3053 arch
->printable_name
);
3054 target_architecture
= arch
;
3056 case set_arch_manual
:
3057 if (!arch_ok (arch
))
3059 printf_unfiltered ("Target does not support `%s' architecture.\n",
3060 arch
->printable_name
);
3064 target_architecture_auto
= 0;
3065 target_architecture
= arch
;
3073 /* Called if the user enters ``show architecture'' without an argument. */
3075 show_architecture (char *args
, int from_tty
)
3078 arch
= TARGET_ARCHITECTURE
->printable_name
;
3079 if (target_architecture_auto
)
3080 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3082 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3085 /* Called if the user enters ``set architecture'' with or without an
3088 set_architecture (char *args
, int from_tty
)
3092 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3094 else if (strcmp (args
, "auto") == 0)
3096 target_architecture_auto
= 1;
3098 else if (GDB_MULTI_ARCH
)
3100 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3102 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3105 struct gdbarch_info info
;
3106 memset (&info
, 0, sizeof info
);
3107 info
.bfd_arch_info
= arch
;
3108 if (gdbarch_update (info
))
3109 target_architecture_auto
= 0;
3111 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3116 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3118 set_arch (arch
, set_arch_manual
);
3120 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3124 /* Called if the user enters ``info architecture'' without an argument. */
3126 info_architecture (char *args
, int from_tty
)
3128 enum bfd_architecture a
;
3131 if (gdbarch_init_registrary
!= NULL
)
3133 struct gdbarch_init_registration
*rego
;
3134 printf_filtered ("Available architectures are:\n");
3135 for (rego
= gdbarch_init_registrary
;
3139 const struct bfd_arch_info
*ap
;
3140 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3145 printf_filtered (" %s", ap
->printable_name
);
3149 printf_filtered ("\n");
3155 printf_filtered ("There are no available architectures.\n");
3159 printf_filtered ("Available architectures are:\n");
3160 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3162 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3167 printf_filtered (" %s", ap
->printable_name
);
3171 printf_filtered ("\n");
3176 /* Set the architecture from arch/machine */
3178 set_architecture_from_arch_mach (arch
, mach
)
3179 enum bfd_architecture arch
;
3182 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3184 set_arch (wanted
, set_arch_manual
);
3186 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3189 /* Set the architecture from a BFD */
3191 set_architecture_from_file (bfd
*abfd
)
3193 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3194 if (target_architecture_auto
)
3196 set_arch (wanted
, set_arch_auto
);
3198 else if (wanted
!= target_architecture
)
3200 warning ("%s architecture file may be incompatible with %s target.",
3201 wanted
->printable_name
,
3202 target_architecture
->printable_name
);
3207 /* Misc helper functions for targets. */
3210 frame_num_args_unknown (fi
)
3211 struct frame_info
*fi
;
3218 generic_register_convertible_not (num
)
3227 /* Pointer to the target-dependent disassembly function. */
3228 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3229 disassemble_info tm_print_insn_info
;
3233 /* Set the dynamic target-system-dependant parameters (architecture,
3234 byte-order) using information found in the BFD */
3237 set_gdbarch_from_file (abfd
)
3242 struct gdbarch_info info
;
3243 memset (&info
, 0, sizeof info
);
3245 gdbarch_update (info
);
3248 set_architecture_from_file (abfd
);
3249 set_endian_from_file (abfd
);
3253 #if defined (CALL_DUMMY)
3254 /* FIXME - this should go away */
3255 LONGEST call_dummy_words
[] = CALL_DUMMY
;
3256 int sizeof_call_dummy_words
= sizeof (call_dummy_words
);
3260 /* Initialize the current architecture. */
3262 initialize_current_architecture ()
3266 struct gdbarch_init_registration
*rego
;
3267 const struct bfd_arch_info
*chosen
= NULL
;
3268 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3270 const struct bfd_arch_info
*ap
3271 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3273 /* Choose the first architecture alphabetically. */
3275 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3281 struct gdbarch_info info
;
3282 memset (&info
, 0, sizeof info
);
3283 info
.bfd_arch_info
= chosen
;
3284 gdbarch_update (info
);
3289 extern void _initialize_gdbarch (void);
3291 _initialize_gdbarch ()
3293 struct cmd_list_element
*c
;
3295 add_prefix_cmd ("endian", class_support
, set_endian
,
3296 "Set endianness of target.",
3297 &endianlist
, "set endian ", 0, &setlist
);
3298 add_cmd ("big", class_support
, set_endian_big
,
3299 "Set target as being big endian.", &endianlist
);
3300 add_cmd ("little", class_support
, set_endian_little
,
3301 "Set target as being little endian.", &endianlist
);
3302 add_cmd ("auto", class_support
, set_endian_auto
,
3303 "Select target endianness automatically.", &endianlist
);
3304 add_cmd ("endian", class_support
, show_endian
,
3305 "Show endianness of target.", &showlist
);
3307 add_cmd ("architecture", class_support
, set_architecture
,
3308 "Set architecture of target.", &setlist
);
3309 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3310 add_cmd ("architecture", class_support
, show_architecture
,
3311 "Show architecture of target.", &showlist
);
3312 add_cmd ("architecture", class_support
, info_architecture
,
3313 "List supported target architectures", &infolist
);
3315 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3316 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3317 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3318 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3319 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3321 add_show_from_set (add_set_cmd ("arch",
3324 (char *)&gdbarch_debug
,
3325 "Set architecture debugging.\n\
3326 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3328 c
= add_set_cmd ("archdebug",
3331 (char *)&gdbarch_debug
,
3332 "Set architecture debugging.\n\
3333 When non-zero, architecture debugging is enabled.", &setlist
);
3335 deprecate_cmd (c
, "set debug arch");
3336 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");