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 /* Ensure that all values in a GDBARCH are reasonable. */
363 verify_gdbarch (struct gdbarch *gdbarch)
365 /* Only perform sanity checks on a multi-arch target. */
366 if (GDB_MULTI_ARCH <= 0)
369 if (gdbarch->byte_order == 0)
370 internal_error ("verify_gdbarch: byte-order unset");
371 if (gdbarch->bfd_arch_info == NULL)
372 internal_error ("verify_gdbarch: bfd_arch_info unset");
373 /* Check those that need to be defined for the given multi-arch level. */
374 if ((GDB_MULTI_ARCH >= 1)
376 internal_error ("gdbarch: verify_gdbarch: bfd_vma_bit invalid");
377 if ((GDB_MULTI_ARCH >= 1)
378 && (gdbarch->ptr_bit == 0))
379 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
380 if ((GDB_MULTI_ARCH >= 1)
381 && (gdbarch->short_bit == 0))
382 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
383 if ((GDB_MULTI_ARCH >= 1)
384 && (gdbarch->int_bit == 0))
385 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
386 if ((GDB_MULTI_ARCH >= 1)
387 && (gdbarch->long_bit == 0))
388 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
389 if ((GDB_MULTI_ARCH >= 1)
390 && (gdbarch->long_long_bit == 0))
391 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
392 if ((GDB_MULTI_ARCH >= 1)
393 && (gdbarch->float_bit == 0))
394 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
395 if ((GDB_MULTI_ARCH >= 1)
396 && (gdbarch->double_bit == 0))
397 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
398 if ((GDB_MULTI_ARCH >= 1)
399 && (gdbarch->long_double_bit == 0))
400 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
401 if ((GDB_MULTI_ARCH >= 1)
402 && (gdbarch->read_pc == 0))
403 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
404 if ((GDB_MULTI_ARCH >= 1)
405 && (gdbarch->write_pc == 0))
406 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
407 if ((GDB_MULTI_ARCH >= 1)
408 && (gdbarch->read_fp == 0))
409 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
410 if ((GDB_MULTI_ARCH >= 1)
411 && (gdbarch->write_fp == 0))
412 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
413 if ((GDB_MULTI_ARCH >= 1)
414 && (gdbarch->read_sp == 0))
415 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
416 if ((GDB_MULTI_ARCH >= 1)
417 && (gdbarch->write_sp == 0))
418 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
419 if ((GDB_MULTI_ARCH >= 2)
420 && (gdbarch->num_regs == -1))
421 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
422 if ((GDB_MULTI_ARCH >= 2)
423 && (gdbarch->sp_regnum == -1))
424 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
425 if ((GDB_MULTI_ARCH >= 2)
426 && (gdbarch->fp_regnum == -1))
427 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
428 if ((GDB_MULTI_ARCH >= 2)
429 && (gdbarch->pc_regnum == -1))
430 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
431 if ((GDB_MULTI_ARCH >= 2)
432 && (gdbarch->register_name == 0))
433 internal_error ("gdbarch: verify_gdbarch: register_name invalid");
434 if ((GDB_MULTI_ARCH >= 2)
435 && (gdbarch->register_size == -1))
436 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
437 if ((GDB_MULTI_ARCH >= 2)
438 && (gdbarch->register_bytes == -1))
439 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
440 if ((GDB_MULTI_ARCH >= 2)
441 && (gdbarch->register_byte == 0))
442 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
443 if ((GDB_MULTI_ARCH >= 2)
444 && (gdbarch->register_raw_size == 0))
445 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
446 if ((GDB_MULTI_ARCH >= 2)
447 && (gdbarch->max_register_raw_size == -1))
448 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
449 if ((GDB_MULTI_ARCH >= 2)
450 && (gdbarch->register_virtual_size == 0))
451 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
452 if ((GDB_MULTI_ARCH >= 2)
453 && (gdbarch->max_register_virtual_size == -1))
454 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
455 if ((GDB_MULTI_ARCH >= 2)
456 && (gdbarch->register_virtual_type == 0))
457 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
458 if ((GDB_MULTI_ARCH >= 1)
459 && (gdbarch->use_generic_dummy_frames == -1))
460 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
461 if ((GDB_MULTI_ARCH >= 2)
462 && (gdbarch->call_dummy_location == 0))
463 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
464 if ((GDB_MULTI_ARCH >= 2)
465 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
466 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
467 if ((GDB_MULTI_ARCH >= 2)
468 && (gdbarch->call_dummy_start_offset == -1))
469 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
470 if ((GDB_MULTI_ARCH >= 2)
471 && (gdbarch->call_dummy_breakpoint_offset == -1))
472 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
473 if ((GDB_MULTI_ARCH >= 1)
474 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
475 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
476 if ((GDB_MULTI_ARCH >= 2)
477 && (gdbarch->call_dummy_length == -1))
478 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
479 if ((GDB_MULTI_ARCH >= 2)
480 && (gdbarch->pc_in_call_dummy == 0))
481 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
482 if ((GDB_MULTI_ARCH >= 1)
483 && (gdbarch->call_dummy_p == -1))
484 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
485 if ((GDB_MULTI_ARCH >= 1)
486 && (gdbarch->call_dummy_stack_adjust_p == -1))
487 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
488 if ((GDB_MULTI_ARCH >= 2)
489 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
490 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
491 if ((GDB_MULTI_ARCH >= 2)
492 && (gdbarch->fix_call_dummy == 0))
493 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
494 if ((GDB_MULTI_ARCH >= 2)
495 && (gdbarch->coerce_float_to_double == default_coerce_float_to_double))
496 internal_error ("gdbarch: verify_gdbarch: coerce_float_to_double invalid");
497 if ((GDB_MULTI_ARCH >= 1)
498 && (gdbarch->get_saved_register == 0))
499 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
500 if ((GDB_MULTI_ARCH >= 1)
501 && (gdbarch->register_convertible == 0))
502 internal_error ("gdbarch: verify_gdbarch: register_convertible invalid");
503 if ((GDB_MULTI_ARCH >= 2)
504 && (gdbarch->register_convert_to_virtual == 0))
505 internal_error ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
506 if ((GDB_MULTI_ARCH >= 2)
507 && (gdbarch->register_convert_to_raw == 0))
508 internal_error ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
509 if ((GDB_MULTI_ARCH >= 2)
510 && (gdbarch->extract_return_value == 0))
511 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
512 if ((GDB_MULTI_ARCH >= 1)
513 && (gdbarch->push_arguments == 0))
514 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
515 if ((GDB_MULTI_ARCH >= 2)
516 && (gdbarch->push_dummy_frame == 0))
517 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
518 if ((GDB_MULTI_ARCH >= 1)
519 && (gdbarch->push_return_address == 0))
520 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
521 if ((GDB_MULTI_ARCH >= 2)
522 && (gdbarch->pop_frame == 0))
523 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
524 if ((GDB_MULTI_ARCH >= 2)
525 && (gdbarch->d10v_make_daddr == 0))
526 internal_error ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
527 if ((GDB_MULTI_ARCH >= 2)
528 && (gdbarch->d10v_make_iaddr == 0))
529 internal_error ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
530 if ((GDB_MULTI_ARCH >= 2)
531 && (gdbarch->d10v_daddr_p == 0))
532 internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
533 if ((GDB_MULTI_ARCH >= 2)
534 && (gdbarch->d10v_iaddr_p == 0))
535 internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
536 if ((GDB_MULTI_ARCH >= 2)
537 && (gdbarch->d10v_convert_daddr_to_raw == 0))
538 internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
539 if ((GDB_MULTI_ARCH >= 2)
540 && (gdbarch->d10v_convert_iaddr_to_raw == 0))
541 internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
542 if ((GDB_MULTI_ARCH >= 2)
543 && (gdbarch->store_struct_return == 0))
544 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
545 if ((GDB_MULTI_ARCH >= 2)
546 && (gdbarch->store_return_value == 0))
547 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
548 if ((GDB_MULTI_ARCH >= 2)
549 && (gdbarch->extract_struct_value_address == 0))
550 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
551 if ((GDB_MULTI_ARCH >= 2)
552 && (gdbarch->use_struct_convention == 0))
553 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
554 if ((GDB_MULTI_ARCH >= 2)
555 && (gdbarch->frame_init_saved_regs == 0))
556 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
557 if ((GDB_MULTI_ARCH >= 2)
558 && (gdbarch->init_extra_frame_info == 0))
559 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
560 if ((GDB_MULTI_ARCH >= 2)
561 && (gdbarch->skip_prologue == 0))
562 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
563 if ((GDB_MULTI_ARCH >= 2)
564 && (gdbarch->inner_than == 0))
565 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
566 if ((GDB_MULTI_ARCH >= 2)
567 && (gdbarch->breakpoint_from_pc == 0))
568 internal_error ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
569 if ((GDB_MULTI_ARCH >= 2)
571 internal_error ("gdbarch: verify_gdbarch: memory_insert_breakpoint invalid");
572 if ((GDB_MULTI_ARCH >= 2)
574 internal_error ("gdbarch: verify_gdbarch: memory_remove_breakpoint invalid");
575 if ((GDB_MULTI_ARCH >= 2)
576 && (gdbarch->decr_pc_after_break == -1))
577 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
578 if ((GDB_MULTI_ARCH >= 2)
579 && (gdbarch->function_start_offset == -1))
580 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
581 if ((GDB_MULTI_ARCH >= 2)
582 && (gdbarch->remote_translate_xfer_address == 0))
583 internal_error ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
584 if ((GDB_MULTI_ARCH >= 2)
585 && (gdbarch->frame_args_skip == -1))
586 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
587 if ((GDB_MULTI_ARCH >= 2)
588 && (gdbarch->frameless_function_invocation == 0))
589 internal_error ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
590 if ((GDB_MULTI_ARCH >= 2)
591 && (gdbarch->frame_chain == 0))
592 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
593 if ((GDB_MULTI_ARCH >= 1)
594 && (gdbarch->frame_chain_valid == 0))
595 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
596 if ((GDB_MULTI_ARCH >= 2)
597 && (gdbarch->frame_saved_pc == 0))
598 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
599 if ((GDB_MULTI_ARCH >= 2)
600 && (gdbarch->frame_args_address == 0))
601 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
602 if ((GDB_MULTI_ARCH >= 2)
603 && (gdbarch->frame_locals_address == 0))
604 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
605 if ((GDB_MULTI_ARCH >= 2)
606 && (gdbarch->saved_pc_after_call == 0))
607 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
608 if ((GDB_MULTI_ARCH >= 2)
609 && (gdbarch->frame_num_args == 0))
610 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
614 /* Print out the details of the current architecture. */
619 if (TARGET_ARCHITECTURE != NULL)
620 fprintf_unfiltered (gdb_stdlog,
621 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
622 TARGET_ARCHITECTURE->printable_name);
623 fprintf_unfiltered (gdb_stdlog,
624 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
625 (long) TARGET_BYTE_ORDER);
626 fprintf_unfiltered (gdb_stdlog,
627 "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n",
628 (long) TARGET_BFD_VMA_BIT);
629 fprintf_unfiltered (gdb_stdlog,
630 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
631 (long) TARGET_PTR_BIT);
632 fprintf_unfiltered (gdb_stdlog,
633 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
634 (long) TARGET_SHORT_BIT);
635 fprintf_unfiltered (gdb_stdlog,
636 "gdbarch_update: TARGET_INT_BIT = %ld\n",
637 (long) TARGET_INT_BIT);
638 fprintf_unfiltered (gdb_stdlog,
639 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
640 (long) TARGET_LONG_BIT);
641 fprintf_unfiltered (gdb_stdlog,
642 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
643 (long) TARGET_LONG_LONG_BIT);
644 fprintf_unfiltered (gdb_stdlog,
645 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
646 (long) TARGET_FLOAT_BIT);
647 fprintf_unfiltered (gdb_stdlog,
648 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
649 (long) TARGET_DOUBLE_BIT);
650 fprintf_unfiltered (gdb_stdlog,
651 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
652 (long) TARGET_LONG_DOUBLE_BIT);
653 fprintf_unfiltered (gdb_stdlog,
654 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
655 (long) current_gdbarch->read_pc
656 /*TARGET_READ_PC ()*/);
657 fprintf_unfiltered (gdb_stdlog,
658 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
659 (long) current_gdbarch->write_pc
660 /*TARGET_WRITE_PC ()*/);
661 fprintf_unfiltered (gdb_stdlog,
662 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
663 (long) current_gdbarch->read_fp
664 /*TARGET_READ_FP ()*/);
665 fprintf_unfiltered (gdb_stdlog,
666 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
667 (long) current_gdbarch->write_fp
668 /*TARGET_WRITE_FP ()*/);
669 fprintf_unfiltered (gdb_stdlog,
670 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
671 (long) current_gdbarch->read_sp
672 /*TARGET_READ_SP ()*/);
673 fprintf_unfiltered (gdb_stdlog,
674 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
675 (long) current_gdbarch->write_sp
676 /*TARGET_WRITE_SP ()*/);
677 fprintf_unfiltered (gdb_stdlog,
678 "gdbarch_update: NUM_REGS = %ld\n",
680 fprintf_unfiltered (gdb_stdlog,
681 "gdbarch_update: SP_REGNUM = %ld\n",
683 fprintf_unfiltered (gdb_stdlog,
684 "gdbarch_update: FP_REGNUM = %ld\n",
686 fprintf_unfiltered (gdb_stdlog,
687 "gdbarch_update: PC_REGNUM = %ld\n",
689 fprintf_unfiltered (gdb_stdlog,
690 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
691 (long) current_gdbarch->register_name
692 /*REGISTER_NAME ()*/);
693 fprintf_unfiltered (gdb_stdlog,
694 "gdbarch_update: REGISTER_SIZE = %ld\n",
695 (long) REGISTER_SIZE);
696 fprintf_unfiltered (gdb_stdlog,
697 "gdbarch_update: REGISTER_BYTES = %ld\n",
698 (long) REGISTER_BYTES);
699 fprintf_unfiltered (gdb_stdlog,
700 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
701 (long) current_gdbarch->register_byte
702 /*REGISTER_BYTE ()*/);
703 fprintf_unfiltered (gdb_stdlog,
704 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
705 (long) current_gdbarch->register_raw_size
706 /*REGISTER_RAW_SIZE ()*/);
707 fprintf_unfiltered (gdb_stdlog,
708 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
709 (long) MAX_REGISTER_RAW_SIZE);
710 fprintf_unfiltered (gdb_stdlog,
711 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
712 (long) current_gdbarch->register_virtual_size
713 /*REGISTER_VIRTUAL_SIZE ()*/);
714 fprintf_unfiltered (gdb_stdlog,
715 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
716 (long) MAX_REGISTER_VIRTUAL_SIZE);
717 fprintf_unfiltered (gdb_stdlog,
718 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
719 (long) current_gdbarch->register_virtual_type
720 /*REGISTER_VIRTUAL_TYPE ()*/);
721 fprintf_unfiltered (gdb_stdlog,
722 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
723 (long) USE_GENERIC_DUMMY_FRAMES);
724 fprintf_unfiltered (gdb_stdlog,
725 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
726 (long) CALL_DUMMY_LOCATION);
727 fprintf_unfiltered (gdb_stdlog,
728 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
729 (long) current_gdbarch->call_dummy_address
730 /*CALL_DUMMY_ADDRESS ()*/);
731 fprintf_unfiltered (gdb_stdlog,
732 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
733 (long) CALL_DUMMY_START_OFFSET);
734 fprintf_unfiltered (gdb_stdlog,
735 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
736 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
737 fprintf_unfiltered (gdb_stdlog,
738 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
739 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
740 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
741 fprintf_unfiltered (gdb_stdlog,
742 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
743 (long) CALL_DUMMY_LENGTH);
744 fprintf_unfiltered (gdb_stdlog,
745 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
746 (long) current_gdbarch->pc_in_call_dummy
747 /*PC_IN_CALL_DUMMY ()*/);
748 fprintf_unfiltered (gdb_stdlog,
749 "gdbarch_update: CALL_DUMMY_P = %ld\n",
750 (long) CALL_DUMMY_P);
751 fprintf_unfiltered (gdb_stdlog,
752 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
753 (long) CALL_DUMMY_WORDS);
754 fprintf_unfiltered (gdb_stdlog,
755 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
756 (long) SIZEOF_CALL_DUMMY_WORDS);
757 fprintf_unfiltered (gdb_stdlog,
758 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
759 (long) CALL_DUMMY_STACK_ADJUST_P);
760 if (CALL_DUMMY_STACK_ADJUST_P)
761 fprintf_unfiltered (gdb_stdlog,
762 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
763 (long) CALL_DUMMY_STACK_ADJUST);
764 fprintf_unfiltered (gdb_stdlog,
765 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
766 (long) current_gdbarch->fix_call_dummy
767 /*FIX_CALL_DUMMY ()*/);
768 #ifdef BELIEVE_PCC_PROMOTION
769 fprintf_unfiltered (gdb_stdlog,
770 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
771 (long) BELIEVE_PCC_PROMOTION);
773 #ifdef BELIEVE_PCC_PROMOTION_TYPE
774 fprintf_unfiltered (gdb_stdlog,
775 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
776 (long) BELIEVE_PCC_PROMOTION_TYPE);
778 fprintf_unfiltered (gdb_stdlog,
779 "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
780 (long) current_gdbarch->coerce_float_to_double
781 /*COERCE_FLOAT_TO_DOUBLE ()*/);
782 fprintf_unfiltered (gdb_stdlog,
783 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
784 (long) current_gdbarch->get_saved_register
785 /*GET_SAVED_REGISTER ()*/);
786 fprintf_unfiltered (gdb_stdlog,
787 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
788 (long) current_gdbarch->register_convertible
789 /*REGISTER_CONVERTIBLE ()*/);
790 fprintf_unfiltered (gdb_stdlog,
791 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
792 (long) current_gdbarch->register_convert_to_virtual
793 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
794 fprintf_unfiltered (gdb_stdlog,
795 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
796 (long) current_gdbarch->register_convert_to_raw
797 /*REGISTER_CONVERT_TO_RAW ()*/);
798 fprintf_unfiltered (gdb_stdlog,
799 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
800 (long) current_gdbarch->extract_return_value
801 /*EXTRACT_RETURN_VALUE ()*/);
802 fprintf_unfiltered (gdb_stdlog,
803 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
804 (long) current_gdbarch->push_arguments
805 /*PUSH_ARGUMENTS ()*/);
806 fprintf_unfiltered (gdb_stdlog,
807 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
808 (long) current_gdbarch->push_dummy_frame
809 /*PUSH_DUMMY_FRAME ()*/);
810 fprintf_unfiltered (gdb_stdlog,
811 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
812 (long) current_gdbarch->push_return_address
813 /*PUSH_RETURN_ADDRESS ()*/);
814 fprintf_unfiltered (gdb_stdlog,
815 "gdbarch_update: POP_FRAME = 0x%08lx\n",
816 (long) current_gdbarch->pop_frame
818 fprintf_unfiltered (gdb_stdlog,
819 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
820 (long) current_gdbarch->d10v_make_daddr
821 /*D10V_MAKE_DADDR ()*/);
822 fprintf_unfiltered (gdb_stdlog,
823 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
824 (long) current_gdbarch->d10v_make_iaddr
825 /*D10V_MAKE_IADDR ()*/);
826 fprintf_unfiltered (gdb_stdlog,
827 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
828 (long) current_gdbarch->d10v_daddr_p
829 /*D10V_DADDR_P ()*/);
830 fprintf_unfiltered (gdb_stdlog,
831 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
832 (long) current_gdbarch->d10v_iaddr_p
833 /*D10V_IADDR_P ()*/);
834 fprintf_unfiltered (gdb_stdlog,
835 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
836 (long) current_gdbarch->d10v_convert_daddr_to_raw
837 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
838 fprintf_unfiltered (gdb_stdlog,
839 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
840 (long) current_gdbarch->d10v_convert_iaddr_to_raw
841 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
842 fprintf_unfiltered (gdb_stdlog,
843 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
844 (long) current_gdbarch->store_struct_return
845 /*STORE_STRUCT_RETURN ()*/);
846 fprintf_unfiltered (gdb_stdlog,
847 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
848 (long) current_gdbarch->store_return_value
849 /*STORE_RETURN_VALUE ()*/);
850 fprintf_unfiltered (gdb_stdlog,
851 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
852 (long) current_gdbarch->extract_struct_value_address
853 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
854 fprintf_unfiltered (gdb_stdlog,
855 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
856 (long) current_gdbarch->use_struct_convention
857 /*USE_STRUCT_CONVENTION ()*/);
858 fprintf_unfiltered (gdb_stdlog,
859 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
860 (long) current_gdbarch->frame_init_saved_regs
861 /*FRAME_INIT_SAVED_REGS ()*/);
862 fprintf_unfiltered (gdb_stdlog,
863 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
864 (long) current_gdbarch->init_extra_frame_info
865 /*INIT_EXTRA_FRAME_INFO ()*/);
866 fprintf_unfiltered (gdb_stdlog,
867 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
868 (long) current_gdbarch->skip_prologue
869 /*SKIP_PROLOGUE ()*/);
870 fprintf_unfiltered (gdb_stdlog,
871 "gdbarch_update: INNER_THAN = 0x%08lx\n",
872 (long) current_gdbarch->inner_than
874 fprintf_unfiltered (gdb_stdlog,
875 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
876 (long) current_gdbarch->breakpoint_from_pc
877 /*BREAKPOINT_FROM_PC ()*/);
878 fprintf_unfiltered (gdb_stdlog,
879 "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
880 (long) current_gdbarch->memory_insert_breakpoint
881 /*MEMORY_INSERT_BREAKPOINT ()*/);
882 fprintf_unfiltered (gdb_stdlog,
883 "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
884 (long) current_gdbarch->memory_remove_breakpoint
885 /*MEMORY_REMOVE_BREAKPOINT ()*/);
886 fprintf_unfiltered (gdb_stdlog,
887 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
888 (long) DECR_PC_AFTER_BREAK);
889 fprintf_unfiltered (gdb_stdlog,
890 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
891 (long) FUNCTION_START_OFFSET);
892 fprintf_unfiltered (gdb_stdlog,
893 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
894 (long) current_gdbarch->remote_translate_xfer_address
895 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
896 fprintf_unfiltered (gdb_stdlog,
897 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
898 (long) FRAME_ARGS_SKIP);
899 fprintf_unfiltered (gdb_stdlog,
900 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
901 (long) current_gdbarch->frameless_function_invocation
902 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
903 fprintf_unfiltered (gdb_stdlog,
904 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
905 (long) current_gdbarch->frame_chain
907 fprintf_unfiltered (gdb_stdlog,
908 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
909 (long) current_gdbarch->frame_chain_valid
910 /*FRAME_CHAIN_VALID ()*/);
911 fprintf_unfiltered (gdb_stdlog,
912 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
913 (long) current_gdbarch->frame_saved_pc
914 /*FRAME_SAVED_PC ()*/);
915 fprintf_unfiltered (gdb_stdlog,
916 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
917 (long) current_gdbarch->frame_args_address
918 /*FRAME_ARGS_ADDRESS ()*/);
919 fprintf_unfiltered (gdb_stdlog,
920 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
921 (long) current_gdbarch->frame_locals_address
922 /*FRAME_LOCALS_ADDRESS ()*/);
923 fprintf_unfiltered (gdb_stdlog,
924 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
925 (long) current_gdbarch->saved_pc_after_call
926 /*SAVED_PC_AFTER_CALL ()*/);
927 fprintf_unfiltered (gdb_stdlog,
928 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
929 (long) current_gdbarch->frame_num_args
930 /*FRAME_NUM_ARGS ()*/);
933 struct gdbarch_tdep *
934 gdbarch_tdep (struct gdbarch *gdbarch)
936 if (gdbarch_debug >= 2)
937 /* FIXME: gdb_std??? */
938 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
939 return gdbarch->tdep;
943 const struct bfd_arch_info *
944 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
946 if (gdbarch_debug >= 2)
947 /* FIXME: gdb_std??? */
948 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
949 return gdbarch->bfd_arch_info;
953 gdbarch_byte_order (struct gdbarch *gdbarch)
955 if (gdbarch_debug >= 2)
956 /* FIXME: gdb_std??? */
957 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
958 return gdbarch->byte_order;
962 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
965 internal_error ("gdbarch: gdbarch_bfd_vma_bit invalid");
966 if (gdbarch_debug >= 2)
967 /* FIXME: gdb_std??? */
968 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
969 return gdbarch->bfd_vma_bit;
973 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
976 gdbarch->bfd_vma_bit = bfd_vma_bit;
980 gdbarch_ptr_bit (struct gdbarch *gdbarch)
982 if (gdbarch->ptr_bit == 0)
983 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
984 if (gdbarch_debug >= 2)
985 /* FIXME: gdb_std??? */
986 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
987 return gdbarch->ptr_bit;
991 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
994 gdbarch->ptr_bit = ptr_bit;
998 gdbarch_short_bit (struct gdbarch *gdbarch)
1000 if (gdbarch->short_bit == 0)
1001 internal_error ("gdbarch: gdbarch_short_bit invalid");
1002 if (gdbarch_debug >= 2)
1003 /* FIXME: gdb_std??? */
1004 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1005 return gdbarch->short_bit;
1009 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1012 gdbarch->short_bit = short_bit;
1016 gdbarch_int_bit (struct gdbarch *gdbarch)
1018 if (gdbarch->int_bit == 0)
1019 internal_error ("gdbarch: gdbarch_int_bit invalid");
1020 if (gdbarch_debug >= 2)
1021 /* FIXME: gdb_std??? */
1022 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1023 return gdbarch->int_bit;
1027 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1030 gdbarch->int_bit = int_bit;
1034 gdbarch_long_bit (struct gdbarch *gdbarch)
1036 if (gdbarch->long_bit == 0)
1037 internal_error ("gdbarch: gdbarch_long_bit invalid");
1038 if (gdbarch_debug >= 2)
1039 /* FIXME: gdb_std??? */
1040 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1041 return gdbarch->long_bit;
1045 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1048 gdbarch->long_bit = long_bit;
1052 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1054 if (gdbarch->long_long_bit == 0)
1055 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
1056 if (gdbarch_debug >= 2)
1057 /* FIXME: gdb_std??? */
1058 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1059 return gdbarch->long_long_bit;
1063 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1066 gdbarch->long_long_bit = long_long_bit;
1070 gdbarch_float_bit (struct gdbarch *gdbarch)
1072 if (gdbarch->float_bit == 0)
1073 internal_error ("gdbarch: gdbarch_float_bit invalid");
1074 if (gdbarch_debug >= 2)
1075 /* FIXME: gdb_std??? */
1076 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1077 return gdbarch->float_bit;
1081 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1084 gdbarch->float_bit = float_bit;
1088 gdbarch_double_bit (struct gdbarch *gdbarch)
1090 if (gdbarch->double_bit == 0)
1091 internal_error ("gdbarch: gdbarch_double_bit invalid");
1092 if (gdbarch_debug >= 2)
1093 /* FIXME: gdb_std??? */
1094 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1095 return gdbarch->double_bit;
1099 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1102 gdbarch->double_bit = double_bit;
1106 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1108 if (gdbarch->long_double_bit == 0)
1109 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1110 if (gdbarch_debug >= 2)
1111 /* FIXME: gdb_std??? */
1112 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1113 return gdbarch->long_double_bit;
1117 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1118 int long_double_bit)
1120 gdbarch->long_double_bit = long_double_bit;
1124 gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
1126 if (gdbarch->read_pc == 0)
1127 internal_error ("gdbarch: gdbarch_read_pc invalid");
1128 if (gdbarch_debug >= 2)
1129 /* FIXME: gdb_std??? */
1130 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1131 return gdbarch->read_pc (pid);
1135 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1136 gdbarch_read_pc_ftype read_pc)
1138 gdbarch->read_pc = read_pc;
1142 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
1144 if (gdbarch->write_pc == 0)
1145 internal_error ("gdbarch: gdbarch_write_pc invalid");
1146 if (gdbarch_debug >= 2)
1147 /* FIXME: gdb_std??? */
1148 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1149 gdbarch->write_pc (val, pid);
1153 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1154 gdbarch_write_pc_ftype write_pc)
1156 gdbarch->write_pc = write_pc;
1160 gdbarch_read_fp (struct gdbarch *gdbarch)
1162 if (gdbarch->read_fp == 0)
1163 internal_error ("gdbarch: gdbarch_read_fp invalid");
1164 if (gdbarch_debug >= 2)
1165 /* FIXME: gdb_std??? */
1166 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
1167 return gdbarch->read_fp ();
1171 set_gdbarch_read_fp (struct gdbarch *gdbarch,
1172 gdbarch_read_fp_ftype read_fp)
1174 gdbarch->read_fp = read_fp;
1178 gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
1180 if (gdbarch->write_fp == 0)
1181 internal_error ("gdbarch: gdbarch_write_fp invalid");
1182 if (gdbarch_debug >= 2)
1183 /* FIXME: gdb_std??? */
1184 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
1185 gdbarch->write_fp (val);
1189 set_gdbarch_write_fp (struct gdbarch *gdbarch,
1190 gdbarch_write_fp_ftype write_fp)
1192 gdbarch->write_fp = write_fp;
1196 gdbarch_read_sp (struct gdbarch *gdbarch)
1198 if (gdbarch->read_sp == 0)
1199 internal_error ("gdbarch: gdbarch_read_sp invalid");
1200 if (gdbarch_debug >= 2)
1201 /* FIXME: gdb_std??? */
1202 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1203 return gdbarch->read_sp ();
1207 set_gdbarch_read_sp (struct gdbarch *gdbarch,
1208 gdbarch_read_sp_ftype read_sp)
1210 gdbarch->read_sp = read_sp;
1214 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
1216 if (gdbarch->write_sp == 0)
1217 internal_error ("gdbarch: gdbarch_write_sp invalid");
1218 if (gdbarch_debug >= 2)
1219 /* FIXME: gdb_std??? */
1220 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
1221 gdbarch->write_sp (val);
1225 set_gdbarch_write_sp (struct gdbarch *gdbarch,
1226 gdbarch_write_sp_ftype write_sp)
1228 gdbarch->write_sp = write_sp;
1232 gdbarch_num_regs (struct gdbarch *gdbarch)
1234 if (gdbarch->num_regs == -1)
1235 internal_error ("gdbarch: gdbarch_num_regs invalid");
1236 if (gdbarch_debug >= 2)
1237 /* FIXME: gdb_std??? */
1238 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1239 return gdbarch->num_regs;
1243 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1246 gdbarch->num_regs = num_regs;
1250 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1252 if (gdbarch->sp_regnum == -1)
1253 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1254 if (gdbarch_debug >= 2)
1255 /* FIXME: gdb_std??? */
1256 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1257 return gdbarch->sp_regnum;
1261 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1264 gdbarch->sp_regnum = sp_regnum;
1268 gdbarch_fp_regnum (struct gdbarch *gdbarch)
1270 if (gdbarch->fp_regnum == -1)
1271 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1272 if (gdbarch_debug >= 2)
1273 /* FIXME: gdb_std??? */
1274 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
1275 return gdbarch->fp_regnum;
1279 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
1282 gdbarch->fp_regnum = fp_regnum;
1286 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1288 if (gdbarch->pc_regnum == -1)
1289 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1290 if (gdbarch_debug >= 2)
1291 /* FIXME: gdb_std??? */
1292 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1293 return gdbarch->pc_regnum;
1297 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1300 gdbarch->pc_regnum = pc_regnum;
1304 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1306 if (gdbarch->register_name == 0)
1307 internal_error ("gdbarch: gdbarch_register_name invalid");
1308 if (gdbarch_debug >= 2)
1309 /* FIXME: gdb_std??? */
1310 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1311 return gdbarch->register_name (regnr);
1315 set_gdbarch_register_name (struct gdbarch *gdbarch,
1316 gdbarch_register_name_ftype register_name)
1318 gdbarch->register_name = register_name;
1322 gdbarch_register_size (struct gdbarch *gdbarch)
1324 if (gdbarch->register_size == -1)
1325 internal_error ("gdbarch: gdbarch_register_size invalid");
1326 if (gdbarch_debug >= 2)
1327 /* FIXME: gdb_std??? */
1328 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
1329 return gdbarch->register_size;
1333 set_gdbarch_register_size (struct gdbarch *gdbarch,
1336 gdbarch->register_size = register_size;
1340 gdbarch_register_bytes (struct gdbarch *gdbarch)
1342 if (gdbarch->register_bytes == -1)
1343 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1344 if (gdbarch_debug >= 2)
1345 /* FIXME: gdb_std??? */
1346 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
1347 return gdbarch->register_bytes;
1351 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
1354 gdbarch->register_bytes = register_bytes;
1358 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
1360 if (gdbarch->register_byte == 0)
1361 internal_error ("gdbarch: gdbarch_register_byte invalid");
1362 if (gdbarch_debug >= 2)
1363 /* FIXME: gdb_std??? */
1364 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
1365 return gdbarch->register_byte (reg_nr);
1369 set_gdbarch_register_byte (struct gdbarch *gdbarch,
1370 gdbarch_register_byte_ftype register_byte)
1372 gdbarch->register_byte = register_byte;
1376 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
1378 if (gdbarch->register_raw_size == 0)
1379 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1380 if (gdbarch_debug >= 2)
1381 /* FIXME: gdb_std??? */
1382 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
1383 return gdbarch->register_raw_size (reg_nr);
1387 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
1388 gdbarch_register_raw_size_ftype register_raw_size)
1390 gdbarch->register_raw_size = register_raw_size;
1394 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
1396 if (gdbarch->max_register_raw_size == -1)
1397 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1398 if (gdbarch_debug >= 2)
1399 /* FIXME: gdb_std??? */
1400 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
1401 return gdbarch->max_register_raw_size;
1405 set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
1406 int max_register_raw_size)
1408 gdbarch->max_register_raw_size = max_register_raw_size;
1412 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
1414 if (gdbarch->register_virtual_size == 0)
1415 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1416 if (gdbarch_debug >= 2)
1417 /* FIXME: gdb_std??? */
1418 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
1419 return gdbarch->register_virtual_size (reg_nr);
1423 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
1424 gdbarch_register_virtual_size_ftype register_virtual_size)
1426 gdbarch->register_virtual_size = register_virtual_size;
1430 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
1432 if (gdbarch->max_register_virtual_size == -1)
1433 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1434 if (gdbarch_debug >= 2)
1435 /* FIXME: gdb_std??? */
1436 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
1437 return gdbarch->max_register_virtual_size;
1441 set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
1442 int max_register_virtual_size)
1444 gdbarch->max_register_virtual_size = max_register_virtual_size;
1448 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
1450 if (gdbarch->register_virtual_type == 0)
1451 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1452 if (gdbarch_debug >= 2)
1453 /* FIXME: gdb_std??? */
1454 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
1455 return gdbarch->register_virtual_type (reg_nr);
1459 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
1460 gdbarch_register_virtual_type_ftype register_virtual_type)
1462 gdbarch->register_virtual_type = register_virtual_type;
1466 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
1468 if (gdbarch->use_generic_dummy_frames == -1)
1469 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1470 if (gdbarch_debug >= 2)
1471 /* FIXME: gdb_std??? */
1472 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
1473 return gdbarch->use_generic_dummy_frames;
1477 set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
1478 int use_generic_dummy_frames)
1480 gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
1484 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1486 if (gdbarch->call_dummy_location == 0)
1487 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1488 if (gdbarch_debug >= 2)
1489 /* FIXME: gdb_std??? */
1490 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1491 return gdbarch->call_dummy_location;
1495 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1496 int call_dummy_location)
1498 gdbarch->call_dummy_location = call_dummy_location;
1502 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
1504 if (gdbarch->call_dummy_address == 0)
1505 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1506 if (gdbarch_debug >= 2)
1507 /* FIXME: gdb_std??? */
1508 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
1509 return gdbarch->call_dummy_address ();
1513 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
1514 gdbarch_call_dummy_address_ftype call_dummy_address)
1516 gdbarch->call_dummy_address = call_dummy_address;
1520 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
1522 if (gdbarch->call_dummy_start_offset == -1)
1523 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1524 if (gdbarch_debug >= 2)
1525 /* FIXME: gdb_std??? */
1526 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
1527 return gdbarch->call_dummy_start_offset;
1531 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
1532 CORE_ADDR call_dummy_start_offset)
1534 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
1538 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
1540 if (gdbarch->call_dummy_breakpoint_offset == -1)
1541 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1542 if (gdbarch_debug >= 2)
1543 /* FIXME: gdb_std??? */
1544 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
1545 return gdbarch->call_dummy_breakpoint_offset;
1549 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
1550 CORE_ADDR call_dummy_breakpoint_offset)
1552 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
1556 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
1558 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
1559 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1560 if (gdbarch_debug >= 2)
1561 /* FIXME: gdb_std??? */
1562 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1563 return gdbarch->call_dummy_breakpoint_offset_p;
1567 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
1568 int call_dummy_breakpoint_offset_p)
1570 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
1574 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
1576 if (gdbarch->call_dummy_length == -1)
1577 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1578 if (gdbarch_debug >= 2)
1579 /* FIXME: gdb_std??? */
1580 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
1581 return gdbarch->call_dummy_length;
1585 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
1586 int call_dummy_length)
1588 gdbarch->call_dummy_length = call_dummy_length;
1592 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
1594 if (gdbarch->pc_in_call_dummy == 0)
1595 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1596 if (gdbarch_debug >= 2)
1597 /* FIXME: gdb_std??? */
1598 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
1599 return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
1603 set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
1604 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
1606 gdbarch->pc_in_call_dummy = pc_in_call_dummy;
1610 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
1612 if (gdbarch->call_dummy_p == -1)
1613 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1614 if (gdbarch_debug >= 2)
1615 /* FIXME: gdb_std??? */
1616 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
1617 return gdbarch->call_dummy_p;
1621 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
1624 gdbarch->call_dummy_p = call_dummy_p;
1628 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
1630 if (gdbarch_debug >= 2)
1631 /* FIXME: gdb_std??? */
1632 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
1633 return gdbarch->call_dummy_words;
1637 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
1638 LONGEST * call_dummy_words)
1640 gdbarch->call_dummy_words = call_dummy_words;
1644 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
1646 if (gdbarch_debug >= 2)
1647 /* FIXME: gdb_std??? */
1648 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
1649 return gdbarch->sizeof_call_dummy_words;
1653 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
1654 int sizeof_call_dummy_words)
1656 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
1660 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
1662 if (gdbarch->call_dummy_stack_adjust_p == -1)
1663 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1664 if (gdbarch_debug >= 2)
1665 /* FIXME: gdb_std??? */
1666 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
1667 return gdbarch->call_dummy_stack_adjust_p;
1671 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
1672 int call_dummy_stack_adjust_p)
1674 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
1678 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
1680 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
1681 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1682 if (gdbarch_debug >= 2)
1683 /* FIXME: gdb_std??? */
1684 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
1685 return gdbarch->call_dummy_stack_adjust;
1689 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
1690 int call_dummy_stack_adjust)
1692 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
1696 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)
1698 if (gdbarch->fix_call_dummy == 0)
1699 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1700 if (gdbarch_debug >= 2)
1701 /* FIXME: gdb_std??? */
1702 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
1703 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
1707 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
1708 gdbarch_fix_call_dummy_ftype fix_call_dummy)
1710 gdbarch->fix_call_dummy = fix_call_dummy;
1714 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
1716 if (gdbarch_debug >= 2)
1717 /* FIXME: gdb_std??? */
1718 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
1719 return gdbarch->believe_pcc_promotion;
1723 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
1724 int believe_pcc_promotion)
1726 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
1730 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
1732 if (gdbarch_debug >= 2)
1733 /* FIXME: gdb_std??? */
1734 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
1735 return gdbarch->believe_pcc_promotion_type;
1739 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
1740 int believe_pcc_promotion_type)
1742 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
1746 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
1748 if (gdbarch->coerce_float_to_double == 0)
1749 internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid");
1750 if (gdbarch_debug >= 2)
1751 /* FIXME: gdb_std??? */
1752 fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
1753 return gdbarch->coerce_float_to_double (formal, actual);
1757 set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
1758 gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
1760 gdbarch->coerce_float_to_double = coerce_float_to_double;
1764 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)
1766 if (gdbarch->get_saved_register == 0)
1767 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1768 if (gdbarch_debug >= 2)
1769 /* FIXME: gdb_std??? */
1770 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
1771 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
1775 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
1776 gdbarch_get_saved_register_ftype get_saved_register)
1778 gdbarch->get_saved_register = get_saved_register;
1782 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
1784 if (gdbarch->register_convertible == 0)
1785 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1786 if (gdbarch_debug >= 2)
1787 /* FIXME: gdb_std??? */
1788 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
1789 return gdbarch->register_convertible (nr);
1793 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
1794 gdbarch_register_convertible_ftype register_convertible)
1796 gdbarch->register_convertible = register_convertible;
1800 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
1802 if (gdbarch->register_convert_to_virtual == 0)
1803 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1804 if (gdbarch_debug >= 2)
1805 /* FIXME: gdb_std??? */
1806 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
1807 gdbarch->register_convert_to_virtual (regnum, type, from, to);
1811 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
1812 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
1814 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
1818 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
1820 if (gdbarch->register_convert_to_raw == 0)
1821 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1822 if (gdbarch_debug >= 2)
1823 /* FIXME: gdb_std??? */
1824 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
1825 gdbarch->register_convert_to_raw (type, regnum, from, to);
1829 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
1830 gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
1832 gdbarch->register_convert_to_raw = register_convert_to_raw;
1836 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
1838 if (gdbarch->extract_return_value == 0)
1839 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1840 if (gdbarch_debug >= 2)
1841 /* FIXME: gdb_std??? */
1842 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
1843 gdbarch->extract_return_value (type, regbuf, valbuf);
1847 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
1848 gdbarch_extract_return_value_ftype extract_return_value)
1850 gdbarch->extract_return_value = extract_return_value;
1854 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
1856 if (gdbarch->push_arguments == 0)
1857 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1858 if (gdbarch_debug >= 2)
1859 /* FIXME: gdb_std??? */
1860 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
1861 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
1865 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
1866 gdbarch_push_arguments_ftype push_arguments)
1868 gdbarch->push_arguments = push_arguments;
1872 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
1874 if (gdbarch->push_dummy_frame == 0)
1875 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1876 if (gdbarch_debug >= 2)
1877 /* FIXME: gdb_std??? */
1878 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
1879 gdbarch->push_dummy_frame ();
1883 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
1884 gdbarch_push_dummy_frame_ftype push_dummy_frame)
1886 gdbarch->push_dummy_frame = push_dummy_frame;
1890 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
1892 if (gdbarch->push_return_address == 0)
1893 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1894 if (gdbarch_debug >= 2)
1895 /* FIXME: gdb_std??? */
1896 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
1897 return gdbarch->push_return_address (pc, sp);
1901 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
1902 gdbarch_push_return_address_ftype push_return_address)
1904 gdbarch->push_return_address = push_return_address;
1908 gdbarch_pop_frame (struct gdbarch *gdbarch)
1910 if (gdbarch->pop_frame == 0)
1911 internal_error ("gdbarch: gdbarch_pop_frame invalid");
1912 if (gdbarch_debug >= 2)
1913 /* FIXME: gdb_std??? */
1914 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
1915 gdbarch->pop_frame ();
1919 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
1920 gdbarch_pop_frame_ftype pop_frame)
1922 gdbarch->pop_frame = pop_frame;
1926 gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
1928 if (gdbarch->d10v_make_daddr == 0)
1929 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
1930 if (gdbarch_debug >= 2)
1931 /* FIXME: gdb_std??? */
1932 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
1933 return gdbarch->d10v_make_daddr (x);
1937 set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch,
1938 gdbarch_d10v_make_daddr_ftype d10v_make_daddr)
1940 gdbarch->d10v_make_daddr = d10v_make_daddr;
1944 gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
1946 if (gdbarch->d10v_make_iaddr == 0)
1947 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
1948 if (gdbarch_debug >= 2)
1949 /* FIXME: gdb_std??? */
1950 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
1951 return gdbarch->d10v_make_iaddr (x);
1955 set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch,
1956 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr)
1958 gdbarch->d10v_make_iaddr = d10v_make_iaddr;
1962 gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
1964 if (gdbarch->d10v_daddr_p == 0)
1965 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
1966 if (gdbarch_debug >= 2)
1967 /* FIXME: gdb_std??? */
1968 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
1969 return gdbarch->d10v_daddr_p (x);
1973 set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch,
1974 gdbarch_d10v_daddr_p_ftype d10v_daddr_p)
1976 gdbarch->d10v_daddr_p = d10v_daddr_p;
1980 gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
1982 if (gdbarch->d10v_iaddr_p == 0)
1983 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
1984 if (gdbarch_debug >= 2)
1985 /* FIXME: gdb_std??? */
1986 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
1987 return gdbarch->d10v_iaddr_p (x);
1991 set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch,
1992 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p)
1994 gdbarch->d10v_iaddr_p = d10v_iaddr_p;
1998 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2000 if (gdbarch->d10v_convert_daddr_to_raw == 0)
2001 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
2002 if (gdbarch_debug >= 2)
2003 /* FIXME: gdb_std??? */
2004 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
2005 return gdbarch->d10v_convert_daddr_to_raw (x);
2009 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch,
2010 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw)
2012 gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
2016 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2018 if (gdbarch->d10v_convert_iaddr_to_raw == 0)
2019 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2020 if (gdbarch_debug >= 2)
2021 /* FIXME: gdb_std??? */
2022 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2023 return gdbarch->d10v_convert_iaddr_to_raw (x);
2027 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch,
2028 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw)
2030 gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
2034 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2036 if (gdbarch->store_struct_return == 0)
2037 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
2038 if (gdbarch_debug >= 2)
2039 /* FIXME: gdb_std??? */
2040 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
2041 gdbarch->store_struct_return (addr, sp);
2045 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
2046 gdbarch_store_struct_return_ftype store_struct_return)
2048 gdbarch->store_struct_return = store_struct_return;
2052 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
2054 if (gdbarch->store_return_value == 0)
2055 internal_error ("gdbarch: gdbarch_store_return_value invalid");
2056 if (gdbarch_debug >= 2)
2057 /* FIXME: gdb_std??? */
2058 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2059 gdbarch->store_return_value (type, valbuf);
2063 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2064 gdbarch_store_return_value_ftype store_return_value)
2066 gdbarch->store_return_value = store_return_value;
2070 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
2072 if (gdbarch->extract_struct_value_address == 0)
2073 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
2074 if (gdbarch_debug >= 2)
2075 /* FIXME: gdb_std??? */
2076 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
2077 return gdbarch->extract_struct_value_address (regbuf);
2081 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
2082 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
2084 gdbarch->extract_struct_value_address = extract_struct_value_address;
2088 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2090 if (gdbarch->use_struct_convention == 0)
2091 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2092 if (gdbarch_debug >= 2)
2093 /* FIXME: gdb_std??? */
2094 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
2095 return gdbarch->use_struct_convention (gcc_p, value_type);
2099 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
2100 gdbarch_use_struct_convention_ftype use_struct_convention)
2102 gdbarch->use_struct_convention = use_struct_convention;
2106 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
2108 if (gdbarch->frame_init_saved_regs == 0)
2109 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2110 if (gdbarch_debug >= 2)
2111 /* FIXME: gdb_std??? */
2112 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
2113 gdbarch->frame_init_saved_regs (frame);
2117 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
2118 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
2120 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
2124 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
2126 if (gdbarch->init_extra_frame_info == 0)
2127 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2128 if (gdbarch_debug >= 2)
2129 /* FIXME: gdb_std??? */
2130 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
2131 gdbarch->init_extra_frame_info (fromleaf, frame);
2135 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
2136 gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
2138 gdbarch->init_extra_frame_info = init_extra_frame_info;
2142 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2144 if (gdbarch->skip_prologue == 0)
2145 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2146 if (gdbarch_debug >= 2)
2147 /* FIXME: gdb_std??? */
2148 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2149 return gdbarch->skip_prologue (ip);
2153 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2154 gdbarch_skip_prologue_ftype skip_prologue)
2156 gdbarch->skip_prologue = skip_prologue;
2160 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2162 if (gdbarch->inner_than == 0)
2163 internal_error ("gdbarch: gdbarch_inner_than invalid");
2164 if (gdbarch_debug >= 2)
2165 /* FIXME: gdb_std??? */
2166 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2167 return gdbarch->inner_than (lhs, rhs);
2171 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2172 gdbarch_inner_than_ftype inner_than)
2174 gdbarch->inner_than = inner_than;
2178 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2180 if (gdbarch->breakpoint_from_pc == 0)
2181 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2182 if (gdbarch_debug >= 2)
2183 /* FIXME: gdb_std??? */
2184 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2185 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2189 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2190 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2192 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2196 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
2198 if (gdbarch->memory_insert_breakpoint == 0)
2199 internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid");
2200 if (gdbarch_debug >= 2)
2201 /* FIXME: gdb_std??? */
2202 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2203 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
2207 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2208 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2210 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2214 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
2216 if (gdbarch->memory_remove_breakpoint == 0)
2217 internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid");
2218 if (gdbarch_debug >= 2)
2219 /* FIXME: gdb_std??? */
2220 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2221 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
2225 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2226 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2228 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2232 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2234 if (gdbarch->decr_pc_after_break == -1)
2235 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2236 if (gdbarch_debug >= 2)
2237 /* FIXME: gdb_std??? */
2238 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2239 return gdbarch->decr_pc_after_break;
2243 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2244 CORE_ADDR decr_pc_after_break)
2246 gdbarch->decr_pc_after_break = decr_pc_after_break;
2250 gdbarch_function_start_offset (struct gdbarch *gdbarch)
2252 if (gdbarch->function_start_offset == -1)
2253 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2254 if (gdbarch_debug >= 2)
2255 /* FIXME: gdb_std??? */
2256 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
2257 return gdbarch->function_start_offset;
2261 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
2262 CORE_ADDR function_start_offset)
2264 gdbarch->function_start_offset = function_start_offset;
2268 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
2270 if (gdbarch->remote_translate_xfer_address == 0)
2271 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2272 if (gdbarch_debug >= 2)
2273 /* FIXME: gdb_std??? */
2274 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
2275 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
2279 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
2280 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
2282 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
2286 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2288 if (gdbarch->frame_args_skip == -1)
2289 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2290 if (gdbarch_debug >= 2)
2291 /* FIXME: gdb_std??? */
2292 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2293 return gdbarch->frame_args_skip;
2297 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2298 CORE_ADDR frame_args_skip)
2300 gdbarch->frame_args_skip = frame_args_skip;
2304 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
2306 if (gdbarch->frameless_function_invocation == 0)
2307 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2308 if (gdbarch_debug >= 2)
2309 /* FIXME: gdb_std??? */
2310 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
2311 return gdbarch->frameless_function_invocation (fi);
2315 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
2316 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
2318 gdbarch->frameless_function_invocation = frameless_function_invocation;
2322 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
2324 if (gdbarch->frame_chain == 0)
2325 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2326 if (gdbarch_debug >= 2)
2327 /* FIXME: gdb_std??? */
2328 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
2329 return gdbarch->frame_chain (frame);
2333 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
2334 gdbarch_frame_chain_ftype frame_chain)
2336 gdbarch->frame_chain = frame_chain;
2340 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
2342 if (gdbarch->frame_chain_valid == 0)
2343 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2344 if (gdbarch_debug >= 2)
2345 /* FIXME: gdb_std??? */
2346 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
2347 return gdbarch->frame_chain_valid (chain, thisframe);
2351 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
2352 gdbarch_frame_chain_valid_ftype frame_chain_valid)
2354 gdbarch->frame_chain_valid = frame_chain_valid;
2358 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
2360 if (gdbarch->frame_saved_pc == 0)
2361 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2362 if (gdbarch_debug >= 2)
2363 /* FIXME: gdb_std??? */
2364 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
2365 return gdbarch->frame_saved_pc (fi);
2369 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
2370 gdbarch_frame_saved_pc_ftype frame_saved_pc)
2372 gdbarch->frame_saved_pc = frame_saved_pc;
2376 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
2378 if (gdbarch->frame_args_address == 0)
2379 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2380 if (gdbarch_debug >= 2)
2381 /* FIXME: gdb_std??? */
2382 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
2383 return gdbarch->frame_args_address (fi);
2387 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
2388 gdbarch_frame_args_address_ftype frame_args_address)
2390 gdbarch->frame_args_address = frame_args_address;
2394 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
2396 if (gdbarch->frame_locals_address == 0)
2397 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2398 if (gdbarch_debug >= 2)
2399 /* FIXME: gdb_std??? */
2400 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
2401 return gdbarch->frame_locals_address (fi);
2405 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
2406 gdbarch_frame_locals_address_ftype frame_locals_address)
2408 gdbarch->frame_locals_address = frame_locals_address;
2412 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
2414 if (gdbarch->saved_pc_after_call == 0)
2415 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2416 if (gdbarch_debug >= 2)
2417 /* FIXME: gdb_std??? */
2418 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
2419 return gdbarch->saved_pc_after_call (frame);
2423 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
2424 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
2426 gdbarch->saved_pc_after_call = saved_pc_after_call;
2430 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2432 if (gdbarch->frame_num_args == 0)
2433 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2434 if (gdbarch_debug >= 2)
2435 /* FIXME: gdb_std??? */
2436 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2437 return gdbarch->frame_num_args (frame);
2441 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2442 gdbarch_frame_num_args_ftype frame_num_args)
2444 gdbarch->frame_num_args = frame_num_args;
2448 /* Keep a registrary of per-architecture data-pointers required by GDB
2456 struct gdbarch_data_registration
2458 gdbarch_data_ftype *init;
2459 struct gdbarch_data *data;
2460 struct gdbarch_data_registration *next;
2463 struct gdbarch_data_registrary
2466 struct gdbarch_data_registration *registrations;
2469 struct gdbarch_data_registrary gdbarch_data_registrary =
2474 struct gdbarch_data *
2475 register_gdbarch_data (gdbarch_data_ftype *init)
2477 struct gdbarch_data_registration **curr;
2478 for (curr = &gdbarch_data_registrary.registrations;
2480 curr = &(*curr)->next);
2481 (*curr) = XMALLOC (struct gdbarch_data_registration);
2482 (*curr)->next = NULL;
2483 (*curr)->init = init;
2484 (*curr)->data = XMALLOC (struct gdbarch_data);
2485 (*curr)->data->index = gdbarch_data_registrary.nr++;
2486 return (*curr)->data;
2490 /* Walk through all the registered users initializing each in turn. */
2493 init_gdbarch_data (struct gdbarch *gdbarch)
2495 struct gdbarch_data_registration *rego;
2496 gdbarch->nr_data = gdbarch_data_registrary.nr + 1;
2497 gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
2498 for (rego = gdbarch_data_registrary.registrations;
2502 if (rego->data->index < gdbarch->nr_data)
2503 gdbarch->data[rego->data->index] = rego->init ();
2508 /* Return the current value of the specified per-architecture
2513 struct gdbarch_data *data;
2515 if (data->index >= current_gdbarch->nr_data)
2516 internal_error ("gdbarch_data: request for non-existant data.");
2517 return current_gdbarch->data[data->index];
2522 /* Keep a registrary of swaped data required by GDB modules. */
2527 struct gdbarch_swap_registration *source;
2528 struct gdbarch_swap *next;
2531 struct gdbarch_swap_registration
2534 unsigned long sizeof_data;
2535 gdbarch_swap_ftype *init;
2536 struct gdbarch_swap_registration *next;
2539 struct gdbarch_swap_registrary
2542 struct gdbarch_swap_registration *registrations;
2545 struct gdbarch_swap_registrary gdbarch_swap_registrary =
2551 register_gdbarch_swap (void *data,
2552 unsigned long sizeof_data,
2553 gdbarch_swap_ftype *init)
2555 struct gdbarch_swap_registration **rego;
2556 for (rego = &gdbarch_swap_registrary.registrations;
2558 rego = &(*rego)->next);
2559 (*rego) = XMALLOC (struct gdbarch_swap_registration);
2560 (*rego)->next = NULL;
2561 (*rego)->init = init;
2562 (*rego)->data = data;
2563 (*rego)->sizeof_data = sizeof_data;
2568 init_gdbarch_swap (struct gdbarch *gdbarch)
2570 struct gdbarch_swap_registration *rego;
2571 struct gdbarch_swap **curr = &gdbarch->swap;
2572 for (rego = gdbarch_swap_registrary.registrations;
2576 if (rego->data != NULL)
2578 (*curr) = XMALLOC (struct gdbarch_swap);
2579 (*curr)->source = rego;
2580 (*curr)->swap = xmalloc (rego->sizeof_data);
2581 (*curr)->next = NULL;
2582 memset (rego->data, 0, rego->sizeof_data);
2583 curr = &(*curr)->next;
2585 if (rego->init != NULL)
2591 swapout_gdbarch_swap (struct gdbarch *gdbarch)
2593 struct gdbarch_swap *curr;
2594 for (curr = gdbarch->swap;
2597 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
2601 swapin_gdbarch_swap (struct gdbarch *gdbarch)
2603 struct gdbarch_swap *curr;
2604 for (curr = gdbarch->swap;
2607 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
2611 /* Keep a registrary of the architectures known by GDB. */
2613 struct gdbarch_init_registration
2615 enum bfd_architecture bfd_architecture;
2616 gdbarch_init_ftype *init;
2617 struct gdbarch_list *arches;
2618 struct gdbarch_init_registration *next;
2621 static struct gdbarch_init_registration *gdbarch_init_registrary = NULL;
2624 register_gdbarch_init (enum bfd_architecture bfd_architecture,
2625 gdbarch_init_ftype *init)
2627 struct gdbarch_init_registration **curr;
2628 const struct bfd_arch_info *bfd_arch_info;
2629 /* Check that BFD reconizes this architecture */
2630 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
2631 if (bfd_arch_info == NULL)
2633 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
2635 /* Check that we haven't seen this architecture before */
2636 for (curr = &gdbarch_init_registrary;
2638 curr = &(*curr)->next)
2640 if (bfd_architecture == (*curr)->bfd_architecture)
2641 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2642 bfd_arch_info->printable_name);
2646 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
2647 bfd_arch_info->printable_name,
2650 (*curr) = XMALLOC (struct gdbarch_init_registration);
2651 (*curr)->bfd_architecture = bfd_architecture;
2652 (*curr)->init = init;
2653 (*curr)->arches = NULL;
2654 (*curr)->next = NULL;
2659 /* Look for an architecture using gdbarch_info. Base search on only
2660 BFD_ARCH_INFO and BYTE_ORDER. */
2662 struct gdbarch_list *
2663 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
2664 const struct gdbarch_info *info)
2666 for (; arches != NULL; arches = arches->next)
2668 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
2670 if (info->byte_order != arches->gdbarch->byte_order)
2678 /* Update the current architecture. Return ZERO if the update request
2682 gdbarch_update (struct gdbarch_info info)
2684 struct gdbarch *new_gdbarch;
2685 struct gdbarch_list **list;
2686 struct gdbarch_init_registration *rego;
2688 /* Fill in any missing bits. Most important is the bfd_architecture
2689 which is used to select the target architecture. */
2690 if (info.bfd_architecture == bfd_arch_unknown)
2692 if (info.bfd_arch_info != NULL)
2693 info.bfd_architecture = info.bfd_arch_info->arch;
2694 else if (info.abfd != NULL)
2695 info.bfd_architecture = bfd_get_arch (info.abfd);
2696 /* FIXME - should query BFD for its default architecture. */
2698 info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
2700 if (info.bfd_arch_info == NULL)
2702 if (target_architecture_auto && info.abfd != NULL)
2703 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
2705 info.bfd_arch_info = current_gdbarch->bfd_arch_info;
2707 if (info.byte_order == 0)
2709 if (target_byte_order_auto && info.abfd != NULL)
2710 info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
2711 : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
2714 info.byte_order = current_gdbarch->byte_order;
2715 /* FIXME - should query BFD for its default byte-order. */
2717 /* A default for abfd? */
2719 /* Find the target that knows about this architecture. */
2720 for (rego = gdbarch_init_registrary;
2721 rego != NULL && rego->bfd_architecture != info.bfd_architecture;
2726 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
2732 fprintf_unfiltered (gdb_stdlog,
2733 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2734 info.bfd_architecture,
2735 bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
2736 fprintf_unfiltered (gdb_stdlog,
2737 "gdbarch_update: info.bfd_arch_info %s\n",
2738 (info.bfd_arch_info != NULL
2739 ? info.bfd_arch_info->printable_name
2741 fprintf_unfiltered (gdb_stdlog,
2742 "gdbarch_update: info.byte_order %d (%s)\n",
2744 (info.byte_order == BIG_ENDIAN ? "big"
2745 : info.byte_order == LITTLE_ENDIAN ? "little"
2747 fprintf_unfiltered (gdb_stdlog,
2748 "gdbarch_update: info.abfd 0x%lx\n",
2750 fprintf_unfiltered (gdb_stdlog,
2751 "gdbarch_update: info.tdep_info 0x%lx\n",
2752 (long) info.tdep_info);
2755 /* Ask the target for a replacement architecture. */
2756 new_gdbarch = rego->init (info, rego->arches);
2758 /* Did the target like it? No. Reject the change. */
2759 if (new_gdbarch == NULL)
2762 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
2766 /* Did the architecture change? No. Do nothing. */
2767 if (current_gdbarch == new_gdbarch)
2770 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2772 new_gdbarch->bfd_arch_info->printable_name);
2776 /* Swap all data belonging to the old target out */
2777 swapout_gdbarch_swap (current_gdbarch);
2779 /* Is this a pre-existing architecture? Yes. Swap it in. */
2780 for (list = ®o->arches;
2782 list = &(*list)->next)
2784 if ((*list)->gdbarch == new_gdbarch)
2787 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2789 new_gdbarch->bfd_arch_info->printable_name);
2790 current_gdbarch = new_gdbarch;
2791 swapin_gdbarch_swap (new_gdbarch);
2796 /* Append this new architecture to this targets list. */
2797 (*list) = XMALLOC (struct gdbarch_list);
2798 (*list)->next = NULL;
2799 (*list)->gdbarch = new_gdbarch;
2801 /* Switch to this new architecture. Dump it out. */
2802 current_gdbarch = new_gdbarch;
2805 fprintf_unfiltered (gdb_stdlog,
2806 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2808 new_gdbarch->bfd_arch_info->printable_name);
2812 /* Check that the newly installed architecture is valid. */
2813 verify_gdbarch (new_gdbarch);
2815 /* Initialize the per-architecture memory (swap) areas.
2816 CURRENT_GDBARCH must be update before these modules are
2818 init_gdbarch_swap (new_gdbarch);
2820 /* Initialize the per-architecture data-pointer of all parties that
2821 registered an interest in this architecture. CURRENT_GDBARCH
2822 must be updated before these modules are called. */
2823 init_gdbarch_data (new_gdbarch);
2830 /* Functions to manipulate the endianness of the target. */
2832 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2833 /* compat - Catch old targets that expect a selectable byte-order to
2834 default to BIG_ENDIAN */
2835 #ifndef TARGET_BYTE_ORDER_DEFAULT
2836 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2839 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2840 #ifndef TARGET_BYTE_ORDER_DEFAULT
2841 /* compat - Catch old non byte-order selectable targets that do not
2842 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2843 TARGET_BYTE_ORDER to be used as the default. For targets that
2844 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2845 below will get a strange compiler warning. */
2846 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2849 #ifndef TARGET_BYTE_ORDER_DEFAULT
2850 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2852 int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
2853 int target_byte_order_auto = 1;
2855 /* Chain containing the \"set endian\" commands. */
2856 static struct cmd_list_element *endianlist = NULL;
2858 /* Called by ``show endian''. */
2860 show_endian (char *args, int from_tty)
2863 (TARGET_BYTE_ORDER_AUTO
2864 ? "The target endianness is set automatically (currently %s endian)\n"
2865 : "The target is assumed to be %s endian\n");
2866 printf_unfiltered (msg, (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
2869 /* Called if the user enters ``set endian'' without an argument. */
2871 set_endian (char *args, int from_tty)
2873 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2874 show_endian (args, from_tty);
2877 /* Called by ``set endian big''. */
2879 set_endian_big (char *args, int from_tty)
2881 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2883 target_byte_order = BIG_ENDIAN;
2884 target_byte_order_auto = 0;
2887 struct gdbarch_info info;
2888 memset (&info, 0, sizeof info);
2889 info.byte_order = BIG_ENDIAN;
2890 gdbarch_update (info);
2895 printf_unfiltered ("Byte order is not selectable.");
2896 show_endian (args, from_tty);
2900 /* Called by ``set endian little''. */
2902 set_endian_little (char *args, int from_tty)
2904 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2906 target_byte_order = LITTLE_ENDIAN;
2907 target_byte_order_auto = 0;
2910 struct gdbarch_info info;
2911 memset (&info, 0, sizeof info);
2912 info.byte_order = LITTLE_ENDIAN;
2913 gdbarch_update (info);
2918 printf_unfiltered ("Byte order is not selectable.");
2919 show_endian (args, from_tty);
2923 /* Called by ``set endian auto''. */
2925 set_endian_auto (char *args, int from_tty)
2927 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2929 target_byte_order_auto = 1;
2933 printf_unfiltered ("Byte order is not selectable.");
2934 show_endian (args, from_tty);
2938 /* Set the endianness from a BFD. */
2940 set_endian_from_file (bfd *abfd)
2942 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2946 if (bfd_big_endian (abfd))
2949 want = LITTLE_ENDIAN;
2950 if (TARGET_BYTE_ORDER_AUTO)
2951 target_byte_order = want;
2952 else if (TARGET_BYTE_ORDER != want)
2953 warning ("%s endian file does not match %s endian target.",
2954 want == BIG_ENDIAN ? "big" : "little",
2955 TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
2959 if (bfd_big_endian (abfd)
2960 ? TARGET_BYTE_ORDER != BIG_ENDIAN
2961 : TARGET_BYTE_ORDER == BIG_ENDIAN)
2962 warning ("%s endian file does not match %s endian target.",
2963 bfd_big_endian (abfd) ? "big" : "little",
2964 TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
2970 /* Functions to manipulate the architecture of the target */
2972 enum set_arch { set_arch_auto, set_arch_manual };
2974 int target_architecture_auto = 1;
2975 extern const struct bfd_arch_info bfd_default_arch_struct;
2976 const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
2977 int (*target_architecture_hook) (const struct bfd_arch_info *ap);
2979 static void show_endian (char *, int);
2980 static void set_endian (char *, int);
2981 static void set_endian_big (char *, int);
2982 static void set_endian_little (char *, int);
2983 static void set_endian_auto (char *, int);
2984 static void set_endian_from_file (bfd *);
2985 static int arch_ok (const struct bfd_arch_info *arch);
2986 static void set_arch (const struct bfd_arch_info *arch, enum set_arch type);
2987 static void show_architecture (char *, int);
2988 static void set_architecture (char *, int);
2989 static void info_architecture (char *, int);
2990 static void set_architecture_from_file (bfd *);
2992 /* Do the real work of changing the current architecture */
2995 arch_ok (const struct bfd_arch_info *arch)
2997 /* Should be performing the more basic check that the binary is
2998 compatible with GDB. */
2999 /* Check with the target that the architecture is valid. */
3000 return (target_architecture_hook == NULL
3001 || target_architecture_hook (arch));
3005 set_arch (const struct bfd_arch_info *arch,
3011 if (!arch_ok (arch))
3012 warning ("Target may not support %s architecture",
3013 arch->printable_name);
3014 target_architecture = arch;
3016 case set_arch_manual:
3017 if (!arch_ok (arch))
3019 printf_unfiltered ("Target does not support `%s' architecture.\n",
3020 arch->printable_name);
3024 target_architecture_auto = 0;
3025 target_architecture = arch;
3033 /* Called if the user enters ``show architecture'' without an argument. */
3035 show_architecture (char *args, int from_tty)
3038 arch = TARGET_ARCHITECTURE->printable_name;
3039 if (target_architecture_auto)
3040 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch);
3042 printf_filtered ("The target architecture is assumed to be %s\n", arch);
3045 /* Called if the user enters ``set architecture'' with or without an
3048 set_architecture (char *args, int from_tty)
3052 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3054 else if (strcmp (args, "auto") == 0)
3056 target_architecture_auto = 1;
3058 else if (GDB_MULTI_ARCH)
3060 const struct bfd_arch_info *arch = bfd_scan_arch (args);
3062 printf_unfiltered ("Architecture `%s' not reconized.\n", args);
3065 struct gdbarch_info info;
3066 memset (&info, 0, sizeof info);
3067 info.bfd_arch_info = arch;
3068 if (gdbarch_update (info))
3069 target_architecture_auto = 0;
3071 printf_unfiltered ("Architecture `%s' not reconized.\n", args);
3076 const struct bfd_arch_info *arch = bfd_scan_arch (args);
3078 set_arch (arch, set_arch_manual);
3080 printf_unfiltered ("Architecture `%s' not reconized.\n", args);
3084 /* Called if the user enters ``info architecture'' without an argument. */
3086 info_architecture (char *args, int from_tty)
3088 enum bfd_architecture a;
3091 if (gdbarch_init_registrary != NULL)
3093 struct gdbarch_init_registration *rego;
3094 printf_filtered ("Available architectures are:\n");
3095 for (rego = gdbarch_init_registrary;
3099 const struct bfd_arch_info *ap;
3100 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3105 printf_filtered (" %s", ap->printable_name);
3109 printf_filtered ("\n");
3115 printf_filtered ("There are no available architectures.\n");
3119 printf_filtered ("Available architectures are:\n");
3120 for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
3122 const struct bfd_arch_info *ap = bfd_lookup_arch (a, 0);
3127 printf_filtered (" %s", ap->printable_name);
3131 printf_filtered ("\n");
3136 /* Set the architecture from arch/machine */
3138 set_architecture_from_arch_mach (arch, mach)
3139 enum bfd_architecture arch;
3142 const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
3144 set_arch (wanted, set_arch_manual);
3146 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3149 /* Set the architecture from a BFD */
3151 set_architecture_from_file (bfd *abfd)
3153 const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
3154 if (target_architecture_auto)
3156 set_arch (wanted, set_arch_auto);
3158 else if (wanted != target_architecture)
3160 warning ("%s architecture file may be incompatible with %s target.",
3161 wanted->printable_name,
3162 target_architecture->printable_name);
3167 /* Misc helper functions for targets. */
3170 frame_num_args_unknown (fi)
3171 struct frame_info *fi;
3178 generic_register_convertible_not (num)
3186 /* Pointer to the target-dependent disassembly function. */
3187 int (*tm_print_insn) (bfd_vma, disassemble_info *);
3188 disassemble_info tm_print_insn_info;
3192 /* Set the dynamic target-system-dependant parameters (architecture,
3193 byte-order) using information found in the BFD */
3196 set_gdbarch_from_file (abfd)
3201 struct gdbarch_info info;
3202 memset (&info, 0, sizeof info);
3204 gdbarch_update (info);
3207 set_architecture_from_file (abfd);
3208 set_endian_from_file (abfd);
3212 #if defined (CALL_DUMMY)
3213 /* FIXME - this should go away */
3214 LONGEST call_dummy_words[] = CALL_DUMMY;
3215 int sizeof_call_dummy_words = sizeof (call_dummy_words);
3219 /* Initialize the current architecture. */
3221 initialize_current_architecture ()
3225 struct gdbarch_init_registration *rego;
3226 const struct bfd_arch_info *chosen = NULL;
3227 for (rego = gdbarch_init_registrary; rego != NULL; rego = rego->next)
3229 const struct bfd_arch_info *ap
3230 = bfd_lookup_arch (rego->bfd_architecture, 0);
3232 /* Choose the first architecture alphabetically. */
3234 || strcmp (ap->printable_name, chosen->printable_name) < 0)
3240 struct gdbarch_info info;
3241 memset (&info, 0, sizeof info);
3242 info.bfd_arch_info = chosen;
3243 gdbarch_update (info);
3248 extern void _initialize_gdbarch (void);
3250 _initialize_gdbarch ()
3252 add_prefix_cmd ("endian", class_support, set_endian,
3253 "Set endianness of target.",
3254 &endianlist, "set endian ", 0, &setlist);
3255 add_cmd ("big", class_support, set_endian_big,
3256 "Set target as being big endian.", &endianlist);
3257 add_cmd ("little", class_support, set_endian_little,
3258 "Set target as being little endian.", &endianlist);
3259 add_cmd ("auto", class_support, set_endian_auto,
3260 "Select target endianness automatically.", &endianlist);
3261 add_cmd ("endian", class_support, show_endian,
3262 "Show endianness of target.", &showlist);
3264 add_cmd ("architecture", class_support, set_architecture,
3265 "Set architecture of target.", &setlist);
3266 add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
3267 add_cmd ("architecture", class_support, show_architecture,
3268 "Show architecture of target.", &showlist);
3269 add_cmd ("architecture", class_support, info_architecture,
3270 "List supported target architectures", &infolist);
3272 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
3273 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
3274 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
3275 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
3276 tm_print_insn_info.print_address_func = dis_asm_print_address;
3278 add_show_from_set (add_set_cmd ("archdebug",
3281 (char *)&gdbarch_debug,
3282 "Set architecture debugging.\n\
3283 When non-zero, architecture debugging is enabled.", &setlist),