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_extract_return_value_ftype
*extract_return_value
;
182 gdbarch_push_arguments_ftype
*push_arguments
;
183 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
184 gdbarch_push_return_address_ftype
*push_return_address
;
185 gdbarch_pop_frame_ftype
*pop_frame
;
186 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
187 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
188 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
189 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
190 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
191 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
192 gdbarch_store_struct_return_ftype
*store_struct_return
;
193 gdbarch_store_return_value_ftype
*store_return_value
;
194 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
195 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
196 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
197 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
198 gdbarch_skip_prologue_ftype
*skip_prologue
;
199 gdbarch_inner_than_ftype
*inner_than
;
200 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
201 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
202 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
203 CORE_ADDR decr_pc_after_break
;
204 CORE_ADDR function_start_offset
;
205 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
206 CORE_ADDR frame_args_skip
;
207 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
208 gdbarch_frame_chain_ftype
*frame_chain
;
209 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
210 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
211 gdbarch_frame_args_address_ftype
*frame_args_address
;
212 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
213 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
214 gdbarch_frame_num_args_ftype
*frame_num_args
;
218 /* The default architecture uses host values (for want of a better
221 extern const struct bfd_arch_info bfd_default_arch_struct
;
223 struct gdbarch startup_gdbarch
= {
224 /* basic architecture information */
225 &bfd_default_arch_struct
,
227 /* target specific vector */
229 /*per-architecture data-pointers and swap regions */
231 /* Multi-arch values */
237 8 * sizeof (LONGEST
),
240 8 * sizeof (long double),
278 generic_get_saved_register
,
318 /* startup_gdbarch() */
320 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
323 /* Create a new ``struct gdbarch'' based in information provided by
324 ``struct gdbarch_info''. */
327 gdbarch_alloc (const struct gdbarch_info
*info
,
328 struct gdbarch_tdep
*tdep
)
330 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
331 memset (gdbarch
, 0, sizeof (*gdbarch
));
333 gdbarch
->tdep
= tdep
;
335 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
336 gdbarch
->byte_order
= info
->byte_order
;
338 /* Force the explicit initialization of these. */
339 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
340 gdbarch
->ieee_float
= 1;
341 gdbarch
->num_regs
= -1;
342 gdbarch
->sp_regnum
= -1;
343 gdbarch
->fp_regnum
= -1;
344 gdbarch
->pc_regnum
= -1;
345 gdbarch
->register_name
= legacy_register_name
;
346 gdbarch
->register_size
= -1;
347 gdbarch
->register_bytes
= -1;
348 gdbarch
->max_register_raw_size
= -1;
349 gdbarch
->max_register_virtual_size
= -1;
350 gdbarch
->use_generic_dummy_frames
= -1;
351 gdbarch
->call_dummy_start_offset
= -1;
352 gdbarch
->call_dummy_breakpoint_offset
= -1;
353 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
354 gdbarch
->call_dummy_length
= -1;
355 gdbarch
->call_dummy_p
= -1;
356 gdbarch
->call_dummy_words
= legacy_call_dummy_words
;
357 gdbarch
->sizeof_call_dummy_words
= legacy_sizeof_call_dummy_words
;
358 gdbarch
->call_dummy_stack_adjust_p
= -1;
359 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
360 gdbarch
->register_convertible
= generic_register_convertible_not
;
361 gdbarch
->pointer_to_address
= generic_pointer_to_address
;
362 gdbarch
->address_to_pointer
= generic_address_to_pointer
;
363 gdbarch
->breakpoint_from_pc
= legacy_breakpoint_from_pc
;
364 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
365 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
366 gdbarch
->decr_pc_after_break
= -1;
367 gdbarch
->function_start_offset
= -1;
368 gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
369 gdbarch
->frame_args_skip
= -1;
370 gdbarch
->frameless_function_invocation
= generic_frameless_function_invocation_not
;
371 /* gdbarch_alloc() */
377 /* Free a gdbarch struct. This should never happen in normal
378 operation --- once you've created a gdbarch, you keep it around.
379 However, if an architecture's init function encounters an error
380 building the structure, it may need to clean up a partially
381 constructed gdbarch. */
383 gdbarch_free (struct gdbarch
*arch
)
385 /* At the moment, this is trivial. */
390 /* Ensure that all values in a GDBARCH are reasonable. */
393 verify_gdbarch (struct gdbarch
*gdbarch
)
395 /* Only perform sanity checks on a multi-arch target. */
396 if (GDB_MULTI_ARCH
<= 0)
399 if (gdbarch
->byte_order
== 0)
400 internal_error ("verify_gdbarch: byte-order unset");
401 if (gdbarch
->bfd_arch_info
== NULL
)
402 internal_error ("verify_gdbarch: bfd_arch_info unset");
403 /* Check those that need to be defined for the given multi-arch level. */
404 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
405 if ((GDB_MULTI_ARCH
>= 1)
406 && (gdbarch
->ptr_bit
== 0))
407 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
408 if ((GDB_MULTI_ARCH
>= 1)
409 && (gdbarch
->short_bit
== 0))
410 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
411 if ((GDB_MULTI_ARCH
>= 1)
412 && (gdbarch
->int_bit
== 0))
413 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
414 if ((GDB_MULTI_ARCH
>= 1)
415 && (gdbarch
->long_bit
== 0))
416 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
417 if ((GDB_MULTI_ARCH
>= 1)
418 && (gdbarch
->long_long_bit
== 0))
419 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
420 if ((GDB_MULTI_ARCH
>= 1)
421 && (gdbarch
->float_bit
== 0))
422 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
423 if ((GDB_MULTI_ARCH
>= 1)
424 && (gdbarch
->double_bit
== 0))
425 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
426 if ((GDB_MULTI_ARCH
>= 1)
427 && (gdbarch
->long_double_bit
== 0))
428 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
429 /* Skip verify of ieee_float, invalid_p == 0 */
430 if ((GDB_MULTI_ARCH
>= 1)
431 && (gdbarch
->read_pc
== 0))
432 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
433 if ((GDB_MULTI_ARCH
>= 1)
434 && (gdbarch
->write_pc
== 0))
435 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
436 if ((GDB_MULTI_ARCH
>= 1)
437 && (gdbarch
->read_fp
== 0))
438 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
439 if ((GDB_MULTI_ARCH
>= 1)
440 && (gdbarch
->write_fp
== 0))
441 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
442 if ((GDB_MULTI_ARCH
>= 1)
443 && (gdbarch
->read_sp
== 0))
444 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
445 if ((GDB_MULTI_ARCH
>= 1)
446 && (gdbarch
->write_sp
== 0))
447 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
448 if ((GDB_MULTI_ARCH
>= 2)
449 && (gdbarch
->num_regs
== -1))
450 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
451 if ((GDB_MULTI_ARCH
>= 2)
452 && (gdbarch
->sp_regnum
== -1))
453 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
454 if ((GDB_MULTI_ARCH
>= 2)
455 && (gdbarch
->fp_regnum
== -1))
456 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
457 if ((GDB_MULTI_ARCH
>= 2)
458 && (gdbarch
->pc_regnum
== -1))
459 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
460 /* Skip verify of register_name, invalid_p == 0 */
461 if ((GDB_MULTI_ARCH
>= 2)
462 && (gdbarch
->register_size
== -1))
463 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
464 if ((GDB_MULTI_ARCH
>= 2)
465 && (gdbarch
->register_bytes
== -1))
466 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
467 if ((GDB_MULTI_ARCH
>= 2)
468 && (gdbarch
->register_byte
== 0))
469 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
470 if ((GDB_MULTI_ARCH
>= 2)
471 && (gdbarch
->register_raw_size
== 0))
472 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
473 if ((GDB_MULTI_ARCH
>= 2)
474 && (gdbarch
->max_register_raw_size
== -1))
475 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
476 if ((GDB_MULTI_ARCH
>= 2)
477 && (gdbarch
->register_virtual_size
== 0))
478 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
479 if ((GDB_MULTI_ARCH
>= 2)
480 && (gdbarch
->max_register_virtual_size
== -1))
481 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
482 if ((GDB_MULTI_ARCH
>= 2)
483 && (gdbarch
->register_virtual_type
== 0))
484 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
485 if ((GDB_MULTI_ARCH
>= 1)
486 && (gdbarch
->use_generic_dummy_frames
== -1))
487 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
488 if ((GDB_MULTI_ARCH
>= 2)
489 && (gdbarch
->call_dummy_location
== 0))
490 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
491 if ((GDB_MULTI_ARCH
>= 2)
492 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
493 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
494 if ((GDB_MULTI_ARCH
>= 2)
495 && (gdbarch
->call_dummy_start_offset
== -1))
496 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
497 if ((GDB_MULTI_ARCH
>= 2)
498 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
499 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
500 if ((GDB_MULTI_ARCH
>= 1)
501 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
502 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
503 if ((GDB_MULTI_ARCH
>= 2)
504 && (gdbarch
->call_dummy_length
== -1))
505 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
506 if ((GDB_MULTI_ARCH
>= 2)
507 && (gdbarch
->pc_in_call_dummy
== 0))
508 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
509 if ((GDB_MULTI_ARCH
>= 1)
510 && (gdbarch
->call_dummy_p
== -1))
511 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
512 /* Skip verify of call_dummy_words, invalid_p == 0 */
513 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
514 if ((GDB_MULTI_ARCH
>= 1)
515 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
516 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
517 if ((GDB_MULTI_ARCH
>= 2)
518 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
519 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
520 if ((GDB_MULTI_ARCH
>= 2)
521 && (gdbarch
->fix_call_dummy
== 0))
522 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
523 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
524 if ((GDB_MULTI_ARCH
>= 1)
525 && (gdbarch
->get_saved_register
== 0))
526 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
527 /* Skip verify of register_convertible, invalid_p == 0 */
528 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
529 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
530 /* Skip verify of pointer_to_address, invalid_p == 0 */
531 /* Skip verify of address_to_pointer, invalid_p == 0 */
532 if ((GDB_MULTI_ARCH
>= 2)
533 && (gdbarch
->extract_return_value
== 0))
534 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
535 if ((GDB_MULTI_ARCH
>= 1)
536 && (gdbarch
->push_arguments
== 0))
537 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
538 if ((GDB_MULTI_ARCH
>= 2)
539 && (gdbarch
->push_dummy_frame
== 0))
540 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
541 if ((GDB_MULTI_ARCH
>= 1)
542 && (gdbarch
->push_return_address
== 0))
543 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
544 if ((GDB_MULTI_ARCH
>= 2)
545 && (gdbarch
->pop_frame
== 0))
546 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
547 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
548 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
549 if ((GDB_MULTI_ARCH
>= 2)
550 && (gdbarch
->d10v_daddr_p
== 0))
551 internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
552 if ((GDB_MULTI_ARCH
>= 2)
553 && (gdbarch
->d10v_iaddr_p
== 0))
554 internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
555 if ((GDB_MULTI_ARCH
>= 2)
556 && (gdbarch
->d10v_convert_daddr_to_raw
== 0))
557 internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
558 if ((GDB_MULTI_ARCH
>= 2)
559 && (gdbarch
->d10v_convert_iaddr_to_raw
== 0))
560 internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
561 if ((GDB_MULTI_ARCH
>= 2)
562 && (gdbarch
->store_struct_return
== 0))
563 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
564 if ((GDB_MULTI_ARCH
>= 2)
565 && (gdbarch
->store_return_value
== 0))
566 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
567 if ((GDB_MULTI_ARCH
>= 2)
568 && (gdbarch
->extract_struct_value_address
== 0))
569 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
570 if ((GDB_MULTI_ARCH
>= 2)
571 && (gdbarch
->use_struct_convention
== 0))
572 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
573 if ((GDB_MULTI_ARCH
>= 2)
574 && (gdbarch
->frame_init_saved_regs
== 0))
575 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
576 if ((GDB_MULTI_ARCH
>= 2)
577 && (gdbarch
->init_extra_frame_info
== 0))
578 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
579 if ((GDB_MULTI_ARCH
>= 2)
580 && (gdbarch
->skip_prologue
== 0))
581 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
582 if ((GDB_MULTI_ARCH
>= 2)
583 && (gdbarch
->inner_than
== 0))
584 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
585 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
586 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
587 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
588 if ((GDB_MULTI_ARCH
>= 2)
589 && (gdbarch
->decr_pc_after_break
== -1))
590 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
591 if ((GDB_MULTI_ARCH
>= 2)
592 && (gdbarch
->function_start_offset
== -1))
593 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
594 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
595 if ((GDB_MULTI_ARCH
>= 2)
596 && (gdbarch
->frame_args_skip
== -1))
597 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
598 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
599 if ((GDB_MULTI_ARCH
>= 2)
600 && (gdbarch
->frame_chain
== 0))
601 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
602 if ((GDB_MULTI_ARCH
>= 1)
603 && (gdbarch
->frame_chain_valid
== 0))
604 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
605 if ((GDB_MULTI_ARCH
>= 2)
606 && (gdbarch
->frame_saved_pc
== 0))
607 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
608 if ((GDB_MULTI_ARCH
>= 2)
609 && (gdbarch
->frame_args_address
== 0))
610 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
611 if ((GDB_MULTI_ARCH
>= 2)
612 && (gdbarch
->frame_locals_address
== 0))
613 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
614 if ((GDB_MULTI_ARCH
>= 2)
615 && (gdbarch
->saved_pc_after_call
== 0))
616 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
617 if ((GDB_MULTI_ARCH
>= 2)
618 && (gdbarch
->frame_num_args
== 0))
619 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
623 /* Print out the details of the current architecture. */
628 if (TARGET_ARCHITECTURE
!= NULL
)
629 fprintf_unfiltered (gdb_stdlog
,
630 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
631 TARGET_ARCHITECTURE
->printable_name
);
632 fprintf_unfiltered (gdb_stdlog
,
633 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
634 (long) TARGET_BYTE_ORDER
);
635 fprintf_unfiltered (gdb_stdlog
,
636 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
637 (long) TARGET_BFD_VMA_BIT
);
638 fprintf_unfiltered (gdb_stdlog
,
639 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
640 (long) TARGET_PTR_BIT
);
641 fprintf_unfiltered (gdb_stdlog
,
642 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
643 (long) TARGET_SHORT_BIT
);
644 fprintf_unfiltered (gdb_stdlog
,
645 "gdbarch_update: TARGET_INT_BIT = %ld\n",
646 (long) TARGET_INT_BIT
);
647 fprintf_unfiltered (gdb_stdlog
,
648 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
649 (long) TARGET_LONG_BIT
);
650 fprintf_unfiltered (gdb_stdlog
,
651 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
652 (long) TARGET_LONG_LONG_BIT
);
653 fprintf_unfiltered (gdb_stdlog
,
654 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
655 (long) TARGET_FLOAT_BIT
);
656 fprintf_unfiltered (gdb_stdlog
,
657 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
658 (long) TARGET_DOUBLE_BIT
);
659 fprintf_unfiltered (gdb_stdlog
,
660 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
661 (long) TARGET_LONG_DOUBLE_BIT
);
662 fprintf_unfiltered (gdb_stdlog
,
663 "gdbarch_update: IEEE_FLOAT = %ld\n",
665 fprintf_unfiltered (gdb_stdlog
,
666 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
667 (long) current_gdbarch
->read_pc
668 /*TARGET_READ_PC ()*/);
669 fprintf_unfiltered (gdb_stdlog
,
670 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
671 (long) current_gdbarch
->write_pc
672 /*TARGET_WRITE_PC ()*/);
673 fprintf_unfiltered (gdb_stdlog
,
674 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
675 (long) current_gdbarch
->read_fp
676 /*TARGET_READ_FP ()*/);
677 fprintf_unfiltered (gdb_stdlog
,
678 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
679 (long) current_gdbarch
->write_fp
680 /*TARGET_WRITE_FP ()*/);
681 fprintf_unfiltered (gdb_stdlog
,
682 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
683 (long) current_gdbarch
->read_sp
684 /*TARGET_READ_SP ()*/);
685 fprintf_unfiltered (gdb_stdlog
,
686 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
687 (long) current_gdbarch
->write_sp
688 /*TARGET_WRITE_SP ()*/);
689 fprintf_unfiltered (gdb_stdlog
,
690 "gdbarch_update: NUM_REGS = %ld\n",
692 fprintf_unfiltered (gdb_stdlog
,
693 "gdbarch_update: SP_REGNUM = %ld\n",
695 fprintf_unfiltered (gdb_stdlog
,
696 "gdbarch_update: FP_REGNUM = %ld\n",
698 fprintf_unfiltered (gdb_stdlog
,
699 "gdbarch_update: PC_REGNUM = %ld\n",
701 fprintf_unfiltered (gdb_stdlog
,
702 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
703 (long) current_gdbarch
->register_name
704 /*REGISTER_NAME ()*/);
705 fprintf_unfiltered (gdb_stdlog
,
706 "gdbarch_update: REGISTER_SIZE = %ld\n",
707 (long) REGISTER_SIZE
);
708 fprintf_unfiltered (gdb_stdlog
,
709 "gdbarch_update: REGISTER_BYTES = %ld\n",
710 (long) REGISTER_BYTES
);
711 fprintf_unfiltered (gdb_stdlog
,
712 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
713 (long) current_gdbarch
->register_byte
714 /*REGISTER_BYTE ()*/);
715 fprintf_unfiltered (gdb_stdlog
,
716 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
717 (long) current_gdbarch
->register_raw_size
718 /*REGISTER_RAW_SIZE ()*/);
719 fprintf_unfiltered (gdb_stdlog
,
720 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
721 (long) MAX_REGISTER_RAW_SIZE
);
722 fprintf_unfiltered (gdb_stdlog
,
723 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
724 (long) current_gdbarch
->register_virtual_size
725 /*REGISTER_VIRTUAL_SIZE ()*/);
726 fprintf_unfiltered (gdb_stdlog
,
727 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
728 (long) MAX_REGISTER_VIRTUAL_SIZE
);
729 fprintf_unfiltered (gdb_stdlog
,
730 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
731 (long) current_gdbarch
->register_virtual_type
732 /*REGISTER_VIRTUAL_TYPE ()*/);
733 fprintf_unfiltered (gdb_stdlog
,
734 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
735 (long) USE_GENERIC_DUMMY_FRAMES
);
736 fprintf_unfiltered (gdb_stdlog
,
737 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
738 (long) CALL_DUMMY_LOCATION
);
739 fprintf_unfiltered (gdb_stdlog
,
740 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
741 (long) current_gdbarch
->call_dummy_address
742 /*CALL_DUMMY_ADDRESS ()*/);
743 fprintf_unfiltered (gdb_stdlog
,
744 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
745 (long) CALL_DUMMY_START_OFFSET
);
746 fprintf_unfiltered (gdb_stdlog
,
747 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
748 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
749 fprintf_unfiltered (gdb_stdlog
,
750 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
751 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
752 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
753 fprintf_unfiltered (gdb_stdlog
,
754 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
755 (long) CALL_DUMMY_LENGTH
);
756 fprintf_unfiltered (gdb_stdlog
,
757 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
758 (long) current_gdbarch
->pc_in_call_dummy
759 /*PC_IN_CALL_DUMMY ()*/);
760 fprintf_unfiltered (gdb_stdlog
,
761 "gdbarch_update: CALL_DUMMY_P = %ld\n",
762 (long) CALL_DUMMY_P
);
763 fprintf_unfiltered (gdb_stdlog
,
764 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
765 (long) CALL_DUMMY_WORDS
);
766 fprintf_unfiltered (gdb_stdlog
,
767 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
768 (long) SIZEOF_CALL_DUMMY_WORDS
);
769 fprintf_unfiltered (gdb_stdlog
,
770 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
771 (long) CALL_DUMMY_STACK_ADJUST_P
);
772 if (CALL_DUMMY_STACK_ADJUST_P
)
773 fprintf_unfiltered (gdb_stdlog
,
774 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
775 (long) CALL_DUMMY_STACK_ADJUST
);
776 fprintf_unfiltered (gdb_stdlog
,
777 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
778 (long) current_gdbarch
->fix_call_dummy
779 /*FIX_CALL_DUMMY ()*/);
780 #ifdef BELIEVE_PCC_PROMOTION
781 fprintf_unfiltered (gdb_stdlog
,
782 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
783 (long) BELIEVE_PCC_PROMOTION
);
785 #ifdef BELIEVE_PCC_PROMOTION_TYPE
786 fprintf_unfiltered (gdb_stdlog
,
787 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
788 (long) BELIEVE_PCC_PROMOTION_TYPE
);
790 fprintf_unfiltered (gdb_stdlog
,
791 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
792 (long) current_gdbarch
->coerce_float_to_double
793 /*COERCE_FLOAT_TO_DOUBLE ()*/);
794 fprintf_unfiltered (gdb_stdlog
,
795 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
796 (long) current_gdbarch
->get_saved_register
797 /*GET_SAVED_REGISTER ()*/);
798 fprintf_unfiltered (gdb_stdlog
,
799 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
800 (long) current_gdbarch
->register_convertible
801 /*REGISTER_CONVERTIBLE ()*/);
802 fprintf_unfiltered (gdb_stdlog
,
803 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
804 (long) current_gdbarch
->register_convert_to_virtual
805 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
806 fprintf_unfiltered (gdb_stdlog
,
807 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
808 (long) current_gdbarch
->register_convert_to_raw
809 /*REGISTER_CONVERT_TO_RAW ()*/);
810 fprintf_unfiltered (gdb_stdlog
,
811 "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n",
812 (long) current_gdbarch
->pointer_to_address
813 /*POINTER_TO_ADDRESS ()*/);
814 fprintf_unfiltered (gdb_stdlog
,
815 "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n",
816 (long) current_gdbarch
->address_to_pointer
817 /*ADDRESS_TO_POINTER ()*/);
818 fprintf_unfiltered (gdb_stdlog
,
819 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
820 (long) current_gdbarch
->extract_return_value
821 /*EXTRACT_RETURN_VALUE ()*/);
822 fprintf_unfiltered (gdb_stdlog
,
823 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
824 (long) current_gdbarch
->push_arguments
825 /*PUSH_ARGUMENTS ()*/);
826 fprintf_unfiltered (gdb_stdlog
,
827 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
828 (long) current_gdbarch
->push_dummy_frame
829 /*PUSH_DUMMY_FRAME ()*/);
830 fprintf_unfiltered (gdb_stdlog
,
831 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
832 (long) current_gdbarch
->push_return_address
833 /*PUSH_RETURN_ADDRESS ()*/);
834 fprintf_unfiltered (gdb_stdlog
,
835 "gdbarch_update: POP_FRAME = 0x%08lx\n",
836 (long) current_gdbarch
->pop_frame
838 fprintf_unfiltered (gdb_stdlog
,
839 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
840 (long) current_gdbarch
->d10v_make_daddr
841 /*D10V_MAKE_DADDR ()*/);
842 fprintf_unfiltered (gdb_stdlog
,
843 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
844 (long) current_gdbarch
->d10v_make_iaddr
845 /*D10V_MAKE_IADDR ()*/);
846 fprintf_unfiltered (gdb_stdlog
,
847 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
848 (long) current_gdbarch
->d10v_daddr_p
849 /*D10V_DADDR_P ()*/);
850 fprintf_unfiltered (gdb_stdlog
,
851 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
852 (long) current_gdbarch
->d10v_iaddr_p
853 /*D10V_IADDR_P ()*/);
854 fprintf_unfiltered (gdb_stdlog
,
855 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
856 (long) current_gdbarch
->d10v_convert_daddr_to_raw
857 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
858 fprintf_unfiltered (gdb_stdlog
,
859 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
860 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
861 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
862 fprintf_unfiltered (gdb_stdlog
,
863 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
864 (long) current_gdbarch
->store_struct_return
865 /*STORE_STRUCT_RETURN ()*/);
866 fprintf_unfiltered (gdb_stdlog
,
867 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
868 (long) current_gdbarch
->store_return_value
869 /*STORE_RETURN_VALUE ()*/);
870 fprintf_unfiltered (gdb_stdlog
,
871 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
872 (long) current_gdbarch
->extract_struct_value_address
873 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
874 fprintf_unfiltered (gdb_stdlog
,
875 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
876 (long) current_gdbarch
->use_struct_convention
877 /*USE_STRUCT_CONVENTION ()*/);
878 fprintf_unfiltered (gdb_stdlog
,
879 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
880 (long) current_gdbarch
->frame_init_saved_regs
881 /*FRAME_INIT_SAVED_REGS ()*/);
882 fprintf_unfiltered (gdb_stdlog
,
883 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
884 (long) current_gdbarch
->init_extra_frame_info
885 /*INIT_EXTRA_FRAME_INFO ()*/);
886 fprintf_unfiltered (gdb_stdlog
,
887 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
888 (long) current_gdbarch
->skip_prologue
889 /*SKIP_PROLOGUE ()*/);
890 fprintf_unfiltered (gdb_stdlog
,
891 "gdbarch_update: INNER_THAN = 0x%08lx\n",
892 (long) current_gdbarch
->inner_than
894 fprintf_unfiltered (gdb_stdlog
,
895 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
896 (long) current_gdbarch
->breakpoint_from_pc
897 /*BREAKPOINT_FROM_PC ()*/);
898 fprintf_unfiltered (gdb_stdlog
,
899 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
900 (long) current_gdbarch
->memory_insert_breakpoint
901 /*MEMORY_INSERT_BREAKPOINT ()*/);
902 fprintf_unfiltered (gdb_stdlog
,
903 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
904 (long) current_gdbarch
->memory_remove_breakpoint
905 /*MEMORY_REMOVE_BREAKPOINT ()*/);
906 fprintf_unfiltered (gdb_stdlog
,
907 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
908 (long) DECR_PC_AFTER_BREAK
);
909 fprintf_unfiltered (gdb_stdlog
,
910 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
911 (long) FUNCTION_START_OFFSET
);
912 fprintf_unfiltered (gdb_stdlog
,
913 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
914 (long) current_gdbarch
->remote_translate_xfer_address
915 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
916 fprintf_unfiltered (gdb_stdlog
,
917 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
918 (long) FRAME_ARGS_SKIP
);
919 fprintf_unfiltered (gdb_stdlog
,
920 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
921 (long) current_gdbarch
->frameless_function_invocation
922 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
923 fprintf_unfiltered (gdb_stdlog
,
924 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
925 (long) current_gdbarch
->frame_chain
927 fprintf_unfiltered (gdb_stdlog
,
928 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
929 (long) current_gdbarch
->frame_chain_valid
930 /*FRAME_CHAIN_VALID ()*/);
931 fprintf_unfiltered (gdb_stdlog
,
932 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
933 (long) current_gdbarch
->frame_saved_pc
934 /*FRAME_SAVED_PC ()*/);
935 fprintf_unfiltered (gdb_stdlog
,
936 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
937 (long) current_gdbarch
->frame_args_address
938 /*FRAME_ARGS_ADDRESS ()*/);
939 fprintf_unfiltered (gdb_stdlog
,
940 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
941 (long) current_gdbarch
->frame_locals_address
942 /*FRAME_LOCALS_ADDRESS ()*/);
943 fprintf_unfiltered (gdb_stdlog
,
944 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
945 (long) current_gdbarch
->saved_pc_after_call
946 /*SAVED_PC_AFTER_CALL ()*/);
947 fprintf_unfiltered (gdb_stdlog
,
948 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
949 (long) current_gdbarch
->frame_num_args
950 /*FRAME_NUM_ARGS ()*/);
953 struct gdbarch_tdep
*
954 gdbarch_tdep (struct gdbarch
*gdbarch
)
956 if (gdbarch_debug
>= 2)
957 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
958 return gdbarch
->tdep
;
962 const struct bfd_arch_info
*
963 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
965 if (gdbarch_debug
>= 2)
966 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
967 return gdbarch
->bfd_arch_info
;
971 gdbarch_byte_order (struct gdbarch
*gdbarch
)
973 if (gdbarch_debug
>= 2)
974 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
975 return gdbarch
->byte_order
;
979 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
981 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
982 if (gdbarch_debug
>= 2)
983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
984 return gdbarch
->bfd_vma_bit
;
988 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
991 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
995 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
997 if (gdbarch
->ptr_bit
== 0)
998 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
999 if (gdbarch_debug
>= 2)
1000 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1001 return gdbarch
->ptr_bit
;
1005 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1008 gdbarch
->ptr_bit
= ptr_bit
;
1012 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1014 if (gdbarch
->short_bit
== 0)
1015 internal_error ("gdbarch: gdbarch_short_bit invalid");
1016 if (gdbarch_debug
>= 2)
1017 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1018 return gdbarch
->short_bit
;
1022 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1025 gdbarch
->short_bit
= short_bit
;
1029 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1031 if (gdbarch
->int_bit
== 0)
1032 internal_error ("gdbarch: gdbarch_int_bit invalid");
1033 if (gdbarch_debug
>= 2)
1034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1035 return gdbarch
->int_bit
;
1039 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1042 gdbarch
->int_bit
= int_bit
;
1046 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1048 if (gdbarch
->long_bit
== 0)
1049 internal_error ("gdbarch: gdbarch_long_bit invalid");
1050 if (gdbarch_debug
>= 2)
1051 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1052 return gdbarch
->long_bit
;
1056 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1059 gdbarch
->long_bit
= long_bit
;
1063 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1065 if (gdbarch
->long_long_bit
== 0)
1066 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1067 if (gdbarch_debug
>= 2)
1068 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1069 return gdbarch
->long_long_bit
;
1073 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1076 gdbarch
->long_long_bit
= long_long_bit
;
1080 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1082 if (gdbarch
->float_bit
== 0)
1083 internal_error ("gdbarch: gdbarch_float_bit invalid");
1084 if (gdbarch_debug
>= 2)
1085 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1086 return gdbarch
->float_bit
;
1090 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1093 gdbarch
->float_bit
= float_bit
;
1097 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1099 if (gdbarch
->double_bit
== 0)
1100 internal_error ("gdbarch: gdbarch_double_bit invalid");
1101 if (gdbarch_debug
>= 2)
1102 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1103 return gdbarch
->double_bit
;
1107 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1110 gdbarch
->double_bit
= double_bit
;
1114 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1116 if (gdbarch
->long_double_bit
== 0)
1117 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1118 if (gdbarch_debug
>= 2)
1119 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1120 return gdbarch
->long_double_bit
;
1124 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1125 int long_double_bit
)
1127 gdbarch
->long_double_bit
= long_double_bit
;
1131 gdbarch_ieee_float (struct gdbarch
*gdbarch
)
1133 /* Skip verify of ieee_float, invalid_p == 0 */
1134 if (gdbarch_debug
>= 2)
1135 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ieee_float called\n");
1136 return gdbarch
->ieee_float
;
1140 set_gdbarch_ieee_float (struct gdbarch
*gdbarch
,
1143 gdbarch
->ieee_float
= ieee_float
;
1147 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1149 if (gdbarch
->read_pc
== 0)
1150 internal_error ("gdbarch: gdbarch_read_pc invalid");
1151 if (gdbarch_debug
>= 2)
1152 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1153 return gdbarch
->read_pc (pid
);
1157 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1158 gdbarch_read_pc_ftype read_pc
)
1160 gdbarch
->read_pc
= read_pc
;
1164 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1166 if (gdbarch
->write_pc
== 0)
1167 internal_error ("gdbarch: gdbarch_write_pc invalid");
1168 if (gdbarch_debug
>= 2)
1169 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1170 gdbarch
->write_pc (val
, pid
);
1174 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1175 gdbarch_write_pc_ftype write_pc
)
1177 gdbarch
->write_pc
= write_pc
;
1181 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1183 if (gdbarch
->read_fp
== 0)
1184 internal_error ("gdbarch: gdbarch_read_fp invalid");
1185 if (gdbarch_debug
>= 2)
1186 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1187 return gdbarch
->read_fp ();
1191 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1192 gdbarch_read_fp_ftype read_fp
)
1194 gdbarch
->read_fp
= read_fp
;
1198 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1200 if (gdbarch
->write_fp
== 0)
1201 internal_error ("gdbarch: gdbarch_write_fp invalid");
1202 if (gdbarch_debug
>= 2)
1203 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1204 gdbarch
->write_fp (val
);
1208 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1209 gdbarch_write_fp_ftype write_fp
)
1211 gdbarch
->write_fp
= write_fp
;
1215 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1217 if (gdbarch
->read_sp
== 0)
1218 internal_error ("gdbarch: gdbarch_read_sp invalid");
1219 if (gdbarch_debug
>= 2)
1220 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1221 return gdbarch
->read_sp ();
1225 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1226 gdbarch_read_sp_ftype read_sp
)
1228 gdbarch
->read_sp
= read_sp
;
1232 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1234 if (gdbarch
->write_sp
== 0)
1235 internal_error ("gdbarch: gdbarch_write_sp invalid");
1236 if (gdbarch_debug
>= 2)
1237 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1238 gdbarch
->write_sp (val
);
1242 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1243 gdbarch_write_sp_ftype write_sp
)
1245 gdbarch
->write_sp
= write_sp
;
1249 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1251 if (gdbarch
->num_regs
== -1)
1252 internal_error ("gdbarch: gdbarch_num_regs invalid");
1253 if (gdbarch_debug
>= 2)
1254 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1255 return gdbarch
->num_regs
;
1259 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1262 gdbarch
->num_regs
= num_regs
;
1266 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1268 if (gdbarch
->sp_regnum
== -1)
1269 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1270 if (gdbarch_debug
>= 2)
1271 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1272 return gdbarch
->sp_regnum
;
1276 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1279 gdbarch
->sp_regnum
= sp_regnum
;
1283 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1285 if (gdbarch
->fp_regnum
== -1)
1286 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1287 if (gdbarch_debug
>= 2)
1288 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1289 return gdbarch
->fp_regnum
;
1293 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1296 gdbarch
->fp_regnum
= fp_regnum
;
1300 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1302 if (gdbarch
->pc_regnum
== -1)
1303 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1304 if (gdbarch_debug
>= 2)
1305 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1306 return gdbarch
->pc_regnum
;
1310 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1313 gdbarch
->pc_regnum
= pc_regnum
;
1317 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1319 if (GDB_MULTI_ARCH
== 0)
1320 return legacy_register_name (regnr
);
1321 if (gdbarch
->register_name
== 0)
1322 internal_error ("gdbarch: gdbarch_register_name invalid");
1323 if (gdbarch_debug
>= 2)
1324 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1325 return gdbarch
->register_name (regnr
);
1329 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1330 gdbarch_register_name_ftype register_name
)
1332 gdbarch
->register_name
= register_name
;
1336 gdbarch_register_size (struct gdbarch
*gdbarch
)
1338 if (gdbarch
->register_size
== -1)
1339 internal_error ("gdbarch: gdbarch_register_size invalid");
1340 if (gdbarch_debug
>= 2)
1341 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1342 return gdbarch
->register_size
;
1346 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1349 gdbarch
->register_size
= register_size
;
1353 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1355 if (gdbarch
->register_bytes
== -1)
1356 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1357 if (gdbarch_debug
>= 2)
1358 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1359 return gdbarch
->register_bytes
;
1363 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1366 gdbarch
->register_bytes
= register_bytes
;
1370 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1372 if (gdbarch
->register_byte
== 0)
1373 internal_error ("gdbarch: gdbarch_register_byte invalid");
1374 if (gdbarch_debug
>= 2)
1375 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1376 return gdbarch
->register_byte (reg_nr
);
1380 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1381 gdbarch_register_byte_ftype register_byte
)
1383 gdbarch
->register_byte
= register_byte
;
1387 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1389 if (gdbarch
->register_raw_size
== 0)
1390 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1391 if (gdbarch_debug
>= 2)
1392 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1393 return gdbarch
->register_raw_size (reg_nr
);
1397 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1398 gdbarch_register_raw_size_ftype register_raw_size
)
1400 gdbarch
->register_raw_size
= register_raw_size
;
1404 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1406 if (gdbarch
->max_register_raw_size
== -1)
1407 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1408 if (gdbarch_debug
>= 2)
1409 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1410 return gdbarch
->max_register_raw_size
;
1414 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1415 int max_register_raw_size
)
1417 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1421 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1423 if (gdbarch
->register_virtual_size
== 0)
1424 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1425 if (gdbarch_debug
>= 2)
1426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1427 return gdbarch
->register_virtual_size (reg_nr
);
1431 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1432 gdbarch_register_virtual_size_ftype register_virtual_size
)
1434 gdbarch
->register_virtual_size
= register_virtual_size
;
1438 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1440 if (gdbarch
->max_register_virtual_size
== -1)
1441 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1442 if (gdbarch_debug
>= 2)
1443 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1444 return gdbarch
->max_register_virtual_size
;
1448 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1449 int max_register_virtual_size
)
1451 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1455 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1457 if (gdbarch
->register_virtual_type
== 0)
1458 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1459 if (gdbarch_debug
>= 2)
1460 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1461 return gdbarch
->register_virtual_type (reg_nr
);
1465 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1466 gdbarch_register_virtual_type_ftype register_virtual_type
)
1468 gdbarch
->register_virtual_type
= register_virtual_type
;
1472 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1474 if (gdbarch
->use_generic_dummy_frames
== -1)
1475 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1476 if (gdbarch_debug
>= 2)
1477 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1478 return gdbarch
->use_generic_dummy_frames
;
1482 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1483 int use_generic_dummy_frames
)
1485 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1489 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1491 if (gdbarch
->call_dummy_location
== 0)
1492 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1493 if (gdbarch_debug
>= 2)
1494 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1495 return gdbarch
->call_dummy_location
;
1499 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1500 int call_dummy_location
)
1502 gdbarch
->call_dummy_location
= call_dummy_location
;
1506 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1508 if (gdbarch
->call_dummy_address
== 0)
1509 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1510 if (gdbarch_debug
>= 2)
1511 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1512 return gdbarch
->call_dummy_address ();
1516 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1517 gdbarch_call_dummy_address_ftype call_dummy_address
)
1519 gdbarch
->call_dummy_address
= call_dummy_address
;
1523 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1525 if (gdbarch
->call_dummy_start_offset
== -1)
1526 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1527 if (gdbarch_debug
>= 2)
1528 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1529 return gdbarch
->call_dummy_start_offset
;
1533 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1534 CORE_ADDR call_dummy_start_offset
)
1536 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1540 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1542 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1543 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1544 if (gdbarch_debug
>= 2)
1545 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1546 return gdbarch
->call_dummy_breakpoint_offset
;
1550 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1551 CORE_ADDR call_dummy_breakpoint_offset
)
1553 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1557 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1559 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1560 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1561 if (gdbarch_debug
>= 2)
1562 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1563 return gdbarch
->call_dummy_breakpoint_offset_p
;
1567 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1568 int call_dummy_breakpoint_offset_p
)
1570 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1574 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1576 if (gdbarch
->call_dummy_length
== -1)
1577 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1578 if (gdbarch_debug
>= 2)
1579 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1580 return gdbarch
->call_dummy_length
;
1584 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1585 int call_dummy_length
)
1587 gdbarch
->call_dummy_length
= call_dummy_length
;
1591 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1593 if (gdbarch
->pc_in_call_dummy
== 0)
1594 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1595 if (gdbarch_debug
>= 2)
1596 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1597 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1601 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1602 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1604 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1608 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1610 if (gdbarch
->call_dummy_p
== -1)
1611 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1612 if (gdbarch_debug
>= 2)
1613 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1614 return gdbarch
->call_dummy_p
;
1618 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1621 gdbarch
->call_dummy_p
= call_dummy_p
;
1625 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1627 /* Skip verify of call_dummy_words, invalid_p == 0 */
1628 if (gdbarch_debug
>= 2)
1629 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1630 return gdbarch
->call_dummy_words
;
1634 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1635 LONGEST
* call_dummy_words
)
1637 gdbarch
->call_dummy_words
= call_dummy_words
;
1641 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1643 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
1644 if (gdbarch_debug
>= 2)
1645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1646 return gdbarch
->sizeof_call_dummy_words
;
1650 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1651 int sizeof_call_dummy_words
)
1653 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1657 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1659 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1660 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1661 if (gdbarch_debug
>= 2)
1662 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1663 return gdbarch
->call_dummy_stack_adjust_p
;
1667 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1668 int call_dummy_stack_adjust_p
)
1670 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1674 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1676 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1677 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1678 if (gdbarch_debug
>= 2)
1679 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1680 return gdbarch
->call_dummy_stack_adjust
;
1684 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1685 int call_dummy_stack_adjust
)
1687 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1691 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
)
1693 if (gdbarch
->fix_call_dummy
== 0)
1694 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1695 if (gdbarch_debug
>= 2)
1696 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1697 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1701 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1702 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1704 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1708 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1710 if (gdbarch_debug
>= 2)
1711 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1712 return gdbarch
->believe_pcc_promotion
;
1716 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1717 int believe_pcc_promotion
)
1719 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1723 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1725 if (gdbarch_debug
>= 2)
1726 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1727 return gdbarch
->believe_pcc_promotion_type
;
1731 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1732 int believe_pcc_promotion_type
)
1734 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1738 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
1740 if (GDB_MULTI_ARCH
== 0)
1741 return default_coerce_float_to_double (formal
, actual
);
1742 if (gdbarch
->coerce_float_to_double
== 0)
1743 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1744 if (gdbarch_debug
>= 2)
1745 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
1746 return gdbarch
->coerce_float_to_double (formal
, actual
);
1750 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
1751 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
1753 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
1757 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
)
1759 if (gdbarch
->get_saved_register
== 0)
1760 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1761 if (gdbarch_debug
>= 2)
1762 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1763 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1767 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1768 gdbarch_get_saved_register_ftype get_saved_register
)
1770 gdbarch
->get_saved_register
= get_saved_register
;
1774 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1776 if (GDB_MULTI_ARCH
== 0)
1777 return generic_register_convertible_not (nr
);
1778 if (gdbarch
->register_convertible
== 0)
1779 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1780 if (gdbarch_debug
>= 2)
1781 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1782 return gdbarch
->register_convertible (nr
);
1786 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1787 gdbarch_register_convertible_ftype register_convertible
)
1789 gdbarch
->register_convertible
= register_convertible
;
1793 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1795 if (gdbarch
->register_convert_to_virtual
== 0)
1796 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1797 if (gdbarch_debug
>= 2)
1798 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1799 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1803 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1804 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1806 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1810 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1812 if (gdbarch
->register_convert_to_raw
== 0)
1813 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1814 if (gdbarch_debug
>= 2)
1815 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1816 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1820 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1821 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1823 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1827 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
)
1829 if (GDB_MULTI_ARCH
== 0)
1830 return generic_pointer_to_address (type
, buf
);
1831 if (gdbarch
->pointer_to_address
== 0)
1832 internal_error ("gdbarch: gdbarch_pointer_to_address invalid");
1833 if (gdbarch_debug
>= 2)
1834 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
1835 return gdbarch
->pointer_to_address (type
, buf
);
1839 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
1840 gdbarch_pointer_to_address_ftype pointer_to_address
)
1842 gdbarch
->pointer_to_address
= pointer_to_address
;
1846 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, char *buf
, CORE_ADDR addr
)
1848 if (GDB_MULTI_ARCH
== 0)
1850 generic_address_to_pointer (type
, buf
, addr
);
1853 if (gdbarch
->address_to_pointer
== 0)
1854 internal_error ("gdbarch: gdbarch_address_to_pointer invalid");
1855 if (gdbarch_debug
>= 2)
1856 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
1857 gdbarch
->address_to_pointer (type
, buf
, addr
);
1861 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
1862 gdbarch_address_to_pointer_ftype address_to_pointer
)
1864 gdbarch
->address_to_pointer
= address_to_pointer
;
1868 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1870 if (gdbarch
->extract_return_value
== 0)
1871 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1872 if (gdbarch_debug
>= 2)
1873 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1874 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1878 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1879 gdbarch_extract_return_value_ftype extract_return_value
)
1881 gdbarch
->extract_return_value
= extract_return_value
;
1885 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1887 if (gdbarch
->push_arguments
== 0)
1888 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1889 if (gdbarch_debug
>= 2)
1890 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1891 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1895 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1896 gdbarch_push_arguments_ftype push_arguments
)
1898 gdbarch
->push_arguments
= push_arguments
;
1902 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1904 if (gdbarch
->push_dummy_frame
== 0)
1905 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1906 if (gdbarch_debug
>= 2)
1907 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1908 gdbarch
->push_dummy_frame ();
1912 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
1913 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
1915 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1919 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1921 if (gdbarch
->push_return_address
== 0)
1922 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1923 if (gdbarch_debug
>= 2)
1924 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1925 return gdbarch
->push_return_address (pc
, sp
);
1929 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
1930 gdbarch_push_return_address_ftype push_return_address
)
1932 gdbarch
->push_return_address
= push_return_address
;
1936 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
1938 if (gdbarch
->pop_frame
== 0)
1939 internal_error ("gdbarch: gdbarch_pop_frame invalid");
1940 if (gdbarch_debug
>= 2)
1941 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
1942 gdbarch
->pop_frame ();
1946 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
1947 gdbarch_pop_frame_ftype pop_frame
)
1949 gdbarch
->pop_frame
= pop_frame
;
1953 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1955 if (gdbarch
->d10v_make_daddr
== 0)
1956 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
1957 if (gdbarch_debug
>= 2)
1958 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
1959 return gdbarch
->d10v_make_daddr (x
);
1963 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
1964 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
1966 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
1970 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1972 if (gdbarch
->d10v_make_iaddr
== 0)
1973 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
1974 if (gdbarch_debug
>= 2)
1975 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
1976 return gdbarch
->d10v_make_iaddr (x
);
1980 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
1981 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
1983 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
1987 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1989 if (gdbarch
->d10v_daddr_p
== 0)
1990 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
1991 if (gdbarch_debug
>= 2)
1992 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
1993 return gdbarch
->d10v_daddr_p (x
);
1997 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
1998 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
2000 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
2004 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2006 if (gdbarch
->d10v_iaddr_p
== 0)
2007 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
2008 if (gdbarch_debug
>= 2)
2009 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2010 return gdbarch
->d10v_iaddr_p (x
);
2014 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2015 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2017 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2021 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2023 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2024 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2025 if (gdbarch_debug
>= 2)
2026 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2027 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2031 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2032 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2034 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2038 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2040 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2041 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2042 if (gdbarch_debug
>= 2)
2043 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2044 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2048 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2049 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2051 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2055 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2057 if (gdbarch
->store_struct_return
== 0)
2058 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2059 if (gdbarch_debug
>= 2)
2060 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2061 gdbarch
->store_struct_return (addr
, sp
);
2065 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2066 gdbarch_store_struct_return_ftype store_struct_return
)
2068 gdbarch
->store_struct_return
= store_struct_return
;
2072 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2074 if (gdbarch
->store_return_value
== 0)
2075 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2076 if (gdbarch_debug
>= 2)
2077 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2078 gdbarch
->store_return_value (type
, valbuf
);
2082 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2083 gdbarch_store_return_value_ftype store_return_value
)
2085 gdbarch
->store_return_value
= store_return_value
;
2089 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2091 if (gdbarch
->extract_struct_value_address
== 0)
2092 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2093 if (gdbarch_debug
>= 2)
2094 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2095 return gdbarch
->extract_struct_value_address (regbuf
);
2099 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2100 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2102 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2106 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2108 if (gdbarch
->use_struct_convention
== 0)
2109 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2110 if (gdbarch_debug
>= 2)
2111 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2112 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2116 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2117 gdbarch_use_struct_convention_ftype use_struct_convention
)
2119 gdbarch
->use_struct_convention
= use_struct_convention
;
2123 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2125 if (gdbarch
->frame_init_saved_regs
== 0)
2126 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2127 if (gdbarch_debug
>= 2)
2128 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2129 gdbarch
->frame_init_saved_regs (frame
);
2133 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2134 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2136 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2140 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2142 if (gdbarch
->init_extra_frame_info
== 0)
2143 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2144 if (gdbarch_debug
>= 2)
2145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2146 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2150 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2151 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2153 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2157 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2159 if (gdbarch
->skip_prologue
== 0)
2160 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2161 if (gdbarch_debug
>= 2)
2162 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2163 return gdbarch
->skip_prologue (ip
);
2167 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2168 gdbarch_skip_prologue_ftype skip_prologue
)
2170 gdbarch
->skip_prologue
= skip_prologue
;
2174 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2176 if (gdbarch
->inner_than
== 0)
2177 internal_error ("gdbarch: gdbarch_inner_than invalid");
2178 if (gdbarch_debug
>= 2)
2179 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2180 return gdbarch
->inner_than (lhs
, rhs
);
2184 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2185 gdbarch_inner_than_ftype inner_than
)
2187 gdbarch
->inner_than
= inner_than
;
2191 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2193 if (GDB_MULTI_ARCH
== 0)
2194 return legacy_breakpoint_from_pc (pcptr
, lenptr
);
2195 if (gdbarch
->breakpoint_from_pc
== 0)
2196 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2197 if (gdbarch_debug
>= 2)
2198 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2199 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2203 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2204 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2206 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2210 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2212 if (GDB_MULTI_ARCH
== 0)
2213 return default_memory_insert_breakpoint (addr
, contents_cache
);
2214 if (gdbarch
->memory_insert_breakpoint
== 0)
2215 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2216 if (gdbarch_debug
>= 2)
2217 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2218 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2222 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2223 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2225 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2229 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2231 if (GDB_MULTI_ARCH
== 0)
2232 return default_memory_remove_breakpoint (addr
, contents_cache
);
2233 if (gdbarch
->memory_remove_breakpoint
== 0)
2234 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2235 if (gdbarch_debug
>= 2)
2236 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2237 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2241 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2242 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2244 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2248 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2250 if (gdbarch
->decr_pc_after_break
== -1)
2251 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2252 if (gdbarch_debug
>= 2)
2253 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2254 return gdbarch
->decr_pc_after_break
;
2258 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2259 CORE_ADDR decr_pc_after_break
)
2261 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2265 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2267 if (gdbarch
->function_start_offset
== -1)
2268 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2269 if (gdbarch_debug
>= 2)
2270 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2271 return gdbarch
->function_start_offset
;
2275 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2276 CORE_ADDR function_start_offset
)
2278 gdbarch
->function_start_offset
= function_start_offset
;
2282 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2284 if (GDB_MULTI_ARCH
== 0)
2286 generic_remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2289 if (gdbarch
->remote_translate_xfer_address
== 0)
2290 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2291 if (gdbarch_debug
>= 2)
2292 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2293 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2297 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2298 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2300 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2304 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2306 if (gdbarch
->frame_args_skip
== -1)
2307 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2308 if (gdbarch_debug
>= 2)
2309 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2310 return gdbarch
->frame_args_skip
;
2314 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2315 CORE_ADDR frame_args_skip
)
2317 gdbarch
->frame_args_skip
= frame_args_skip
;
2321 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2323 if (GDB_MULTI_ARCH
== 0)
2324 return generic_frameless_function_invocation_not (fi
);
2325 if (gdbarch
->frameless_function_invocation
== 0)
2326 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2327 if (gdbarch_debug
>= 2)
2328 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2329 return gdbarch
->frameless_function_invocation (fi
);
2333 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2334 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2336 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2340 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2342 if (gdbarch
->frame_chain
== 0)
2343 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2344 if (gdbarch_debug
>= 2)
2345 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2346 return gdbarch
->frame_chain (frame
);
2350 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2351 gdbarch_frame_chain_ftype frame_chain
)
2353 gdbarch
->frame_chain
= frame_chain
;
2357 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2359 if (gdbarch
->frame_chain_valid
== 0)
2360 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2361 if (gdbarch_debug
>= 2)
2362 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2363 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2367 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2368 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2370 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2374 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2376 if (gdbarch
->frame_saved_pc
== 0)
2377 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2378 if (gdbarch_debug
>= 2)
2379 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2380 return gdbarch
->frame_saved_pc (fi
);
2384 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2385 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2387 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2391 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2393 if (gdbarch
->frame_args_address
== 0)
2394 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2395 if (gdbarch_debug
>= 2)
2396 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2397 return gdbarch
->frame_args_address (fi
);
2401 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2402 gdbarch_frame_args_address_ftype frame_args_address
)
2404 gdbarch
->frame_args_address
= frame_args_address
;
2408 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2410 if (gdbarch
->frame_locals_address
== 0)
2411 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2412 if (gdbarch_debug
>= 2)
2413 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2414 return gdbarch
->frame_locals_address (fi
);
2418 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2419 gdbarch_frame_locals_address_ftype frame_locals_address
)
2421 gdbarch
->frame_locals_address
= frame_locals_address
;
2425 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2427 if (gdbarch
->saved_pc_after_call
== 0)
2428 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2429 if (gdbarch_debug
>= 2)
2430 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2431 return gdbarch
->saved_pc_after_call (frame
);
2435 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2436 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2438 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2442 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2444 if (gdbarch
->frame_num_args
== 0)
2445 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2446 if (gdbarch_debug
>= 2)
2447 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2448 return gdbarch
->frame_num_args (frame
);
2452 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2453 gdbarch_frame_num_args_ftype frame_num_args
)
2455 gdbarch
->frame_num_args
= frame_num_args
;
2459 /* Keep a registrary of per-architecture data-pointers required by GDB
2467 struct gdbarch_data_registration
2469 gdbarch_data_ftype
*init
;
2470 struct gdbarch_data
*data
;
2471 struct gdbarch_data_registration
*next
;
2474 struct gdbarch_data_registrary
2477 struct gdbarch_data_registration
*registrations
;
2480 struct gdbarch_data_registrary gdbarch_data_registrary
=
2485 struct gdbarch_data
*
2486 register_gdbarch_data (gdbarch_data_ftype
*init
)
2488 struct gdbarch_data_registration
**curr
;
2489 for (curr
= &gdbarch_data_registrary
.registrations
;
2491 curr
= &(*curr
)->next
);
2492 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2493 (*curr
)->next
= NULL
;
2494 (*curr
)->init
= init
;
2495 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2496 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2497 return (*curr
)->data
;
2501 /* Walk through all the registered users initializing each in turn. */
2504 init_gdbarch_data (struct gdbarch
*gdbarch
)
2506 struct gdbarch_data_registration
*rego
;
2507 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2508 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2509 for (rego
= gdbarch_data_registrary
.registrations
;
2513 if (rego
->data
->index
< gdbarch
->nr_data
)
2514 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2519 /* Return the current value of the specified per-architecture
2524 struct gdbarch_data
*data
;
2526 if (data
->index
>= current_gdbarch
->nr_data
)
2527 internal_error ("gdbarch_data: request for non-existant data.");
2528 return current_gdbarch
->data
[data
->index
];
2533 /* Keep a registrary of swaped data required by GDB modules. */
2538 struct gdbarch_swap_registration
*source
;
2539 struct gdbarch_swap
*next
;
2542 struct gdbarch_swap_registration
2545 unsigned long sizeof_data
;
2546 gdbarch_swap_ftype
*init
;
2547 struct gdbarch_swap_registration
*next
;
2550 struct gdbarch_swap_registrary
2553 struct gdbarch_swap_registration
*registrations
;
2556 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2562 register_gdbarch_swap (void *data
,
2563 unsigned long sizeof_data
,
2564 gdbarch_swap_ftype
*init
)
2566 struct gdbarch_swap_registration
**rego
;
2567 for (rego
= &gdbarch_swap_registrary
.registrations
;
2569 rego
= &(*rego
)->next
);
2570 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2571 (*rego
)->next
= NULL
;
2572 (*rego
)->init
= init
;
2573 (*rego
)->data
= data
;
2574 (*rego
)->sizeof_data
= sizeof_data
;
2579 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2581 struct gdbarch_swap_registration
*rego
;
2582 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2583 for (rego
= gdbarch_swap_registrary
.registrations
;
2587 if (rego
->data
!= NULL
)
2589 (*curr
) = XMALLOC (struct gdbarch_swap
);
2590 (*curr
)->source
= rego
;
2591 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2592 (*curr
)->next
= NULL
;
2593 memset (rego
->data
, 0, rego
->sizeof_data
);
2594 curr
= &(*curr
)->next
;
2596 if (rego
->init
!= NULL
)
2602 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2604 struct gdbarch_swap
*curr
;
2605 for (curr
= gdbarch
->swap
;
2608 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2612 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2614 struct gdbarch_swap
*curr
;
2615 for (curr
= gdbarch
->swap
;
2618 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2622 /* Keep a registrary of the architectures known by GDB. */
2624 struct gdbarch_init_registration
2626 enum bfd_architecture bfd_architecture
;
2627 gdbarch_init_ftype
*init
;
2628 struct gdbarch_list
*arches
;
2629 struct gdbarch_init_registration
*next
;
2632 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2635 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2636 gdbarch_init_ftype
*init
)
2638 struct gdbarch_init_registration
**curr
;
2639 const struct bfd_arch_info
*bfd_arch_info
;
2640 /* Check that BFD reconizes this architecture */
2641 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2642 if (bfd_arch_info
== NULL
)
2644 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2646 /* Check that we haven't seen this architecture before */
2647 for (curr
= &gdbarch_init_registrary
;
2649 curr
= &(*curr
)->next
)
2651 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2652 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2653 bfd_arch_info
->printable_name
);
2657 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2658 bfd_arch_info
->printable_name
,
2661 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2662 (*curr
)->bfd_architecture
= bfd_architecture
;
2663 (*curr
)->init
= init
;
2664 (*curr
)->arches
= NULL
;
2665 (*curr
)->next
= NULL
;
2670 /* Look for an architecture using gdbarch_info. Base search on only
2671 BFD_ARCH_INFO and BYTE_ORDER. */
2673 struct gdbarch_list
*
2674 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2675 const struct gdbarch_info
*info
)
2677 for (; arches
!= NULL
; arches
= arches
->next
)
2679 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2681 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2689 /* Update the current architecture. Return ZERO if the update request
2693 gdbarch_update (struct gdbarch_info info
)
2695 struct gdbarch
*new_gdbarch
;
2696 struct gdbarch_list
**list
;
2697 struct gdbarch_init_registration
*rego
;
2699 /* Fill in any missing bits. Most important is the bfd_architecture
2700 which is used to select the target architecture. */
2701 if (info
.bfd_architecture
== bfd_arch_unknown
)
2703 if (info
.bfd_arch_info
!= NULL
)
2704 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2705 else if (info
.abfd
!= NULL
)
2706 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2707 /* FIXME - should query BFD for its default architecture. */
2709 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2711 if (info
.bfd_arch_info
== NULL
)
2713 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2714 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2716 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2718 if (info
.byte_order
== 0)
2720 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2721 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2722 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2725 info
.byte_order
= current_gdbarch
->byte_order
;
2726 /* FIXME - should query BFD for its default byte-order. */
2728 /* A default for abfd? */
2730 /* Find the target that knows about this architecture. */
2731 for (rego
= gdbarch_init_registrary
;
2732 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2743 fprintf_unfiltered (gdb_stdlog
,
2744 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2745 info
.bfd_architecture
,
2746 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2747 fprintf_unfiltered (gdb_stdlog
,
2748 "gdbarch_update: info.bfd_arch_info %s\n",
2749 (info
.bfd_arch_info
!= NULL
2750 ? info
.bfd_arch_info
->printable_name
2752 fprintf_unfiltered (gdb_stdlog
,
2753 "gdbarch_update: info.byte_order %d (%s)\n",
2755 (info
.byte_order
== BIG_ENDIAN
? "big"
2756 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2758 fprintf_unfiltered (gdb_stdlog
,
2759 "gdbarch_update: info.abfd 0x%lx\n",
2761 fprintf_unfiltered (gdb_stdlog
,
2762 "gdbarch_update: info.tdep_info 0x%lx\n",
2763 (long) info
.tdep_info
);
2766 /* Ask the target for a replacement architecture. */
2767 new_gdbarch
= rego
->init (info
, rego
->arches
);
2769 /* Did the target like it? No. Reject the change. */
2770 if (new_gdbarch
== NULL
)
2773 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2777 /* Did the architecture change? No. Do nothing. */
2778 if (current_gdbarch
== new_gdbarch
)
2781 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2783 new_gdbarch
->bfd_arch_info
->printable_name
);
2787 /* Swap all data belonging to the old target out */
2788 swapout_gdbarch_swap (current_gdbarch
);
2790 /* Is this a pre-existing architecture? Yes. Swap it in. */
2791 for (list
= ®o
->arches
;
2793 list
= &(*list
)->next
)
2795 if ((*list
)->gdbarch
== new_gdbarch
)
2798 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2800 new_gdbarch
->bfd_arch_info
->printable_name
);
2801 current_gdbarch
= new_gdbarch
;
2802 swapin_gdbarch_swap (new_gdbarch
);
2807 /* Append this new architecture to this targets list. */
2808 (*list
) = XMALLOC (struct gdbarch_list
);
2809 (*list
)->next
= NULL
;
2810 (*list
)->gdbarch
= new_gdbarch
;
2812 /* Switch to this new architecture. Dump it out. */
2813 current_gdbarch
= new_gdbarch
;
2816 fprintf_unfiltered (gdb_stdlog
,
2817 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2819 new_gdbarch
->bfd_arch_info
->printable_name
);
2823 /* Check that the newly installed architecture is valid. */
2824 verify_gdbarch (new_gdbarch
);
2826 /* Initialize the per-architecture memory (swap) areas.
2827 CURRENT_GDBARCH must be update before these modules are
2829 init_gdbarch_swap (new_gdbarch
);
2831 /* Initialize the per-architecture data-pointer of all parties that
2832 registered an interest in this architecture. CURRENT_GDBARCH
2833 must be updated before these modules are called. */
2834 init_gdbarch_data (new_gdbarch
);
2841 /* Functions to manipulate the endianness of the target. */
2843 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2844 /* compat - Catch old targets that expect a selectable byte-order to
2845 default to BIG_ENDIAN */
2846 #ifndef TARGET_BYTE_ORDER_DEFAULT
2847 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2850 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2851 #ifndef TARGET_BYTE_ORDER_DEFAULT
2852 /* compat - Catch old non byte-order selectable targets that do not
2853 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2854 TARGET_BYTE_ORDER to be used as the default. For targets that
2855 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2856 below will get a strange compiler warning. */
2857 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2860 #ifndef TARGET_BYTE_ORDER_DEFAULT
2861 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2863 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2864 int target_byte_order_auto
= 1;
2866 /* Chain containing the \"set endian\" commands. */
2867 static struct cmd_list_element
*endianlist
= NULL
;
2869 /* Called by ``show endian''. */
2871 show_endian (char *args
, int from_tty
)
2874 (TARGET_BYTE_ORDER_AUTO
2875 ? "The target endianness is set automatically (currently %s endian)\n"
2876 : "The target is assumed to be %s endian\n");
2877 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
2880 /* Called if the user enters ``set endian'' without an argument. */
2882 set_endian (char *args
, int from_tty
)
2884 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2885 show_endian (args
, from_tty
);
2888 /* Called by ``set endian big''. */
2890 set_endian_big (char *args
, int from_tty
)
2892 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2894 target_byte_order
= BIG_ENDIAN
;
2895 target_byte_order_auto
= 0;
2898 struct gdbarch_info info
;
2899 memset (&info
, 0, sizeof info
);
2900 info
.byte_order
= BIG_ENDIAN
;
2901 gdbarch_update (info
);
2906 printf_unfiltered ("Byte order is not selectable.");
2907 show_endian (args
, from_tty
);
2911 /* Called by ``set endian little''. */
2913 set_endian_little (char *args
, int from_tty
)
2915 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2917 target_byte_order
= LITTLE_ENDIAN
;
2918 target_byte_order_auto
= 0;
2921 struct gdbarch_info info
;
2922 memset (&info
, 0, sizeof info
);
2923 info
.byte_order
= LITTLE_ENDIAN
;
2924 gdbarch_update (info
);
2929 printf_unfiltered ("Byte order is not selectable.");
2930 show_endian (args
, from_tty
);
2934 /* Called by ``set endian auto''. */
2936 set_endian_auto (char *args
, int from_tty
)
2938 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2940 target_byte_order_auto
= 1;
2944 printf_unfiltered ("Byte order is not selectable.");
2945 show_endian (args
, from_tty
);
2949 /* Set the endianness from a BFD. */
2951 set_endian_from_file (bfd
*abfd
)
2953 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2957 if (bfd_big_endian (abfd
))
2960 want
= LITTLE_ENDIAN
;
2961 if (TARGET_BYTE_ORDER_AUTO
)
2962 target_byte_order
= want
;
2963 else if (TARGET_BYTE_ORDER
!= want
)
2964 warning ("%s endian file does not match %s endian target.",
2965 want
== BIG_ENDIAN
? "big" : "little",
2966 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2970 if (bfd_big_endian (abfd
)
2971 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
2972 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
2973 warning ("%s endian file does not match %s endian target.",
2974 bfd_big_endian (abfd
) ? "big" : "little",
2975 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2981 /* Functions to manipulate the architecture of the target */
2983 enum set_arch
{ set_arch_auto
, set_arch_manual
};
2985 int target_architecture_auto
= 1;
2986 extern const struct bfd_arch_info bfd_default_arch_struct
;
2987 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
2988 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
2990 static void show_endian (char *, int);
2991 static void set_endian (char *, int);
2992 static void set_endian_big (char *, int);
2993 static void set_endian_little (char *, int);
2994 static void set_endian_auto (char *, int);
2995 static void set_endian_from_file (bfd
*);
2996 static int arch_ok (const struct bfd_arch_info
*arch
);
2997 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
2998 static void show_architecture (char *, int);
2999 static void set_architecture (char *, int);
3000 static void info_architecture (char *, int);
3001 static void set_architecture_from_file (bfd
*);
3003 /* Do the real work of changing the current architecture */
3006 arch_ok (const struct bfd_arch_info
*arch
)
3008 /* Should be performing the more basic check that the binary is
3009 compatible with GDB. */
3010 /* Check with the target that the architecture is valid. */
3011 return (target_architecture_hook
== NULL
3012 || target_architecture_hook (arch
));
3016 set_arch (const struct bfd_arch_info
*arch
,
3022 if (!arch_ok (arch
))
3023 warning ("Target may not support %s architecture",
3024 arch
->printable_name
);
3025 target_architecture
= arch
;
3027 case set_arch_manual
:
3028 if (!arch_ok (arch
))
3030 printf_unfiltered ("Target does not support `%s' architecture.\n",
3031 arch
->printable_name
);
3035 target_architecture_auto
= 0;
3036 target_architecture
= arch
;
3044 /* Called if the user enters ``show architecture'' without an argument. */
3046 show_architecture (char *args
, int from_tty
)
3049 arch
= TARGET_ARCHITECTURE
->printable_name
;
3050 if (target_architecture_auto
)
3051 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3053 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3056 /* Called if the user enters ``set architecture'' with or without an
3059 set_architecture (char *args
, int from_tty
)
3063 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3065 else if (strcmp (args
, "auto") == 0)
3067 target_architecture_auto
= 1;
3069 else if (GDB_MULTI_ARCH
)
3071 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3073 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3076 struct gdbarch_info info
;
3077 memset (&info
, 0, sizeof info
);
3078 info
.bfd_arch_info
= arch
;
3079 if (gdbarch_update (info
))
3080 target_architecture_auto
= 0;
3082 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3087 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3089 set_arch (arch
, set_arch_manual
);
3091 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3095 /* Called if the user enters ``info architecture'' without an argument. */
3097 info_architecture (char *args
, int from_tty
)
3099 enum bfd_architecture a
;
3102 if (gdbarch_init_registrary
!= NULL
)
3104 struct gdbarch_init_registration
*rego
;
3105 printf_filtered ("Available architectures are:\n");
3106 for (rego
= gdbarch_init_registrary
;
3110 const struct bfd_arch_info
*ap
;
3111 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3116 printf_filtered (" %s", ap
->printable_name
);
3120 printf_filtered ("\n");
3126 printf_filtered ("There are no available architectures.\n");
3130 printf_filtered ("Available architectures are:\n");
3131 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3133 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3138 printf_filtered (" %s", ap
->printable_name
);
3142 printf_filtered ("\n");
3147 /* Set the architecture from arch/machine */
3149 set_architecture_from_arch_mach (arch
, mach
)
3150 enum bfd_architecture arch
;
3153 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3155 set_arch (wanted
, set_arch_manual
);
3157 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3160 /* Set the architecture from a BFD */
3162 set_architecture_from_file (bfd
*abfd
)
3164 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3165 if (target_architecture_auto
)
3167 set_arch (wanted
, set_arch_auto
);
3169 else if (wanted
!= target_architecture
)
3171 warning ("%s architecture file may be incompatible with %s target.",
3172 wanted
->printable_name
,
3173 target_architecture
->printable_name
);
3178 /* Misc helper functions for targets. */
3181 frame_num_args_unknown (fi
)
3182 struct frame_info
*fi
;
3189 generic_register_convertible_not (num
)
3198 /* Pointer to the target-dependent disassembly function. */
3199 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3200 disassemble_info tm_print_insn_info
;
3204 /* Set the dynamic target-system-dependant parameters (architecture,
3205 byte-order) using information found in the BFD */
3208 set_gdbarch_from_file (abfd
)
3213 struct gdbarch_info info
;
3214 memset (&info
, 0, sizeof info
);
3216 gdbarch_update (info
);
3219 set_architecture_from_file (abfd
);
3220 set_endian_from_file (abfd
);
3224 #if defined (CALL_DUMMY)
3225 /* FIXME - this should go away */
3226 LONGEST call_dummy_words
[] = CALL_DUMMY
;
3227 int sizeof_call_dummy_words
= sizeof (call_dummy_words
);
3231 /* Initialize the current architecture. */
3233 initialize_current_architecture ()
3237 struct gdbarch_init_registration
*rego
;
3238 const struct bfd_arch_info
*chosen
= NULL
;
3239 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3241 const struct bfd_arch_info
*ap
3242 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3244 /* Choose the first architecture alphabetically. */
3246 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3252 struct gdbarch_info info
;
3253 memset (&info
, 0, sizeof info
);
3254 info
.bfd_arch_info
= chosen
;
3255 gdbarch_update (info
);
3260 extern void _initialize_gdbarch (void);
3262 _initialize_gdbarch ()
3264 struct cmd_list_element
*c
;
3266 add_prefix_cmd ("endian", class_support
, set_endian
,
3267 "Set endianness of target.",
3268 &endianlist
, "set endian ", 0, &setlist
);
3269 add_cmd ("big", class_support
, set_endian_big
,
3270 "Set target as being big endian.", &endianlist
);
3271 add_cmd ("little", class_support
, set_endian_little
,
3272 "Set target as being little endian.", &endianlist
);
3273 add_cmd ("auto", class_support
, set_endian_auto
,
3274 "Select target endianness automatically.", &endianlist
);
3275 add_cmd ("endian", class_support
, show_endian
,
3276 "Show endianness of target.", &showlist
);
3278 add_cmd ("architecture", class_support
, set_architecture
,
3279 "Set architecture of target.", &setlist
);
3280 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3281 add_cmd ("architecture", class_support
, show_architecture
,
3282 "Show architecture of target.", &showlist
);
3283 add_cmd ("architecture", class_support
, info_architecture
,
3284 "List supported target architectures", &infolist
);
3286 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3287 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3288 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3289 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3290 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3292 add_show_from_set (add_set_cmd ("arch",
3295 (char *)&gdbarch_debug
,
3296 "Set architecture debugging.\n\
3297 When non-zero, architecture debugging is enabled.", &setdebuglist
),
3299 c
= add_set_cmd ("archdebug",
3302 (char *)&gdbarch_debug
,
3303 "Set architecture debugging.\n\
3304 When non-zero, architecture debugging is enabled.", &setlist
);
3306 deprecate_cmd (c
, "set debug arch");
3307 deprecate_cmd (add_show_from_set (c
, &showlist
), "show debug arch");