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).
136 gdbarch_read_pc_ftype
*read_pc
;
137 gdbarch_write_pc_ftype
*write_pc
;
138 gdbarch_read_fp_ftype
*read_fp
;
139 gdbarch_write_fp_ftype
*write_fp
;
140 gdbarch_read_sp_ftype
*read_sp
;
141 gdbarch_write_sp_ftype
*write_sp
;
146 gdbarch_register_name_ftype
*register_name
;
149 gdbarch_register_byte_ftype
*register_byte
;
150 gdbarch_register_raw_size_ftype
*register_raw_size
;
151 int max_register_raw_size
;
152 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
153 int max_register_virtual_size
;
154 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
155 int use_generic_dummy_frames
;
156 int call_dummy_location
;
157 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
158 CORE_ADDR call_dummy_start_offset
;
159 CORE_ADDR call_dummy_breakpoint_offset
;
160 int call_dummy_breakpoint_offset_p
;
161 int call_dummy_length
;
162 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
164 LONGEST
* call_dummy_words
;
165 int sizeof_call_dummy_words
;
166 int call_dummy_stack_adjust_p
;
167 int call_dummy_stack_adjust
;
168 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
169 int believe_pcc_promotion
;
170 int believe_pcc_promotion_type
;
171 gdbarch_get_saved_register_ftype
*get_saved_register
;
172 gdbarch_register_convertible_ftype
*register_convertible
;
173 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
174 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
175 gdbarch_extract_return_value_ftype
*extract_return_value
;
176 gdbarch_push_arguments_ftype
*push_arguments
;
177 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
178 gdbarch_push_return_address_ftype
*push_return_address
;
179 gdbarch_pop_frame_ftype
*pop_frame
;
180 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
181 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
182 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
183 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
184 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
185 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
186 gdbarch_store_struct_return_ftype
*store_struct_return
;
187 gdbarch_store_return_value_ftype
*store_return_value
;
188 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
189 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
190 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
191 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
192 gdbarch_skip_prologue_ftype
*skip_prologue
;
193 gdbarch_inner_than_ftype
*inner_than
;
194 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
195 CORE_ADDR decr_pc_after_break
;
196 CORE_ADDR function_start_offset
;
197 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
198 CORE_ADDR frame_args_skip
;
199 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
200 gdbarch_frame_chain_ftype
*frame_chain
;
201 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
202 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
203 gdbarch_frame_args_address_ftype
*frame_args_address
;
204 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
205 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
206 gdbarch_frame_num_args_ftype
*frame_num_args
;
210 /* The default architecture uses host values (for want of a better
213 extern const struct bfd_arch_info bfd_default_arch_struct
;
215 struct gdbarch default_gdbarch
= {
216 /* basic architecture information */
217 &bfd_default_arch_struct
,
219 /* target specific vector */
221 /*per-architecture data-pointers and swap regions */
223 /* Multi-arch values */
228 8 * sizeof (LONGEST
),
231 8 * sizeof (long double),
267 generic_get_saved_register
,
303 /* default_gdbarch() */
305 struct gdbarch
*current_gdbarch
= &default_gdbarch
;
308 /* Create a new ``struct gdbarch'' based in information provided by
309 ``struct gdbarch_info''. */
312 gdbarch_alloc (const struct gdbarch_info
*info
,
313 struct gdbarch_tdep
*tdep
)
315 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
316 memset (gdbarch
, 0, sizeof (*gdbarch
));
318 gdbarch
->tdep
= tdep
;
320 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
321 gdbarch
->byte_order
= info
->byte_order
;
323 /* Force the explicit initialization of these. */
324 gdbarch
->num_regs
= -1;
325 gdbarch
->sp_regnum
= -1;
326 gdbarch
->fp_regnum
= -1;
327 gdbarch
->pc_regnum
= -1;
328 gdbarch
->register_size
= -1;
329 gdbarch
->register_bytes
= -1;
330 gdbarch
->max_register_raw_size
= -1;
331 gdbarch
->max_register_virtual_size
= -1;
332 gdbarch
->use_generic_dummy_frames
= -1;
333 gdbarch
->call_dummy_start_offset
= -1;
334 gdbarch
->call_dummy_breakpoint_offset
= -1;
335 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
336 gdbarch
->call_dummy_length
= -1;
337 gdbarch
->call_dummy_p
= -1;
338 gdbarch
->call_dummy_stack_adjust_p
= -1;
339 gdbarch
->decr_pc_after_break
= -1;
340 gdbarch
->function_start_offset
= -1;
341 gdbarch
->frame_args_skip
= -1;
342 /* gdbarch_alloc() */
348 /* Ensure that all values in a GDBARCH are reasonable. */
351 verify_gdbarch (struct gdbarch
*gdbarch
)
353 /* Only perform sanity checks on a multi-arch target. */
354 if (GDB_MULTI_ARCH
<= 0)
357 if (gdbarch
->byte_order
== 0)
358 internal_error ("verify_gdbarch: byte-order unset");
359 if (gdbarch
->bfd_arch_info
== NULL
)
360 internal_error ("verify_gdbarch: bfd_arch_info unset");
361 /* Check those that need to be defined for the given multi-arch level. */
362 if ((GDB_MULTI_ARCH
>= 1)
363 && (gdbarch
->ptr_bit
== 0))
364 internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
365 if ((GDB_MULTI_ARCH
>= 1)
366 && (gdbarch
->short_bit
== 0))
367 internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
368 if ((GDB_MULTI_ARCH
>= 1)
369 && (gdbarch
->int_bit
== 0))
370 internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
371 if ((GDB_MULTI_ARCH
>= 1)
372 && (gdbarch
->long_bit
== 0))
373 internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
374 if ((GDB_MULTI_ARCH
>= 1)
375 && (gdbarch
->long_long_bit
== 0))
376 internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
377 if ((GDB_MULTI_ARCH
>= 1)
378 && (gdbarch
->float_bit
== 0))
379 internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
380 if ((GDB_MULTI_ARCH
>= 1)
381 && (gdbarch
->double_bit
== 0))
382 internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
383 if ((GDB_MULTI_ARCH
>= 1)
384 && (gdbarch
->long_double_bit
== 0))
385 internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
386 if ((GDB_MULTI_ARCH
>= 1)
387 && (gdbarch
->read_pc
== 0))
388 internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
389 if ((GDB_MULTI_ARCH
>= 1)
390 && (gdbarch
->write_pc
== 0))
391 internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
392 if ((GDB_MULTI_ARCH
>= 1)
393 && (gdbarch
->read_fp
== 0))
394 internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
395 if ((GDB_MULTI_ARCH
>= 1)
396 && (gdbarch
->write_fp
== 0))
397 internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
398 if ((GDB_MULTI_ARCH
>= 1)
399 && (gdbarch
->read_sp
== 0))
400 internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
401 if ((GDB_MULTI_ARCH
>= 1)
402 && (gdbarch
->write_sp
== 0))
403 internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
404 if ((GDB_MULTI_ARCH
>= 2)
405 && (gdbarch
->num_regs
== -1))
406 internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
407 if ((GDB_MULTI_ARCH
>= 2)
408 && (gdbarch
->sp_regnum
== -1))
409 internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
410 if ((GDB_MULTI_ARCH
>= 2)
411 && (gdbarch
->fp_regnum
== -1))
412 internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
413 if ((GDB_MULTI_ARCH
>= 2)
414 && (gdbarch
->pc_regnum
== -1))
415 internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
416 if ((GDB_MULTI_ARCH
>= 2)
417 && (gdbarch
->register_name
== 0))
418 internal_error ("gdbarch: verify_gdbarch: register_name invalid");
419 if ((GDB_MULTI_ARCH
>= 2)
420 && (gdbarch
->register_size
== -1))
421 internal_error ("gdbarch: verify_gdbarch: register_size invalid");
422 if ((GDB_MULTI_ARCH
>= 2)
423 && (gdbarch
->register_bytes
== -1))
424 internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
425 if ((GDB_MULTI_ARCH
>= 2)
426 && (gdbarch
->register_byte
== 0))
427 internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
428 if ((GDB_MULTI_ARCH
>= 2)
429 && (gdbarch
->register_raw_size
== 0))
430 internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
431 if ((GDB_MULTI_ARCH
>= 2)
432 && (gdbarch
->max_register_raw_size
== -1))
433 internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
434 if ((GDB_MULTI_ARCH
>= 2)
435 && (gdbarch
->register_virtual_size
== 0))
436 internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
437 if ((GDB_MULTI_ARCH
>= 2)
438 && (gdbarch
->max_register_virtual_size
== -1))
439 internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
440 if ((GDB_MULTI_ARCH
>= 2)
441 && (gdbarch
->register_virtual_type
== 0))
442 internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
443 if ((GDB_MULTI_ARCH
>= 1)
444 && (gdbarch
->use_generic_dummy_frames
== -1))
445 internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
446 if ((GDB_MULTI_ARCH
>= 2)
447 && (gdbarch
->call_dummy_location
== 0))
448 internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
449 if ((GDB_MULTI_ARCH
>= 2)
450 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
451 internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
452 if ((GDB_MULTI_ARCH
>= 2)
453 && (gdbarch
->call_dummy_start_offset
== -1))
454 internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
455 if ((GDB_MULTI_ARCH
>= 2)
456 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
457 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
458 if ((GDB_MULTI_ARCH
>= 1)
459 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
460 internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
461 if ((GDB_MULTI_ARCH
>= 2)
462 && (gdbarch
->call_dummy_length
== -1))
463 internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
464 if ((GDB_MULTI_ARCH
>= 2)
465 && (gdbarch
->pc_in_call_dummy
== 0))
466 internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
467 if ((GDB_MULTI_ARCH
>= 1)
468 && (gdbarch
->call_dummy_p
== -1))
469 internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
470 if ((GDB_MULTI_ARCH
>= 1)
471 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
472 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
473 if ((GDB_MULTI_ARCH
>= 2)
474 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
475 internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
476 if ((GDB_MULTI_ARCH
>= 2)
477 && (gdbarch
->fix_call_dummy
== 0))
478 internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
479 if ((GDB_MULTI_ARCH
>= 1)
480 && (gdbarch
->get_saved_register
== 0))
481 internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
482 if ((GDB_MULTI_ARCH
>= 1)
483 && (gdbarch
->register_convertible
== 0))
484 internal_error ("gdbarch: verify_gdbarch: register_convertible invalid");
485 if ((GDB_MULTI_ARCH
>= 2)
486 && (gdbarch
->register_convert_to_virtual
== 0))
487 internal_error ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
488 if ((GDB_MULTI_ARCH
>= 2)
489 && (gdbarch
->register_convert_to_raw
== 0))
490 internal_error ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
491 if ((GDB_MULTI_ARCH
>= 2)
492 && (gdbarch
->extract_return_value
== 0))
493 internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
494 if ((GDB_MULTI_ARCH
>= 1)
495 && (gdbarch
->push_arguments
== 0))
496 internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
497 if ((GDB_MULTI_ARCH
>= 2)
498 && (gdbarch
->push_dummy_frame
== 0))
499 internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
500 if ((GDB_MULTI_ARCH
>= 1)
501 && (gdbarch
->push_return_address
== 0))
502 internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
503 if ((GDB_MULTI_ARCH
>= 2)
504 && (gdbarch
->pop_frame
== 0))
505 internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
506 if ((GDB_MULTI_ARCH
>= 2)
507 && (gdbarch
->d10v_make_daddr
== 0))
508 internal_error ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
509 if ((GDB_MULTI_ARCH
>= 2)
510 && (gdbarch
->d10v_make_iaddr
== 0))
511 internal_error ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
512 if ((GDB_MULTI_ARCH
>= 2)
513 && (gdbarch
->d10v_daddr_p
== 0))
514 internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
515 if ((GDB_MULTI_ARCH
>= 2)
516 && (gdbarch
->d10v_iaddr_p
== 0))
517 internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
518 if ((GDB_MULTI_ARCH
>= 2)
519 && (gdbarch
->d10v_convert_daddr_to_raw
== 0))
520 internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
521 if ((GDB_MULTI_ARCH
>= 2)
522 && (gdbarch
->d10v_convert_iaddr_to_raw
== 0))
523 internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
524 if ((GDB_MULTI_ARCH
>= 2)
525 && (gdbarch
->store_struct_return
== 0))
526 internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
527 if ((GDB_MULTI_ARCH
>= 2)
528 && (gdbarch
->store_return_value
== 0))
529 internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
530 if ((GDB_MULTI_ARCH
>= 2)
531 && (gdbarch
->extract_struct_value_address
== 0))
532 internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
533 if ((GDB_MULTI_ARCH
>= 2)
534 && (gdbarch
->use_struct_convention
== 0))
535 internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
536 if ((GDB_MULTI_ARCH
>= 2)
537 && (gdbarch
->frame_init_saved_regs
== 0))
538 internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
539 if ((GDB_MULTI_ARCH
>= 2)
540 && (gdbarch
->init_extra_frame_info
== 0))
541 internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
542 if ((GDB_MULTI_ARCH
>= 2)
543 && (gdbarch
->skip_prologue
== 0))
544 internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
545 if ((GDB_MULTI_ARCH
>= 2)
546 && (gdbarch
->inner_than
== 0))
547 internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
548 if ((GDB_MULTI_ARCH
>= 2)
549 && (gdbarch
->breakpoint_from_pc
== 0))
550 internal_error ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
551 if ((GDB_MULTI_ARCH
>= 2)
552 && (gdbarch
->decr_pc_after_break
== -1))
553 internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
554 if ((GDB_MULTI_ARCH
>= 2)
555 && (gdbarch
->function_start_offset
== -1))
556 internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
557 if ((GDB_MULTI_ARCH
>= 2)
558 && (gdbarch
->remote_translate_xfer_address
== 0))
559 internal_error ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
560 if ((GDB_MULTI_ARCH
>= 2)
561 && (gdbarch
->frame_args_skip
== -1))
562 internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
563 if ((GDB_MULTI_ARCH
>= 2)
564 && (gdbarch
->frameless_function_invocation
== 0))
565 internal_error ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
566 if ((GDB_MULTI_ARCH
>= 2)
567 && (gdbarch
->frame_chain
== 0))
568 internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
569 if ((GDB_MULTI_ARCH
>= 1)
570 && (gdbarch
->frame_chain_valid
== 0))
571 internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
572 if ((GDB_MULTI_ARCH
>= 2)
573 && (gdbarch
->frame_saved_pc
== 0))
574 internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
575 if ((GDB_MULTI_ARCH
>= 2)
576 && (gdbarch
->frame_args_address
== 0))
577 internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
578 if ((GDB_MULTI_ARCH
>= 2)
579 && (gdbarch
->frame_locals_address
== 0))
580 internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
581 if ((GDB_MULTI_ARCH
>= 2)
582 && (gdbarch
->saved_pc_after_call
== 0))
583 internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
584 if ((GDB_MULTI_ARCH
>= 2)
585 && (gdbarch
->frame_num_args
== 0))
586 internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
590 /* Print out the details of the current architecture. */
595 if (TARGET_ARCHITECTURE
!= NULL
)
596 fprintf_unfiltered (gdb_stdlog
,
597 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
598 TARGET_ARCHITECTURE
->printable_name
);
599 fprintf_unfiltered (gdb_stdlog
,
600 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
601 (long) TARGET_BYTE_ORDER
);
602 fprintf_unfiltered (gdb_stdlog
,
603 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
604 (long) TARGET_PTR_BIT
);
605 fprintf_unfiltered (gdb_stdlog
,
606 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
607 (long) TARGET_SHORT_BIT
);
608 fprintf_unfiltered (gdb_stdlog
,
609 "gdbarch_update: TARGET_INT_BIT = %ld\n",
610 (long) TARGET_INT_BIT
);
611 fprintf_unfiltered (gdb_stdlog
,
612 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
613 (long) TARGET_LONG_BIT
);
614 fprintf_unfiltered (gdb_stdlog
,
615 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
616 (long) TARGET_LONG_LONG_BIT
);
617 fprintf_unfiltered (gdb_stdlog
,
618 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
619 (long) TARGET_FLOAT_BIT
);
620 fprintf_unfiltered (gdb_stdlog
,
621 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
622 (long) TARGET_DOUBLE_BIT
);
623 fprintf_unfiltered (gdb_stdlog
,
624 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
625 (long) TARGET_LONG_DOUBLE_BIT
);
626 fprintf_unfiltered (gdb_stdlog
,
627 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
628 (long) current_gdbarch
->read_pc
629 /*TARGET_READ_PC ()*/);
630 fprintf_unfiltered (gdb_stdlog
,
631 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
632 (long) current_gdbarch
->write_pc
633 /*TARGET_WRITE_PC ()*/);
634 fprintf_unfiltered (gdb_stdlog
,
635 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
636 (long) current_gdbarch
->read_fp
637 /*TARGET_READ_FP ()*/);
638 fprintf_unfiltered (gdb_stdlog
,
639 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
640 (long) current_gdbarch
->write_fp
641 /*TARGET_WRITE_FP ()*/);
642 fprintf_unfiltered (gdb_stdlog
,
643 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
644 (long) current_gdbarch
->read_sp
645 /*TARGET_READ_SP ()*/);
646 fprintf_unfiltered (gdb_stdlog
,
647 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
648 (long) current_gdbarch
->write_sp
649 /*TARGET_WRITE_SP ()*/);
650 fprintf_unfiltered (gdb_stdlog
,
651 "gdbarch_update: NUM_REGS = %ld\n",
653 fprintf_unfiltered (gdb_stdlog
,
654 "gdbarch_update: SP_REGNUM = %ld\n",
656 fprintf_unfiltered (gdb_stdlog
,
657 "gdbarch_update: FP_REGNUM = %ld\n",
659 fprintf_unfiltered (gdb_stdlog
,
660 "gdbarch_update: PC_REGNUM = %ld\n",
662 fprintf_unfiltered (gdb_stdlog
,
663 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
664 (long) current_gdbarch
->register_name
665 /*REGISTER_NAME ()*/);
666 fprintf_unfiltered (gdb_stdlog
,
667 "gdbarch_update: REGISTER_SIZE = %ld\n",
668 (long) REGISTER_SIZE
);
669 fprintf_unfiltered (gdb_stdlog
,
670 "gdbarch_update: REGISTER_BYTES = %ld\n",
671 (long) REGISTER_BYTES
);
672 fprintf_unfiltered (gdb_stdlog
,
673 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
674 (long) current_gdbarch
->register_byte
675 /*REGISTER_BYTE ()*/);
676 fprintf_unfiltered (gdb_stdlog
,
677 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
678 (long) current_gdbarch
->register_raw_size
679 /*REGISTER_RAW_SIZE ()*/);
680 fprintf_unfiltered (gdb_stdlog
,
681 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
682 (long) MAX_REGISTER_RAW_SIZE
);
683 fprintf_unfiltered (gdb_stdlog
,
684 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
685 (long) current_gdbarch
->register_virtual_size
686 /*REGISTER_VIRTUAL_SIZE ()*/);
687 fprintf_unfiltered (gdb_stdlog
,
688 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
689 (long) MAX_REGISTER_VIRTUAL_SIZE
);
690 fprintf_unfiltered (gdb_stdlog
,
691 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
692 (long) current_gdbarch
->register_virtual_type
693 /*REGISTER_VIRTUAL_TYPE ()*/);
694 fprintf_unfiltered (gdb_stdlog
,
695 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
696 (long) USE_GENERIC_DUMMY_FRAMES
);
697 fprintf_unfiltered (gdb_stdlog
,
698 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
699 (long) CALL_DUMMY_LOCATION
);
700 fprintf_unfiltered (gdb_stdlog
,
701 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
702 (long) current_gdbarch
->call_dummy_address
703 /*CALL_DUMMY_ADDRESS ()*/);
704 fprintf_unfiltered (gdb_stdlog
,
705 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
706 (long) CALL_DUMMY_START_OFFSET
);
707 fprintf_unfiltered (gdb_stdlog
,
708 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
709 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
710 fprintf_unfiltered (gdb_stdlog
,
711 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
712 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
713 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
714 fprintf_unfiltered (gdb_stdlog
,
715 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
716 (long) CALL_DUMMY_LENGTH
);
717 fprintf_unfiltered (gdb_stdlog
,
718 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
719 (long) current_gdbarch
->pc_in_call_dummy
720 /*PC_IN_CALL_DUMMY ()*/);
721 fprintf_unfiltered (gdb_stdlog
,
722 "gdbarch_update: CALL_DUMMY_P = %ld\n",
723 (long) CALL_DUMMY_P
);
724 fprintf_unfiltered (gdb_stdlog
,
725 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
726 (long) CALL_DUMMY_WORDS
);
727 fprintf_unfiltered (gdb_stdlog
,
728 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
729 (long) SIZEOF_CALL_DUMMY_WORDS
);
730 fprintf_unfiltered (gdb_stdlog
,
731 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
732 (long) CALL_DUMMY_STACK_ADJUST_P
);
733 if (CALL_DUMMY_STACK_ADJUST_P
)
734 fprintf_unfiltered (gdb_stdlog
,
735 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
736 (long) CALL_DUMMY_STACK_ADJUST
);
737 fprintf_unfiltered (gdb_stdlog
,
738 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
739 (long) current_gdbarch
->fix_call_dummy
740 /*FIX_CALL_DUMMY ()*/);
741 #ifdef BELIEVE_PCC_PROMOTION
742 fprintf_unfiltered (gdb_stdlog
,
743 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
744 (long) BELIEVE_PCC_PROMOTION
);
746 #ifdef BELIEVE_PCC_PROMOTION_TYPE
747 fprintf_unfiltered (gdb_stdlog
,
748 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
749 (long) BELIEVE_PCC_PROMOTION_TYPE
);
751 fprintf_unfiltered (gdb_stdlog
,
752 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
753 (long) current_gdbarch
->get_saved_register
754 /*GET_SAVED_REGISTER ()*/);
755 fprintf_unfiltered (gdb_stdlog
,
756 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
757 (long) current_gdbarch
->register_convertible
758 /*REGISTER_CONVERTIBLE ()*/);
759 fprintf_unfiltered (gdb_stdlog
,
760 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
761 (long) current_gdbarch
->register_convert_to_virtual
762 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
763 fprintf_unfiltered (gdb_stdlog
,
764 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
765 (long) current_gdbarch
->register_convert_to_raw
766 /*REGISTER_CONVERT_TO_RAW ()*/);
767 fprintf_unfiltered (gdb_stdlog
,
768 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
769 (long) current_gdbarch
->extract_return_value
770 /*EXTRACT_RETURN_VALUE ()*/);
771 fprintf_unfiltered (gdb_stdlog
,
772 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
773 (long) current_gdbarch
->push_arguments
774 /*PUSH_ARGUMENTS ()*/);
775 fprintf_unfiltered (gdb_stdlog
,
776 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
777 (long) current_gdbarch
->push_dummy_frame
778 /*PUSH_DUMMY_FRAME ()*/);
779 fprintf_unfiltered (gdb_stdlog
,
780 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
781 (long) current_gdbarch
->push_return_address
782 /*PUSH_RETURN_ADDRESS ()*/);
783 fprintf_unfiltered (gdb_stdlog
,
784 "gdbarch_update: POP_FRAME = 0x%08lx\n",
785 (long) current_gdbarch
->pop_frame
787 fprintf_unfiltered (gdb_stdlog
,
788 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
789 (long) current_gdbarch
->d10v_make_daddr
790 /*D10V_MAKE_DADDR ()*/);
791 fprintf_unfiltered (gdb_stdlog
,
792 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
793 (long) current_gdbarch
->d10v_make_iaddr
794 /*D10V_MAKE_IADDR ()*/);
795 fprintf_unfiltered (gdb_stdlog
,
796 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
797 (long) current_gdbarch
->d10v_daddr_p
798 /*D10V_DADDR_P ()*/);
799 fprintf_unfiltered (gdb_stdlog
,
800 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
801 (long) current_gdbarch
->d10v_iaddr_p
802 /*D10V_IADDR_P ()*/);
803 fprintf_unfiltered (gdb_stdlog
,
804 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
805 (long) current_gdbarch
->d10v_convert_daddr_to_raw
806 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
807 fprintf_unfiltered (gdb_stdlog
,
808 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
809 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
810 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
811 fprintf_unfiltered (gdb_stdlog
,
812 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
813 (long) current_gdbarch
->store_struct_return
814 /*STORE_STRUCT_RETURN ()*/);
815 fprintf_unfiltered (gdb_stdlog
,
816 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
817 (long) current_gdbarch
->store_return_value
818 /*STORE_RETURN_VALUE ()*/);
819 fprintf_unfiltered (gdb_stdlog
,
820 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
821 (long) current_gdbarch
->extract_struct_value_address
822 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
823 fprintf_unfiltered (gdb_stdlog
,
824 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
825 (long) current_gdbarch
->use_struct_convention
826 /*USE_STRUCT_CONVENTION ()*/);
827 fprintf_unfiltered (gdb_stdlog
,
828 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
829 (long) current_gdbarch
->frame_init_saved_regs
830 /*FRAME_INIT_SAVED_REGS ()*/);
831 fprintf_unfiltered (gdb_stdlog
,
832 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
833 (long) current_gdbarch
->init_extra_frame_info
834 /*INIT_EXTRA_FRAME_INFO ()*/);
835 fprintf_unfiltered (gdb_stdlog
,
836 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
837 (long) current_gdbarch
->skip_prologue
838 /*SKIP_PROLOGUE ()*/);
839 fprintf_unfiltered (gdb_stdlog
,
840 "gdbarch_update: INNER_THAN = 0x%08lx\n",
841 (long) current_gdbarch
->inner_than
843 fprintf_unfiltered (gdb_stdlog
,
844 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
845 (long) current_gdbarch
->breakpoint_from_pc
846 /*BREAKPOINT_FROM_PC ()*/);
847 fprintf_unfiltered (gdb_stdlog
,
848 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
849 (long) DECR_PC_AFTER_BREAK
);
850 fprintf_unfiltered (gdb_stdlog
,
851 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
852 (long) FUNCTION_START_OFFSET
);
853 fprintf_unfiltered (gdb_stdlog
,
854 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
855 (long) current_gdbarch
->remote_translate_xfer_address
856 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
857 fprintf_unfiltered (gdb_stdlog
,
858 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
859 (long) FRAME_ARGS_SKIP
);
860 fprintf_unfiltered (gdb_stdlog
,
861 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
862 (long) current_gdbarch
->frameless_function_invocation
863 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
864 fprintf_unfiltered (gdb_stdlog
,
865 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
866 (long) current_gdbarch
->frame_chain
868 fprintf_unfiltered (gdb_stdlog
,
869 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
870 (long) current_gdbarch
->frame_chain_valid
871 /*FRAME_CHAIN_VALID ()*/);
872 fprintf_unfiltered (gdb_stdlog
,
873 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
874 (long) current_gdbarch
->frame_saved_pc
875 /*FRAME_SAVED_PC ()*/);
876 fprintf_unfiltered (gdb_stdlog
,
877 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
878 (long) current_gdbarch
->frame_args_address
879 /*FRAME_ARGS_ADDRESS ()*/);
880 fprintf_unfiltered (gdb_stdlog
,
881 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
882 (long) current_gdbarch
->frame_locals_address
883 /*FRAME_LOCALS_ADDRESS ()*/);
884 fprintf_unfiltered (gdb_stdlog
,
885 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
886 (long) current_gdbarch
->saved_pc_after_call
887 /*SAVED_PC_AFTER_CALL ()*/);
888 fprintf_unfiltered (gdb_stdlog
,
889 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
890 (long) current_gdbarch
->frame_num_args
891 /*FRAME_NUM_ARGS ()*/);
894 struct gdbarch_tdep
*
895 gdbarch_tdep (struct gdbarch
*gdbarch
)
897 if (gdbarch_debug
>= 2)
898 /* FIXME: gdb_std??? */
899 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
900 return gdbarch
->tdep
;
904 const struct bfd_arch_info
*
905 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
907 if (gdbarch_debug
>= 2)
908 /* FIXME: gdb_std??? */
909 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
910 return gdbarch
->bfd_arch_info
;
914 gdbarch_byte_order (struct gdbarch
*gdbarch
)
916 if (gdbarch_debug
>= 2)
917 /* FIXME: gdb_std??? */
918 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
919 return gdbarch
->byte_order
;
923 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
925 if (gdbarch
->ptr_bit
== 0)
926 internal_error ("gdbarch: gdbarch_ptr_bit invalid");
927 if (gdbarch_debug
>= 2)
928 /* FIXME: gdb_std??? */
929 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
930 return gdbarch
->ptr_bit
;
934 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
937 gdbarch
->ptr_bit
= ptr_bit
;
941 gdbarch_short_bit (struct gdbarch
*gdbarch
)
943 if (gdbarch
->short_bit
== 0)
944 internal_error ("gdbarch: gdbarch_short_bit invalid");
945 if (gdbarch_debug
>= 2)
946 /* FIXME: gdb_std??? */
947 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
948 return gdbarch
->short_bit
;
952 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
955 gdbarch
->short_bit
= short_bit
;
959 gdbarch_int_bit (struct gdbarch
*gdbarch
)
961 if (gdbarch
->int_bit
== 0)
962 internal_error ("gdbarch: gdbarch_int_bit invalid");
963 if (gdbarch_debug
>= 2)
964 /* FIXME: gdb_std??? */
965 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
966 return gdbarch
->int_bit
;
970 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
973 gdbarch
->int_bit
= int_bit
;
977 gdbarch_long_bit (struct gdbarch
*gdbarch
)
979 if (gdbarch
->long_bit
== 0)
980 internal_error ("gdbarch: gdbarch_long_bit invalid");
981 if (gdbarch_debug
>= 2)
982 /* FIXME: gdb_std??? */
983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
984 return gdbarch
->long_bit
;
988 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
991 gdbarch
->long_bit
= long_bit
;
995 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
997 if (gdbarch
->long_long_bit
== 0)
998 internal_error ("gdbarch: gdbarch_long_long_bit invalid");
999 if (gdbarch_debug
>= 2)
1000 /* FIXME: gdb_std??? */
1001 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1002 return gdbarch
->long_long_bit
;
1006 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1009 gdbarch
->long_long_bit
= long_long_bit
;
1013 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1015 if (gdbarch
->float_bit
== 0)
1016 internal_error ("gdbarch: gdbarch_float_bit invalid");
1017 if (gdbarch_debug
>= 2)
1018 /* FIXME: gdb_std??? */
1019 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1020 return gdbarch
->float_bit
;
1024 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1027 gdbarch
->float_bit
= float_bit
;
1031 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1033 if (gdbarch
->double_bit
== 0)
1034 internal_error ("gdbarch: gdbarch_double_bit invalid");
1035 if (gdbarch_debug
>= 2)
1036 /* FIXME: gdb_std??? */
1037 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1038 return gdbarch
->double_bit
;
1042 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1045 gdbarch
->double_bit
= double_bit
;
1049 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1051 if (gdbarch
->long_double_bit
== 0)
1052 internal_error ("gdbarch: gdbarch_long_double_bit invalid");
1053 if (gdbarch_debug
>= 2)
1054 /* FIXME: gdb_std??? */
1055 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1056 return gdbarch
->long_double_bit
;
1060 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1061 int long_double_bit
)
1063 gdbarch
->long_double_bit
= long_double_bit
;
1067 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1069 if (gdbarch
->read_pc
== 0)
1070 internal_error ("gdbarch: gdbarch_read_pc invalid");
1071 if (gdbarch_debug
>= 2)
1072 /* FIXME: gdb_std??? */
1073 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1074 return gdbarch
->read_pc (pid
);
1078 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1079 gdbarch_read_pc_ftype read_pc
)
1081 gdbarch
->read_pc
= read_pc
;
1085 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1087 if (gdbarch
->write_pc
== 0)
1088 internal_error ("gdbarch: gdbarch_write_pc invalid");
1089 if (gdbarch_debug
>= 2)
1090 /* FIXME: gdb_std??? */
1091 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1092 gdbarch
->write_pc (val
, pid
);
1096 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1097 gdbarch_write_pc_ftype write_pc
)
1099 gdbarch
->write_pc
= write_pc
;
1103 gdbarch_read_fp (struct gdbarch
*gdbarch
)
1105 if (gdbarch
->read_fp
== 0)
1106 internal_error ("gdbarch: gdbarch_read_fp invalid");
1107 if (gdbarch_debug
>= 2)
1108 /* FIXME: gdb_std??? */
1109 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_fp called\n");
1110 return gdbarch
->read_fp ();
1114 set_gdbarch_read_fp (struct gdbarch
*gdbarch
,
1115 gdbarch_read_fp_ftype read_fp
)
1117 gdbarch
->read_fp
= read_fp
;
1121 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1123 if (gdbarch
->write_fp
== 0)
1124 internal_error ("gdbarch: gdbarch_write_fp invalid");
1125 if (gdbarch_debug
>= 2)
1126 /* FIXME: gdb_std??? */
1127 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1128 gdbarch
->write_fp (val
);
1132 set_gdbarch_write_fp (struct gdbarch
*gdbarch
,
1133 gdbarch_write_fp_ftype write_fp
)
1135 gdbarch
->write_fp
= write_fp
;
1139 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1141 if (gdbarch
->read_sp
== 0)
1142 internal_error ("gdbarch: gdbarch_read_sp invalid");
1143 if (gdbarch_debug
>= 2)
1144 /* FIXME: gdb_std??? */
1145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1146 return gdbarch
->read_sp ();
1150 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1151 gdbarch_read_sp_ftype read_sp
)
1153 gdbarch
->read_sp
= read_sp
;
1157 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1159 if (gdbarch
->write_sp
== 0)
1160 internal_error ("gdbarch: gdbarch_write_sp invalid");
1161 if (gdbarch_debug
>= 2)
1162 /* FIXME: gdb_std??? */
1163 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1164 gdbarch
->write_sp (val
);
1168 set_gdbarch_write_sp (struct gdbarch
*gdbarch
,
1169 gdbarch_write_sp_ftype write_sp
)
1171 gdbarch
->write_sp
= write_sp
;
1175 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1177 if (gdbarch
->num_regs
== -1)
1178 internal_error ("gdbarch: gdbarch_num_regs invalid");
1179 if (gdbarch_debug
>= 2)
1180 /* FIXME: gdb_std??? */
1181 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1182 return gdbarch
->num_regs
;
1186 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1189 gdbarch
->num_regs
= num_regs
;
1193 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1195 if (gdbarch
->sp_regnum
== -1)
1196 internal_error ("gdbarch: gdbarch_sp_regnum invalid");
1197 if (gdbarch_debug
>= 2)
1198 /* FIXME: gdb_std??? */
1199 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1200 return gdbarch
->sp_regnum
;
1204 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1207 gdbarch
->sp_regnum
= sp_regnum
;
1211 gdbarch_fp_regnum (struct gdbarch
*gdbarch
)
1213 if (gdbarch
->fp_regnum
== -1)
1214 internal_error ("gdbarch: gdbarch_fp_regnum invalid");
1215 if (gdbarch_debug
>= 2)
1216 /* FIXME: gdb_std??? */
1217 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1218 return gdbarch
->fp_regnum
;
1222 set_gdbarch_fp_regnum (struct gdbarch
*gdbarch
,
1225 gdbarch
->fp_regnum
= fp_regnum
;
1229 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1231 if (gdbarch
->pc_regnum
== -1)
1232 internal_error ("gdbarch: gdbarch_pc_regnum invalid");
1233 if (gdbarch_debug
>= 2)
1234 /* FIXME: gdb_std??? */
1235 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1236 return gdbarch
->pc_regnum
;
1240 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1243 gdbarch
->pc_regnum
= pc_regnum
;
1247 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1249 if (gdbarch
->register_name
== 0)
1250 internal_error ("gdbarch: gdbarch_register_name invalid");
1251 if (gdbarch_debug
>= 2)
1252 /* FIXME: gdb_std??? */
1253 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1254 return gdbarch
->register_name (regnr
);
1258 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1259 gdbarch_register_name_ftype register_name
)
1261 gdbarch
->register_name
= register_name
;
1265 gdbarch_register_size (struct gdbarch
*gdbarch
)
1267 if (gdbarch
->register_size
== -1)
1268 internal_error ("gdbarch: gdbarch_register_size invalid");
1269 if (gdbarch_debug
>= 2)
1270 /* FIXME: gdb_std??? */
1271 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1272 return gdbarch
->register_size
;
1276 set_gdbarch_register_size (struct gdbarch
*gdbarch
,
1279 gdbarch
->register_size
= register_size
;
1283 gdbarch_register_bytes (struct gdbarch
*gdbarch
)
1285 if (gdbarch
->register_bytes
== -1)
1286 internal_error ("gdbarch: gdbarch_register_bytes invalid");
1287 if (gdbarch_debug
>= 2)
1288 /* FIXME: gdb_std??? */
1289 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1290 return gdbarch
->register_bytes
;
1294 set_gdbarch_register_bytes (struct gdbarch
*gdbarch
,
1297 gdbarch
->register_bytes
= register_bytes
;
1301 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1303 if (gdbarch
->register_byte
== 0)
1304 internal_error ("gdbarch: gdbarch_register_byte invalid");
1305 if (gdbarch_debug
>= 2)
1306 /* FIXME: gdb_std??? */
1307 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1308 return gdbarch
->register_byte (reg_nr
);
1312 set_gdbarch_register_byte (struct gdbarch
*gdbarch
,
1313 gdbarch_register_byte_ftype register_byte
)
1315 gdbarch
->register_byte
= register_byte
;
1319 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1321 if (gdbarch
->register_raw_size
== 0)
1322 internal_error ("gdbarch: gdbarch_register_raw_size invalid");
1323 if (gdbarch_debug
>= 2)
1324 /* FIXME: gdb_std??? */
1325 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1326 return gdbarch
->register_raw_size (reg_nr
);
1330 set_gdbarch_register_raw_size (struct gdbarch
*gdbarch
,
1331 gdbarch_register_raw_size_ftype register_raw_size
)
1333 gdbarch
->register_raw_size
= register_raw_size
;
1337 gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
)
1339 if (gdbarch
->max_register_raw_size
== -1)
1340 internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
1341 if (gdbarch_debug
>= 2)
1342 /* FIXME: gdb_std??? */
1343 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1344 return gdbarch
->max_register_raw_size
;
1348 set_gdbarch_max_register_raw_size (struct gdbarch
*gdbarch
,
1349 int max_register_raw_size
)
1351 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1355 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1357 if (gdbarch
->register_virtual_size
== 0)
1358 internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
1359 if (gdbarch_debug
>= 2)
1360 /* FIXME: gdb_std??? */
1361 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1362 return gdbarch
->register_virtual_size (reg_nr
);
1366 set_gdbarch_register_virtual_size (struct gdbarch
*gdbarch
,
1367 gdbarch_register_virtual_size_ftype register_virtual_size
)
1369 gdbarch
->register_virtual_size
= register_virtual_size
;
1373 gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
)
1375 if (gdbarch
->max_register_virtual_size
== -1)
1376 internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
1377 if (gdbarch_debug
>= 2)
1378 /* FIXME: gdb_std??? */
1379 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1380 return gdbarch
->max_register_virtual_size
;
1384 set_gdbarch_max_register_virtual_size (struct gdbarch
*gdbarch
,
1385 int max_register_virtual_size
)
1387 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1391 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1393 if (gdbarch
->register_virtual_type
== 0)
1394 internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
1395 if (gdbarch_debug
>= 2)
1396 /* FIXME: gdb_std??? */
1397 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1398 return gdbarch
->register_virtual_type (reg_nr
);
1402 set_gdbarch_register_virtual_type (struct gdbarch
*gdbarch
,
1403 gdbarch_register_virtual_type_ftype register_virtual_type
)
1405 gdbarch
->register_virtual_type
= register_virtual_type
;
1409 gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
)
1411 if (gdbarch
->use_generic_dummy_frames
== -1)
1412 internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1413 if (gdbarch_debug
>= 2)
1414 /* FIXME: gdb_std??? */
1415 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1416 return gdbarch
->use_generic_dummy_frames
;
1420 set_gdbarch_use_generic_dummy_frames (struct gdbarch
*gdbarch
,
1421 int use_generic_dummy_frames
)
1423 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1427 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1429 if (gdbarch
->call_dummy_location
== 0)
1430 internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
1431 if (gdbarch_debug
>= 2)
1432 /* FIXME: gdb_std??? */
1433 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1434 return gdbarch
->call_dummy_location
;
1438 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1439 int call_dummy_location
)
1441 gdbarch
->call_dummy_location
= call_dummy_location
;
1445 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1447 if (gdbarch
->call_dummy_address
== 0)
1448 internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
1449 if (gdbarch_debug
>= 2)
1450 /* FIXME: gdb_std??? */
1451 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1452 return gdbarch
->call_dummy_address ();
1456 set_gdbarch_call_dummy_address (struct gdbarch
*gdbarch
,
1457 gdbarch_call_dummy_address_ftype call_dummy_address
)
1459 gdbarch
->call_dummy_address
= call_dummy_address
;
1463 gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
)
1465 if (gdbarch
->call_dummy_start_offset
== -1)
1466 internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1467 if (gdbarch_debug
>= 2)
1468 /* FIXME: gdb_std??? */
1469 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1470 return gdbarch
->call_dummy_start_offset
;
1474 set_gdbarch_call_dummy_start_offset (struct gdbarch
*gdbarch
,
1475 CORE_ADDR call_dummy_start_offset
)
1477 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1481 gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
)
1483 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1484 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1485 if (gdbarch_debug
>= 2)
1486 /* FIXME: gdb_std??? */
1487 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1488 return gdbarch
->call_dummy_breakpoint_offset
;
1492 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch
*gdbarch
,
1493 CORE_ADDR call_dummy_breakpoint_offset
)
1495 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1499 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
)
1501 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1502 internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1503 if (gdbarch_debug
>= 2)
1504 /* FIXME: gdb_std??? */
1505 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1506 return gdbarch
->call_dummy_breakpoint_offset_p
;
1510 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch
*gdbarch
,
1511 int call_dummy_breakpoint_offset_p
)
1513 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1517 gdbarch_call_dummy_length (struct gdbarch
*gdbarch
)
1519 if (gdbarch
->call_dummy_length
== -1)
1520 internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
1521 if (gdbarch_debug
>= 2)
1522 /* FIXME: gdb_std??? */
1523 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1524 return gdbarch
->call_dummy_length
;
1528 set_gdbarch_call_dummy_length (struct gdbarch
*gdbarch
,
1529 int call_dummy_length
)
1531 gdbarch
->call_dummy_length
= call_dummy_length
;
1535 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1537 if (gdbarch
->pc_in_call_dummy
== 0)
1538 internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1539 if (gdbarch_debug
>= 2)
1540 /* FIXME: gdb_std??? */
1541 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1542 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1546 set_gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
,
1547 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
)
1549 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1553 gdbarch_call_dummy_p (struct gdbarch
*gdbarch
)
1555 if (gdbarch
->call_dummy_p
== -1)
1556 internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
1557 if (gdbarch_debug
>= 2)
1558 /* FIXME: gdb_std??? */
1559 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1560 return gdbarch
->call_dummy_p
;
1564 set_gdbarch_call_dummy_p (struct gdbarch
*gdbarch
,
1567 gdbarch
->call_dummy_p
= call_dummy_p
;
1571 gdbarch_call_dummy_words (struct gdbarch
*gdbarch
)
1573 if (gdbarch_debug
>= 2)
1574 /* FIXME: gdb_std??? */
1575 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1576 return gdbarch
->call_dummy_words
;
1580 set_gdbarch_call_dummy_words (struct gdbarch
*gdbarch
,
1581 LONGEST
* call_dummy_words
)
1583 gdbarch
->call_dummy_words
= call_dummy_words
;
1587 gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
)
1589 if (gdbarch_debug
>= 2)
1590 /* FIXME: gdb_std??? */
1591 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1592 return gdbarch
->sizeof_call_dummy_words
;
1596 set_gdbarch_sizeof_call_dummy_words (struct gdbarch
*gdbarch
,
1597 int sizeof_call_dummy_words
)
1599 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1603 gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
)
1605 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1606 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1607 if (gdbarch_debug
>= 2)
1608 /* FIXME: gdb_std??? */
1609 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1610 return gdbarch
->call_dummy_stack_adjust_p
;
1614 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch
*gdbarch
,
1615 int call_dummy_stack_adjust_p
)
1617 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1621 gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
)
1623 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1624 internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1625 if (gdbarch_debug
>= 2)
1626 /* FIXME: gdb_std??? */
1627 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1628 return gdbarch
->call_dummy_stack_adjust
;
1632 set_gdbarch_call_dummy_stack_adjust (struct gdbarch
*gdbarch
,
1633 int call_dummy_stack_adjust
)
1635 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1639 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
)
1641 if (gdbarch
->fix_call_dummy
== 0)
1642 internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
1643 if (gdbarch_debug
>= 2)
1644 /* FIXME: gdb_std??? */
1645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1646 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1650 set_gdbarch_fix_call_dummy (struct gdbarch
*gdbarch
,
1651 gdbarch_fix_call_dummy_ftype fix_call_dummy
)
1653 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1657 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1659 if (gdbarch_debug
>= 2)
1660 /* FIXME: gdb_std??? */
1661 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1662 return gdbarch
->believe_pcc_promotion
;
1666 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1667 int believe_pcc_promotion
)
1669 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1673 gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
)
1675 if (gdbarch_debug
>= 2)
1676 /* FIXME: gdb_std??? */
1677 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1678 return gdbarch
->believe_pcc_promotion_type
;
1682 set_gdbarch_believe_pcc_promotion_type (struct gdbarch
*gdbarch
,
1683 int believe_pcc_promotion_type
)
1685 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1689 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
)
1691 if (gdbarch
->get_saved_register
== 0)
1692 internal_error ("gdbarch: gdbarch_get_saved_register invalid");
1693 if (gdbarch_debug
>= 2)
1694 /* FIXME: gdb_std??? */
1695 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1696 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1700 set_gdbarch_get_saved_register (struct gdbarch
*gdbarch
,
1701 gdbarch_get_saved_register_ftype get_saved_register
)
1703 gdbarch
->get_saved_register
= get_saved_register
;
1707 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1709 if (gdbarch
->register_convertible
== 0)
1710 internal_error ("gdbarch: gdbarch_register_convertible invalid");
1711 if (gdbarch_debug
>= 2)
1712 /* FIXME: gdb_std??? */
1713 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1714 return gdbarch
->register_convertible (nr
);
1718 set_gdbarch_register_convertible (struct gdbarch
*gdbarch
,
1719 gdbarch_register_convertible_ftype register_convertible
)
1721 gdbarch
->register_convertible
= register_convertible
;
1725 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1727 if (gdbarch
->register_convert_to_virtual
== 0)
1728 internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1729 if (gdbarch_debug
>= 2)
1730 /* FIXME: gdb_std??? */
1731 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1732 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1736 set_gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
,
1737 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
)
1739 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1743 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1745 if (gdbarch
->register_convert_to_raw
== 0)
1746 internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
1747 if (gdbarch_debug
>= 2)
1748 /* FIXME: gdb_std??? */
1749 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1750 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1754 set_gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
,
1755 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
)
1757 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1761 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1763 if (gdbarch
->extract_return_value
== 0)
1764 internal_error ("gdbarch: gdbarch_extract_return_value invalid");
1765 if (gdbarch_debug
>= 2)
1766 /* FIXME: gdb_std??? */
1767 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1768 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1772 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
1773 gdbarch_extract_return_value_ftype extract_return_value
)
1775 gdbarch
->extract_return_value
= extract_return_value
;
1779 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1781 if (gdbarch
->push_arguments
== 0)
1782 internal_error ("gdbarch: gdbarch_push_arguments invalid");
1783 if (gdbarch_debug
>= 2)
1784 /* FIXME: gdb_std??? */
1785 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1786 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1790 set_gdbarch_push_arguments (struct gdbarch
*gdbarch
,
1791 gdbarch_push_arguments_ftype push_arguments
)
1793 gdbarch
->push_arguments
= push_arguments
;
1797 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1799 if (gdbarch
->push_dummy_frame
== 0)
1800 internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
1801 if (gdbarch_debug
>= 2)
1802 /* FIXME: gdb_std??? */
1803 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1804 gdbarch
->push_dummy_frame ();
1808 set_gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
,
1809 gdbarch_push_dummy_frame_ftype push_dummy_frame
)
1811 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1815 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1817 if (gdbarch
->push_return_address
== 0)
1818 internal_error ("gdbarch: gdbarch_push_return_address invalid");
1819 if (gdbarch_debug
>= 2)
1820 /* FIXME: gdb_std??? */
1821 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1822 return gdbarch
->push_return_address (pc
, sp
);
1826 set_gdbarch_push_return_address (struct gdbarch
*gdbarch
,
1827 gdbarch_push_return_address_ftype push_return_address
)
1829 gdbarch
->push_return_address
= push_return_address
;
1833 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
1835 if (gdbarch
->pop_frame
== 0)
1836 internal_error ("gdbarch: gdbarch_pop_frame invalid");
1837 if (gdbarch_debug
>= 2)
1838 /* FIXME: gdb_std??? */
1839 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
1840 gdbarch
->pop_frame ();
1844 set_gdbarch_pop_frame (struct gdbarch
*gdbarch
,
1845 gdbarch_pop_frame_ftype pop_frame
)
1847 gdbarch
->pop_frame
= pop_frame
;
1851 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1853 if (gdbarch
->d10v_make_daddr
== 0)
1854 internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
1855 if (gdbarch_debug
>= 2)
1856 /* FIXME: gdb_std??? */
1857 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
1858 return gdbarch
->d10v_make_daddr (x
);
1862 set_gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
,
1863 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
)
1865 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
1869 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1871 if (gdbarch
->d10v_make_iaddr
== 0)
1872 internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
1873 if (gdbarch_debug
>= 2)
1874 /* FIXME: gdb_std??? */
1875 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
1876 return gdbarch
->d10v_make_iaddr (x
);
1880 set_gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
,
1881 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
)
1883 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
1887 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1889 if (gdbarch
->d10v_daddr_p
== 0)
1890 internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
1891 if (gdbarch_debug
>= 2)
1892 /* FIXME: gdb_std??? */
1893 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
1894 return gdbarch
->d10v_daddr_p (x
);
1898 set_gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
,
1899 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
)
1901 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
1905 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1907 if (gdbarch
->d10v_iaddr_p
== 0)
1908 internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
1909 if (gdbarch_debug
>= 2)
1910 /* FIXME: gdb_std??? */
1911 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
1912 return gdbarch
->d10v_iaddr_p (x
);
1916 set_gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
,
1917 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
)
1919 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
1923 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1925 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
1926 internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
1927 if (gdbarch_debug
>= 2)
1928 /* FIXME: gdb_std??? */
1929 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
1930 return gdbarch
->d10v_convert_daddr_to_raw (x
);
1934 set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
,
1935 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
)
1937 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
1941 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1943 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
1944 internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
1945 if (gdbarch_debug
>= 2)
1946 /* FIXME: gdb_std??? */
1947 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
1948 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
1952 set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
,
1953 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
)
1955 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
1959 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
1961 if (gdbarch
->store_struct_return
== 0)
1962 internal_error ("gdbarch: gdbarch_store_struct_return invalid");
1963 if (gdbarch_debug
>= 2)
1964 /* FIXME: gdb_std??? */
1965 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
1966 gdbarch
->store_struct_return (addr
, sp
);
1970 set_gdbarch_store_struct_return (struct gdbarch
*gdbarch
,
1971 gdbarch_store_struct_return_ftype store_struct_return
)
1973 gdbarch
->store_struct_return
= store_struct_return
;
1977 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
1979 if (gdbarch
->store_return_value
== 0)
1980 internal_error ("gdbarch: gdbarch_store_return_value invalid");
1981 if (gdbarch_debug
>= 2)
1982 /* FIXME: gdb_std??? */
1983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
1984 gdbarch
->store_return_value (type
, valbuf
);
1988 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
1989 gdbarch_store_return_value_ftype store_return_value
)
1991 gdbarch
->store_return_value
= store_return_value
;
1995 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
1997 if (gdbarch
->extract_struct_value_address
== 0)
1998 internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
1999 if (gdbarch_debug
>= 2)
2000 /* FIXME: gdb_std??? */
2001 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2002 return gdbarch
->extract_struct_value_address (regbuf
);
2006 set_gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
,
2007 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
)
2009 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2013 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2015 if (gdbarch
->use_struct_convention
== 0)
2016 internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
2017 if (gdbarch_debug
>= 2)
2018 /* FIXME: gdb_std??? */
2019 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2020 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2024 set_gdbarch_use_struct_convention (struct gdbarch
*gdbarch
,
2025 gdbarch_use_struct_convention_ftype use_struct_convention
)
2027 gdbarch
->use_struct_convention
= use_struct_convention
;
2031 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2033 if (gdbarch
->frame_init_saved_regs
== 0)
2034 internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2035 if (gdbarch_debug
>= 2)
2036 /* FIXME: gdb_std??? */
2037 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2038 gdbarch
->frame_init_saved_regs (frame
);
2042 set_gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
,
2043 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
)
2045 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2049 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2051 if (gdbarch
->init_extra_frame_info
== 0)
2052 internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
2053 if (gdbarch_debug
>= 2)
2054 /* FIXME: gdb_std??? */
2055 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2056 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2060 set_gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
,
2061 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
)
2063 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2067 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2069 if (gdbarch
->skip_prologue
== 0)
2070 internal_error ("gdbarch: gdbarch_skip_prologue invalid");
2071 if (gdbarch_debug
>= 2)
2072 /* FIXME: gdb_std??? */
2073 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2074 return gdbarch
->skip_prologue (ip
);
2078 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2079 gdbarch_skip_prologue_ftype skip_prologue
)
2081 gdbarch
->skip_prologue
= skip_prologue
;
2085 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2087 if (gdbarch
->inner_than
== 0)
2088 internal_error ("gdbarch: gdbarch_inner_than invalid");
2089 if (gdbarch_debug
>= 2)
2090 /* FIXME: gdb_std??? */
2091 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2092 return gdbarch
->inner_than (lhs
, rhs
);
2096 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2097 gdbarch_inner_than_ftype inner_than
)
2099 gdbarch
->inner_than
= inner_than
;
2103 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2105 if (gdbarch
->breakpoint_from_pc
== 0)
2106 internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2107 if (gdbarch_debug
>= 2)
2108 /* FIXME: gdb_std??? */
2109 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2110 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2114 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2115 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2117 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2121 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2123 if (gdbarch
->decr_pc_after_break
== -1)
2124 internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
2125 if (gdbarch_debug
>= 2)
2126 /* FIXME: gdb_std??? */
2127 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2128 return gdbarch
->decr_pc_after_break
;
2132 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2133 CORE_ADDR decr_pc_after_break
)
2135 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2139 gdbarch_function_start_offset (struct gdbarch
*gdbarch
)
2141 if (gdbarch
->function_start_offset
== -1)
2142 internal_error ("gdbarch: gdbarch_function_start_offset invalid");
2143 if (gdbarch_debug
>= 2)
2144 /* FIXME: gdb_std??? */
2145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2146 return gdbarch
->function_start_offset
;
2150 set_gdbarch_function_start_offset (struct gdbarch
*gdbarch
,
2151 CORE_ADDR function_start_offset
)
2153 gdbarch
->function_start_offset
= function_start_offset
;
2157 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2159 if (gdbarch
->remote_translate_xfer_address
== 0)
2160 internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2161 if (gdbarch_debug
>= 2)
2162 /* FIXME: gdb_std??? */
2163 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2164 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2168 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2169 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2171 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2175 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2177 if (gdbarch
->frame_args_skip
== -1)
2178 internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
2179 if (gdbarch_debug
>= 2)
2180 /* FIXME: gdb_std??? */
2181 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2182 return gdbarch
->frame_args_skip
;
2186 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2187 CORE_ADDR frame_args_skip
)
2189 gdbarch
->frame_args_skip
= frame_args_skip
;
2193 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2195 if (gdbarch
->frameless_function_invocation
== 0)
2196 internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
2197 if (gdbarch_debug
>= 2)
2198 /* FIXME: gdb_std??? */
2199 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2200 return gdbarch
->frameless_function_invocation (fi
);
2204 set_gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
,
2205 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
)
2207 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2211 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2213 if (gdbarch
->frame_chain
== 0)
2214 internal_error ("gdbarch: gdbarch_frame_chain invalid");
2215 if (gdbarch_debug
>= 2)
2216 /* FIXME: gdb_std??? */
2217 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2218 return gdbarch
->frame_chain (frame
);
2222 set_gdbarch_frame_chain (struct gdbarch
*gdbarch
,
2223 gdbarch_frame_chain_ftype frame_chain
)
2225 gdbarch
->frame_chain
= frame_chain
;
2229 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2231 if (gdbarch
->frame_chain_valid
== 0)
2232 internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
2233 if (gdbarch_debug
>= 2)
2234 /* FIXME: gdb_std??? */
2235 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2236 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2240 set_gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
,
2241 gdbarch_frame_chain_valid_ftype frame_chain_valid
)
2243 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2247 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2249 if (gdbarch
->frame_saved_pc
== 0)
2250 internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
2251 if (gdbarch_debug
>= 2)
2252 /* FIXME: gdb_std??? */
2253 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2254 return gdbarch
->frame_saved_pc (fi
);
2258 set_gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
,
2259 gdbarch_frame_saved_pc_ftype frame_saved_pc
)
2261 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2265 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2267 if (gdbarch
->frame_args_address
== 0)
2268 internal_error ("gdbarch: gdbarch_frame_args_address invalid");
2269 if (gdbarch_debug
>= 2)
2270 /* FIXME: gdb_std??? */
2271 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2272 return gdbarch
->frame_args_address (fi
);
2276 set_gdbarch_frame_args_address (struct gdbarch
*gdbarch
,
2277 gdbarch_frame_args_address_ftype frame_args_address
)
2279 gdbarch
->frame_args_address
= frame_args_address
;
2283 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2285 if (gdbarch
->frame_locals_address
== 0)
2286 internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
2287 if (gdbarch_debug
>= 2)
2288 /* FIXME: gdb_std??? */
2289 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2290 return gdbarch
->frame_locals_address (fi
);
2294 set_gdbarch_frame_locals_address (struct gdbarch
*gdbarch
,
2295 gdbarch_frame_locals_address_ftype frame_locals_address
)
2297 gdbarch
->frame_locals_address
= frame_locals_address
;
2301 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2303 if (gdbarch
->saved_pc_after_call
== 0)
2304 internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
2305 if (gdbarch_debug
>= 2)
2306 /* FIXME: gdb_std??? */
2307 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2308 return gdbarch
->saved_pc_after_call (frame
);
2312 set_gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
,
2313 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
)
2315 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2319 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2321 if (gdbarch
->frame_num_args
== 0)
2322 internal_error ("gdbarch: gdbarch_frame_num_args invalid");
2323 if (gdbarch_debug
>= 2)
2324 /* FIXME: gdb_std??? */
2325 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2326 return gdbarch
->frame_num_args (frame
);
2330 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2331 gdbarch_frame_num_args_ftype frame_num_args
)
2333 gdbarch
->frame_num_args
= frame_num_args
;
2337 /* Keep a registrary of per-architecture data-pointers required by GDB
2345 struct gdbarch_data_registration
2347 gdbarch_data_ftype
*init
;
2348 struct gdbarch_data
*data
;
2349 struct gdbarch_data_registration
*next
;
2352 struct gdbarch_data_registrary
2355 struct gdbarch_data_registration
*registrations
;
2358 struct gdbarch_data_registrary gdbarch_data_registrary
=
2363 struct gdbarch_data
*
2364 register_gdbarch_data (gdbarch_data_ftype
*init
)
2366 struct gdbarch_data_registration
**curr
;
2367 for (curr
= &gdbarch_data_registrary
.registrations
;
2369 curr
= &(*curr
)->next
);
2370 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2371 (*curr
)->next
= NULL
;
2372 (*curr
)->init
= init
;
2373 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2374 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2375 return (*curr
)->data
;
2379 /* Walk through all the registered users initializing each in turn. */
2382 init_gdbarch_data (struct gdbarch
*gdbarch
)
2384 struct gdbarch_data_registration
*rego
;
2385 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2386 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2387 for (rego
= gdbarch_data_registrary
.registrations
;
2391 if (rego
->data
->index
< gdbarch
->nr_data
)
2392 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2397 /* Return the current value of the specified per-architecture
2402 struct gdbarch_data
*data
;
2404 if (data
->index
>= current_gdbarch
->nr_data
)
2405 internal_error ("gdbarch_data: request for non-existant data.");
2406 return current_gdbarch
->data
[data
->index
];
2411 /* Keep a registrary of swaped data required by GDB modules. */
2416 struct gdbarch_swap_registration
*source
;
2417 struct gdbarch_swap
*next
;
2420 struct gdbarch_swap_registration
2423 unsigned long sizeof_data
;
2424 gdbarch_swap_ftype
*init
;
2425 struct gdbarch_swap_registration
*next
;
2428 struct gdbarch_swap_registrary
2431 struct gdbarch_swap_registration
*registrations
;
2434 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2440 register_gdbarch_swap (void *data
,
2441 unsigned long sizeof_data
,
2442 gdbarch_swap_ftype
*init
)
2444 struct gdbarch_swap_registration
**rego
;
2445 for (rego
= &gdbarch_swap_registrary
.registrations
;
2447 rego
= &(*rego
)->next
);
2448 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2449 (*rego
)->next
= NULL
;
2450 (*rego
)->init
= init
;
2451 (*rego
)->data
= data
;
2452 (*rego
)->sizeof_data
= sizeof_data
;
2457 init_gdbarch_swap (struct gdbarch
*gdbarch
)
2459 struct gdbarch_swap_registration
*rego
;
2460 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2461 for (rego
= gdbarch_swap_registrary
.registrations
;
2465 if (rego
->data
!= NULL
)
2467 (*curr
) = XMALLOC (struct gdbarch_swap
);
2468 (*curr
)->source
= rego
;
2469 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2470 (*curr
)->next
= NULL
;
2471 memset (rego
->data
, 0, rego
->sizeof_data
);
2472 curr
= &(*curr
)->next
;
2474 if (rego
->init
!= NULL
)
2480 swapout_gdbarch_swap (struct gdbarch
*gdbarch
)
2482 struct gdbarch_swap
*curr
;
2483 for (curr
= gdbarch
->swap
;
2486 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2490 swapin_gdbarch_swap (struct gdbarch
*gdbarch
)
2492 struct gdbarch_swap
*curr
;
2493 for (curr
= gdbarch
->swap
;
2496 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2500 /* Keep a registrary of the architectures known by GDB. */
2502 struct gdbarch_init_registration
2504 enum bfd_architecture bfd_architecture
;
2505 gdbarch_init_ftype
*init
;
2506 struct gdbarch_list
*arches
;
2507 struct gdbarch_init_registration
*next
;
2510 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2513 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
2514 gdbarch_init_ftype
*init
)
2516 struct gdbarch_init_registration
**curr
;
2517 const struct bfd_arch_info
*bfd_arch_info
;
2518 /* Check that BFD reconizes this architecture */
2519 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2520 if (bfd_arch_info
== NULL
)
2522 internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2524 /* Check that we haven't seen this architecture before */
2525 for (curr
= &gdbarch_init_registrary
;
2527 curr
= &(*curr
)->next
)
2529 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2530 internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
2531 bfd_arch_info
->printable_name
);
2535 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2536 bfd_arch_info
->printable_name
,
2539 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2540 (*curr
)->bfd_architecture
= bfd_architecture
;
2541 (*curr
)->init
= init
;
2542 (*curr
)->arches
= NULL
;
2543 (*curr
)->next
= NULL
;
2548 /* Look for an architecture using gdbarch_info. Base search on only
2549 BFD_ARCH_INFO and BYTE_ORDER. */
2551 struct gdbarch_list
*
2552 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
2553 const struct gdbarch_info
*info
)
2555 for (; arches
!= NULL
; arches
= arches
->next
)
2557 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2559 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2567 /* Update the current architecture. Return ZERO if the update request
2571 gdbarch_update (struct gdbarch_info info
)
2573 struct gdbarch
*new_gdbarch
;
2574 struct gdbarch_list
**list
;
2575 struct gdbarch_init_registration
*rego
;
2577 /* Fill in any missing bits. Most important is the bfd_architecture
2578 which is used to select the target architecture. */
2579 if (info
.bfd_architecture
== bfd_arch_unknown
)
2581 if (info
.bfd_arch_info
!= NULL
)
2582 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2583 else if (info
.abfd
!= NULL
)
2584 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2585 /* FIXME - should query BFD for its default architecture. */
2587 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2589 if (info
.bfd_arch_info
== NULL
)
2591 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2592 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2594 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2596 if (info
.byte_order
== 0)
2598 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2599 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2600 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2603 info
.byte_order
= current_gdbarch
->byte_order
;
2604 /* FIXME - should query BFD for its default byte-order. */
2606 /* A default for abfd? */
2608 /* Find the target that knows about this architecture. */
2609 for (rego
= gdbarch_init_registrary
;
2610 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2615 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2621 fprintf_unfiltered (gdb_stdlog
,
2622 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2623 info
.bfd_architecture
,
2624 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2625 fprintf_unfiltered (gdb_stdlog
,
2626 "gdbarch_update: info.bfd_arch_info %s\n",
2627 (info
.bfd_arch_info
!= NULL
2628 ? info
.bfd_arch_info
->printable_name
2630 fprintf_unfiltered (gdb_stdlog
,
2631 "gdbarch_update: info.byte_order %d (%s)\n",
2633 (info
.byte_order
== BIG_ENDIAN
? "big"
2634 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2636 fprintf_unfiltered (gdb_stdlog
,
2637 "gdbarch_update: info.abfd 0x%lx\n",
2639 fprintf_unfiltered (gdb_stdlog
,
2640 "gdbarch_update: info.tdep_info 0x%lx\n",
2641 (long) info
.tdep_info
);
2644 /* Ask the target for a replacement architecture. */
2645 new_gdbarch
= rego
->init (info
, rego
->arches
);
2647 /* Did the target like it? No. Reject the change. */
2648 if (new_gdbarch
== NULL
)
2651 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2655 /* Did the architecture change? No. Do nothing. */
2656 if (current_gdbarch
== new_gdbarch
)
2659 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2661 new_gdbarch
->bfd_arch_info
->printable_name
);
2665 /* Swap all data belonging to the old target out */
2666 swapout_gdbarch_swap (current_gdbarch
);
2668 /* Is this a pre-existing architecture? Yes. Swap it in. */
2669 for (list
= ®o
->arches
;
2671 list
= &(*list
)->next
)
2673 if ((*list
)->gdbarch
== new_gdbarch
)
2676 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2678 new_gdbarch
->bfd_arch_info
->printable_name
);
2679 current_gdbarch
= new_gdbarch
;
2680 swapin_gdbarch_swap (new_gdbarch
);
2685 /* Append this new architecture to this targets list. */
2686 (*list
) = XMALLOC (struct gdbarch_list
);
2687 (*list
)->next
= NULL
;
2688 (*list
)->gdbarch
= new_gdbarch
;
2690 /* Switch to this new architecture. Dump it out. */
2691 current_gdbarch
= new_gdbarch
;
2694 fprintf_unfiltered (gdb_stdlog
,
2695 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2697 new_gdbarch
->bfd_arch_info
->printable_name
);
2701 /* Check that the newly installed architecture is valid. */
2702 verify_gdbarch (new_gdbarch
);
2704 /* Initialize the per-architecture memory (swap) areas.
2705 CURRENT_GDBARCH must be update before these modules are
2707 init_gdbarch_swap (new_gdbarch
);
2709 /* Initialize the per-architecture data-pointer of all parties that
2710 registered an interest in this architecture. CURRENT_GDBARCH
2711 must be updated before these modules are called. */
2712 init_gdbarch_data (new_gdbarch
);
2719 /* Functions to manipulate the endianness of the target. */
2721 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2722 /* compat - Catch old targets that expect a selectable byte-order to
2723 default to BIG_ENDIAN */
2724 #ifndef TARGET_BYTE_ORDER_DEFAULT
2725 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2728 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2729 #ifndef TARGET_BYTE_ORDER_DEFAULT
2730 /* compat - Catch old non byte-order selectable targets that do not
2731 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2732 TARGET_BYTE_ORDER to be used as the default. For targets that
2733 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2734 below will get a strange compiler warning. */
2735 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2738 #ifndef TARGET_BYTE_ORDER_DEFAULT
2739 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2741 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2742 int target_byte_order_auto
= 1;
2744 /* Chain containing the \"set endian\" commands. */
2745 static struct cmd_list_element
*endianlist
= NULL
;
2747 /* Called by ``show endian''. */
2749 show_endian (char *args
, int from_tty
)
2752 (TARGET_BYTE_ORDER_AUTO
2753 ? "The target endianness is set automatically (currently %s endian)\n"
2754 : "The target is assumed to be %s endian\n");
2755 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
2758 /* Called if the user enters ``set endian'' without an argument. */
2760 set_endian (char *args
, int from_tty
)
2762 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2763 show_endian (args
, from_tty
);
2766 /* Called by ``set endian big''. */
2768 set_endian_big (char *args
, int from_tty
)
2770 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2772 target_byte_order
= BIG_ENDIAN
;
2773 target_byte_order_auto
= 0;
2776 struct gdbarch_info info
;
2777 memset (&info
, 0, sizeof info
);
2778 info
.byte_order
= BIG_ENDIAN
;
2779 gdbarch_update (info
);
2784 printf_unfiltered ("Byte order is not selectable.");
2785 show_endian (args
, from_tty
);
2789 /* Called by ``set endian little''. */
2791 set_endian_little (char *args
, int from_tty
)
2793 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2795 target_byte_order
= LITTLE_ENDIAN
;
2796 target_byte_order_auto
= 0;
2799 struct gdbarch_info info
;
2800 memset (&info
, 0, sizeof info
);
2801 info
.byte_order
= LITTLE_ENDIAN
;
2802 gdbarch_update (info
);
2807 printf_unfiltered ("Byte order is not selectable.");
2808 show_endian (args
, from_tty
);
2812 /* Called by ``set endian auto''. */
2814 set_endian_auto (char *args
, int from_tty
)
2816 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2818 target_byte_order_auto
= 1;
2822 printf_unfiltered ("Byte order is not selectable.");
2823 show_endian (args
, from_tty
);
2827 /* Set the endianness from a BFD. */
2829 set_endian_from_file (bfd
*abfd
)
2831 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2835 if (bfd_big_endian (abfd
))
2838 want
= LITTLE_ENDIAN
;
2839 if (TARGET_BYTE_ORDER_AUTO
)
2840 target_byte_order
= want
;
2841 else if (TARGET_BYTE_ORDER
!= want
)
2842 warning ("%s endian file does not match %s endian target.",
2843 want
== BIG_ENDIAN
? "big" : "little",
2844 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2848 if (bfd_big_endian (abfd
)
2849 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
2850 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
2851 warning ("%s endian file does not match %s endian target.",
2852 bfd_big_endian (abfd
) ? "big" : "little",
2853 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2859 /* Functions to manipulate the architecture of the target */
2861 enum set_arch
{ set_arch_auto
, set_arch_manual
};
2863 int target_architecture_auto
= 1;
2864 extern const struct bfd_arch_info bfd_default_arch_struct
;
2865 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
2866 int (*target_architecture_hook
) (const struct bfd_arch_info
*ap
);
2868 static void show_endian (char *, int);
2869 static void set_endian (char *, int);
2870 static void set_endian_big (char *, int);
2871 static void set_endian_little (char *, int);
2872 static void set_endian_auto (char *, int);
2873 static void set_endian_from_file (bfd
*);
2874 static int arch_ok (const struct bfd_arch_info
*arch
);
2875 static void set_arch (const struct bfd_arch_info
*arch
, enum set_arch type
);
2876 static void show_architecture (char *, int);
2877 static void set_architecture (char *, int);
2878 static void info_architecture (char *, int);
2879 static void set_architecture_from_file (bfd
*);
2881 /* Do the real work of changing the current architecture */
2884 arch_ok (const struct bfd_arch_info
*arch
)
2886 /* Should be performing the more basic check that the binary is
2887 compatible with GDB. */
2888 /* Check with the target that the architecture is valid. */
2889 return (target_architecture_hook
== NULL
2890 || target_architecture_hook (arch
));
2894 set_arch (const struct bfd_arch_info
*arch
,
2900 if (!arch_ok (arch
))
2901 warning ("Target may not support %s architecture",
2902 arch
->printable_name
);
2903 target_architecture
= arch
;
2905 case set_arch_manual
:
2906 if (!arch_ok (arch
))
2908 printf_unfiltered ("Target does not support `%s' architecture.\n",
2909 arch
->printable_name
);
2913 target_architecture_auto
= 0;
2914 target_architecture
= arch
;
2922 /* Called if the user enters ``show architecture'' without an argument. */
2924 show_architecture (char *args
, int from_tty
)
2927 arch
= TARGET_ARCHITECTURE
->printable_name
;
2928 if (target_architecture_auto
)
2929 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
2931 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
2934 /* Called if the user enters ``set architecture'' with or without an
2937 set_architecture (char *args
, int from_tty
)
2941 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
2943 else if (strcmp (args
, "auto") == 0)
2945 target_architecture_auto
= 1;
2947 else if (GDB_MULTI_ARCH
)
2949 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
2951 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
2954 struct gdbarch_info info
;
2955 memset (&info
, 0, sizeof info
);
2956 info
.bfd_arch_info
= arch
;
2957 if (gdbarch_update (info
))
2958 target_architecture_auto
= 0;
2960 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
2965 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
2967 set_arch (arch
, set_arch_manual
);
2969 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
2973 /* Called if the user enters ``info architecture'' without an argument. */
2975 info_architecture (char *args
, int from_tty
)
2977 enum bfd_architecture a
;
2980 if (gdbarch_init_registrary
!= NULL
)
2982 struct gdbarch_init_registration
*rego
;
2983 printf_filtered ("Available architectures are:\n");
2984 for (rego
= gdbarch_init_registrary
;
2988 const struct bfd_arch_info
*ap
;
2989 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
2994 printf_filtered (" %s", ap
->printable_name
);
2998 printf_filtered ("\n");
3004 printf_filtered ("There are no available architectures.\n");
3008 printf_filtered ("Available architectures are:\n");
3009 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3011 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3016 printf_filtered (" %s", ap
->printable_name
);
3020 printf_filtered ("\n");
3025 /* Set the architecture from arch/machine */
3027 set_architecture_from_arch_mach (arch
, mach
)
3028 enum bfd_architecture arch
;
3031 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3033 set_arch (wanted
, set_arch_manual
);
3035 internal_error ("gdbarch: hardwired architecture/machine not reconized");
3038 /* Set the architecture from a BFD */
3040 set_architecture_from_file (bfd
*abfd
)
3042 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3043 if (target_architecture_auto
)
3045 set_arch (wanted
, set_arch_auto
);
3047 else if (wanted
!= target_architecture
)
3049 warning ("%s architecture file may be incompatible with %s target.",
3050 wanted
->printable_name
,
3051 target_architecture
->printable_name
);
3056 /* Misc helper functions for targets. */
3059 frame_num_args_unknown (fi
)
3060 struct frame_info
*fi
;
3067 generic_register_convertible_not (num
)
3075 /* Pointer to the target-dependent disassembly function. */
3076 int (*tm_print_insn
) (bfd_vma
, disassemble_info
*);
3077 disassemble_info tm_print_insn_info
;
3081 /* Set the dynamic target-system-dependant parameters (architecture,
3082 byte-order) using information found in the BFD */
3085 set_gdbarch_from_file (abfd
)
3090 struct gdbarch_info info
;
3091 memset (&info
, 0, sizeof info
);
3093 gdbarch_update (info
);
3096 set_architecture_from_file (abfd
);
3097 set_endian_from_file (abfd
);
3101 #if defined (CALL_DUMMY)
3102 /* FIXME - this should go away */
3103 LONGEST call_dummy_words
[] = CALL_DUMMY
;
3104 int sizeof_call_dummy_words
= sizeof (call_dummy_words
);
3108 extern void _initialize_gdbarch (void);
3110 _initialize_gdbarch ()
3112 add_prefix_cmd ("endian", class_support
, set_endian
,
3113 "Set endianness of target.",
3114 &endianlist
, "set endian ", 0, &setlist
);
3115 add_cmd ("big", class_support
, set_endian_big
,
3116 "Set target as being big endian.", &endianlist
);
3117 add_cmd ("little", class_support
, set_endian_little
,
3118 "Set target as being little endian.", &endianlist
);
3119 add_cmd ("auto", class_support
, set_endian_auto
,
3120 "Select target endianness automatically.", &endianlist
);
3121 add_cmd ("endian", class_support
, show_endian
,
3122 "Show endianness of target.", &showlist
);
3124 add_cmd ("architecture", class_support
, set_architecture
,
3125 "Set architecture of target.", &setlist
);
3126 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3127 add_cmd ("architecture", class_support
, show_architecture
,
3128 "Show architecture of target.", &showlist
);
3129 add_cmd ("architecture", class_support
, info_architecture
,
3130 "List supported target architectures", &infolist
);
3132 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3133 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3134 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3135 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3136 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3138 add_show_from_set (add_set_cmd ("archdebug",
3141 (char *)&gdbarch_debug
,
3142 "Set architecture debugging.\n\
3143 When non-zero, architecture debugging is enabled.", &setlist
),