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
;
216 gdbarch_stack_align_ftype
*stack_align
;
220 /* The default architecture uses host values (for want of a better
223 extern const struct bfd_arch_info bfd_default_arch_struct
;
225 struct gdbarch startup_gdbarch
= {
226 /* basic architecture information */
227 &bfd_default_arch_struct
,
229 /* target specific vector */
231 /*per-architecture data-pointers and swap regions */
233 /* Multi-arch values */
239 8 * sizeof (LONGEST
),
242 8 * sizeof (long double),
280 generic_get_saved_register
,
322 /* startup_gdbarch() */
324 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
327 /* Create a new ``struct gdbarch'' based in information provided by
328 ``struct gdbarch_info''. */
331 gdbarch_alloc (const struct gdbarch_info
*info
,
332 struct gdbarch_tdep
*tdep
)
334 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
335 memset (gdbarch
, 0, sizeof (*gdbarch
));
337 gdbarch
->tdep
= tdep
;
339 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
340 gdbarch
->byte_order
= info
->byte_order
;
342 /* Force the explicit initialization of these. */
343 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
344 gdbarch
->num_regs
= -1;
345 gdbarch
->sp_regnum
= -1;
346 gdbarch
->fp_regnum
= -1;
347 gdbarch
->pc_regnum
= -1;
348 gdbarch
->register_name
= legacy_register_name
;
349 gdbarch
->register_size
= -1;
350 gdbarch
->register_bytes
= -1;
351 gdbarch
->max_register_raw_size
= -1;
352 gdbarch
->max_register_virtual_size
= -1;
353 gdbarch
->use_generic_dummy_frames
= -1;
354 gdbarch
->call_dummy_start_offset
= -1;
355 gdbarch
->call_dummy_breakpoint_offset
= -1;
356 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
357 gdbarch
->call_dummy_length
= -1;
358 gdbarch
->call_dummy_p
= -1;
359 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
360 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
361 gdbarch
->call_dummy_stack_adjust_p
= -1;
362 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
363 gdbarch
->register_convertible
= generic_register_convertible_not
;
364 gdbarch
->pointer_to_address
= generic_pointer_to_address
;
365 gdbarch
->address_to_pointer
= generic_address_to_pointer
;
366 gdbarch
->return_value_on_stack
= generic_return_value_on_stack_not
;
367 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
368 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
369 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
370 gdbarch
->decr_pc_after_break
= -1;
371 gdbarch
->function_start_offset
= -1;
372 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
373 gdbarch
->frame_args_skip
= -1;
374 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
375 /* gdbarch_alloc() */
381 /* Free a gdbarch struct. This should never happen in normal
382 operation --- once you've created a gdbarch, you keep it around.
383 However, if an architecture's init function encounters an error
384 building the structure, it may need to clean up a partially
385 constructed gdbarch. */
387 gdbarch_free (struct gdbarch
*arch
)
389 /* At the moment, this is trivial. */
394 /* Ensure that all values in a GDBARCH are reasonable. */
397 verify_gdbarch (struct gdbarch
*gdbarch
)
399 /* Only perform sanity checks on a multi-arch target. */
400 if (GDB_MULTI_ARCH
<= 0)
403 if (gdbarch
->byte_order
== 0)
404 internal_error ("verify_gdbarch: byte-order unset");
405 if (gdbarch
->bfd_arch_info
== NULL
)
406 internal_error ("verify_gdbarch: bfd_arch_info unset");
407 /* Check those that need to be defined for the given multi-arch level. */
408 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
409 if ((GDB_MULTI_ARCH
>= 1)
410 && (gdbarch
->ptr_bit
== 0))
411 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
412 if ((GDB_MULTI_ARCH
>= 1)
413 && (gdbarch
->short_bit
== 0))
414 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
415 if ((GDB_MULTI_ARCH
>= 1)
416 && (gdbarch
->int_bit
== 0))
417 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
418 if ((GDB_MULTI_ARCH
>= 1)
419 && (gdbarch
->long_bit
== 0))
420 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
421 if ((GDB_MULTI_ARCH
>= 1)
422 && (gdbarch
->long_long_bit
== 0))
423 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
424 if ((GDB_MULTI_ARCH
>= 1)
425 && (gdbarch
->float_bit
== 0))
426 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
427 if ((GDB_MULTI_ARCH
>= 1)
428 && (gdbarch
->double_bit
== 0))
429 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
430 if ((GDB_MULTI_ARCH
>= 1)
431 && (gdbarch
->long_double_bit
== 0))
432 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
433 /* Skip verify of ieee_float, invalid_p == 0 */
434 if ((GDB_MULTI_ARCH
>= 1)
435 && (gdbarch
->read_pc
== 0))
436 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
437 if ((GDB_MULTI_ARCH
>= 1)
438 && (gdbarch
->write_pc
== 0))
439 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
440 if ((GDB_MULTI_ARCH
>= 1)
441 && (gdbarch
->read_fp
== 0))
442 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
443 if ((GDB_MULTI_ARCH
>= 1)
444 && (gdbarch
->write_fp
== 0))
445 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
446 if ((GDB_MULTI_ARCH
>= 1)
447 && (gdbarch
->read_sp
== 0))
448 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
449 if ((GDB_MULTI_ARCH
>= 1)
450 && (gdbarch
->write_sp
== 0))
451 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
452 if ((GDB_MULTI_ARCH
>= 2)
453 && (gdbarch
->num_regs
== -1))
454 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
455 if ((GDB_MULTI_ARCH
>= 2)
456 && (gdbarch
->sp_regnum
== -1))
457 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
458 if ((GDB_MULTI_ARCH
>= 2)
459 && (gdbarch
->fp_regnum
== -1))
460 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
461 if ((GDB_MULTI_ARCH
>= 2)
462 && (gdbarch
->pc_regnum
== -1))
463 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
464 /* Skip verify of register_name, invalid_p == 0 */
465 if ((GDB_MULTI_ARCH
>= 2)
466 && (gdbarch
->register_size
== -1))
467 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
468 if ((GDB_MULTI_ARCH
>= 2)
469 && (gdbarch
->register_bytes
== -1))
470 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
471 if ((GDB_MULTI_ARCH
>= 2)
472 && (gdbarch
->register_byte
== 0))
473 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
474 if ((GDB_MULTI_ARCH
>= 2)
475 && (gdbarch
->register_raw_size
== 0))
476 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
477 if ((GDB_MULTI_ARCH
>= 2)
478 && (gdbarch
->max_register_raw_size
== -1))
479 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
480 if ((GDB_MULTI_ARCH
>= 2)
481 && (gdbarch
->register_virtual_size
== 0))
482 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
483 if ((GDB_MULTI_ARCH
>= 2)
484 && (gdbarch
->max_register_virtual_size
== -1))
485 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
486 if ((GDB_MULTI_ARCH
>= 2)
487 && (gdbarch
->register_virtual_type
== 0))
488 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
489 if ((GDB_MULTI_ARCH
>= 1)
490 && (gdbarch
->use_generic_dummy_frames
== -1))
491 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
492 if ((GDB_MULTI_ARCH
>= 2)
493 && (gdbarch
->call_dummy_location
== 0))
494 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
495 if ((GDB_MULTI_ARCH
>= 2)
496 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
497 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
498 if ((GDB_MULTI_ARCH
>= 2)
499 && (gdbarch
->call_dummy_start_offset
== -1))
500 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
501 if ((GDB_MULTI_ARCH
>= 2)
502 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
503 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
504 if ((GDB_MULTI_ARCH
>= 1)
505 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
506 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
507 if ((GDB_MULTI_ARCH
>= 2)
508 && (gdbarch
->call_dummy_length
== -1))
509 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
510 if ((GDB_MULTI_ARCH
>= 2)
511 && (gdbarch
->pc_in_call_dummy
== 0))
512 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
513 if ((GDB_MULTI_ARCH
>= 1)
514 && (gdbarch
->call_dummy_p
== -1))
515 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
516 /* Skip verify of call_dummy_words, invalid_p == 0 */
517 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
518 if ((GDB_MULTI_ARCH
>= 1)
519 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
520 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
521 if ((GDB_MULTI_ARCH
>= 2)
522 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
523 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
524 if ((GDB_MULTI_ARCH
>= 2)
525 && (gdbarch
->fix_call_dummy
== 0))
526 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
527 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
528 if ((GDB_MULTI_ARCH
>= 1)
529 && (gdbarch
->get_saved_register
== 0))
530 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
531 /* Skip verify of register_convertible, invalid_p == 0 */
532 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
533 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
534 /* Skip verify of pointer_to_address, invalid_p == 0 */
535 /* Skip verify of address_to_pointer, invalid_p == 0 */
536 /* Skip verify of return_value_on_stack, invalid_p == 0 */
537 if ((GDB_MULTI_ARCH
>= 2)
538 && (gdbarch
->extract_return_value
== 0))
539 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
540 if ((GDB_MULTI_ARCH
>= 1)
541 && (gdbarch
->push_arguments
== 0))
542 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
543 if ((GDB_MULTI_ARCH
>= 2)
544 && (gdbarch
->push_dummy_frame
== 0))
545 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
546 if ((GDB_MULTI_ARCH
>= 1)
547 && (gdbarch
->push_return_address
== 0))
548 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
549 if ((GDB_MULTI_ARCH
>= 2)
550 && (gdbarch
->pop_frame
== 0))
551 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
552 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
553 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
554 if ((GDB_MULTI_ARCH
>= 2)
555 && (gdbarch
->d10v_daddr_p
== 0))
556 internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
557 if ((GDB_MULTI_ARCH
>= 2)
558 && (gdbarch
->d10v_iaddr_p
== 0))
559 internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
560 if ((GDB_MULTI_ARCH
>= 2)
561 && (gdbarch
->d10v_convert_daddr_to_raw
== 0))
562 internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
563 if ((GDB_MULTI_ARCH
>= 2)
564 && (gdbarch
->d10v_convert_iaddr_to_raw
== 0))
565 internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
566 if ((GDB_MULTI_ARCH
>= 2)
567 && (gdbarch
->store_struct_return
== 0))
568 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
569 if ((GDB_MULTI_ARCH
>= 2)
570 && (gdbarch
->store_return_value
== 0))
571 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
572 if ((GDB_MULTI_ARCH
>= 2)
573 && (gdbarch
->extract_struct_value_address
== 0))
574 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
575 if ((GDB_MULTI_ARCH
>= 2)
576 && (gdbarch
->use_struct_convention
== 0))
577 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
578 if ((GDB_MULTI_ARCH
>= 2)
579 && (gdbarch
->frame_init_saved_regs
== 0))
580 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
581 if ((GDB_MULTI_ARCH
>= 2)
582 && (gdbarch
->init_extra_frame_info
== 0))
583 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
584 if ((GDB_MULTI_ARCH
>= 2)
585 && (gdbarch
->skip_prologue
== 0))
586 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
587 if ((GDB_MULTI_ARCH
>= 2)
588 && (gdbarch
->inner_than
== 0))
589 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
590 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
591 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
592 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
593 if ((GDB_MULTI_ARCH
>= 2)
594 && (gdbarch
->decr_pc_after_break
== -1))
595 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
596 if ((GDB_MULTI_ARCH
>= 2)
597 && (gdbarch
->function_start_offset
== -1))
598 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
599 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
600 if ((GDB_MULTI_ARCH
>= 2)
601 && (gdbarch
->frame_args_skip
== -1))
602 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
603 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
604 if ((GDB_MULTI_ARCH
>= 2)
605 && (gdbarch
->frame_chain
== 0))
606 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
607 if ((GDB_MULTI_ARCH
>= 1)
608 && (gdbarch
->frame_chain_valid
== 0))
609 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
610 if ((GDB_MULTI_ARCH
>= 2)
611 && (gdbarch
->frame_saved_pc
== 0))
612 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
613 if ((GDB_MULTI_ARCH
>= 2)
614 && (gdbarch
->frame_args_address
== 0))
615 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
616 if ((GDB_MULTI_ARCH
>= 2)
617 && (gdbarch
->frame_locals_address
== 0))
618 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
619 if ((GDB_MULTI_ARCH
>= 2)
620 && (gdbarch
->saved_pc_after_call
== 0))
621 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
622 if ((GDB_MULTI_ARCH
>= 2)
623 && (gdbarch
->frame_num_args
== 0))
624 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
625 /* Skip verify of stack_align, has predicate */
629 /* Print out the details of the current architecture. */
634 if (TARGET_ARCHITECTURE
!= NULL
)
635 fprintf_unfiltered (gdb_stdlog
,
636 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
637 TARGET_ARCHITECTURE
->printable_name
);
638 fprintf_unfiltered (gdb_stdlog
,
639 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
640 (long) TARGET_BYTE_ORDER
);
641 fprintf_unfiltered (gdb_stdlog
,
642 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
643 (long) TARGET_BFD_VMA_BIT
);
644 fprintf_unfiltered (gdb_stdlog
,
645 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
646 (long) TARGET_PTR_BIT
);
647 fprintf_unfiltered (gdb_stdlog
,
648 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
649 (long) TARGET_SHORT_BIT
);
650 fprintf_unfiltered (gdb_stdlog
,
651 "gdbarch_update: TARGET_INT_BIT = %ld\n",
652 (long) TARGET_INT_BIT
);
653 fprintf_unfiltered (gdb_stdlog
,
654 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
655 (long) TARGET_LONG_BIT
);
656 fprintf_unfiltered (gdb_stdlog
,
657 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
658 (long) TARGET_LONG_LONG_BIT
);
659 fprintf_unfiltered (gdb_stdlog
,
660 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
661 (long) TARGET_FLOAT_BIT
);
662 fprintf_unfiltered (gdb_stdlog
,
663 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
664 (long) TARGET_DOUBLE_BIT
);
665 fprintf_unfiltered (gdb_stdlog
,
666 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
667 (long) TARGET_LONG_DOUBLE_BIT
);
668 fprintf_unfiltered (gdb_stdlog
,
669 "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 ()*/);
961 fprintf_unfiltered (gdb_stdlog
,
962 "gdbarch_update: STACK_ALIGN = 0x%08lx\n",
963 (long) current_gdbarch
->stack_align
967 struct gdbarch_tdep
*
968 gdbarch_tdep (struct gdbarch
*gdbarch
)
970 if (gdbarch_debug
>= 2)
971 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
972 return gdbarch
->tdep
;
976 const struct bfd_arch_info
*
977 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
979 if (gdbarch_debug
>= 2)
980 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
981 return gdbarch
->bfd_arch_info
;
985 gdbarch_byte_order (struct gdbarch
*gdbarch
)
987 if (gdbarch_debug
>= 2)
988 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
989 return gdbarch
->byte_order
;
993 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
995 if (GDB_MULTI_ARCH
== 0)
996 return TARGET_ARCHITECTURE
->bits_per_address
;
997 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
998 if (gdbarch_debug
>= 2)
999 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1000 return gdbarch
->bfd_vma_bit
;
1004 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1007 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1011 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1013 if (gdbarch
->ptr_bit
== 0)
1014 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
1015 if (gdbarch_debug
>= 2)
1016 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1017 return gdbarch
->ptr_bit
;
1021 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1024 gdbarch
->ptr_bit
= ptr_bit
;
1028 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1030 if (gdbarch
->short_bit
== 0)
1031 internal_error ("gdbarch: gdbarch_short_bit invalid");
1032 if (gdbarch_debug
>= 2)
1033 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1034 return gdbarch
->short_bit
;
1038 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1041 gdbarch
->short_bit
= short_bit
;
1045 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1047 if (gdbarch
->int_bit
== 0)
1048 internal_error ("gdbarch: gdbarch_int_bit invalid");
1049 if (gdbarch_debug
>= 2)
1050 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1051 return gdbarch
->int_bit
;
1055 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1058 gdbarch
->int_bit
= int_bit
;
1062 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1064 if (gdbarch
->long_bit
== 0)
1065 internal_error ("gdbarch: gdbarch_long_bit invalid");
1066 if (gdbarch_debug
>= 2)
1067 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1068 return gdbarch
->long_bit
;
1072 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1075 gdbarch
->long_bit
= long_bit
;
1079 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1081 if (gdbarch
->long_long_bit
== 0)
1082 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1083 if (gdbarch_debug
>= 2)
1084 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1085 return gdbarch
->long_long_bit
;
1089 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1092 gdbarch
->long_long_bit
= long_long_bit
;
1096 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1098 if (gdbarch
->float_bit
== 0)
1099 internal_error ("gdbarch: gdbarch_float_bit invalid");
1100 if (gdbarch_debug
>= 2)
1101 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1102 return gdbarch
->float_bit
;
1106 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1109 gdbarch
->float_bit
= float_bit
;
1113 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1115 if (gdbarch
->double_bit
== 0)
1116 internal_error ("gdbarch: gdbarch_double_bit invalid");
1117 if (gdbarch_debug
>= 2)
1118 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1119 return gdbarch
->double_bit
;
1123 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1126 gdbarch
->double_bit
= double_bit
;
1130 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1132 if (gdbarch
->long_double_bit
== 0)
1133 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1134 if (gdbarch_debug
>= 2)
1135 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1136 return gdbarch
->long_double_bit
;
1140 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1141 int long_double_bit
)
1143 gdbarch
->long_double_bit
= long_double_bit
;
1147 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1149 /* Skip verify of ieee_float, invalid_p == 0 */
1150 if (gdbarch_debug
>= 2)
1151 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1152 return gdbarch
->ieee_float
;
1156 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1159 gdbarch
->ieee_float
= ieee_float
;
1163 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1165 if (gdbarch
->read_pc
== 0)
1166 internal_error ("gdbarch: gdbarch_read_pc invalid");
1167 if (gdbarch_debug
>= 2)
1168 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1169 return gdbarch
->read_pc (pid
);
1173 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1174 gdbarch_read_pc_ftype read_pc
)
1176 gdbarch
->read_pc
= read_pc
;
1180 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1182 if (gdbarch
->write_pc
== 0)
1183 internal_error ("gdbarch: gdbarch_write_pc invalid");
1184 if (gdbarch_debug
>= 2)
1185 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1186 gdbarch
->write_pc (val
, pid
);
1190 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1191 gdbarch_write_pc_ftype write_pc
)
1193 gdbarch
->write_pc
= write_pc
;
1197 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1199 if (gdbarch
->read_fp
== 0)
1200 internal_error ("gdbarch: gdbarch_read_fp invalid");
1201 if (gdbarch_debug
>= 2)
1202 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1203 return gdbarch
->read_fp ();
1207 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1208 gdbarch_read_fp_ftype read_fp
)
1210 gdbarch
->read_fp
= read_fp
;
1214 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1216 if (gdbarch
->write_fp
== 0)
1217 internal_error ("gdbarch: gdbarch_write_fp invalid");
1218 if (gdbarch_debug
>= 2)
1219 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1220 gdbarch
->write_fp (val
);
1224 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1225 gdbarch_write_fp_ftype write_fp
)
1227 gdbarch
->write_fp
= write_fp
;
1231 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1233 if (gdbarch
->read_sp
== 0)
1234 internal_error ("gdbarch: gdbarch_read_sp invalid");
1235 if (gdbarch_debug
>= 2)
1236 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1237 return gdbarch
->read_sp ();
1241 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1242 gdbarch_read_sp_ftype read_sp
)
1244 gdbarch
->read_sp
= read_sp
;
1248 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1250 if (gdbarch
->write_sp
== 0)
1251 internal_error ("gdbarch: gdbarch_write_sp invalid");
1252 if (gdbarch_debug
>= 2)
1253 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1254 gdbarch
->write_sp (val
);
1258 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1259 gdbarch_write_sp_ftype write_sp
)
1261 gdbarch
->write_sp
= write_sp
;
1265 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1267 if (gdbarch
->num_regs
== -1)
1268 internal_error ("gdbarch: gdbarch_num_regs invalid");
1269 if (gdbarch_debug
>= 2)
1270 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1271 return gdbarch
->num_regs
;
1275 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1278 gdbarch
->num_regs
= num_regs
;
1282 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1284 if (gdbarch
->sp_regnum
== -1)
1285 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1286 if (gdbarch_debug
>= 2)
1287 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1288 return gdbarch
->sp_regnum
;
1292 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1295 gdbarch
->sp_regnum
= sp_regnum
;
1299 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1301 if (gdbarch
->fp_regnum
== -1)
1302 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1303 if (gdbarch_debug
>= 2)
1304 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1305 return gdbarch
->fp_regnum
;
1309 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1312 gdbarch
->fp_regnum
= fp_regnum
;
1316 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1318 if (gdbarch
->pc_regnum
== -1)
1319 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1320 if (gdbarch_debug
>= 2)
1321 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1322 return gdbarch
->pc_regnum
;
1326 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1329 gdbarch
->pc_regnum
= pc_regnum
;
1333 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1335 if (GDB_MULTI_ARCH
== 0)
1336 return legacy_register_name (regnr
);
1337 if (gdbarch
->register_name
== 0)
1338 internal_error ("gdbarch: gdbarch_register_name invalid");
1339 if (gdbarch_debug
>= 2)
1340 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1341 return gdbarch
->register_name (regnr
);
1345 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1346 gdbarch_register_name_ftype register_name
)
1348 gdbarch
->register_name
= register_name
;
1352 gdbarch_register_size (struct gdbarch
*gdbarch
)
1354 if (gdbarch
->register_size
== -1)
1355 internal_error ("gdbarch: gdbarch_register_size invalid");
1356 if (gdbarch_debug
>= 2)
1357 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1358 return gdbarch
->register_size
;
1362 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1365 gdbarch
->register_size
= register_size
;
1369 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1371 if (gdbarch
->register_bytes
== -1)
1372 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1373 if (gdbarch_debug
>= 2)
1374 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1375 return gdbarch
->register_bytes
;
1379 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1382 gdbarch
->register_bytes
= register_bytes
;
1386 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1388 if (gdbarch
->register_byte
== 0)
1389 internal_error ("gdbarch: gdbarch_register_byte invalid");
1390 if (gdbarch_debug
>= 2)
1391 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1392 return gdbarch
->register_byte (reg_nr
);
1396 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1397 gdbarch_register_byte_ftype register_byte
)
1399 gdbarch
->register_byte
= register_byte
;
1403 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1405 if (gdbarch
->register_raw_size
== 0)
1406 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1407 if (gdbarch_debug
>= 2)
1408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1409 return gdbarch
->register_raw_size (reg_nr
);
1413 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1414 gdbarch_register_raw_size_ftype register_raw_size
)
1416 gdbarch
->register_raw_size
= register_raw_size
;
1420 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1422 if (gdbarch
->max_register_raw_size
== -1)
1423 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1424 if (gdbarch_debug
>= 2)
1425 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1426 return gdbarch
->max_register_raw_size
;
1430 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1431 int max_register_raw_size
)
1433 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1437 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1439 if (gdbarch
->register_virtual_size
== 0)
1440 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1441 if (gdbarch_debug
>= 2)
1442 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1443 return gdbarch
->register_virtual_size (reg_nr
);
1447 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1448 gdbarch_register_virtual_size_ftype register_virtual_size
)
1450 gdbarch
->register_virtual_size
= register_virtual_size
;
1454 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1456 if (gdbarch
->max_register_virtual_size
== -1)
1457 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1458 if (gdbarch_debug
>= 2)
1459 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1460 return gdbarch
->max_register_virtual_size
;
1464 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1465 int max_register_virtual_size
)
1467 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1471 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1473 if (gdbarch
->register_virtual_type
== 0)
1474 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1475 if (gdbarch_debug
>= 2)
1476 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1477 return gdbarch
->register_virtual_type (reg_nr
);
1481 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1482 gdbarch_register_virtual_type_ftype register_virtual_type
)
1484 gdbarch
->register_virtual_type
= register_virtual_type
;
1488 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1490 if (gdbarch
->use_generic_dummy_frames
== -1)
1491 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1492 if (gdbarch_debug
>= 2)
1493 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1494 return gdbarch
->use_generic_dummy_frames
;
1498 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1499 int use_generic_dummy_frames
)
1501 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1505 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1507 if (gdbarch
->call_dummy_location
== 0)
1508 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1509 if (gdbarch_debug
>= 2)
1510 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1511 return gdbarch
->call_dummy_location
;
1515 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1516 int call_dummy_location
)
1518 gdbarch
->call_dummy_location
= call_dummy_location
;
1522 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1524 if (gdbarch
->call_dummy_address
== 0)
1525 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1526 if (gdbarch_debug
>= 2)
1527 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1528 return gdbarch
->call_dummy_address ();
1532 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1533 gdbarch_call_dummy_address_ftype call_dummy_address
)
1535 gdbarch
->call_dummy_address
= call_dummy_address
;
1539 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1541 if (gdbarch
->call_dummy_start_offset
== -1)
1542 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1543 if (gdbarch_debug
>= 2)
1544 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1545 return gdbarch
->call_dummy_start_offset
;
1549 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1550 CORE_ADDR call_dummy_start_offset
)
1552 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1556 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1558 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1559 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1560 if (gdbarch_debug
>= 2)
1561 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1562 return gdbarch
->call_dummy_breakpoint_offset
;
1566 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1567 CORE_ADDR call_dummy_breakpoint_offset
)
1569 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1573 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1575 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1576 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1577 if (gdbarch_debug
>= 2)
1578 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1579 return gdbarch
->call_dummy_breakpoint_offset_p
;
1583 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1584 int call_dummy_breakpoint_offset_p
)
1586 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1590 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1592 if (gdbarch
->call_dummy_length
== -1)
1593 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1594 if (gdbarch_debug
>= 2)
1595 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1596 return gdbarch
->call_dummy_length
;
1600 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1601 int call_dummy_length
)
1603 gdbarch
->call_dummy_length
= call_dummy_length
;
1607 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1609 if (gdbarch
->pc_in_call_dummy
== 0)
1610 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1611 if (gdbarch_debug
>= 2)
1612 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1613 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1617 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1618 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1620 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1624 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1626 if (gdbarch
->call_dummy_p
== -1)
1627 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1628 if (gdbarch_debug
>= 2)
1629 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1630 return gdbarch
->call_dummy_p
;
1634 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1637 gdbarch
->call_dummy_p
= call_dummy_p
;
1641 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1643 if (GDB_MULTI_ARCH
== 0)
1644 return legacy_call_dummy_words
;
1645 /* Skip verify of call_dummy_words, invalid_p == 0 */
1646 if (gdbarch_debug
>= 2)
1647 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1648 return gdbarch
->call_dummy_words
;
1652 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1653 LONGEST
* call_dummy_words
)
1655 gdbarch
->call_dummy_words
= call_dummy_words
;
1659 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1661 if (GDB_MULTI_ARCH
== 0)
1662 return legacy_sizeof_call_dummy_words
;
1663 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1664 if (gdbarch_debug
>= 2)
1665 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1666 return gdbarch
->sizeof_call_dummy_words
;
1670 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1671 int sizeof_call_dummy_words
)
1673 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1677 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1679 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1680 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1681 if (gdbarch_debug
>= 2)
1682 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1683 return gdbarch
->call_dummy_stack_adjust_p
;
1687 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1688 int call_dummy_stack_adjust_p
)
1690 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1694 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1696 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1697 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1698 if (gdbarch_debug
>= 2)
1699 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1700 return gdbarch
->call_dummy_stack_adjust
;
1704 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1705 int call_dummy_stack_adjust
)
1707 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1711 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
)
1713 if (gdbarch
->fix_call_dummy
== 0)
1714 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1715 if (gdbarch_debug
>= 2)
1716 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1717 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1721 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1722 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1724 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1728 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1730 if (gdbarch_debug
>= 2)
1731 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1732 return gdbarch
->believe_pcc_promotion
;
1736 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1737 int believe_pcc_promotion
)
1739 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1743 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1745 if (gdbarch_debug
>= 2)
1746 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1747 return gdbarch
->believe_pcc_promotion_type
;
1751 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1752 int believe_pcc_promotion_type
)
1754 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1758 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
1760 if (GDB_MULTI_ARCH
== 0)
1761 return default_coerce_float_to_double (formal
, actual
);
1762 if (gdbarch
->coerce_float_to_double
== 0)
1763 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1764 if (gdbarch_debug
>= 2)
1765 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
1766 return gdbarch
->coerce_float_to_double (formal
, actual
);
1770 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
1771 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
1773 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
1777 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
)
1779 if (gdbarch
->get_saved_register
== 0)
1780 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1781 if (gdbarch_debug
>= 2)
1782 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1783 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1787 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1788 gdbarch_get_saved_register_ftype get_saved_register
)
1790 gdbarch
->get_saved_register
= get_saved_register
;
1794 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1796 if (GDB_MULTI_ARCH
== 0)
1797 return generic_register_convertible_not (nr
);
1798 if (gdbarch
->register_convertible
== 0)
1799 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1800 if (gdbarch_debug
>= 2)
1801 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1802 return gdbarch
->register_convertible (nr
);
1806 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1807 gdbarch_register_convertible_ftype register_convertible
)
1809 gdbarch
->register_convertible
= register_convertible
;
1813 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1815 if (gdbarch
->register_convert_to_virtual
== 0)
1816 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1817 if (gdbarch_debug
>= 2)
1818 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1819 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1823 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1824 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1826 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1830 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1832 if (gdbarch
->register_convert_to_raw
== 0)
1833 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1834 if (gdbarch_debug
>= 2)
1835 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1836 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1840 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1841 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1843 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1847 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
1849 if (GDB_MULTI_ARCH
== 0)
1850 return generic_pointer_to_address (type
, buf
);
1851 if (gdbarch
->pointer_to_address
== 0)
1852 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
1853 if (gdbarch_debug
>= 2)
1854 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
1855 return gdbarch
->pointer_to_address (type
, buf
);
1859 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
1860 gdbarch_pointer_to_address_ftype pointer_to_address
)
1862 gdbarch
->pointer_to_address
= pointer_to_address
;
1866 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
1868 if (GDB_MULTI_ARCH
== 0)
1870 generic_address_to_pointer (type
, buf
, addr
);
1873 if (gdbarch
->address_to_pointer
== 0)
1874 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
1875 if (gdbarch_debug
>= 2)
1876 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
1877 gdbarch
->address_to_pointer (type
, buf
, addr
);
1881 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
1882 gdbarch_address_to_pointer_ftype address_to_pointer
)
1884 gdbarch
->address_to_pointer
= address_to_pointer
;
1888 gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
, struct type
*type
)
1890 if (GDB_MULTI_ARCH
== 0)
1891 return generic_return_value_on_stack_not (type
);
1892 if (gdbarch
->return_value_on_stack
== 0)
1893 internal_error ("gdbarch: gdbarch_return_value_on_stack invalid");
1894 if (gdbarch_debug
>= 2)
1895 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value_on_stack called\n");
1896 return gdbarch
->return_value_on_stack (type
);
1900 set_gdbarch_return_value_on_stack (struct gdbarch
*gdbarch
,
1901 gdbarch_return_value_on_stack_ftype return_value_on_stack
)
1903 gdbarch
->return_value_on_stack
= return_value_on_stack
;
1907 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1909 if (gdbarch
->extract_return_value
== 0)
1910 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1911 if (gdbarch_debug
>= 2)
1912 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1913 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1917 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1918 gdbarch_extract_return_value_ftype extract_return_value
)
1920 gdbarch
->extract_return_value
= extract_return_value
;
1924 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1926 if (gdbarch
->push_arguments
== 0)
1927 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1928 if (gdbarch_debug
>= 2)
1929 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1930 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1934 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1935 gdbarch_push_arguments_ftype push_arguments
)
1937 gdbarch
->push_arguments
= push_arguments
;
1941 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1943 if (gdbarch
->push_dummy_frame
== 0)
1944 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1945 if (gdbarch_debug
>= 2)
1946 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1947 gdbarch
->push_dummy_frame ();
1951 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
1952 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
1954 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1958 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1960 if (gdbarch
->push_return_address
== 0)
1961 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1962 if (gdbarch_debug
>= 2)
1963 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1964 return gdbarch
->push_return_address (pc
, sp
);
1968 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
1969 gdbarch_push_return_address_ftype push_return_address
)
1971 gdbarch
->push_return_address
= push_return_address
;
1975 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
1977 if (gdbarch
->pop_frame
== 0)
1978 internal_error ("gdbarch: gdbarch_pop_frame invalid");
1979 if (gdbarch_debug
>= 2)
1980 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
1981 gdbarch
->pop_frame ();
1985 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
1986 gdbarch_pop_frame_ftype pop_frame
)
1988 gdbarch
->pop_frame
= pop_frame
;
1992 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1994 if (gdbarch
->d10v_make_daddr
== 0)
1995 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
1996 if (gdbarch_debug
>= 2)
1997 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
1998 return gdbarch
->d10v_make_daddr (x
);
2002 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
2003 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
2005 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
2009 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2011 if (gdbarch
->d10v_make_iaddr
== 0)
2012 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
2013 if (gdbarch_debug
>= 2)
2014 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
2015 return gdbarch
->d10v_make_iaddr (x
);
2019 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
2020 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
2022 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
2026 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2028 if (gdbarch
->d10v_daddr_p
== 0)
2029 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
2030 if (gdbarch_debug
>= 2)
2031 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
2032 return gdbarch
->d10v_daddr_p (x
);
2036 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
2037 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2039 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2043 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2045 if (gdbarch
->d10v_iaddr_p
== 0)
2046 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2047 if (gdbarch_debug
>= 2)
2048 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2049 return gdbarch
->d10v_iaddr_p (x
);
2053 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2054 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2056 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2060 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2062 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2063 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2064 if (gdbarch_debug
>= 2)
2065 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2066 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2070 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2071 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2073 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2077 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2079 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2080 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2081 if (gdbarch_debug
>= 2)
2082 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2083 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2087 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2088 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2090 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2094 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2096 if (gdbarch
->store_struct_return
== 0)
2097 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2098 if (gdbarch_debug
>= 2)
2099 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2100 gdbarch
->store_struct_return (addr
, sp
);
2104 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2105 gdbarch_store_struct_return_ftype store_struct_return
)
2107 gdbarch
->store_struct_return
= store_struct_return
;
2111 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2113 if (gdbarch
->store_return_value
== 0)
2114 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2115 if (gdbarch_debug
>= 2)
2116 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2117 gdbarch
->store_return_value (type
, valbuf
);
2121 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2122 gdbarch_store_return_value_ftype store_return_value
)
2124 gdbarch
->store_return_value
= store_return_value
;
2128 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2130 if (gdbarch
->extract_struct_value_address
== 0)
2131 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2132 if (gdbarch_debug
>= 2)
2133 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2134 return gdbarch
->extract_struct_value_address (regbuf
);
2138 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2139 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2141 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2145 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2147 if (gdbarch
->use_struct_convention
== 0)
2148 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2149 if (gdbarch_debug
>= 2)
2150 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2151 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2155 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2156 gdbarch_use_struct_convention_ftype use_struct_convention
)
2158 gdbarch
->use_struct_convention
= use_struct_convention
;
2162 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2164 if (gdbarch
->frame_init_saved_regs
== 0)
2165 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2166 if (gdbarch_debug
>= 2)
2167 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2168 gdbarch
->frame_init_saved_regs (frame
);
2172 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2173 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2175 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2179 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2181 if (gdbarch
->init_extra_frame_info
== 0)
2182 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2183 if (gdbarch_debug
>= 2)
2184 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2185 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2189 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2190 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2192 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2196 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2198 if (gdbarch
->skip_prologue
== 0)
2199 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2200 if (gdbarch_debug
>= 2)
2201 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2202 return gdbarch
->skip_prologue (ip
);
2206 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2207 gdbarch_skip_prologue_ftype skip_prologue
)
2209 gdbarch
->skip_prologue
= skip_prologue
;
2213 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2215 if (gdbarch
->inner_than
== 0)
2216 internal_error ("gdbarch: gdbarch_inner_than invalid");
2217 if (gdbarch_debug
>= 2)
2218 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2219 return gdbarch
->inner_than (lhs
, rhs
);
2223 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2224 gdbarch_inner_than_ftype inner_than
)
2226 gdbarch
->inner_than
= inner_than
;
2230 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2232 if (GDB_MULTI_ARCH
== 0)
2233 return legacy_breakpoint_from_pc (pcptr
, lenptr
);
2234 if (gdbarch
->breakpoint_from_pc
== 0)
2235 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2236 if (gdbarch_debug
>= 2)
2237 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2238 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2242 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2243 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2245 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2249 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2251 if (GDB_MULTI_ARCH
== 0)
2252 return default_memory_insert_breakpoint (addr
, contents_cache
);
2253 if (gdbarch
->memory_insert_breakpoint
== 0)
2254 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2255 if (gdbarch_debug
>= 2)
2256 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2257 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2261 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2262 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2264 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2268 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2270 if (GDB_MULTI_ARCH
== 0)
2271 return default_memory_remove_breakpoint (addr
, contents_cache
);
2272 if (gdbarch
->memory_remove_breakpoint
== 0)
2273 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2274 if (gdbarch_debug
>= 2)
2275 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2276 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2280 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2281 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2283 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2287 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2289 if (gdbarch
->decr_pc_after_break
== -1)
2290 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2291 if (gdbarch_debug
>= 2)
2292 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2293 return gdbarch
->decr_pc_after_break
;
2297 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2298 CORE_ADDR decr_pc_after_break
)
2300 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2304 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2306 if (gdbarch
->function_start_offset
== -1)
2307 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2308 if (gdbarch_debug
>= 2)
2309 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2310 return gdbarch
->function_start_offset
;
2314 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2315 CORE_ADDR function_start_offset
)
2317 gdbarch
->function_start_offset
= function_start_offset
;
2321 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2323 if (GDB_MULTI_ARCH
== 0)
2325 generic_remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2328 if (gdbarch
->remote_translate_xfer_address
== 0)
2329 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2330 if (gdbarch_debug
>= 2)
2331 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2332 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2336 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2337 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2339 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2343 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2345 if (gdbarch
->frame_args_skip
== -1)
2346 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2347 if (gdbarch_debug
>= 2)
2348 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2349 return gdbarch
->frame_args_skip
;
2353 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2354 CORE_ADDR frame_args_skip
)
2356 gdbarch
->frame_args_skip
= frame_args_skip
;
2360 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2362 if (GDB_MULTI_ARCH
== 0)
2363 return generic_frameless_function_invocation_not (fi
);
2364 if (gdbarch
->frameless_function_invocation
== 0)
2365 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2366 if (gdbarch_debug
>= 2)
2367 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2368 return gdbarch
->frameless_function_invocation (fi
);
2372 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2373 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2375 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2379 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2381 if (gdbarch
->frame_chain
== 0)
2382 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2383 if (gdbarch_debug
>= 2)
2384 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2385 return gdbarch
->frame_chain (frame
);
2389 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2390 gdbarch_frame_chain_ftype frame_chain
)
2392 gdbarch
->frame_chain
= frame_chain
;
2396 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2398 if (gdbarch
->frame_chain_valid
== 0)
2399 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2400 if (gdbarch_debug
>= 2)
2401 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2402 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2406 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2407 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2409 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2413 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2415 if (gdbarch
->frame_saved_pc
== 0)
2416 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2417 if (gdbarch_debug
>= 2)
2418 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2419 return gdbarch
->frame_saved_pc (fi
);
2423 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2424 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2426 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2430 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2432 if (gdbarch
->frame_args_address
== 0)
2433 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2434 if (gdbarch_debug
>= 2)
2435 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2436 return gdbarch
->frame_args_address (fi
);
2440 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2441 gdbarch_frame_args_address_ftype frame_args_address
)
2443 gdbarch
->frame_args_address
= frame_args_address
;
2447 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2449 if (gdbarch
->frame_locals_address
== 0)
2450 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2451 if (gdbarch_debug
>= 2)
2452 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2453 return gdbarch
->frame_locals_address (fi
);
2457 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2458 gdbarch_frame_locals_address_ftype frame_locals_address
)
2460 gdbarch
->frame_locals_address
= frame_locals_address
;
2464 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2466 if (gdbarch
->saved_pc_after_call
== 0)
2467 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2468 if (gdbarch_debug
>= 2)
2469 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2470 return gdbarch
->saved_pc_after_call (frame
);
2474 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2475 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2477 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2481 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2483 if (gdbarch
->frame_num_args
== 0)
2484 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2485 if (gdbarch_debug
>= 2)
2486 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2487 return gdbarch
->frame_num_args (frame
);
2491 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2492 gdbarch_frame_num_args_ftype frame_num_args
)
2494 gdbarch
->frame_num_args
= frame_num_args
;
2498 gdbarch_stack_align_p (struct gdbarch
*gdbarch
)
2500 return gdbarch
->stack_align
!= 0;
2504 gdbarch_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
2506 if (gdbarch
->stack_align
== 0)
2507 internal_error ("gdbarch: gdbarch_stack_align invalid");
2508 if (gdbarch_debug
>= 2)
2509 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stack_align called\n");
2510 return gdbarch
->stack_align (sp
);
2514 set_gdbarch_stack_align (struct gdbarch
*gdbarch
,
2515 gdbarch_stack_align_ftype stack_align
)
2517 gdbarch
->stack_align
= stack_align
;
2521 /* Keep a registrary of per-architecture data-pointers required by GDB
2529 struct gdbarch_data_registration
2531 gdbarch_data_ftype
*init
;
2532 struct gdbarch_data
*data
;
2533 struct gdbarch_data_registration
*next
;
2536 struct gdbarch_data_registrary
2539 struct gdbarch_data_registration
*registrations
;
2542 struct gdbarch_data_registrary gdbarch_data_registrary
=
2547 struct gdbarch_data
*
2548 register_gdbarch_data (gdbarch_data_ftype
*init
)
2550 struct gdbarch_data_registration
**curr
;
2551 for (curr
= &gdbarch_data_registrary
.registrations
;
2553 curr
= &(*curr
)->next
);
2554 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2555 (*curr
)->next
= NULL
;
2556 (*curr
)->init
= init
;
2557 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2558 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2559 return (*curr
)->data
;
2563 /* Walk through all the registered users initializing each in turn. */
2566 init_gdbarch_data (struct gdbarch
*gdbarch
)
2568 struct gdbarch_data_registration
*rego
;
2569 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2570 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2571 for (rego
= gdbarch_data_registrary
.registrations
;
2575 if (rego
->data
->index
< gdbarch
->nr_data
)
2576 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2581 /* Return the current value of the specified per-architecture
2586 struct gdbarch_data
*data
;
2588 if (data
->index
>= current_gdbarch
->nr_data
)
2589 internal_error ("gdbarch_data: request for non-existant data.");
2590 return current_gdbarch
->data
[data
->index
];
2595 /* Keep a registrary of swaped data required by GDB modules. */
2600 struct gdbarch_swap_registration
*source
;
2601 struct gdbarch_swap
*next
;
2604 struct gdbarch_swap_registration
2607 unsigned long sizeof_data
;
2608 gdbarch_swap_ftype
*init
;
2609 struct gdbarch_swap_registration
*next
;
2612 struct gdbarch_swap_registrary
2615 struct gdbarch_swap_registration
*registrations
;
2618 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2624 register_gdbarch_swap (void *data
,
2625 unsigned long sizeof_data
,
2626 gdbarch_swap_ftype
*init
)
2628 struct gdbarch_swap_registration
**rego
;
2629 for (rego
= &gdbarch_swap_registrary
.registrations
;
2631 rego
= &(*rego
)->next
);
2632 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2633 (*rego
)->next
= NULL
;
2634 (*rego
)->init
= init
;
2635 (*rego
)->data
= data
;
2636 (*rego
)->sizeof_data
= sizeof_data
;
2641 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2643 struct gdbarch_swap_registration
*rego
;
2644 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2645 for (rego
= gdbarch_swap_registrary
.registrations
;
2649 if (rego
->data
!= NULL
)
2651 (*curr
) = XMALLOC (struct gdbarch_swap
);
2652 (*curr
)->source
= rego
;
2653 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2654 (*curr
)->next
= NULL
;
2655 memset (rego
->data
, 0, rego
->sizeof_data
);
2656 curr
= &(*curr
)->next
;
2658 if (rego
->init
!= NULL
)
2664 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2666 struct gdbarch_swap
*curr
;
2667 for (curr
= gdbarch
->swap
;
2670 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2674 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2676 struct gdbarch_swap
*curr
;
2677 for (curr
= gdbarch
->swap
;
2680 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2684 /* Keep a registrary of the architectures known by GDB. */
2686 struct gdbarch_init_registration
2688 enum bfd_architecture bfd_architecture
;
2689 gdbarch_init_ftype
*init
;
2690 struct gdbarch_list
*arches
;
2691 struct gdbarch_init_registration
*next
;
2694 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2697 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2698 gdbarch_init_ftype
*init
)
2700 struct gdbarch_init_registration
**curr
;
2701 const struct bfd_arch_info
*bfd_arch_info
;
2702 /* Check that BFD reconizes this architecture */
2703 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2704 if (bfd_arch_info
== NULL
)
2706 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2708 /* Check that we haven't seen this architecture before */
2709 for (curr
= &gdbarch_init_registrary
;
2711 curr
= &(*curr
)->next
)
2713 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2714 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2715 bfd_arch_info
->printable_name
);
2719 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2720 bfd_arch_info
->printable_name
,
2723 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2724 (*curr
)->bfd_architecture
= bfd_architecture
;
2725 (*curr
)->init
= init
;
2726 (*curr
)->arches
= NULL
;
2727 (*curr
)->next
= NULL
;
2732 /* Look for an architecture using gdbarch_info. Base search on only
2733 BFD_ARCH_INFO and BYTE_ORDER. */
2735 struct gdbarch_list
*
2736 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2737 const struct gdbarch_info
*info
)
2739 for (; arches
!= NULL
; arches
= arches
->next
)
2741 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2743 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2751 /* Update the current architecture. Return ZERO if the update request
2755 gdbarch_update (struct gdbarch_info info
)
2757 struct gdbarch
*new_gdbarch
;
2758 struct gdbarch_list
**list
;
2759 struct gdbarch_init_registration
*rego
;
2761 /* Fill in any missing bits. Most important is the bfd_architecture
2762 which is used to select the target architecture. */
2763 if (info
.bfd_architecture
== bfd_arch_unknown
)
2765 if (info
.bfd_arch_info
!= NULL
)
2766 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2767 else if (info
.abfd
!= NULL
)
2768 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2769 /* FIXME - should query BFD for its default architecture. */
2771 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2773 if (info
.bfd_arch_info
== NULL
)
2775 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2776 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2778 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2780 if (info
.byte_order
== 0)
2782 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2783 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2784 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2787 info
.byte_order
= current_gdbarch
->byte_order
;
2788 /* FIXME - should query BFD for its default byte-order. */
2790 /* A default for abfd? */
2792 /* Find the target that knows about this architecture. */
2793 for (rego
= gdbarch_init_registrary
;
2794 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2799 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2805 fprintf_unfiltered (gdb_stdlog
,
2806 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2807 info
.bfd_architecture
,
2808 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2809 fprintf_unfiltered (gdb_stdlog
,
2810 "gdbarch_update: info.bfd_arch_info %s\n",
2811 (info
.bfd_arch_info
!= NULL
2812 ? info
.bfd_arch_info
->printable_name
2814 fprintf_unfiltered (gdb_stdlog
,
2815 "gdbarch_update: info.byte_order %d (%s)\n",
2817 (info
.byte_order
== BIG_ENDIAN
? "big"
2818 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2820 fprintf_unfiltered (gdb_stdlog
,
2821 "gdbarch_update: info.abfd 0x%lx\n",
2823 fprintf_unfiltered (gdb_stdlog
,
2824 "gdbarch_update: info.tdep_info 0x%lx\n",
2825 (long) info
.tdep_info
);
2828 /* Ask the target for a replacement architecture. */
2829 new_gdbarch
= rego
->init (info
, rego
->arches
);
2831 /* Did the target like it? No. Reject the change. */
2832 if (new_gdbarch
== NULL
)
2835 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2839 /* Did the architecture change? No. Do nothing. */
2840 if (current_gdbarch
== new_gdbarch
)
2843 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2845 new_gdbarch
->bfd_arch_info
->printable_name
);
2849 /* Swap all data belonging to the old target out */
2850 swapout_gdbarch_swap (current_gdbarch
);
2852 /* Is this a pre-existing architecture? Yes. Swap it in. */
2853 for (list
= ®o
->arches
;
2855 list
= &(*list
)->next
)
2857 if ((*list
)->gdbarch
== new_gdbarch
)
2860 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2862 new_gdbarch
->bfd_arch_info
->printable_name
);
2863 current_gdbarch
= new_gdbarch
;
2864 swapin_gdbarch_swap (new_gdbarch
);
2869 /* Append this new architecture to this targets list. */
2870 (*list
) = XMALLOC (struct gdbarch_list
);
2871 (*list
)->next
= NULL
;
2872 (*list
)->gdbarch
= new_gdbarch
;
2874 /* Switch to this new architecture. Dump it out. */
2875 current_gdbarch
= new_gdbarch
;
2878 fprintf_unfiltered (gdb_stdlog
,
2879 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2881 new_gdbarch
->bfd_arch_info
->printable_name
);
2885 /* Check that the newly installed architecture is valid. */
2886 verify_gdbarch (new_gdbarch
);
2888 /* Initialize the per-architecture memory (swap) areas.
2889 CURRENT_GDBARCH must be update before these modules are
2891 init_gdbarch_swap (new_gdbarch
);
2893 /* Initialize the per-architecture data-pointer of all parties that
2894 registered an interest in this architecture. CURRENT_GDBARCH
2895 must be updated before these modules are called. */
2896 init_gdbarch_data (new_gdbarch
);
2903 /* Functions to manipulate the endianness of the target. */
2905 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2906 /* compat - Catch old targets that expect a selectable byte-order to
2907 default to BIG_ENDIAN */
2908 #ifndef TARGET_BYTE_ORDER_DEFAULT
2909 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2912 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2913 #ifndef TARGET_BYTE_ORDER_DEFAULT
2914 /* compat - Catch old non byte-order selectable targets that do not
2915 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2916 TARGET_BYTE_ORDER to be used as the default. For targets that
2917 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2918 below will get a strange compiler warning. */
2919 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2922 #ifndef TARGET_BYTE_ORDER_DEFAULT
2923 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2925 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2926 int target_byte_order_auto
= 1;
2928 /* Chain containing the \"set endian\" commands. */
2929 static struct cmd_list_element
*endianlist
= NULL
;
2931 /* Called by ``show endian''. */
2933 show_endian (char *args
, int from_tty
)
2936 (TARGET_BYTE_ORDER_AUTO
2937 ? "The target endianness is set automatically (currently %s endian)\n"
2938 : "The target is assumed to be %s endian\n");
2939 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
2942 /* Called if the user enters ``set endian'' without an argument. */
2944 set_endian (char *args
, int from_tty
)
2946 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2947 show_endian (args
, from_tty
);
2950 /* Called by ``set endian big''. */
2952 set_endian_big (char *args
, int from_tty
)
2954 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2956 target_byte_order
= BIG_ENDIAN
;
2957 target_byte_order_auto
= 0;
2960 struct gdbarch_info info
;
2961 memset (&info
, 0, sizeof info
);
2962 info
.byte_order
= BIG_ENDIAN
;
2963 gdbarch_update (info
);
2968 printf_unfiltered ("Byte order is not selectable.");
2969 show_endian (args
, from_tty
);
2973 /* Called by ``set endian little''. */
2975 set_endian_little (char *args
, int from_tty
)
2977 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2979 target_byte_order
= LITTLE_ENDIAN
;
2980 target_byte_order_auto
= 0;
2983 struct gdbarch_info info
;
2984 memset (&info
, 0, sizeof info
);
2985 info
.byte_order
= LITTLE_ENDIAN
;
2986 gdbarch_update (info
);
2991 printf_unfiltered ("Byte order is not selectable.");
2992 show_endian (args
, from_tty
);
2996 /* Called by ``set endian auto''. */
2998 set_endian_auto (char *args
, int from_tty
)
3000 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3002 target_byte_order_auto
= 1;
3006 printf_unfiltered ("Byte order is not selectable.");
3007 show_endian (args
, from_tty
);
3011 /* Set the endianness from a BFD. */
3013 set_endian_from_file (bfd
*abfd
)
3015 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
3019 if (bfd_big_endian (abfd
))
3022 want
= LITTLE_ENDIAN
;
3023 if (TARGET_BYTE_ORDER_AUTO
)
3024 target_byte_order
= want
;
3025 else if (TARGET_BYTE_ORDER
!= want
)
3026 warning ("%s endian file does not match %s endian target.",
3027 want
== BIG_ENDIAN
? "big" : "little",
3028 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3032 if (bfd_big_endian (abfd
)
3033 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
3034 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
3035 warning ("%s endian file does not match %s endian target.",
3036 bfd_big_endian (abfd
) ? "big" : "little",
3037 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
3043 /* Functions to manipulate the architecture of the target */
3045 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3047 int target_architecture_auto
= 1;
3048 extern const struct bfd_arch_info bfd_default_arch_struct
;
3049 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
3050 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
3052 static void show_endian (char *, int);
3053 static void set_endian (char *, int);
3054 static void set_endian_big (char *, int);
3055 static void set_endian_little (char *, int);
3056 static void set_endian_auto (char *, int);
3057 static void set_endian_from_file (bfd
*);
3058 static int arch_ok (const struct bfd_arch_info
*arch
);
3059 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3060 static void show_architecture (char *, int);
3061 static void set_architecture (char *, int);
3062 static void info_architecture (char *, int);
3063 static void set_architecture_from_file (bfd
*);
3065 /* Do the real work of changing the current architecture */
3068 arch_ok (const struct bfd_arch_info
*arch
)
3070 /* Should be performing the more basic check that the binary is
3071 compatible with GDB. */
3072 /* Check with the target that the architecture is valid. */
3073 return (target_architecture_hook
== NULL
3074 || target_architecture_hook (arch
));
3078 set_arch (const struct bfd_arch_info
*arch
,
3084 if (!arch_ok (arch
))
3085 warning ("Target may not support %s architecture",
3086 arch
->printable_name
);
3087 target_architecture
= arch
;
3089 case set_arch_manual
:
3090 if (!arch_ok (arch
))
3092 printf_unfiltered ("Target does not support `%s' architecture.\n",
3093 arch
->printable_name
);
3097 target_architecture_auto
= 0;
3098 target_architecture
= arch
;
3106 /* Called if the user enters ``show architecture'' without an argument. */
3108 show_architecture (char *args
, int from_tty
)
3111 arch
= TARGET_ARCHITECTURE
->printable_name
;
3112 if (target_architecture_auto
)
3113 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3115 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3118 /* Called if the user enters ``set architecture'' with or without an
3121 set_architecture (char *args
, int from_tty
)
3125 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3127 else if (strcmp (args
, "auto") == 0)
3129 target_architecture_auto
= 1;
3131 else if (GDB_MULTI_ARCH
)
3133 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3135 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3138 struct gdbarch_info info
;
3139 memset (&info
, 0, sizeof info
);
3140 info
.bfd_arch_info
= arch
;
3141 if (gdbarch_update (info
))
3142 target_architecture_auto
= 0;
3144 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3149 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3151 set_arch (arch
, set_arch_manual
);
3153 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3157 /* Called if the user enters ``info architecture'' without an argument. */
3159 info_architecture (char *args
, int from_tty
)
3161 enum bfd_architecture a
;
3164 if (gdbarch_init_registrary
!= NULL
)
3166 struct gdbarch_init_registration
*rego
;
3167 printf_filtered ("Available architectures are:\n");
3168 for (rego
= gdbarch_init_registrary
;
3172 const struct bfd_arch_info
*ap
;
3173 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3178 printf_filtered (" %s", ap
->printable_name
);
3182 printf_filtered ("\n");
3188 printf_filtered ("There are no available architectures.\n");
3192 printf_filtered ("Available architectures are:\n");
3193 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3195 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3200 printf_filtered (" %s", ap
->printable_name
);
3204 printf_filtered ("\n");
3209 /* Set the architecture from arch/machine */
3211 set_architecture_from_arch_mach (arch
, mach
)
3212 enum bfd_architecture arch
;
3215 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3217 set_arch (wanted
, set_arch_manual
);
3219 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3222 /* Set the architecture from a BFD */
3224 set_architecture_from_file (bfd
*abfd
)
3226 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3227 if (target_architecture_auto
)
3229 set_arch (wanted
, set_arch_auto
);
3231 else if (wanted
!= target_architecture
)
3233 warning ("%s architecture file may be incompatible with %s target.",
3234 wanted
->printable_name
,
3235 target_architecture
->printable_name
);
3240 /* Misc helper functions for targets. */
3243 frame_num_args_unknown (fi
)
3244 struct frame_info
*fi
;
3251 generic_register_convertible_not (num
)
3260 /* Pointer to the target-dependent disassembly function. */
3261 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3262 disassemble_info tm_print_insn_info
;
3266 /* Set the dynamic target-system-dependant parameters (architecture,
3267 byte-order) using information found in the BFD */
3270 set_gdbarch_from_file (abfd
)
3275 struct gdbarch_info info
;
3276 memset (&info
, 0, sizeof info
);
3278 gdbarch_update (info
);
3281 set_architecture_from_file (abfd
);
3282 set_endian_from_file (abfd
);
3286 /* Initialize the current architecture. */
3288 initialize_current_architecture ()
3292 struct gdbarch_init_registration
*rego
;
3293 const struct bfd_arch_info
*chosen
= NULL
;
3294 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3296 const struct bfd_arch_info
*ap
3297 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3299 /* Choose the first architecture alphabetically. */
3301 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3307 struct gdbarch_info info
;
3308 memset (&info
, 0, sizeof info
);
3309 info
.bfd_arch_info
= chosen
;
3310 gdbarch_update (info
);
3315 extern void _initialize_gdbarch (void);
3317 _initialize_gdbarch ()
3319 struct cmd_list_element
*c
;
3321 add_prefix_cmd ("endian", class_support
, set_endian
,
3322 "Set endianness of target.",
3323 &endianlist
, "set endian ", 0, &setlist
);
3324 add_cmd ("big", class_support
, set_endian_big
,
3325 "Set target as being big endian.", &endianlist
);
3326 add_cmd ("little", class_support
, set_endian_little
,
3327 "Set target as being little endian.", &endianlist
);
3328 add_cmd ("auto", class_support
, set_endian_auto
,
3329 "Select target endianness automatically.", &endianlist
);
3330 add_cmd ("endian", class_support
, show_endian
,
3331 "Show endianness of target.", &showlist
);
3333 add_cmd ("architecture", class_support
, set_architecture
,
3334 "Set architecture of target.", &setlist
);
3335 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3336 add_cmd ("architecture", class_support
, show_architecture
,
3337 "Show architecture of target.", &showlist
);
3338 add_cmd ("architecture", class_support
, info_architecture
,
3339 "List supported target architectures", &infolist
);
3341 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3342 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3343 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3344 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3345 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3347 add_show_from_set (add_set_cmd ("arch",
3350 (char *)&gdbarch_debug
,
3351 "Set architecture debugging.\n\
3352 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3354 c
= add_set_cmd ("archdebug",
3357 (char *)&gdbarch_debug
,
3358 "Set architecture debugging.\n\
3359 When non-zero, architecture debugging is enabled.", &setlist
);
3361 deprecate_cmd (c
, "set debug arch");
3362 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");