1 /* Dynamic architecture support for GDB, the GNU debugger.
2 Copyright 1998-1999, Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* *INDENT-OFF* */ /* ``typedef (f)();'' confuses indent */
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
40 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
42 /* Just include everything in sight so that the every old definition
43 of macro is visible. */
44 #include "gdb_string.h"
49 #include "breakpoint.h"
54 #include "gdbthread.h"
56 #include "symfile.h" /* for overlay functions */
61 /* Static function declarations */
63 static void verify_gdbarch (struct gdbarch
*gdbarch
);
64 static void init_gdbarch_data (struct gdbarch
*);
65 static void init_gdbarch_swap (struct gdbarch
*);
66 static void swapout_gdbarch_swap (struct gdbarch
*);
67 static void swapin_gdbarch_swap (struct gdbarch
*);
69 /* Convenience macro for allocting typesafe memory. */
72 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
76 /* Non-zero if we want to trace architecture code. */
79 #define GDBARCH_DEBUG 0
81 int gdbarch_debug
= GDBARCH_DEBUG
;
84 /* Maintain the struct gdbarch object */
88 /* basic architectural information */
89 const struct bfd_arch_info
* bfd_arch_info
;
92 /* target specific vector. */
93 struct gdbarch_tdep
*tdep
;
95 /* per-architecture data-pointers */
99 /* per-architecture swap-regions */
100 struct gdbarch_swap
*swap
;
102 /* Multi-arch values.
104 When extending this structure you must:
108 Declare set/get functions and define the corresponding
111 gdbarch_alloc(): If zero/NULL is not a suitable default,
112 initialize the new field.
114 verify_gdbarch(): Confirm that the target updated the field
117 gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
120 ``default_gdbarch()'': Append an initial value to the static
121 variable (base values on the host's c-type system).
123 get_gdbarch(): Implement the set/get functions (probably using
124 the macro's as shortcuts).
137 gdbarch_read_pc_ftype
*read_pc
;
138 gdbarch_write_pc_ftype
*write_pc
;
139 gdbarch_read_fp_ftype
*read_fp
;
140 gdbarch_write_fp_ftype
*write_fp
;
141 gdbarch_read_sp_ftype
*read_sp
;
142 gdbarch_write_sp_ftype
*write_sp
;
147 gdbarch_register_name_ftype
*register_name
;
150 gdbarch_register_byte_ftype
*register_byte
;
151 gdbarch_register_raw_size_ftype
*register_raw_size
;
152 int max_register_raw_size
;
153 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
154 int max_register_virtual_size
;
155 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
156 int use_generic_dummy_frames
;
157 int call_dummy_location
;
158 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
159 CORE_ADDR call_dummy_start_offset
;
160 CORE_ADDR call_dummy_breakpoint_offset
;
161 int call_dummy_breakpoint_offset_p
;
162 int call_dummy_length
;
163 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
165 LONGEST
* call_dummy_words
;
166 int sizeof_call_dummy_words
;
167 int call_dummy_stack_adjust_p
;
168 int call_dummy_stack_adjust
;
169 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
170 int believe_pcc_promotion
;
171 int believe_pcc_promotion_type
;
172 gdbarch_coerce_float_to_double_ftype
*coerce_float_to_double
;
173 gdbarch_get_saved_register_ftype
*get_saved_register
;
174 gdbarch_register_convertible_ftype
*register_convertible
;
175 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
176 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
177 gdbarch_extract_return_value_ftype
*extract_return_value
;
178 gdbarch_push_arguments_ftype
*push_arguments
;
179 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
180 gdbarch_push_return_address_ftype
*push_return_address
;
181 gdbarch_pop_frame_ftype
*pop_frame
;
182 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
183 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
184 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
185 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
186 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
187 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
188 gdbarch_store_struct_return_ftype
*store_struct_return
;
189 gdbarch_store_return_value_ftype
*store_return_value
;
190 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
191 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
192 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
193 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
194 gdbarch_skip_prologue_ftype
*skip_prologue
;
195 gdbarch_inner_than_ftype
*inner_than
;
196 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
197 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
198 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
199 CORE_ADDR decr_pc_after_break
;
200 CORE_ADDR function_start_offset
;
201 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
202 CORE_ADDR frame_args_skip
;
203 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
204 gdbarch_frame_chain_ftype
*frame_chain
;
205 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
206 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
207 gdbarch_frame_args_address_ftype
*frame_args_address
;
208 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
209 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
210 gdbarch_frame_num_args_ftype
*frame_num_args
;
214 /* The default architecture uses host values (for want of a better
217 extern const struct bfd_arch_info bfd_default_arch_struct
;
219 struct gdbarch default_gdbarch
= {
220 /* basic architecture information */
221 &bfd_default_arch_struct
,
223 /* target specific vector */
225 /*per-architecture data-pointers and swap regions */
227 /* Multi-arch values */
233 8 * sizeof (LONGEST
),
236 8 * sizeof (long double),
273 generic_get_saved_register
,
311 /* default_gdbarch() */
313 struct gdbarch
*current_gdbarch
= &default_gdbarch
;
316 /* Create a new ``struct gdbarch'' based in information provided by
317 ``struct gdbarch_info''. */
320 gdbarch_alloc (const struct gdbarch_info
*info
,
321 struct gdbarch_tdep
*tdep
)
323 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
324 memset (gdbarch
, 0, sizeof (*gdbarch
));
326 gdbarch
->tdep
= tdep
;
328 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
329 gdbarch
->byte_order
= info
->byte_order
;
331 /* Force the explicit initialization of these. */
332 gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
333 gdbarch
->num_regs
= -1;
334 gdbarch
->sp_regnum
= -1;
335 gdbarch
->fp_regnum
= -1;
336 gdbarch
->pc_regnum
= -1;
337 gdbarch
->register_size
= -1;
338 gdbarch
->register_bytes
= -1;
339 gdbarch
->max_register_raw_size
= -1;
340 gdbarch
->max_register_virtual_size
= -1;
341 gdbarch
->use_generic_dummy_frames
= -1;
342 gdbarch
->call_dummy_start_offset
= -1;
343 gdbarch
->call_dummy_breakpoint_offset
= -1;
344 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
345 gdbarch
->call_dummy_length
= -1;
346 gdbarch
->call_dummy_p
= -1;
347 gdbarch
->call_dummy_stack_adjust_p
= -1;
348 gdbarch
->coerce_float_to_double
= default_coerce_float_to_double
;
349 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
350 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
351 gdbarch
->decr_pc_after_break
= -1;
352 gdbarch
->function_start_offset
= -1;
353 gdbarch
->frame_args_skip
= -1;
354 /* gdbarch_alloc() */
360 /* Free a gdbarch struct. This should never happen in normal
361 operation --- once you've created a gdbarch, you keep it around.
362 However, if an architecture's init function encounters an error
363 building the structure, it may need to clean up a partially
364 constructed gdbarch. */
366 gdbarch_free (struct gdbarch
*arch
)
368 /* At the moment, this is trivial. */
373 /* Ensure that all values in a GDBARCH are reasonable. */
376 verify_gdbarch (struct gdbarch
*gdbarch
)
378 /* Only perform sanity checks on a multi-arch target. */
379 if (GDB_MULTI_ARCH
<= 0)
382 if (gdbarch
->byte_order
== 0)
383 internal_error ("verify_gdbarch: byte-order unset");
384 if (gdbarch
->bfd_arch_info
== NULL
)
385 internal_error ("verify_gdbarch: bfd_arch_info unset");
386 /* Check those that need to be defined for the given multi-arch level. */
387 if ((GDB_MULTI_ARCH
>= 1)
389 internal_error ("gdbarch: verify_gdbarch: bfd_vma_bit invalid");
390 if ((GDB_MULTI_ARCH
>= 1)
391 && (gdbarch
->ptr_bit
== 0))
392 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
393 if ((GDB_MULTI_ARCH
>= 1)
394 && (gdbarch
->short_bit
== 0))
395 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
396 if ((GDB_MULTI_ARCH
>= 1)
397 && (gdbarch
->int_bit
== 0))
398 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
399 if ((GDB_MULTI_ARCH
>= 1)
400 && (gdbarch
->long_bit
== 0))
401 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
402 if ((GDB_MULTI_ARCH
>= 1)
403 && (gdbarch
->long_long_bit
== 0))
404 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
405 if ((GDB_MULTI_ARCH
>= 1)
406 && (gdbarch
->float_bit
== 0))
407 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
408 if ((GDB_MULTI_ARCH
>= 1)
409 && (gdbarch
->double_bit
== 0))
410 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
411 if ((GDB_MULTI_ARCH
>= 1)
412 && (gdbarch
->long_double_bit
== 0))
413 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
414 if ((GDB_MULTI_ARCH
>= 1)
415 && (gdbarch
->read_pc
== 0))
416 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
417 if ((GDB_MULTI_ARCH
>= 1)
418 && (gdbarch
->write_pc
== 0))
419 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
420 if ((GDB_MULTI_ARCH
>= 1)
421 && (gdbarch
->read_fp
== 0))
422 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
423 if ((GDB_MULTI_ARCH
>= 1)
424 && (gdbarch
->write_fp
== 0))
425 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
426 if ((GDB_MULTI_ARCH
>= 1)
427 && (gdbarch
->read_sp
== 0))
428 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
429 if ((GDB_MULTI_ARCH
>= 1)
430 && (gdbarch
->write_sp
== 0))
431 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
432 if ((GDB_MULTI_ARCH
>= 2)
433 && (gdbarch
->num_regs
== -1))
434 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
435 if ((GDB_MULTI_ARCH
>= 2)
436 && (gdbarch
->sp_regnum
== -1))
437 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
438 if ((GDB_MULTI_ARCH
>= 2)
439 && (gdbarch
->fp_regnum
== -1))
440 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
441 if ((GDB_MULTI_ARCH
>= 2)
442 && (gdbarch
->pc_regnum
== -1))
443 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
444 if ((GDB_MULTI_ARCH
>= 2)
445 && (gdbarch
->register_name
== 0))
446 internal_error ("gdbarch: verify_gdbarch: register_name invalid");
447 if ((GDB_MULTI_ARCH
>= 2)
448 && (gdbarch
->register_size
== -1))
449 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
450 if ((GDB_MULTI_ARCH
>= 2)
451 && (gdbarch
->register_bytes
== -1))
452 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
453 if ((GDB_MULTI_ARCH
>= 2)
454 && (gdbarch
->register_byte
== 0))
455 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
456 if ((GDB_MULTI_ARCH
>= 2)
457 && (gdbarch
->register_raw_size
== 0))
458 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
459 if ((GDB_MULTI_ARCH
>= 2)
460 && (gdbarch
->max_register_raw_size
== -1))
461 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
462 if ((GDB_MULTI_ARCH
>= 2)
463 && (gdbarch
->register_virtual_size
== 0))
464 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
465 if ((GDB_MULTI_ARCH
>= 2)
466 && (gdbarch
->max_register_virtual_size
== -1))
467 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
468 if ((GDB_MULTI_ARCH
>= 2)
469 && (gdbarch
->register_virtual_type
== 0))
470 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
471 if ((GDB_MULTI_ARCH
>= 1)
472 && (gdbarch
->use_generic_dummy_frames
== -1))
473 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
474 if ((GDB_MULTI_ARCH
>= 2)
475 && (gdbarch
->call_dummy_location
== 0))
476 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
477 if ((GDB_MULTI_ARCH
>= 2)
478 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
479 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
480 if ((GDB_MULTI_ARCH
>= 2)
481 && (gdbarch
->call_dummy_start_offset
== -1))
482 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
483 if ((GDB_MULTI_ARCH
>= 2)
484 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
485 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
486 if ((GDB_MULTI_ARCH
>= 1)
487 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
488 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
489 if ((GDB_MULTI_ARCH
>= 2)
490 && (gdbarch
->call_dummy_length
== -1))
491 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
492 if ((GDB_MULTI_ARCH
>= 2)
493 && (gdbarch
->pc_in_call_dummy
== 0))
494 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
495 if ((GDB_MULTI_ARCH
>= 1)
496 && (gdbarch
->call_dummy_p
== -1))
497 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
498 if ((GDB_MULTI_ARCH
>= 1)
499 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
500 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
501 if ((GDB_MULTI_ARCH
>= 2)
502 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
503 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
504 if ((GDB_MULTI_ARCH
>= 2)
505 && (gdbarch
->fix_call_dummy
== 0))
506 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
507 if ((GDB_MULTI_ARCH
>= 2)
508 && (gdbarch
->coerce_float_to_double
== default_coerce_float_to_double
))
509 internal_error ("gdbarch: verify_gdbarch: coerce_float_to_double invalid");
510 if ((GDB_MULTI_ARCH
>= 1)
511 && (gdbarch
->get_saved_register
== 0))
512 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
513 if ((GDB_MULTI_ARCH
>= 1)
514 && (gdbarch
->register_convertible
== 0))
515 internal_error ("gdbarch: verify_gdbarch: register_convertible invalid");
516 if ((GDB_MULTI_ARCH
>= 2)
517 && (gdbarch
->register_convert_to_virtual
== 0))
518 internal_error ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
519 if ((GDB_MULTI_ARCH
>= 2)
520 && (gdbarch
->register_convert_to_raw
== 0))
521 internal_error ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
522 if ((GDB_MULTI_ARCH
>= 2)
523 && (gdbarch
->extract_return_value
== 0))
524 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
525 if ((GDB_MULTI_ARCH
>= 1)
526 && (gdbarch
->push_arguments
== 0))
527 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
528 if ((GDB_MULTI_ARCH
>= 2)
529 && (gdbarch
->push_dummy_frame
== 0))
530 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
531 if ((GDB_MULTI_ARCH
>= 1)
532 && (gdbarch
->push_return_address
== 0))
533 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
534 if ((GDB_MULTI_ARCH
>= 2)
535 && (gdbarch
->pop_frame
== 0))
536 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
537 if ((GDB_MULTI_ARCH
>= 2)
538 && (gdbarch
->d10v_make_daddr
== 0))
539 internal_error ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
540 if ((GDB_MULTI_ARCH
>= 2)
541 && (gdbarch
->d10v_make_iaddr
== 0))
542 internal_error ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
543 if ((GDB_MULTI_ARCH
>= 2)
544 && (gdbarch
->d10v_daddr_p
== 0))
545 internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
546 if ((GDB_MULTI_ARCH
>= 2)
547 && (gdbarch
->d10v_iaddr_p
== 0))
548 internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
549 if ((GDB_MULTI_ARCH
>= 2)
550 && (gdbarch
->d10v_convert_daddr_to_raw
== 0))
551 internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
552 if ((GDB_MULTI_ARCH
>= 2)
553 && (gdbarch
->d10v_convert_iaddr_to_raw
== 0))
554 internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
555 if ((GDB_MULTI_ARCH
>= 2)
556 && (gdbarch
->store_struct_return
== 0))
557 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
558 if ((GDB_MULTI_ARCH
>= 2)
559 && (gdbarch
->store_return_value
== 0))
560 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
561 if ((GDB_MULTI_ARCH
>= 2)
562 && (gdbarch
->extract_struct_value_address
== 0))
563 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
564 if ((GDB_MULTI_ARCH
>= 2)
565 && (gdbarch
->use_struct_convention
== 0))
566 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
567 if ((GDB_MULTI_ARCH
>= 2)
568 && (gdbarch
->frame_init_saved_regs
== 0))
569 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
570 if ((GDB_MULTI_ARCH
>= 2)
571 && (gdbarch
->init_extra_frame_info
== 0))
572 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
573 if ((GDB_MULTI_ARCH
>= 2)
574 && (gdbarch
->skip_prologue
== 0))
575 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
576 if ((GDB_MULTI_ARCH
>= 2)
577 && (gdbarch
->inner_than
== 0))
578 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
579 if ((GDB_MULTI_ARCH
>= 2)
580 && (gdbarch
->breakpoint_from_pc
== 0))
581 internal_error ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
582 if ((GDB_MULTI_ARCH
>= 2)
584 internal_error ("gdbarch: verify_gdbarch: memory_insert_breakpoint invalid");
585 if ((GDB_MULTI_ARCH
>= 2)
587 internal_error ("gdbarch: verify_gdbarch: memory_remove_breakpoint invalid");
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 if ((GDB_MULTI_ARCH
>= 2)
595 && (gdbarch
->remote_translate_xfer_address
== 0))
596 internal_error ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
597 if ((GDB_MULTI_ARCH
>= 2)
598 && (gdbarch
->frame_args_skip
== -1))
599 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
600 if ((GDB_MULTI_ARCH
>= 2)
601 && (gdbarch
->frameless_function_invocation
== 0))
602 internal_error ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
603 if ((GDB_MULTI_ARCH
>= 2)
604 && (gdbarch
->frame_chain
== 0))
605 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
606 if ((GDB_MULTI_ARCH
>= 1)
607 && (gdbarch
->frame_chain_valid
== 0))
608 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
609 if ((GDB_MULTI_ARCH
>= 2)
610 && (gdbarch
->frame_saved_pc
== 0))
611 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
612 if ((GDB_MULTI_ARCH
>= 2)
613 && (gdbarch
->frame_args_address
== 0))
614 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
615 if ((GDB_MULTI_ARCH
>= 2)
616 && (gdbarch
->frame_locals_address
== 0))
617 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
618 if ((GDB_MULTI_ARCH
>= 2)
619 && (gdbarch
->saved_pc_after_call
== 0))
620 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
621 if ((GDB_MULTI_ARCH
>= 2)
622 && (gdbarch
->frame_num_args
== 0))
623 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
627 /* Print out the details of the current architecture. */
632 if (TARGET_ARCHITECTURE
!= NULL
)
633 fprintf_unfiltered (gdb_stdlog
,
634 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
635 TARGET_ARCHITECTURE
->printable_name
);
636 fprintf_unfiltered (gdb_stdlog
,
637 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
638 (long) TARGET_BYTE_ORDER
);
639 fprintf_unfiltered (gdb_stdlog
,
640 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
641 (long) TARGET_BFD_VMA_BIT
);
642 fprintf_unfiltered (gdb_stdlog
,
643 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
644 (long) TARGET_PTR_BIT
);
645 fprintf_unfiltered (gdb_stdlog
,
646 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
647 (long) TARGET_SHORT_BIT
);
648 fprintf_unfiltered (gdb_stdlog
,
649 "gdbarch_update: TARGET_INT_BIT = %ld\n",
650 (long) TARGET_INT_BIT
);
651 fprintf_unfiltered (gdb_stdlog
,
652 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
653 (long) TARGET_LONG_BIT
);
654 fprintf_unfiltered (gdb_stdlog
,
655 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
656 (long) TARGET_LONG_LONG_BIT
);
657 fprintf_unfiltered (gdb_stdlog
,
658 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
659 (long) TARGET_FLOAT_BIT
);
660 fprintf_unfiltered (gdb_stdlog
,
661 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
662 (long) TARGET_DOUBLE_BIT
);
663 fprintf_unfiltered (gdb_stdlog
,
664 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
665 (long) TARGET_LONG_DOUBLE_BIT
);
666 fprintf_unfiltered (gdb_stdlog
,
667 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
668 (long) current_gdbarch
->read_pc
669 /*TARGET_READ_PC ()*/);
670 fprintf_unfiltered (gdb_stdlog
,
671 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
672 (long) current_gdbarch
->write_pc
673 /*TARGET_WRITE_PC ()*/);
674 fprintf_unfiltered (gdb_stdlog
,
675 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
676 (long) current_gdbarch
->read_fp
677 /*TARGET_READ_FP ()*/);
678 fprintf_unfiltered (gdb_stdlog
,
679 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
680 (long) current_gdbarch
->write_fp
681 /*TARGET_WRITE_FP ()*/);
682 fprintf_unfiltered (gdb_stdlog
,
683 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
684 (long) current_gdbarch
->read_sp
685 /*TARGET_READ_SP ()*/);
686 fprintf_unfiltered (gdb_stdlog
,
687 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
688 (long) current_gdbarch
->write_sp
689 /*TARGET_WRITE_SP ()*/);
690 fprintf_unfiltered (gdb_stdlog
,
691 "gdbarch_update: NUM_REGS = %ld\n",
693 fprintf_unfiltered (gdb_stdlog
,
694 "gdbarch_update: SP_REGNUM = %ld\n",
696 fprintf_unfiltered (gdb_stdlog
,
697 "gdbarch_update: FP_REGNUM = %ld\n",
699 fprintf_unfiltered (gdb_stdlog
,
700 "gdbarch_update: PC_REGNUM = %ld\n",
702 fprintf_unfiltered (gdb_stdlog
,
703 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
704 (long) current_gdbarch
->register_name
705 /*REGISTER_NAME ()*/);
706 fprintf_unfiltered (gdb_stdlog
,
707 "gdbarch_update: REGISTER_SIZE = %ld\n",
708 (long) REGISTER_SIZE
);
709 fprintf_unfiltered (gdb_stdlog
,
710 "gdbarch_update: REGISTER_BYTES = %ld\n",
711 (long) REGISTER_BYTES
);
712 fprintf_unfiltered (gdb_stdlog
,
713 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
714 (long) current_gdbarch
->register_byte
715 /*REGISTER_BYTE ()*/);
716 fprintf_unfiltered (gdb_stdlog
,
717 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
718 (long) current_gdbarch
->register_raw_size
719 /*REGISTER_RAW_SIZE ()*/);
720 fprintf_unfiltered (gdb_stdlog
,
721 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
722 (long) MAX_REGISTER_RAW_SIZE
);
723 fprintf_unfiltered (gdb_stdlog
,
724 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
725 (long) current_gdbarch
->register_virtual_size
726 /*REGISTER_VIRTUAL_SIZE ()*/);
727 fprintf_unfiltered (gdb_stdlog
,
728 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
729 (long) MAX_REGISTER_VIRTUAL_SIZE
);
730 fprintf_unfiltered (gdb_stdlog
,
731 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
732 (long) current_gdbarch
->register_virtual_type
733 /*REGISTER_VIRTUAL_TYPE ()*/);
734 fprintf_unfiltered (gdb_stdlog
,
735 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
736 (long) USE_GENERIC_DUMMY_FRAMES
);
737 fprintf_unfiltered (gdb_stdlog
,
738 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
739 (long) CALL_DUMMY_LOCATION
);
740 fprintf_unfiltered (gdb_stdlog
,
741 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
742 (long) current_gdbarch
->call_dummy_address
743 /*CALL_DUMMY_ADDRESS ()*/);
744 fprintf_unfiltered (gdb_stdlog
,
745 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
746 (long) CALL_DUMMY_START_OFFSET
);
747 fprintf_unfiltered (gdb_stdlog
,
748 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
749 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
750 fprintf_unfiltered (gdb_stdlog
,
751 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
752 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
753 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
754 fprintf_unfiltered (gdb_stdlog
,
755 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
756 (long) CALL_DUMMY_LENGTH
);
757 fprintf_unfiltered (gdb_stdlog
,
758 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
759 (long) current_gdbarch
->pc_in_call_dummy
760 /*PC_IN_CALL_DUMMY ()*/);
761 fprintf_unfiltered (gdb_stdlog
,
762 "gdbarch_update: CALL_DUMMY_P = %ld\n",
763 (long) CALL_DUMMY_P
);
764 fprintf_unfiltered (gdb_stdlog
,
765 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
766 (long) CALL_DUMMY_WORDS
);
767 fprintf_unfiltered (gdb_stdlog
,
768 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
769 (long) SIZEOF_CALL_DUMMY_WORDS
);
770 fprintf_unfiltered (gdb_stdlog
,
771 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
772 (long) CALL_DUMMY_STACK_ADJUST_P
);
773 if (CALL_DUMMY_STACK_ADJUST_P
)
774 fprintf_unfiltered (gdb_stdlog
,
775 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
776 (long) CALL_DUMMY_STACK_ADJUST
);
777 fprintf_unfiltered (gdb_stdlog
,
778 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
779 (long) current_gdbarch
->fix_call_dummy
780 /*FIX_CALL_DUMMY ()*/);
781 #ifdef BELIEVE_PCC_PROMOTION
782 fprintf_unfiltered (gdb_stdlog
,
783 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
784 (long) BELIEVE_PCC_PROMOTION
);
786 #ifdef BELIEVE_PCC_PROMOTION_TYPE
787 fprintf_unfiltered (gdb_stdlog
,
788 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
789 (long) BELIEVE_PCC_PROMOTION_TYPE
);
791 fprintf_unfiltered (gdb_stdlog
,
792 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
793 (long) current_gdbarch
->coerce_float_to_double
794 /*COERCE_FLOAT_TO_DOUBLE ()*/);
795 fprintf_unfiltered (gdb_stdlog
,
796 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
797 (long) current_gdbarch
->get_saved_register
798 /*GET_SAVED_REGISTER ()*/);
799 fprintf_unfiltered (gdb_stdlog
,
800 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
801 (long) current_gdbarch
->register_convertible
802 /*REGISTER_CONVERTIBLE ()*/);
803 fprintf_unfiltered (gdb_stdlog
,
804 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
805 (long) current_gdbarch
->register_convert_to_virtual
806 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
807 fprintf_unfiltered (gdb_stdlog
,
808 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
809 (long) current_gdbarch
->register_convert_to_raw
810 /*REGISTER_CONVERT_TO_RAW ()*/);
811 fprintf_unfiltered (gdb_stdlog
,
812 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
813 (long) current_gdbarch
->extract_return_value
814 /*EXTRACT_RETURN_VALUE ()*/);
815 fprintf_unfiltered (gdb_stdlog
,
816 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
817 (long) current_gdbarch
->push_arguments
818 /*PUSH_ARGUMENTS ()*/);
819 fprintf_unfiltered (gdb_stdlog
,
820 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
821 (long) current_gdbarch
->push_dummy_frame
822 /*PUSH_DUMMY_FRAME ()*/);
823 fprintf_unfiltered (gdb_stdlog
,
824 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
825 (long) current_gdbarch
->push_return_address
826 /*PUSH_RETURN_ADDRESS ()*/);
827 fprintf_unfiltered (gdb_stdlog
,
828 "gdbarch_update: POP_FRAME = 0x%08lx\n",
829 (long) current_gdbarch
->pop_frame
831 fprintf_unfiltered (gdb_stdlog
,
832 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
833 (long) current_gdbarch
->d10v_make_daddr
834 /*D10V_MAKE_DADDR ()*/);
835 fprintf_unfiltered (gdb_stdlog
,
836 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
837 (long) current_gdbarch
->d10v_make_iaddr
838 /*D10V_MAKE_IADDR ()*/);
839 fprintf_unfiltered (gdb_stdlog
,
840 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
841 (long) current_gdbarch
->d10v_daddr_p
842 /*D10V_DADDR_P ()*/);
843 fprintf_unfiltered (gdb_stdlog
,
844 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
845 (long) current_gdbarch
->d10v_iaddr_p
846 /*D10V_IADDR_P ()*/);
847 fprintf_unfiltered (gdb_stdlog
,
848 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
849 (long) current_gdbarch
->d10v_convert_daddr_to_raw
850 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
851 fprintf_unfiltered (gdb_stdlog
,
852 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
853 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
854 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
855 fprintf_unfiltered (gdb_stdlog
,
856 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
857 (long) current_gdbarch
->store_struct_return
858 /*STORE_STRUCT_RETURN ()*/);
859 fprintf_unfiltered (gdb_stdlog
,
860 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
861 (long) current_gdbarch
->store_return_value
862 /*STORE_RETURN_VALUE ()*/);
863 fprintf_unfiltered (gdb_stdlog
,
864 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
865 (long) current_gdbarch
->extract_struct_value_address
866 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
867 fprintf_unfiltered (gdb_stdlog
,
868 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
869 (long) current_gdbarch
->use_struct_convention
870 /*USE_STRUCT_CONVENTION ()*/);
871 fprintf_unfiltered (gdb_stdlog
,
872 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
873 (long) current_gdbarch
->frame_init_saved_regs
874 /*FRAME_INIT_SAVED_REGS ()*/);
875 fprintf_unfiltered (gdb_stdlog
,
876 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
877 (long) current_gdbarch
->init_extra_frame_info
878 /*INIT_EXTRA_FRAME_INFO ()*/);
879 fprintf_unfiltered (gdb_stdlog
,
880 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
881 (long) current_gdbarch
->skip_prologue
882 /*SKIP_PROLOGUE ()*/);
883 fprintf_unfiltered (gdb_stdlog
,
884 "gdbarch_update: INNER_THAN = 0x%08lx\n",
885 (long) current_gdbarch
->inner_than
887 fprintf_unfiltered (gdb_stdlog
,
888 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
889 (long) current_gdbarch
->breakpoint_from_pc
890 /*BREAKPOINT_FROM_PC ()*/);
891 fprintf_unfiltered (gdb_stdlog
,
892 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
893 (long) current_gdbarch
->memory_insert_breakpoint
894 /*MEMORY_INSERT_BREAKPOINT ()*/);
895 fprintf_unfiltered (gdb_stdlog
,
896 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
897 (long) current_gdbarch
->memory_remove_breakpoint
898 /*MEMORY_REMOVE_BREAKPOINT ()*/);
899 fprintf_unfiltered (gdb_stdlog
,
900 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
901 (long) DECR_PC_AFTER_BREAK
);
902 fprintf_unfiltered (gdb_stdlog
,
903 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
904 (long) FUNCTION_START_OFFSET
);
905 fprintf_unfiltered (gdb_stdlog
,
906 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
907 (long) current_gdbarch
->remote_translate_xfer_address
908 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
909 fprintf_unfiltered (gdb_stdlog
,
910 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
911 (long) FRAME_ARGS_SKIP
);
912 fprintf_unfiltered (gdb_stdlog
,
913 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
914 (long) current_gdbarch
->frameless_function_invocation
915 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
916 fprintf_unfiltered (gdb_stdlog
,
917 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
918 (long) current_gdbarch
->frame_chain
920 fprintf_unfiltered (gdb_stdlog
,
921 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
922 (long) current_gdbarch
->frame_chain_valid
923 /*FRAME_CHAIN_VALID ()*/);
924 fprintf_unfiltered (gdb_stdlog
,
925 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
926 (long) current_gdbarch
->frame_saved_pc
927 /*FRAME_SAVED_PC ()*/);
928 fprintf_unfiltered (gdb_stdlog
,
929 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
930 (long) current_gdbarch
->frame_args_address
931 /*FRAME_ARGS_ADDRESS ()*/);
932 fprintf_unfiltered (gdb_stdlog
,
933 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
934 (long) current_gdbarch
->frame_locals_address
935 /*FRAME_LOCALS_ADDRESS ()*/);
936 fprintf_unfiltered (gdb_stdlog
,
937 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
938 (long) current_gdbarch
->saved_pc_after_call
939 /*SAVED_PC_AFTER_CALL ()*/);
940 fprintf_unfiltered (gdb_stdlog
,
941 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
942 (long) current_gdbarch
->frame_num_args
943 /*FRAME_NUM_ARGS ()*/);
946 struct gdbarch_tdep
*
947 gdbarch_tdep (struct gdbarch
*gdbarch
)
949 if (gdbarch_debug
>= 2)
950 /* FIXME: gdb_std??? */
951 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
952 return gdbarch
->tdep
;
956 const struct bfd_arch_info
*
957 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
959 if (gdbarch_debug
>= 2)
960 /* FIXME: gdb_std??? */
961 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
962 return gdbarch
->bfd_arch_info
;
966 gdbarch_byte_order (struct gdbarch
*gdbarch
)
968 if (gdbarch_debug
>= 2)
969 /* FIXME: gdb_std??? */
970 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
971 return gdbarch
->byte_order
;
975 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
978 internal_error ("gdbarch: gdbarch_bfd_vma_bit invalid");
979 if (gdbarch_debug
>= 2)
980 /* FIXME: gdb_std??? */
981 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
982 return gdbarch
->bfd_vma_bit
;
986 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
989 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
993 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
995 if (gdbarch
->ptr_bit
== 0)
996 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
997 if (gdbarch_debug
>= 2)
998 /* FIXME: gdb_std??? */
999 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1000 return gdbarch
->ptr_bit
;
1004 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1007 gdbarch
->ptr_bit
= ptr_bit
;
1011 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1013 if (gdbarch
->short_bit
== 0)
1014 internal_error ("gdbarch: gdbarch_short_bit invalid");
1015 if (gdbarch_debug
>= 2)
1016 /* FIXME: gdb_std??? */
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 /* FIXME: gdb_std??? */
1035 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1036 return gdbarch
->int_bit
;
1040 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1043 gdbarch
->int_bit
= int_bit
;
1047 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1049 if (gdbarch
->long_bit
== 0)
1050 internal_error ("gdbarch: gdbarch_long_bit invalid");
1051 if (gdbarch_debug
>= 2)
1052 /* FIXME: gdb_std??? */
1053 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1054 return gdbarch
->long_bit
;
1058 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1061 gdbarch
->long_bit
= long_bit
;
1065 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1067 if (gdbarch
->long_long_bit
== 0)
1068 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1069 if (gdbarch_debug
>= 2)
1070 /* FIXME: gdb_std??? */
1071 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1072 return gdbarch
->long_long_bit
;
1076 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1079 gdbarch
->long_long_bit
= long_long_bit
;
1083 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1085 if (gdbarch
->float_bit
== 0)
1086 internal_error ("gdbarch: gdbarch_float_bit invalid");
1087 if (gdbarch_debug
>= 2)
1088 /* FIXME: gdb_std??? */
1089 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1090 return gdbarch
->float_bit
;
1094 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1097 gdbarch
->float_bit
= float_bit
;
1101 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1103 if (gdbarch
->double_bit
== 0)
1104 internal_error ("gdbarch: gdbarch_double_bit invalid");
1105 if (gdbarch_debug
>= 2)
1106 /* FIXME: gdb_std??? */
1107 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1108 return gdbarch
->double_bit
;
1112 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1115 gdbarch
->double_bit
= double_bit
;
1119 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1121 if (gdbarch
->long_double_bit
== 0)
1122 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1123 if (gdbarch_debug
>= 2)
1124 /* FIXME: gdb_std??? */
1125 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1126 return gdbarch
->long_double_bit
;
1130 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1131 int long_double_bit
)
1133 gdbarch
->long_double_bit
= long_double_bit
;
1137 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1139 if (gdbarch
->read_pc
== 0)
1140 internal_error ("gdbarch: gdbarch_read_pc invalid");
1141 if (gdbarch_debug
>= 2)
1142 /* FIXME: gdb_std??? */
1143 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1144 return gdbarch
->read_pc (pid
);
1148 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1149 gdbarch_read_pc_ftype read_pc
)
1151 gdbarch
->read_pc
= read_pc
;
1155 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1157 if (gdbarch
->write_pc
== 0)
1158 internal_error ("gdbarch: gdbarch_write_pc invalid");
1159 if (gdbarch_debug
>= 2)
1160 /* FIXME: gdb_std??? */
1161 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1162 gdbarch
->write_pc (val
, pid
);
1166 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1167 gdbarch_write_pc_ftype write_pc
)
1169 gdbarch
->write_pc
= write_pc
;
1173 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1175 if (gdbarch
->read_fp
== 0)
1176 internal_error ("gdbarch: gdbarch_read_fp invalid");
1177 if (gdbarch_debug
>= 2)
1178 /* FIXME: gdb_std??? */
1179 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1180 return gdbarch
->read_fp ();
1184 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1185 gdbarch_read_fp_ftype read_fp
)
1187 gdbarch
->read_fp
= read_fp
;
1191 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1193 if (gdbarch
->write_fp
== 0)
1194 internal_error ("gdbarch: gdbarch_write_fp invalid");
1195 if (gdbarch_debug
>= 2)
1196 /* FIXME: gdb_std??? */
1197 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1198 gdbarch
->write_fp (val
);
1202 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1203 gdbarch_write_fp_ftype write_fp
)
1205 gdbarch
->write_fp
= write_fp
;
1209 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1211 if (gdbarch
->read_sp
== 0)
1212 internal_error ("gdbarch: gdbarch_read_sp invalid");
1213 if (gdbarch_debug
>= 2)
1214 /* FIXME: gdb_std??? */
1215 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1216 return gdbarch
->read_sp ();
1220 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1221 gdbarch_read_sp_ftype read_sp
)
1223 gdbarch
->read_sp
= read_sp
;
1227 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1229 if (gdbarch
->write_sp
== 0)
1230 internal_error ("gdbarch: gdbarch_write_sp invalid");
1231 if (gdbarch_debug
>= 2)
1232 /* FIXME: gdb_std??? */
1233 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1234 gdbarch
->write_sp (val
);
1238 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1239 gdbarch_write_sp_ftype write_sp
)
1241 gdbarch
->write_sp
= write_sp
;
1245 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1247 if (gdbarch
->num_regs
== -1)
1248 internal_error ("gdbarch: gdbarch_num_regs invalid");
1249 if (gdbarch_debug
>= 2)
1250 /* FIXME: gdb_std??? */
1251 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1252 return gdbarch
->num_regs
;
1256 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1259 gdbarch
->num_regs
= num_regs
;
1263 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1265 if (gdbarch
->sp_regnum
== -1)
1266 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1267 if (gdbarch_debug
>= 2)
1268 /* FIXME: gdb_std??? */
1269 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1270 return gdbarch
->sp_regnum
;
1274 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1277 gdbarch
->sp_regnum
= sp_regnum
;
1281 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1283 if (gdbarch
->fp_regnum
== -1)
1284 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1285 if (gdbarch_debug
>= 2)
1286 /* FIXME: gdb_std??? */
1287 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1288 return gdbarch
->fp_regnum
;
1292 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1295 gdbarch
->fp_regnum
= fp_regnum
;
1299 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1301 if (gdbarch
->pc_regnum
== -1)
1302 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1303 if (gdbarch_debug
>= 2)
1304 /* FIXME: gdb_std??? */
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 (gdbarch
->register_name
== 0)
1320 internal_error ("gdbarch: gdbarch_register_name invalid");
1321 if (gdbarch_debug
>= 2)
1322 /* FIXME: gdb_std??? */
1323 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1324 return gdbarch
->register_name (regnr
);
1328 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1329 gdbarch_register_name_ftype register_name
)
1331 gdbarch
->register_name
= register_name
;
1335 gdbarch_register_size (struct gdbarch
*gdbarch
)
1337 if (gdbarch
->register_size
== -1)
1338 internal_error ("gdbarch: gdbarch_register_size invalid");
1339 if (gdbarch_debug
>= 2)
1340 /* FIXME: gdb_std??? */
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 /* FIXME: gdb_std??? */
1359 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1360 return gdbarch
->register_bytes
;
1364 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1367 gdbarch
->register_bytes
= register_bytes
;
1371 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1373 if (gdbarch
->register_byte
== 0)
1374 internal_error ("gdbarch: gdbarch_register_byte invalid");
1375 if (gdbarch_debug
>= 2)
1376 /* FIXME: gdb_std??? */
1377 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1378 return gdbarch
->register_byte (reg_nr
);
1382 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1383 gdbarch_register_byte_ftype register_byte
)
1385 gdbarch
->register_byte
= register_byte
;
1389 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1391 if (gdbarch
->register_raw_size
== 0)
1392 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1393 if (gdbarch_debug
>= 2)
1394 /* FIXME: gdb_std??? */
1395 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1396 return gdbarch
->register_raw_size (reg_nr
);
1400 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1401 gdbarch_register_raw_size_ftype register_raw_size
)
1403 gdbarch
->register_raw_size
= register_raw_size
;
1407 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1409 if (gdbarch
->max_register_raw_size
== -1)
1410 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1411 if (gdbarch_debug
>= 2)
1412 /* FIXME: gdb_std??? */
1413 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1414 return gdbarch
->max_register_raw_size
;
1418 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1419 int max_register_raw_size
)
1421 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1425 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1427 if (gdbarch
->register_virtual_size
== 0)
1428 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1429 if (gdbarch_debug
>= 2)
1430 /* FIXME: gdb_std??? */
1431 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1432 return gdbarch
->register_virtual_size (reg_nr
);
1436 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1437 gdbarch_register_virtual_size_ftype register_virtual_size
)
1439 gdbarch
->register_virtual_size
= register_virtual_size
;
1443 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1445 if (gdbarch
->max_register_virtual_size
== -1)
1446 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1447 if (gdbarch_debug
>= 2)
1448 /* FIXME: gdb_std??? */
1449 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1450 return gdbarch
->max_register_virtual_size
;
1454 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1455 int max_register_virtual_size
)
1457 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1461 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1463 if (gdbarch
->register_virtual_type
== 0)
1464 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1465 if (gdbarch_debug
>= 2)
1466 /* FIXME: gdb_std??? */
1467 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1468 return gdbarch
->register_virtual_type (reg_nr
);
1472 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1473 gdbarch_register_virtual_type_ftype register_virtual_type
)
1475 gdbarch
->register_virtual_type
= register_virtual_type
;
1479 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1481 if (gdbarch
->use_generic_dummy_frames
== -1)
1482 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1483 if (gdbarch_debug
>= 2)
1484 /* FIXME: gdb_std??? */
1485 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1486 return gdbarch
->use_generic_dummy_frames
;
1490 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1491 int use_generic_dummy_frames
)
1493 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1497 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1499 if (gdbarch
->call_dummy_location
== 0)
1500 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1501 if (gdbarch_debug
>= 2)
1502 /* FIXME: gdb_std??? */
1503 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1504 return gdbarch
->call_dummy_location
;
1508 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1509 int call_dummy_location
)
1511 gdbarch
->call_dummy_location
= call_dummy_location
;
1515 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1517 if (gdbarch
->call_dummy_address
== 0)
1518 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1519 if (gdbarch_debug
>= 2)
1520 /* FIXME: gdb_std??? */
1521 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1522 return gdbarch
->call_dummy_address ();
1526 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1527 gdbarch_call_dummy_address_ftype call_dummy_address
)
1529 gdbarch
->call_dummy_address
= call_dummy_address
;
1533 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1535 if (gdbarch
->call_dummy_start_offset
== -1)
1536 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1537 if (gdbarch_debug
>= 2)
1538 /* FIXME: gdb_std??? */
1539 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1540 return gdbarch
->call_dummy_start_offset
;
1544 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1545 CORE_ADDR call_dummy_start_offset
)
1547 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1551 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1553 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1554 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1555 if (gdbarch_debug
>= 2)
1556 /* FIXME: gdb_std??? */
1557 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1558 return gdbarch
->call_dummy_breakpoint_offset
;
1562 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1563 CORE_ADDR call_dummy_breakpoint_offset
)
1565 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1569 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1571 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1572 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1573 if (gdbarch_debug
>= 2)
1574 /* FIXME: gdb_std??? */
1575 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1576 return gdbarch
->call_dummy_breakpoint_offset_p
;
1580 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1581 int call_dummy_breakpoint_offset_p
)
1583 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1587 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1589 if (gdbarch
->call_dummy_length
== -1)
1590 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1591 if (gdbarch_debug
>= 2)
1592 /* FIXME: gdb_std??? */
1593 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1594 return gdbarch
->call_dummy_length
;
1598 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1599 int call_dummy_length
)
1601 gdbarch
->call_dummy_length
= call_dummy_length
;
1605 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1607 if (gdbarch
->pc_in_call_dummy
== 0)
1608 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1609 if (gdbarch_debug
>= 2)
1610 /* FIXME: gdb_std??? */
1611 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1612 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1616 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1617 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1619 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1623 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1625 if (gdbarch
->call_dummy_p
== -1)
1626 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1627 if (gdbarch_debug
>= 2)
1628 /* FIXME: gdb_std??? */
1629 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1630 return gdbarch
->call_dummy_p
;
1634 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1637 gdbarch
->call_dummy_p
= call_dummy_p
;
1641 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1643 if (gdbarch_debug
>= 2)
1644 /* FIXME: gdb_std??? */
1645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1646 return gdbarch
->call_dummy_words
;
1650 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1651 LONGEST
* call_dummy_words
)
1653 gdbarch
->call_dummy_words
= call_dummy_words
;
1657 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1659 if (gdbarch_debug
>= 2)
1660 /* FIXME: gdb_std??? */
1661 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1662 return gdbarch
->sizeof_call_dummy_words
;
1666 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1667 int sizeof_call_dummy_words
)
1669 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1673 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1675 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1676 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1677 if (gdbarch_debug
>= 2)
1678 /* FIXME: gdb_std??? */
1679 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1680 return gdbarch
->call_dummy_stack_adjust_p
;
1684 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1685 int call_dummy_stack_adjust_p
)
1687 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1691 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1693 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1694 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1695 if (gdbarch_debug
>= 2)
1696 /* FIXME: gdb_std??? */
1697 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1698 return gdbarch
->call_dummy_stack_adjust
;
1702 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1703 int call_dummy_stack_adjust
)
1705 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1709 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
)
1711 if (gdbarch
->fix_call_dummy
== 0)
1712 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1713 if (gdbarch_debug
>= 2)
1714 /* FIXME: gdb_std??? */
1715 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1716 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1720 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1721 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1723 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1727 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1729 if (gdbarch_debug
>= 2)
1730 /* FIXME: gdb_std??? */
1731 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1732 return gdbarch
->believe_pcc_promotion
;
1736 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1737 int believe_pcc_promotion
)
1739 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1743 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1745 if (gdbarch_debug
>= 2)
1746 /* FIXME: gdb_std??? */
1747 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1748 return gdbarch
->believe_pcc_promotion_type
;
1752 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1753 int believe_pcc_promotion_type
)
1755 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1759 gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
, struct type
*formal
, struct type
*actual
)
1761 if (gdbarch
->coerce_float_to_double
== 0)
1762 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1763 if (gdbarch_debug
>= 2)
1764 /* FIXME: gdb_std??? */
1765 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coerce_float_to_double called\n");
1766 return gdbarch
->coerce_float_to_double (formal
, actual
);
1770 set_gdbarch_coerce_float_to_double (struct gdbarch
*gdbarch
,
1771 gdbarch_coerce_float_to_double_ftype coerce_float_to_double
)
1773 gdbarch
->coerce_float_to_double
= coerce_float_to_double
;
1777 gdbarch_get_saved_register (struct gdbarch
*gdbarch
, char *raw_buffer
, int *optimized
, CORE_ADDR
*addrp
, struct frame_info
*frame
, int regnum
, enum lval_type
*lval
)
1779 if (gdbarch
->get_saved_register
== 0)
1780 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1781 if (gdbarch_debug
>= 2)
1782 /* FIXME: gdb_std??? */
1783 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1784 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1788 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1789 gdbarch_get_saved_register_ftype get_saved_register
)
1791 gdbarch
->get_saved_register
= get_saved_register
;
1795 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1797 if (gdbarch
->register_convertible
== 0)
1798 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1799 if (gdbarch_debug
>= 2)
1800 /* FIXME: gdb_std??? */
1801 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1802 return gdbarch
->register_convertible (nr
);
1806 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1807 gdbarch_register_convertible_ftype register_convertible
)
1809 gdbarch
->register_convertible
= register_convertible
;
1813 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1815 if (gdbarch
->register_convert_to_virtual
== 0)
1816 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1817 if (gdbarch_debug
>= 2)
1818 /* FIXME: gdb_std??? */
1819 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1820 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1824 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1825 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1827 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1831 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1833 if (gdbarch
->register_convert_to_raw
== 0)
1834 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1835 if (gdbarch_debug
>= 2)
1836 /* FIXME: gdb_std??? */
1837 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1838 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1842 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1843 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1845 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1849 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1851 if (gdbarch
->extract_return_value
== 0)
1852 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1853 if (gdbarch_debug
>= 2)
1854 /* FIXME: gdb_std??? */
1855 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1856 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1860 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1861 gdbarch_extract_return_value_ftype extract_return_value
)
1863 gdbarch
->extract_return_value
= extract_return_value
;
1867 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1869 if (gdbarch
->push_arguments
== 0)
1870 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1871 if (gdbarch_debug
>= 2)
1872 /* FIXME: gdb_std??? */
1873 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1874 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1878 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1879 gdbarch_push_arguments_ftype push_arguments
)
1881 gdbarch
->push_arguments
= push_arguments
;
1885 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1887 if (gdbarch
->push_dummy_frame
== 0)
1888 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1889 if (gdbarch_debug
>= 2)
1890 /* FIXME: gdb_std??? */
1891 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1892 gdbarch
->push_dummy_frame ();
1896 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
1897 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
1899 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1903 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1905 if (gdbarch
->push_return_address
== 0)
1906 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1907 if (gdbarch_debug
>= 2)
1908 /* FIXME: gdb_std??? */
1909 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1910 return gdbarch
->push_return_address (pc
, sp
);
1914 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
1915 gdbarch_push_return_address_ftype push_return_address
)
1917 gdbarch
->push_return_address
= push_return_address
;
1921 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
1923 if (gdbarch
->pop_frame
== 0)
1924 internal_error ("gdbarch: gdbarch_pop_frame invalid");
1925 if (gdbarch_debug
>= 2)
1926 /* FIXME: gdb_std??? */
1927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
1928 gdbarch
->pop_frame ();
1932 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
1933 gdbarch_pop_frame_ftype pop_frame
)
1935 gdbarch
->pop_frame
= pop_frame
;
1939 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1941 if (gdbarch
->d10v_make_daddr
== 0)
1942 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
1943 if (gdbarch_debug
>= 2)
1944 /* FIXME: gdb_std??? */
1945 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
1946 return gdbarch
->d10v_make_daddr (x
);
1950 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
1951 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
1953 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
1957 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1959 if (gdbarch
->d10v_make_iaddr
== 0)
1960 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
1961 if (gdbarch_debug
>= 2)
1962 /* FIXME: gdb_std??? */
1963 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
1964 return gdbarch
->d10v_make_iaddr (x
);
1968 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
1969 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
1971 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
1975 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1977 if (gdbarch
->d10v_daddr_p
== 0)
1978 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
1979 if (gdbarch_debug
>= 2)
1980 /* FIXME: gdb_std??? */
1981 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
1982 return gdbarch
->d10v_daddr_p (x
);
1986 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
1987 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
1989 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
1993 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1995 if (gdbarch
->d10v_iaddr_p
== 0)
1996 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
1997 if (gdbarch_debug
>= 2)
1998 /* FIXME: gdb_std??? */
1999 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
2000 return gdbarch
->d10v_iaddr_p (x
);
2004 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
2005 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
2007 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
2011 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2013 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
2014 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2015 if (gdbarch_debug
>= 2)
2016 /* FIXME: gdb_std??? */
2017 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
2018 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2022 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
2023 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
2025 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2029 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2031 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2032 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2033 if (gdbarch_debug
>= 2)
2034 /* FIXME: gdb_std??? */
2035 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2036 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2040 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
2041 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
2043 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2047 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2049 if (gdbarch
->store_struct_return
== 0)
2050 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2051 if (gdbarch_debug
>= 2)
2052 /* FIXME: gdb_std??? */
2053 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2054 gdbarch
->store_struct_return (addr
, sp
);
2058 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
2059 gdbarch_store_struct_return_ftype store_struct_return
)
2061 gdbarch
->store_struct_return
= store_struct_return
;
2065 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2067 if (gdbarch
->store_return_value
== 0)
2068 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2069 if (gdbarch_debug
>= 2)
2070 /* FIXME: gdb_std??? */
2071 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2072 gdbarch
->store_return_value (type
, valbuf
);
2076 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2077 gdbarch_store_return_value_ftype store_return_value
)
2079 gdbarch
->store_return_value
= store_return_value
;
2083 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2085 if (gdbarch
->extract_struct_value_address
== 0)
2086 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2087 if (gdbarch_debug
>= 2)
2088 /* FIXME: gdb_std??? */
2089 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2090 return gdbarch
->extract_struct_value_address (regbuf
);
2094 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2095 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2097 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2101 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2103 if (gdbarch
->use_struct_convention
== 0)
2104 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2105 if (gdbarch_debug
>= 2)
2106 /* FIXME: gdb_std??? */
2107 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2108 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2112 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2113 gdbarch_use_struct_convention_ftype use_struct_convention
)
2115 gdbarch
->use_struct_convention
= use_struct_convention
;
2119 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2121 if (gdbarch
->frame_init_saved_regs
== 0)
2122 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2123 if (gdbarch_debug
>= 2)
2124 /* FIXME: gdb_std??? */
2125 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2126 gdbarch
->frame_init_saved_regs (frame
);
2130 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2131 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2133 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2137 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2139 if (gdbarch
->init_extra_frame_info
== 0)
2140 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2141 if (gdbarch_debug
>= 2)
2142 /* FIXME: gdb_std??? */
2143 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2144 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2148 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2149 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2151 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2155 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2157 if (gdbarch
->skip_prologue
== 0)
2158 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2159 if (gdbarch_debug
>= 2)
2160 /* FIXME: gdb_std??? */
2161 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2162 return gdbarch
->skip_prologue (ip
);
2166 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2167 gdbarch_skip_prologue_ftype skip_prologue
)
2169 gdbarch
->skip_prologue
= skip_prologue
;
2173 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2175 if (gdbarch
->inner_than
== 0)
2176 internal_error ("gdbarch: gdbarch_inner_than invalid");
2177 if (gdbarch_debug
>= 2)
2178 /* FIXME: gdb_std??? */
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 (gdbarch
->breakpoint_from_pc
== 0)
2194 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2195 if (gdbarch_debug
>= 2)
2196 /* FIXME: gdb_std??? */
2197 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2198 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2202 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2203 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2205 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2209 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2211 if (gdbarch
->memory_insert_breakpoint
== 0)
2212 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2213 if (gdbarch_debug
>= 2)
2214 /* FIXME: gdb_std??? */
2215 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2216 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2220 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2221 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2223 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2227 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2229 if (gdbarch
->memory_remove_breakpoint
== 0)
2230 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2231 if (gdbarch_debug
>= 2)
2232 /* FIXME: gdb_std??? */
2233 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2234 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2238 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2239 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2241 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2245 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2247 if (gdbarch
->decr_pc_after_break
== -1)
2248 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2249 if (gdbarch_debug
>= 2)
2250 /* FIXME: gdb_std??? */
2251 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2252 return gdbarch
->decr_pc_after_break
;
2256 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2257 CORE_ADDR decr_pc_after_break
)
2259 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2263 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2265 if (gdbarch
->function_start_offset
== -1)
2266 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2267 if (gdbarch_debug
>= 2)
2268 /* FIXME: gdb_std??? */
2269 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2270 return gdbarch
->function_start_offset
;
2274 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2275 CORE_ADDR function_start_offset
)
2277 gdbarch
->function_start_offset
= function_start_offset
;
2281 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2283 if (gdbarch
->remote_translate_xfer_address
== 0)
2284 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2285 if (gdbarch_debug
>= 2)
2286 /* FIXME: gdb_std??? */
2287 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2288 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2292 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2293 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2295 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2299 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2301 if (gdbarch
->frame_args_skip
== -1)
2302 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2303 if (gdbarch_debug
>= 2)
2304 /* FIXME: gdb_std??? */
2305 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2306 return gdbarch
->frame_args_skip
;
2310 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2311 CORE_ADDR frame_args_skip
)
2313 gdbarch
->frame_args_skip
= frame_args_skip
;
2317 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2319 if (gdbarch
->frameless_function_invocation
== 0)
2320 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2321 if (gdbarch_debug
>= 2)
2322 /* FIXME: gdb_std??? */
2323 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2324 return gdbarch
->frameless_function_invocation (fi
);
2328 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2329 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2331 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2335 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2337 if (gdbarch
->frame_chain
== 0)
2338 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2339 if (gdbarch_debug
>= 2)
2340 /* FIXME: gdb_std??? */
2341 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2342 return gdbarch
->frame_chain (frame
);
2346 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2347 gdbarch_frame_chain_ftype frame_chain
)
2349 gdbarch
->frame_chain
= frame_chain
;
2353 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2355 if (gdbarch
->frame_chain_valid
== 0)
2356 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2357 if (gdbarch_debug
>= 2)
2358 /* FIXME: gdb_std??? */
2359 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2360 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2364 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2365 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2367 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2371 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2373 if (gdbarch
->frame_saved_pc
== 0)
2374 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2375 if (gdbarch_debug
>= 2)
2376 /* FIXME: gdb_std??? */
2377 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2378 return gdbarch
->frame_saved_pc (fi
);
2382 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2383 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2385 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2389 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2391 if (gdbarch
->frame_args_address
== 0)
2392 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2393 if (gdbarch_debug
>= 2)
2394 /* FIXME: gdb_std??? */
2395 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2396 return gdbarch
->frame_args_address (fi
);
2400 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2401 gdbarch_frame_args_address_ftype frame_args_address
)
2403 gdbarch
->frame_args_address
= frame_args_address
;
2407 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2409 if (gdbarch
->frame_locals_address
== 0)
2410 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2411 if (gdbarch_debug
>= 2)
2412 /* FIXME: gdb_std??? */
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 /* FIXME: gdb_std??? */
2431 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2432 return gdbarch
->saved_pc_after_call (frame
);
2436 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2437 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2439 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2443 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2445 if (gdbarch
->frame_num_args
== 0)
2446 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2447 if (gdbarch_debug
>= 2)
2448 /* FIXME: gdb_std??? */
2449 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2450 return gdbarch
->frame_num_args (frame
);
2454 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2455 gdbarch_frame_num_args_ftype frame_num_args
)
2457 gdbarch
->frame_num_args
= frame_num_args
;
2461 /* Keep a registrary of per-architecture data-pointers required by GDB
2469 struct gdbarch_data_registration
2471 gdbarch_data_ftype
*init
;
2472 struct gdbarch_data
*data
;
2473 struct gdbarch_data_registration
*next
;
2476 struct gdbarch_data_registrary
2479 struct gdbarch_data_registration
*registrations
;
2482 struct gdbarch_data_registrary gdbarch_data_registrary
=
2487 struct gdbarch_data
*
2488 register_gdbarch_data (gdbarch_data_ftype
*init
)
2490 struct gdbarch_data_registration
**curr
;
2491 for (curr
= &gdbarch_data_registrary
.registrations
;
2493 curr
= &(*curr
)->next
);
2494 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2495 (*curr
)->next
= NULL
;
2496 (*curr
)->init
= init
;
2497 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2498 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2499 return (*curr
)->data
;
2503 /* Walk through all the registered users initializing each in turn. */
2506 init_gdbarch_data (struct gdbarch
*gdbarch
)
2508 struct gdbarch_data_registration
*rego
;
2509 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2510 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2511 for (rego
= gdbarch_data_registrary
.registrations
;
2515 if (rego
->data
->index
< gdbarch
->nr_data
)
2516 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2521 /* Return the current value of the specified per-architecture
2526 struct gdbarch_data
*data
;
2528 if (data
->index
>= current_gdbarch
->nr_data
)
2529 internal_error ("gdbarch_data: request for non-existant data.");
2530 return current_gdbarch
->data
[data
->index
];
2535 /* Keep a registrary of swaped data required by GDB modules. */
2540 struct gdbarch_swap_registration
*source
;
2541 struct gdbarch_swap
*next
;
2544 struct gdbarch_swap_registration
2547 unsigned long sizeof_data
;
2548 gdbarch_swap_ftype
*init
;
2549 struct gdbarch_swap_registration
*next
;
2552 struct gdbarch_swap_registrary
2555 struct gdbarch_swap_registration
*registrations
;
2558 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2564 register_gdbarch_swap (void *data
,
2565 unsigned long sizeof_data
,
2566 gdbarch_swap_ftype
*init
)
2568 struct gdbarch_swap_registration
**rego
;
2569 for (rego
= &gdbarch_swap_registrary
.registrations
;
2571 rego
= &(*rego
)->next
);
2572 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2573 (*rego
)->next
= NULL
;
2574 (*rego
)->init
= init
;
2575 (*rego
)->data
= data
;
2576 (*rego
)->sizeof_data
= sizeof_data
;
2581 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2583 struct gdbarch_swap_registration
*rego
;
2584 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2585 for (rego
= gdbarch_swap_registrary
.registrations
;
2589 if (rego
->data
!= NULL
)
2591 (*curr
) = XMALLOC (struct gdbarch_swap
);
2592 (*curr
)->source
= rego
;
2593 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2594 (*curr
)->next
= NULL
;
2595 memset (rego
->data
, 0, rego
->sizeof_data
);
2596 curr
= &(*curr
)->next
;
2598 if (rego
->init
!= NULL
)
2604 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2606 struct gdbarch_swap
*curr
;
2607 for (curr
= gdbarch
->swap
;
2610 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2614 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2616 struct gdbarch_swap
*curr
;
2617 for (curr
= gdbarch
->swap
;
2620 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2624 /* Keep a registrary of the architectures known by GDB. */
2626 struct gdbarch_init_registration
2628 enum bfd_architecture bfd_architecture
;
2629 gdbarch_init_ftype
*init
;
2630 struct gdbarch_list
*arches
;
2631 struct gdbarch_init_registration
*next
;
2634 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2637 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2638 gdbarch_init_ftype
*init
)
2640 struct gdbarch_init_registration
**curr
;
2641 const struct bfd_arch_info
*bfd_arch_info
;
2642 /* Check that BFD reconizes this architecture */
2643 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2644 if (bfd_arch_info
== NULL
)
2646 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2648 /* Check that we haven't seen this architecture before */
2649 for (curr
= &gdbarch_init_registrary
;
2651 curr
= &(*curr
)->next
)
2653 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2654 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2655 bfd_arch_info
->printable_name
);
2659 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2660 bfd_arch_info
->printable_name
,
2663 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2664 (*curr
)->bfd_architecture
= bfd_architecture
;
2665 (*curr
)->init
= init
;
2666 (*curr
)->arches
= NULL
;
2667 (*curr
)->next
= NULL
;
2672 /* Look for an architecture using gdbarch_info. Base search on only
2673 BFD_ARCH_INFO and BYTE_ORDER. */
2675 struct gdbarch_list
*
2676 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2677 const struct gdbarch_info
*info
)
2679 for (; arches
!= NULL
; arches
= arches
->next
)
2681 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2683 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2691 /* Update the current architecture. Return ZERO if the update request
2695 gdbarch_update (struct gdbarch_info info
)
2697 struct gdbarch
*new_gdbarch
;
2698 struct gdbarch_list
**list
;
2699 struct gdbarch_init_registration
*rego
;
2701 /* Fill in any missing bits. Most important is the bfd_architecture
2702 which is used to select the target architecture. */
2703 if (info
.bfd_architecture
== bfd_arch_unknown
)
2705 if (info
.bfd_arch_info
!= NULL
)
2706 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2707 else if (info
.abfd
!= NULL
)
2708 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2709 /* FIXME - should query BFD for its default architecture. */
2711 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2713 if (info
.bfd_arch_info
== NULL
)
2715 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2716 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2718 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2720 if (info
.byte_order
== 0)
2722 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2723 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2724 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2727 info
.byte_order
= current_gdbarch
->byte_order
;
2728 /* FIXME - should query BFD for its default byte-order. */
2730 /* A default for abfd? */
2732 /* Find the target that knows about this architecture. */
2733 for (rego
= gdbarch_init_registrary
;
2734 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2739 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2745 fprintf_unfiltered (gdb_stdlog
,
2746 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2747 info
.bfd_architecture
,
2748 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2749 fprintf_unfiltered (gdb_stdlog
,
2750 "gdbarch_update: info.bfd_arch_info %s\n",
2751 (info
.bfd_arch_info
!= NULL
2752 ? info
.bfd_arch_info
->printable_name
2754 fprintf_unfiltered (gdb_stdlog
,
2755 "gdbarch_update: info.byte_order %d (%s)\n",
2757 (info
.byte_order
== BIG_ENDIAN
? "big"
2758 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2760 fprintf_unfiltered (gdb_stdlog
,
2761 "gdbarch_update: info.abfd 0x%lx\n",
2763 fprintf_unfiltered (gdb_stdlog
,
2764 "gdbarch_update: info.tdep_info 0x%lx\n",
2765 (long) info
.tdep_info
);
2768 /* Ask the target for a replacement architecture. */
2769 new_gdbarch
= rego
->init (info
, rego
->arches
);
2771 /* Did the target like it? No. Reject the change. */
2772 if (new_gdbarch
== NULL
)
2775 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2779 /* Did the architecture change? No. Do nothing. */
2780 if (current_gdbarch
== new_gdbarch
)
2783 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2785 new_gdbarch
->bfd_arch_info
->printable_name
);
2789 /* Swap all data belonging to the old target out */
2790 swapout_gdbarch_swap (current_gdbarch
);
2792 /* Is this a pre-existing architecture? Yes. Swap it in. */
2793 for (list
= ®o
->arches
;
2795 list
= &(*list
)->next
)
2797 if ((*list
)->gdbarch
== new_gdbarch
)
2800 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2802 new_gdbarch
->bfd_arch_info
->printable_name
);
2803 current_gdbarch
= new_gdbarch
;
2804 swapin_gdbarch_swap (new_gdbarch
);
2809 /* Append this new architecture to this targets list. */
2810 (*list
) = XMALLOC (struct gdbarch_list
);
2811 (*list
)->next
= NULL
;
2812 (*list
)->gdbarch
= new_gdbarch
;
2814 /* Switch to this new architecture. Dump it out. */
2815 current_gdbarch
= new_gdbarch
;
2818 fprintf_unfiltered (gdb_stdlog
,
2819 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2821 new_gdbarch
->bfd_arch_info
->printable_name
);
2825 /* Check that the newly installed architecture is valid. */
2826 verify_gdbarch (new_gdbarch
);
2828 /* Initialize the per-architecture memory (swap) areas.
2829 CURRENT_GDBARCH must be update before these modules are
2831 init_gdbarch_swap (new_gdbarch
);
2833 /* Initialize the per-architecture data-pointer of all parties that
2834 registered an interest in this architecture. CURRENT_GDBARCH
2835 must be updated before these modules are called. */
2836 init_gdbarch_data (new_gdbarch
);
2843 /* Functions to manipulate the endianness of the target. */
2845 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2846 /* compat - Catch old targets that expect a selectable byte-order to
2847 default to BIG_ENDIAN */
2848 #ifndef TARGET_BYTE_ORDER_DEFAULT
2849 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2852 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2853 #ifndef TARGET_BYTE_ORDER_DEFAULT
2854 /* compat - Catch old non byte-order selectable targets that do not
2855 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2856 TARGET_BYTE_ORDER to be used as the default. For targets that
2857 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2858 below will get a strange compiler warning. */
2859 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2862 #ifndef TARGET_BYTE_ORDER_DEFAULT
2863 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2865 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2866 int target_byte_order_auto
= 1;
2868 /* Chain containing the \"set endian\" commands. */
2869 static struct cmd_list_element
*endianlist
= NULL
;
2871 /* Called by ``show endian''. */
2873 show_endian (char *args
, int from_tty
)
2876 (TARGET_BYTE_ORDER_AUTO
2877 ? "The target endianness is set automatically (currently %s endian)\n"
2878 : "The target is assumed to be %s endian\n");
2879 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
2882 /* Called if the user enters ``set endian'' without an argument. */
2884 set_endian (char *args
, int from_tty
)
2886 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2887 show_endian (args
, from_tty
);
2890 /* Called by ``set endian big''. */
2892 set_endian_big (char *args
, int from_tty
)
2894 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2896 target_byte_order
= BIG_ENDIAN
;
2897 target_byte_order_auto
= 0;
2900 struct gdbarch_info info
;
2901 memset (&info
, 0, sizeof info
);
2902 info
.byte_order
= BIG_ENDIAN
;
2903 gdbarch_update (info
);
2908 printf_unfiltered ("Byte order is not selectable.");
2909 show_endian (args
, from_tty
);
2913 /* Called by ``set endian little''. */
2915 set_endian_little (char *args
, int from_tty
)
2917 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2919 target_byte_order
= LITTLE_ENDIAN
;
2920 target_byte_order_auto
= 0;
2923 struct gdbarch_info info
;
2924 memset (&info
, 0, sizeof info
);
2925 info
.byte_order
= LITTLE_ENDIAN
;
2926 gdbarch_update (info
);
2931 printf_unfiltered ("Byte order is not selectable.");
2932 show_endian (args
, from_tty
);
2936 /* Called by ``set endian auto''. */
2938 set_endian_auto (char *args
, int from_tty
)
2940 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2942 target_byte_order_auto
= 1;
2946 printf_unfiltered ("Byte order is not selectable.");
2947 show_endian (args
, from_tty
);
2951 /* Set the endianness from a BFD. */
2953 set_endian_from_file (bfd
*abfd
)
2955 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2959 if (bfd_big_endian (abfd
))
2962 want
= LITTLE_ENDIAN
;
2963 if (TARGET_BYTE_ORDER_AUTO
)
2964 target_byte_order
= want
;
2965 else if (TARGET_BYTE_ORDER
!= want
)
2966 warning ("%s endian file does not match %s endian target.",
2967 want
== BIG_ENDIAN
? "big" : "little",
2968 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2972 if (bfd_big_endian (abfd
)
2973 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
2974 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
2975 warning ("%s endian file does not match %s endian target.",
2976 bfd_big_endian (abfd
) ? "big" : "little",
2977 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2983 /* Functions to manipulate the architecture of the target */
2985 enum set_arch
{ set_arch_auto
, set_arch_manual
};
2987 int target_architecture_auto
= 1;
2988 extern const struct bfd_arch_info bfd_default_arch_struct
;
2989 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
2990 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
2992 static void show_endian (char *, int);
2993 static void set_endian (char *, int);
2994 static void set_endian_big (char *, int);
2995 static void set_endian_little (char *, int);
2996 static void set_endian_auto (char *, int);
2997 static void set_endian_from_file (bfd
*);
2998 static int arch_ok (const struct bfd_arch_info
*arch
);
2999 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
3000 static void show_architecture (char *, int);
3001 static void set_architecture (char *, int);
3002 static void info_architecture (char *, int);
3003 static void set_architecture_from_file (bfd
*);
3005 /* Do the real work of changing the current architecture */
3008 arch_ok (const struct bfd_arch_info
*arch
)
3010 /* Should be performing the more basic check that the binary is
3011 compatible with GDB. */
3012 /* Check with the target that the architecture is valid. */
3013 return (target_architecture_hook
== NULL
3014 || target_architecture_hook (arch
));
3018 set_arch (const struct bfd_arch_info
*arch
,
3024 if (!arch_ok (arch
))
3025 warning ("Target may not support %s architecture",
3026 arch
->printable_name
);
3027 target_architecture
= arch
;
3029 case set_arch_manual
:
3030 if (!arch_ok (arch
))
3032 printf_unfiltered ("Target does not support `%s' architecture.\n",
3033 arch
->printable_name
);
3037 target_architecture_auto
= 0;
3038 target_architecture
= arch
;
3046 /* Called if the user enters ``show architecture'' without an argument. */
3048 show_architecture (char *args
, int from_tty
)
3051 arch
= TARGET_ARCHITECTURE
->printable_name
;
3052 if (target_architecture_auto
)
3053 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3055 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3058 /* Called if the user enters ``set architecture'' with or without an
3061 set_architecture (char *args
, int from_tty
)
3065 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3067 else if (strcmp (args
, "auto") == 0)
3069 target_architecture_auto
= 1;
3071 else if (GDB_MULTI_ARCH
)
3073 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3075 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3078 struct gdbarch_info info
;
3079 memset (&info
, 0, sizeof info
);
3080 info
.bfd_arch_info
= arch
;
3081 if (gdbarch_update (info
))
3082 target_architecture_auto
= 0;
3084 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3089 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3091 set_arch (arch
, set_arch_manual
);
3093 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3097 /* Called if the user enters ``info architecture'' without an argument. */
3099 info_architecture (char *args
, int from_tty
)
3101 enum bfd_architecture a
;
3104 if (gdbarch_init_registrary
!= NULL
)
3106 struct gdbarch_init_registration
*rego
;
3107 printf_filtered ("Available architectures are:\n");
3108 for (rego
= gdbarch_init_registrary
;
3112 const struct bfd_arch_info
*ap
;
3113 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3118 printf_filtered (" %s", ap
->printable_name
);
3122 printf_filtered ("\n");
3128 printf_filtered ("There are no available architectures.\n");
3132 printf_filtered ("Available architectures are:\n");
3133 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3135 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3140 printf_filtered (" %s", ap
->printable_name
);
3144 printf_filtered ("\n");
3149 /* Set the architecture from arch/machine */
3151 set_architecture_from_arch_mach (arch
, mach
)
3152 enum bfd_architecture arch
;
3155 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3157 set_arch (wanted
, set_arch_manual
);
3159 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3162 /* Set the architecture from a BFD */
3164 set_architecture_from_file (bfd
*abfd
)
3166 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3167 if (target_architecture_auto
)
3169 set_arch (wanted
, set_arch_auto
);
3171 else if (wanted
!= target_architecture
)
3173 warning ("%s architecture file may be incompatible with %s target.",
3174 wanted
->printable_name
,
3175 target_architecture
->printable_name
);
3180 /* Misc helper functions for targets. */
3183 frame_num_args_unknown (fi
)
3184 struct frame_info
*fi
;
3191 generic_register_convertible_not (num
)
3199 /* Pointer to the target-dependent disassembly function. */
3200 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3201 disassemble_info tm_print_insn_info
;
3205 /* Set the dynamic target-system-dependant parameters (architecture,
3206 byte-order) using information found in the BFD */
3209 set_gdbarch_from_file (abfd
)
3214 struct gdbarch_info info
;
3215 memset (&info
, 0, sizeof info
);
3217 gdbarch_update (info
);
3220 set_architecture_from_file (abfd
);
3221 set_endian_from_file (abfd
);
3225 #if defined (CALL_DUMMY)
3226 /* FIXME - this should go away */
3227 LONGEST call_dummy_words
[] = CALL_DUMMY
;
3228 int sizeof_call_dummy_words
= sizeof (call_dummy_words
);
3232 /* Initialize the current architecture. */
3234 initialize_current_architecture ()
3238 struct gdbarch_init_registration
*rego
;
3239 const struct bfd_arch_info
*chosen
= NULL
;
3240 for (rego
= gdbarch_init_registrary
; rego
!= NULL
; rego
= rego
->next
)
3242 const struct bfd_arch_info
*ap
3243 = bfd_lookup_arch (rego
->bfd_architecture
, 0);
3245 /* Choose the first architecture alphabetically. */
3247 || strcmp (ap
->printable_name
, chosen
->printable_name
) < 0)
3253 struct gdbarch_info info
;
3254 memset (&info
, 0, sizeof info
);
3255 info
.bfd_arch_info
= chosen
;
3256 gdbarch_update (info
);
3261 extern void _initialize_gdbarch (void);
3263 _initialize_gdbarch ()
3265 add_prefix_cmd ("endian", class_support
, set_endian
,
3266 "Set endianness of target.",
3267 &endianlist
, "set endian ", 0, &setlist
);
3268 add_cmd ("big", class_support
, set_endian_big
,
3269 "Set target as being big endian.", &endianlist
);
3270 add_cmd ("little", class_support
, set_endian_little
,
3271 "Set target as being little endian.", &endianlist
);
3272 add_cmd ("auto", class_support
, set_endian_auto
,
3273 "Select target endianness automatically.", &endianlist
);
3274 add_cmd ("endian", class_support
, show_endian
,
3275 "Show endianness of target.", &showlist
);
3277 add_cmd ("architecture", class_support
, set_architecture
,
3278 "Set architecture of target.", &setlist
);
3279 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3280 add_cmd ("architecture", class_support
, show_architecture
,
3281 "Show architecture of target.", &showlist
);
3282 add_cmd ("architecture", class_support
, info_architecture
,
3283 "List supported target architectures", &infolist
);
3285 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3286 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3287 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3288 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3289 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3291 add_show_from_set (add_set_cmd ("archdebug",
3294 (char *)&gdbarch_debug
,
3295 "Set architecture debugging.\n\
3296 When non-zero, architecture debugging is enabled.", &setlist
),