1 /* Semi-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, Boston, MA 02111-1307, USA. */
24 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
26 /* Just include everything in sight so that the every old definition
27 of macro is visible. */
28 #include "gdb_string.h"
33 #include "breakpoint.h"
38 #include "gdbthread.h"
40 #include "symfile.h" /* for overlay functions */
45 /* Convenience macro for allocting typesafe memory. */
48 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
52 /* Non-zero if we want to trace architecture code. */
55 #define GDBARCH_DEBUG 0
57 int gdbarch_debug
= GDBARCH_DEBUG
;
60 /* Maintain the struct gdbarch object */
64 /* basic architectural information */
65 const struct bfd_arch_info
* bfd_arch_info
;
68 /* target specific vector. */
69 struct gdbarch_tdep
*tdep
;
71 /* per-architecture data-pointers */
75 /* per-architecture swap-regions */
76 struct gdbarch_swap
*swap
;
80 When extending this structure you must:
84 Declare set/get functions and define the corresponding
87 gdbarch_alloc(): If zero/NULL is not a suitable default,
88 initialize the new field.
90 verify_gdbarch(): Confirm that the target updated the field
93 gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
96 ``default_gdbarch()'': Append an initial value to the static
97 variable (base values on the host's c-type system).
99 get_gdbarch(): Implement the set/get functions (probably using
100 the macro's as shortcuts).
112 gdbarch_read_pc_ftype
*read_pc
;
113 gdbarch_write_pc_ftype
*write_pc
;
114 gdbarch_read_fp_ftype
*read_fp
;
115 gdbarch_write_fp_ftype
*write_fp
;
116 gdbarch_read_sp_ftype
*read_sp
;
117 gdbarch_write_sp_ftype
*write_sp
;
122 gdbarch_register_name_ftype
*register_name
;
125 gdbarch_register_byte_ftype
*register_byte
;
126 gdbarch_register_raw_size_ftype
*register_raw_size
;
127 int max_register_raw_size
;
128 gdbarch_register_virtual_size_ftype
*register_virtual_size
;
129 int max_register_virtual_size
;
130 gdbarch_register_virtual_type_ftype
*register_virtual_type
;
131 int use_generic_dummy_frames
;
132 int call_dummy_location
;
133 gdbarch_call_dummy_address_ftype
*call_dummy_address
;
134 CORE_ADDR call_dummy_start_offset
;
135 CORE_ADDR call_dummy_breakpoint_offset
;
136 int call_dummy_breakpoint_offset_p
;
137 int call_dummy_length
;
138 gdbarch_pc_in_call_dummy_ftype
*pc_in_call_dummy
;
140 LONGEST
* call_dummy_words
;
141 int sizeof_call_dummy_words
;
142 int call_dummy_stack_adjust_p
;
143 int call_dummy_stack_adjust
;
144 gdbarch_fix_call_dummy_ftype
*fix_call_dummy
;
145 int believe_pcc_promotion
;
146 int believe_pcc_promotion_type
;
147 gdbarch_get_saved_register_ftype
*get_saved_register
;
148 gdbarch_register_convertible_ftype
*register_convertible
;
149 gdbarch_register_convert_to_virtual_ftype
*register_convert_to_virtual
;
150 gdbarch_register_convert_to_raw_ftype
*register_convert_to_raw
;
151 gdbarch_extract_return_value_ftype
*extract_return_value
;
152 gdbarch_push_arguments_ftype
*push_arguments
;
153 gdbarch_push_dummy_frame_ftype
*push_dummy_frame
;
154 gdbarch_push_return_address_ftype
*push_return_address
;
155 gdbarch_pop_frame_ftype
*pop_frame
;
156 gdbarch_d10v_make_daddr_ftype
*d10v_make_daddr
;
157 gdbarch_d10v_make_iaddr_ftype
*d10v_make_iaddr
;
158 gdbarch_d10v_daddr_p_ftype
*d10v_daddr_p
;
159 gdbarch_d10v_iaddr_p_ftype
*d10v_iaddr_p
;
160 gdbarch_d10v_convert_daddr_to_raw_ftype
*d10v_convert_daddr_to_raw
;
161 gdbarch_d10v_convert_iaddr_to_raw_ftype
*d10v_convert_iaddr_to_raw
;
162 gdbarch_store_struct_return_ftype
*store_struct_return
;
163 gdbarch_store_return_value_ftype
*store_return_value
;
164 gdbarch_extract_struct_value_address_ftype
*extract_struct_value_address
;
165 gdbarch_use_struct_convention_ftype
*use_struct_convention
;
166 gdbarch_frame_init_saved_regs_ftype
*frame_init_saved_regs
;
167 gdbarch_init_extra_frame_info_ftype
*init_extra_frame_info
;
168 gdbarch_skip_prologue_ftype
*skip_prologue
;
169 gdbarch_inner_than_ftype
*inner_than
;
170 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
171 CORE_ADDR decr_pc_after_break
;
172 CORE_ADDR function_start_offset
;
173 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
174 CORE_ADDR frame_args_skip
;
175 gdbarch_frameless_function_invocation_ftype
*frameless_function_invocation
;
176 gdbarch_frame_chain_ftype
*frame_chain
;
177 gdbarch_frame_chain_valid_ftype
*frame_chain_valid
;
178 gdbarch_frame_saved_pc_ftype
*frame_saved_pc
;
179 gdbarch_frame_args_address_ftype
*frame_args_address
;
180 gdbarch_frame_locals_address_ftype
*frame_locals_address
;
181 gdbarch_saved_pc_after_call_ftype
*saved_pc_after_call
;
182 gdbarch_frame_num_args_ftype
*frame_num_args
;
186 /* The default architecture uses host values (for want of a better
189 extern const struct bfd_arch_info bfd_default_arch_struct
;
191 struct gdbarch default_gdbarch
= {
192 /* basic architecture information */
193 &bfd_default_arch_struct
,
195 /* target specific vector */
197 /*per-architecture data-pointers and swap regions */
199 /* Multi-arch values */
204 8 * sizeof (LONGEST
),
207 8 * sizeof (long double),
243 generic_get_saved_register
,
279 /* default_gdbarch() */
281 struct gdbarch
*current_gdbarch
= &default_gdbarch
;
284 /* Create a new ``struct gdbarch'' based in information provided by
285 ``struct gdbarch_info''. */
288 gdbarch_alloc (info
, tdep
)
289 const struct gdbarch_info
*info
;
290 struct gdbarch_tdep
*tdep
;
292 struct gdbarch
*gdbarch
= XMALLOC (struct gdbarch
);
293 memset (gdbarch
, 0, sizeof (*gdbarch
));
295 gdbarch
->tdep
= tdep
;
297 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
298 gdbarch
->byte_order
= info
->byte_order
;
300 /* Force the explicit initialization of these. */
301 gdbarch
->num_regs
= -1;
302 gdbarch
->sp_regnum
= -1;
303 gdbarch
->fp_regnum
= -1;
304 gdbarch
->pc_regnum
= -1;
305 gdbarch
->register_size
= -1;
306 gdbarch
->register_bytes
= -1;
307 gdbarch
->max_register_raw_size
= -1;
308 gdbarch
->max_register_virtual_size
= -1;
309 gdbarch
->use_generic_dummy_frames
= -1;
310 gdbarch
->call_dummy_start_offset
= -1;
311 gdbarch
->call_dummy_breakpoint_offset
= -1;
312 gdbarch
->call_dummy_breakpoint_offset_p
= -1;
313 gdbarch
->call_dummy_length
= -1;
314 gdbarch
->call_dummy_p
= -1;
315 gdbarch
->call_dummy_stack_adjust_p
= -1;
316 gdbarch
->decr_pc_after_break
= -1;
317 gdbarch
->function_start_offset
= -1;
318 gdbarch
->frame_args_skip
= -1;
319 /* gdbarch_alloc() */
325 /* Ensure that all values in a GDBARCH are reasonable. */
327 static void verify_gdbarch
PARAMS ((struct gdbarch
*gdbarch
));
329 verify_gdbarch (gdbarch
)
330 struct gdbarch
*gdbarch
;
332 /* Only perform sanity checks on a multi-arch target. */
333 if (GDB_MULTI_ARCH
<= 0)
336 if (gdbarch
->byte_order
== 0)
337 fatal ("verify_gdbarch: byte-order unset");
338 if (gdbarch
->bfd_arch_info
== NULL
)
339 fatal ("verify_gdbarch: bfd_arch_info unset");
340 /* Check those that need to be defined for the given multi-arch level. */
341 if ((GDB_MULTI_ARCH
>= 1)
342 && (gdbarch
->ptr_bit
== 0))
343 fatal ("gdbarch: verify_gdbarch: ptr_bit invalid");
344 if ((GDB_MULTI_ARCH
>= 1)
345 && (gdbarch
->short_bit
== 0))
346 fatal ("gdbarch: verify_gdbarch: short_bit invalid");
347 if ((GDB_MULTI_ARCH
>= 1)
348 && (gdbarch
->int_bit
== 0))
349 fatal ("gdbarch: verify_gdbarch: int_bit invalid");
350 if ((GDB_MULTI_ARCH
>= 1)
351 && (gdbarch
->long_bit
== 0))
352 fatal ("gdbarch: verify_gdbarch: long_bit invalid");
353 if ((GDB_MULTI_ARCH
>= 1)
354 && (gdbarch
->long_long_bit
== 0))
355 fatal ("gdbarch: verify_gdbarch: long_long_bit invalid");
356 if ((GDB_MULTI_ARCH
>= 1)
357 && (gdbarch
->float_bit
== 0))
358 fatal ("gdbarch: verify_gdbarch: float_bit invalid");
359 if ((GDB_MULTI_ARCH
>= 1)
360 && (gdbarch
->double_bit
== 0))
361 fatal ("gdbarch: verify_gdbarch: double_bit invalid");
362 if ((GDB_MULTI_ARCH
>= 1)
363 && (gdbarch
->long_double_bit
== 0))
364 fatal ("gdbarch: verify_gdbarch: long_double_bit invalid");
365 if ((GDB_MULTI_ARCH
>= 1)
366 && (gdbarch
->read_pc
== 0))
367 fatal ("gdbarch: verify_gdbarch: read_pc invalid");
368 if ((GDB_MULTI_ARCH
>= 1)
369 && (gdbarch
->write_pc
== 0))
370 fatal ("gdbarch: verify_gdbarch: write_pc invalid");
371 if ((GDB_MULTI_ARCH
>= 1)
372 && (gdbarch
->read_fp
== 0))
373 fatal ("gdbarch: verify_gdbarch: read_fp invalid");
374 if ((GDB_MULTI_ARCH
>= 1)
375 && (gdbarch
->write_fp
== 0))
376 fatal ("gdbarch: verify_gdbarch: write_fp invalid");
377 if ((GDB_MULTI_ARCH
>= 1)
378 && (gdbarch
->read_sp
== 0))
379 fatal ("gdbarch: verify_gdbarch: read_sp invalid");
380 if ((GDB_MULTI_ARCH
>= 1)
381 && (gdbarch
->write_sp
== 0))
382 fatal ("gdbarch: verify_gdbarch: write_sp invalid");
383 if ((GDB_MULTI_ARCH
>= 2)
384 && (gdbarch
->num_regs
== -1))
385 fatal ("gdbarch: verify_gdbarch: num_regs invalid");
386 if ((GDB_MULTI_ARCH
>= 2)
387 && (gdbarch
->sp_regnum
== -1))
388 fatal ("gdbarch: verify_gdbarch: sp_regnum invalid");
389 if ((GDB_MULTI_ARCH
>= 2)
390 && (gdbarch
->fp_regnum
== -1))
391 fatal ("gdbarch: verify_gdbarch: fp_regnum invalid");
392 if ((GDB_MULTI_ARCH
>= 2)
393 && (gdbarch
->pc_regnum
== -1))
394 fatal ("gdbarch: verify_gdbarch: pc_regnum invalid");
395 if ((GDB_MULTI_ARCH
>= 2)
396 && (gdbarch
->register_name
== 0))
397 fatal ("gdbarch: verify_gdbarch: register_name invalid");
398 if ((GDB_MULTI_ARCH
>= 2)
399 && (gdbarch
->register_size
== -1))
400 fatal ("gdbarch: verify_gdbarch: register_size invalid");
401 if ((GDB_MULTI_ARCH
>= 2)
402 && (gdbarch
->register_bytes
== -1))
403 fatal ("gdbarch: verify_gdbarch: register_bytes invalid");
404 if ((GDB_MULTI_ARCH
>= 2)
405 && (gdbarch
->register_byte
== 0))
406 fatal ("gdbarch: verify_gdbarch: register_byte invalid");
407 if ((GDB_MULTI_ARCH
>= 2)
408 && (gdbarch
->register_raw_size
== 0))
409 fatal ("gdbarch: verify_gdbarch: register_raw_size invalid");
410 if ((GDB_MULTI_ARCH
>= 2)
411 && (gdbarch
->max_register_raw_size
== -1))
412 fatal ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
413 if ((GDB_MULTI_ARCH
>= 2)
414 && (gdbarch
->register_virtual_size
== 0))
415 fatal ("gdbarch: verify_gdbarch: register_virtual_size invalid");
416 if ((GDB_MULTI_ARCH
>= 2)
417 && (gdbarch
->max_register_virtual_size
== -1))
418 fatal ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
419 if ((GDB_MULTI_ARCH
>= 2)
420 && (gdbarch
->register_virtual_type
== 0))
421 fatal ("gdbarch: verify_gdbarch: register_virtual_type invalid");
422 if ((GDB_MULTI_ARCH
>= 1)
423 && (gdbarch
->use_generic_dummy_frames
== -1))
424 fatal ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
425 if ((GDB_MULTI_ARCH
>= 2)
426 && (gdbarch
->call_dummy_location
== 0))
427 fatal ("gdbarch: verify_gdbarch: call_dummy_location invalid");
428 if ((GDB_MULTI_ARCH
>= 2)
429 && (gdbarch
->call_dummy_location
== AT_ENTRY_POINT
&& gdbarch
->call_dummy_address
== 0))
430 fatal ("gdbarch: verify_gdbarch: call_dummy_address invalid");
431 if ((GDB_MULTI_ARCH
>= 2)
432 && (gdbarch
->call_dummy_start_offset
== -1))
433 fatal ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
434 if ((GDB_MULTI_ARCH
>= 2)
435 && (gdbarch
->call_dummy_breakpoint_offset
== -1))
436 fatal ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
437 if ((GDB_MULTI_ARCH
>= 1)
438 && (gdbarch
->call_dummy_breakpoint_offset_p
== -1))
439 fatal ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
440 if ((GDB_MULTI_ARCH
>= 2)
441 && (gdbarch
->call_dummy_length
== -1))
442 fatal ("gdbarch: verify_gdbarch: call_dummy_length invalid");
443 if ((GDB_MULTI_ARCH
>= 2)
444 && (gdbarch
->pc_in_call_dummy
== 0))
445 fatal ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
446 if ((GDB_MULTI_ARCH
>= 1)
447 && (gdbarch
->call_dummy_p
== -1))
448 fatal ("gdbarch: verify_gdbarch: call_dummy_p invalid");
449 if ((GDB_MULTI_ARCH
>= 1)
450 && (gdbarch
->call_dummy_stack_adjust_p
== -1))
451 fatal ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
452 if ((GDB_MULTI_ARCH
>= 2)
453 && (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0))
454 fatal ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
455 if ((GDB_MULTI_ARCH
>= 2)
456 && (gdbarch
->fix_call_dummy
== 0))
457 fatal ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
458 if ((GDB_MULTI_ARCH
>= 1)
459 && (gdbarch
->get_saved_register
== 0))
460 fatal ("gdbarch: verify_gdbarch: get_saved_register invalid");
461 if ((GDB_MULTI_ARCH
>= 1)
462 && (gdbarch
->register_convertible
== 0))
463 fatal ("gdbarch: verify_gdbarch: register_convertible invalid");
464 if ((GDB_MULTI_ARCH
>= 2)
465 && (gdbarch
->register_convert_to_virtual
== 0))
466 fatal ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
467 if ((GDB_MULTI_ARCH
>= 2)
468 && (gdbarch
->register_convert_to_raw
== 0))
469 fatal ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
470 if ((GDB_MULTI_ARCH
>= 2)
471 && (gdbarch
->extract_return_value
== 0))
472 fatal ("gdbarch: verify_gdbarch: extract_return_value invalid");
473 if ((GDB_MULTI_ARCH
>= 1)
474 && (gdbarch
->push_arguments
== 0))
475 fatal ("gdbarch: verify_gdbarch: push_arguments invalid");
476 if ((GDB_MULTI_ARCH
>= 2)
477 && (gdbarch
->push_dummy_frame
== 0))
478 fatal ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
479 if ((GDB_MULTI_ARCH
>= 1)
480 && (gdbarch
->push_return_address
== 0))
481 fatal ("gdbarch: verify_gdbarch: push_return_address invalid");
482 if ((GDB_MULTI_ARCH
>= 2)
483 && (gdbarch
->pop_frame
== 0))
484 fatal ("gdbarch: verify_gdbarch: pop_frame invalid");
485 if ((GDB_MULTI_ARCH
>= 2)
486 && (gdbarch
->d10v_make_daddr
== 0))
487 fatal ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
488 if ((GDB_MULTI_ARCH
>= 2)
489 && (gdbarch
->d10v_make_iaddr
== 0))
490 fatal ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
491 if ((GDB_MULTI_ARCH
>= 2)
492 && (gdbarch
->d10v_daddr_p
== 0))
493 fatal ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
494 if ((GDB_MULTI_ARCH
>= 2)
495 && (gdbarch
->d10v_iaddr_p
== 0))
496 fatal ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
497 if ((GDB_MULTI_ARCH
>= 2)
498 && (gdbarch
->d10v_convert_daddr_to_raw
== 0))
499 fatal ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
500 if ((GDB_MULTI_ARCH
>= 2)
501 && (gdbarch
->d10v_convert_iaddr_to_raw
== 0))
502 fatal ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
503 if ((GDB_MULTI_ARCH
>= 2)
504 && (gdbarch
->store_struct_return
== 0))
505 fatal ("gdbarch: verify_gdbarch: store_struct_return invalid");
506 if ((GDB_MULTI_ARCH
>= 2)
507 && (gdbarch
->store_return_value
== 0))
508 fatal ("gdbarch: verify_gdbarch: store_return_value invalid");
509 if ((GDB_MULTI_ARCH
>= 2)
510 && (gdbarch
->extract_struct_value_address
== 0))
511 fatal ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
512 if ((GDB_MULTI_ARCH
>= 2)
513 && (gdbarch
->use_struct_convention
== 0))
514 fatal ("gdbarch: verify_gdbarch: use_struct_convention invalid");
515 if ((GDB_MULTI_ARCH
>= 2)
516 && (gdbarch
->frame_init_saved_regs
== 0))
517 fatal ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
518 if ((GDB_MULTI_ARCH
>= 2)
519 && (gdbarch
->init_extra_frame_info
== 0))
520 fatal ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
521 if ((GDB_MULTI_ARCH
>= 2)
522 && (gdbarch
->skip_prologue
== 0))
523 fatal ("gdbarch: verify_gdbarch: skip_prologue invalid");
524 if ((GDB_MULTI_ARCH
>= 2)
525 && (gdbarch
->inner_than
== 0))
526 fatal ("gdbarch: verify_gdbarch: inner_than invalid");
527 if ((GDB_MULTI_ARCH
>= 2)
528 && (gdbarch
->breakpoint_from_pc
== 0))
529 fatal ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
530 if ((GDB_MULTI_ARCH
>= 2)
531 && (gdbarch
->decr_pc_after_break
== -1))
532 fatal ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
533 if ((GDB_MULTI_ARCH
>= 2)
534 && (gdbarch
->function_start_offset
== -1))
535 fatal ("gdbarch: verify_gdbarch: function_start_offset invalid");
536 if ((GDB_MULTI_ARCH
>= 2)
537 && (gdbarch
->remote_translate_xfer_address
== 0))
538 fatal ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
539 if ((GDB_MULTI_ARCH
>= 2)
540 && (gdbarch
->frame_args_skip
== -1))
541 fatal ("gdbarch: verify_gdbarch: frame_args_skip invalid");
542 if ((GDB_MULTI_ARCH
>= 2)
543 && (gdbarch
->frameless_function_invocation
== 0))
544 fatal ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
545 if ((GDB_MULTI_ARCH
>= 2)
546 && (gdbarch
->frame_chain
== 0))
547 fatal ("gdbarch: verify_gdbarch: frame_chain invalid");
548 if ((GDB_MULTI_ARCH
>= 1)
549 && (gdbarch
->frame_chain_valid
== 0))
550 fatal ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
551 if ((GDB_MULTI_ARCH
>= 2)
552 && (gdbarch
->frame_saved_pc
== 0))
553 fatal ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
554 if ((GDB_MULTI_ARCH
>= 2)
555 && (gdbarch
->frame_args_address
== 0))
556 fatal ("gdbarch: verify_gdbarch: frame_args_address invalid");
557 if ((GDB_MULTI_ARCH
>= 2)
558 && (gdbarch
->frame_locals_address
== 0))
559 fatal ("gdbarch: verify_gdbarch: frame_locals_address invalid");
560 if ((GDB_MULTI_ARCH
>= 2)
561 && (gdbarch
->saved_pc_after_call
== 0))
562 fatal ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
563 if ((GDB_MULTI_ARCH
>= 2)
564 && (gdbarch
->frame_num_args
== 0))
565 fatal ("gdbarch: verify_gdbarch: frame_num_args invalid");
569 /* Print out the details of the current architecture. */
574 if (TARGET_ARCHITECTURE
!= NULL
)
575 fprintf_unfiltered (gdb_stdlog
,
576 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
577 TARGET_ARCHITECTURE
->printable_name
);
578 fprintf_unfiltered (gdb_stdlog
,
579 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
580 (long) TARGET_BYTE_ORDER
);
581 fprintf_unfiltered (gdb_stdlog
,
582 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
583 (long) TARGET_PTR_BIT
);
584 fprintf_unfiltered (gdb_stdlog
,
585 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
586 (long) TARGET_SHORT_BIT
);
587 fprintf_unfiltered (gdb_stdlog
,
588 "gdbarch_update: TARGET_INT_BIT = %ld\n",
589 (long) TARGET_INT_BIT
);
590 fprintf_unfiltered (gdb_stdlog
,
591 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
592 (long) TARGET_LONG_BIT
);
593 fprintf_unfiltered (gdb_stdlog
,
594 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
595 (long) TARGET_LONG_LONG_BIT
);
596 fprintf_unfiltered (gdb_stdlog
,
597 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
598 (long) TARGET_FLOAT_BIT
);
599 fprintf_unfiltered (gdb_stdlog
,
600 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
601 (long) TARGET_DOUBLE_BIT
);
602 fprintf_unfiltered (gdb_stdlog
,
603 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
604 (long) TARGET_LONG_DOUBLE_BIT
);
605 fprintf_unfiltered (gdb_stdlog
,
606 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
607 (long) current_gdbarch
->read_pc
608 /*TARGET_READ_PC ()*/);
609 fprintf_unfiltered (gdb_stdlog
,
610 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
611 (long) current_gdbarch
->write_pc
612 /*TARGET_WRITE_PC ()*/);
613 fprintf_unfiltered (gdb_stdlog
,
614 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
615 (long) current_gdbarch
->read_fp
616 /*TARGET_READ_FP ()*/);
617 fprintf_unfiltered (gdb_stdlog
,
618 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
619 (long) current_gdbarch
->write_fp
620 /*TARGET_WRITE_FP ()*/);
621 fprintf_unfiltered (gdb_stdlog
,
622 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
623 (long) current_gdbarch
->read_sp
624 /*TARGET_READ_SP ()*/);
625 fprintf_unfiltered (gdb_stdlog
,
626 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
627 (long) current_gdbarch
->write_sp
628 /*TARGET_WRITE_SP ()*/);
629 fprintf_unfiltered (gdb_stdlog
,
630 "gdbarch_update: NUM_REGS = %ld\n",
632 fprintf_unfiltered (gdb_stdlog
,
633 "gdbarch_update: SP_REGNUM = %ld\n",
635 fprintf_unfiltered (gdb_stdlog
,
636 "gdbarch_update: FP_REGNUM = %ld\n",
638 fprintf_unfiltered (gdb_stdlog
,
639 "gdbarch_update: PC_REGNUM = %ld\n",
641 fprintf_unfiltered (gdb_stdlog
,
642 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
643 (long) current_gdbarch
->register_name
644 /*REGISTER_NAME ()*/);
645 fprintf_unfiltered (gdb_stdlog
,
646 "gdbarch_update: REGISTER_SIZE = %ld\n",
647 (long) REGISTER_SIZE
);
648 fprintf_unfiltered (gdb_stdlog
,
649 "gdbarch_update: REGISTER_BYTES = %ld\n",
650 (long) REGISTER_BYTES
);
651 fprintf_unfiltered (gdb_stdlog
,
652 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
653 (long) current_gdbarch
->register_byte
654 /*REGISTER_BYTE ()*/);
655 fprintf_unfiltered (gdb_stdlog
,
656 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
657 (long) current_gdbarch
->register_raw_size
658 /*REGISTER_RAW_SIZE ()*/);
659 fprintf_unfiltered (gdb_stdlog
,
660 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
661 (long) MAX_REGISTER_RAW_SIZE
);
662 fprintf_unfiltered (gdb_stdlog
,
663 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
664 (long) current_gdbarch
->register_virtual_size
665 /*REGISTER_VIRTUAL_SIZE ()*/);
666 fprintf_unfiltered (gdb_stdlog
,
667 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
668 (long) MAX_REGISTER_VIRTUAL_SIZE
);
669 fprintf_unfiltered (gdb_stdlog
,
670 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
671 (long) current_gdbarch
->register_virtual_type
672 /*REGISTER_VIRTUAL_TYPE ()*/);
673 fprintf_unfiltered (gdb_stdlog
,
674 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
675 (long) USE_GENERIC_DUMMY_FRAMES
);
676 fprintf_unfiltered (gdb_stdlog
,
677 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
678 (long) CALL_DUMMY_LOCATION
);
679 fprintf_unfiltered (gdb_stdlog
,
680 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
681 (long) current_gdbarch
->call_dummy_address
682 /*CALL_DUMMY_ADDRESS ()*/);
683 fprintf_unfiltered (gdb_stdlog
,
684 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
685 (long) CALL_DUMMY_START_OFFSET
);
686 fprintf_unfiltered (gdb_stdlog
,
687 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
688 (long) CALL_DUMMY_BREAKPOINT_OFFSET
);
689 fprintf_unfiltered (gdb_stdlog
,
690 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
691 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P
);
692 if (CALL_DUMMY_LOCATION
== BEFORE_TEXT_END
|| CALL_DUMMY_LOCATION
== AFTER_TEXT_END
)
693 fprintf_unfiltered (gdb_stdlog
,
694 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
695 (long) CALL_DUMMY_LENGTH
);
696 fprintf_unfiltered (gdb_stdlog
,
697 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
698 (long) current_gdbarch
->pc_in_call_dummy
699 /*PC_IN_CALL_DUMMY ()*/);
700 fprintf_unfiltered (gdb_stdlog
,
701 "gdbarch_update: CALL_DUMMY_P = %ld\n",
702 (long) CALL_DUMMY_P
);
703 fprintf_unfiltered (gdb_stdlog
,
704 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
705 (long) CALL_DUMMY_WORDS
);
706 fprintf_unfiltered (gdb_stdlog
,
707 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
708 (long) SIZEOF_CALL_DUMMY_WORDS
);
709 fprintf_unfiltered (gdb_stdlog
,
710 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
711 (long) CALL_DUMMY_STACK_ADJUST_P
);
712 if (CALL_DUMMY_STACK_ADJUST_P
)
713 fprintf_unfiltered (gdb_stdlog
,
714 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
715 (long) CALL_DUMMY_STACK_ADJUST
);
716 fprintf_unfiltered (gdb_stdlog
,
717 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
718 (long) current_gdbarch
->fix_call_dummy
719 /*FIX_CALL_DUMMY ()*/);
720 #ifdef BELIEVE_PCC_PROMOTION
721 fprintf_unfiltered (gdb_stdlog
,
722 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
723 (long) BELIEVE_PCC_PROMOTION
);
725 #ifdef BELIEVE_PCC_PROMOTION_TYPE
726 fprintf_unfiltered (gdb_stdlog
,
727 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
728 (long) BELIEVE_PCC_PROMOTION_TYPE
);
730 fprintf_unfiltered (gdb_stdlog
,
731 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
732 (long) current_gdbarch
->get_saved_register
733 /*GET_SAVED_REGISTER ()*/);
734 fprintf_unfiltered (gdb_stdlog
,
735 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
736 (long) current_gdbarch
->register_convertible
737 /*REGISTER_CONVERTIBLE ()*/);
738 fprintf_unfiltered (gdb_stdlog
,
739 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
740 (long) current_gdbarch
->register_convert_to_virtual
741 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
742 fprintf_unfiltered (gdb_stdlog
,
743 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
744 (long) current_gdbarch
->register_convert_to_raw
745 /*REGISTER_CONVERT_TO_RAW ()*/);
746 fprintf_unfiltered (gdb_stdlog
,
747 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
748 (long) current_gdbarch
->extract_return_value
749 /*EXTRACT_RETURN_VALUE ()*/);
750 fprintf_unfiltered (gdb_stdlog
,
751 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
752 (long) current_gdbarch
->push_arguments
753 /*PUSH_ARGUMENTS ()*/);
754 fprintf_unfiltered (gdb_stdlog
,
755 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
756 (long) current_gdbarch
->push_dummy_frame
757 /*PUSH_DUMMY_FRAME ()*/);
758 fprintf_unfiltered (gdb_stdlog
,
759 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
760 (long) current_gdbarch
->push_return_address
761 /*PUSH_RETURN_ADDRESS ()*/);
762 fprintf_unfiltered (gdb_stdlog
,
763 "gdbarch_update: POP_FRAME = 0x%08lx\n",
764 (long) current_gdbarch
->pop_frame
766 fprintf_unfiltered (gdb_stdlog
,
767 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
768 (long) current_gdbarch
->d10v_make_daddr
769 /*D10V_MAKE_DADDR ()*/);
770 fprintf_unfiltered (gdb_stdlog
,
771 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
772 (long) current_gdbarch
->d10v_make_iaddr
773 /*D10V_MAKE_IADDR ()*/);
774 fprintf_unfiltered (gdb_stdlog
,
775 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
776 (long) current_gdbarch
->d10v_daddr_p
777 /*D10V_DADDR_P ()*/);
778 fprintf_unfiltered (gdb_stdlog
,
779 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
780 (long) current_gdbarch
->d10v_iaddr_p
781 /*D10V_IADDR_P ()*/);
782 fprintf_unfiltered (gdb_stdlog
,
783 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
784 (long) current_gdbarch
->d10v_convert_daddr_to_raw
785 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
786 fprintf_unfiltered (gdb_stdlog
,
787 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
788 (long) current_gdbarch
->d10v_convert_iaddr_to_raw
789 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
790 fprintf_unfiltered (gdb_stdlog
,
791 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
792 (long) current_gdbarch
->store_struct_return
793 /*STORE_STRUCT_RETURN ()*/);
794 fprintf_unfiltered (gdb_stdlog
,
795 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
796 (long) current_gdbarch
->store_return_value
797 /*STORE_RETURN_VALUE ()*/);
798 fprintf_unfiltered (gdb_stdlog
,
799 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
800 (long) current_gdbarch
->extract_struct_value_address
801 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
802 fprintf_unfiltered (gdb_stdlog
,
803 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
804 (long) current_gdbarch
->use_struct_convention
805 /*USE_STRUCT_CONVENTION ()*/);
806 fprintf_unfiltered (gdb_stdlog
,
807 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
808 (long) current_gdbarch
->frame_init_saved_regs
809 /*FRAME_INIT_SAVED_REGS ()*/);
810 fprintf_unfiltered (gdb_stdlog
,
811 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
812 (long) current_gdbarch
->init_extra_frame_info
813 /*INIT_EXTRA_FRAME_INFO ()*/);
814 fprintf_unfiltered (gdb_stdlog
,
815 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
816 (long) current_gdbarch
->skip_prologue
817 /*SKIP_PROLOGUE ()*/);
818 fprintf_unfiltered (gdb_stdlog
,
819 "gdbarch_update: INNER_THAN = 0x%08lx\n",
820 (long) current_gdbarch
->inner_than
822 fprintf_unfiltered (gdb_stdlog
,
823 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
824 (long) current_gdbarch
->breakpoint_from_pc
825 /*BREAKPOINT_FROM_PC ()*/);
826 fprintf_unfiltered (gdb_stdlog
,
827 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
828 (long) DECR_PC_AFTER_BREAK
);
829 fprintf_unfiltered (gdb_stdlog
,
830 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
831 (long) FUNCTION_START_OFFSET
);
832 fprintf_unfiltered (gdb_stdlog
,
833 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
834 (long) current_gdbarch
->remote_translate_xfer_address
835 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
836 fprintf_unfiltered (gdb_stdlog
,
837 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
838 (long) FRAME_ARGS_SKIP
);
839 fprintf_unfiltered (gdb_stdlog
,
840 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
841 (long) current_gdbarch
->frameless_function_invocation
842 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
843 fprintf_unfiltered (gdb_stdlog
,
844 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
845 (long) current_gdbarch
->frame_chain
847 fprintf_unfiltered (gdb_stdlog
,
848 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
849 (long) current_gdbarch
->frame_chain_valid
850 /*FRAME_CHAIN_VALID ()*/);
851 fprintf_unfiltered (gdb_stdlog
,
852 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
853 (long) current_gdbarch
->frame_saved_pc
854 /*FRAME_SAVED_PC ()*/);
855 fprintf_unfiltered (gdb_stdlog
,
856 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
857 (long) current_gdbarch
->frame_args_address
858 /*FRAME_ARGS_ADDRESS ()*/);
859 fprintf_unfiltered (gdb_stdlog
,
860 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
861 (long) current_gdbarch
->frame_locals_address
862 /*FRAME_LOCALS_ADDRESS ()*/);
863 fprintf_unfiltered (gdb_stdlog
,
864 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
865 (long) current_gdbarch
->saved_pc_after_call
866 /*SAVED_PC_AFTER_CALL ()*/);
867 fprintf_unfiltered (gdb_stdlog
,
868 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
869 (long) current_gdbarch
->frame_num_args
870 /*FRAME_NUM_ARGS ()*/);
873 struct gdbarch_tdep
*
874 gdbarch_tdep (gdbarch
)
875 struct gdbarch
*gdbarch
;
877 if (gdbarch_debug
>= 2)
878 /* FIXME: gdb_std??? */
879 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
880 return gdbarch
->tdep
;
884 const struct bfd_arch_info
*
885 gdbarch_bfd_arch_info (gdbarch
)
886 struct gdbarch
*gdbarch
;
888 if (gdbarch_debug
>= 2)
889 /* FIXME: gdb_std??? */
890 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
891 return gdbarch
->bfd_arch_info
;
895 gdbarch_byte_order (gdbarch
)
896 struct gdbarch
*gdbarch
;
898 if (gdbarch_debug
>= 2)
899 /* FIXME: gdb_std??? */
900 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
901 return gdbarch
->byte_order
;
905 gdbarch_ptr_bit (gdbarch
)
906 struct gdbarch
*gdbarch
;
908 if (gdbarch
->ptr_bit
== 0)
909 fatal ("gdbarch: gdbarch_ptr_bit invalid");
910 if (gdbarch_debug
>= 2)
911 /* FIXME: gdb_std??? */
912 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
913 return gdbarch
->ptr_bit
;
917 set_gdbarch_ptr_bit (gdbarch
, ptr_bit
)
918 struct gdbarch
*gdbarch
;
921 gdbarch
->ptr_bit
= ptr_bit
;
925 gdbarch_short_bit (gdbarch
)
926 struct gdbarch
*gdbarch
;
928 if (gdbarch
->short_bit
== 0)
929 fatal ("gdbarch: gdbarch_short_bit invalid");
930 if (gdbarch_debug
>= 2)
931 /* FIXME: gdb_std??? */
932 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
933 return gdbarch
->short_bit
;
937 set_gdbarch_short_bit (gdbarch
, short_bit
)
938 struct gdbarch
*gdbarch
;
941 gdbarch
->short_bit
= short_bit
;
945 gdbarch_int_bit (gdbarch
)
946 struct gdbarch
*gdbarch
;
948 if (gdbarch
->int_bit
== 0)
949 fatal ("gdbarch: gdbarch_int_bit invalid");
950 if (gdbarch_debug
>= 2)
951 /* FIXME: gdb_std??? */
952 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
953 return gdbarch
->int_bit
;
957 set_gdbarch_int_bit (gdbarch
, int_bit
)
958 struct gdbarch
*gdbarch
;
961 gdbarch
->int_bit
= int_bit
;
965 gdbarch_long_bit (gdbarch
)
966 struct gdbarch
*gdbarch
;
968 if (gdbarch
->long_bit
== 0)
969 fatal ("gdbarch: gdbarch_long_bit invalid");
970 if (gdbarch_debug
>= 2)
971 /* FIXME: gdb_std??? */
972 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
973 return gdbarch
->long_bit
;
977 set_gdbarch_long_bit (gdbarch
, long_bit
)
978 struct gdbarch
*gdbarch
;
981 gdbarch
->long_bit
= long_bit
;
985 gdbarch_long_long_bit (gdbarch
)
986 struct gdbarch
*gdbarch
;
988 if (gdbarch
->long_long_bit
== 0)
989 fatal ("gdbarch: gdbarch_long_long_bit invalid");
990 if (gdbarch_debug
>= 2)
991 /* FIXME: gdb_std??? */
992 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
993 return gdbarch
->long_long_bit
;
997 set_gdbarch_long_long_bit (gdbarch
, long_long_bit
)
998 struct gdbarch
*gdbarch
;
1001 gdbarch
->long_long_bit
= long_long_bit
;
1005 gdbarch_float_bit (gdbarch
)
1006 struct gdbarch
*gdbarch
;
1008 if (gdbarch
->float_bit
== 0)
1009 fatal ("gdbarch: gdbarch_float_bit invalid");
1010 if (gdbarch_debug
>= 2)
1011 /* FIXME: gdb_std??? */
1012 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1013 return gdbarch
->float_bit
;
1017 set_gdbarch_float_bit (gdbarch
, float_bit
)
1018 struct gdbarch
*gdbarch
;
1021 gdbarch
->float_bit
= float_bit
;
1025 gdbarch_double_bit (gdbarch
)
1026 struct gdbarch
*gdbarch
;
1028 if (gdbarch
->double_bit
== 0)
1029 fatal ("gdbarch: gdbarch_double_bit invalid");
1030 if (gdbarch_debug
>= 2)
1031 /* FIXME: gdb_std??? */
1032 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1033 return gdbarch
->double_bit
;
1037 set_gdbarch_double_bit (gdbarch
, double_bit
)
1038 struct gdbarch
*gdbarch
;
1041 gdbarch
->double_bit
= double_bit
;
1045 gdbarch_long_double_bit (gdbarch
)
1046 struct gdbarch
*gdbarch
;
1048 if (gdbarch
->long_double_bit
== 0)
1049 fatal ("gdbarch: gdbarch_long_double_bit invalid");
1050 if (gdbarch_debug
>= 2)
1051 /* FIXME: gdb_std??? */
1052 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1053 return gdbarch
->long_double_bit
;
1057 set_gdbarch_long_double_bit (gdbarch
, long_double_bit
)
1058 struct gdbarch
*gdbarch
;
1059 int long_double_bit
;
1061 gdbarch
->long_double_bit
= long_double_bit
;
1065 gdbarch_read_pc (struct gdbarch
*gdbarch
, int pid
)
1067 if (gdbarch
->read_pc
== 0)
1068 fatal ("gdbarch: gdbarch_read_pc invalid");
1069 if (gdbarch_debug
>= 2)
1070 /* FIXME: gdb_std??? */
1071 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1072 return gdbarch
->read_pc (pid
);
1076 set_gdbarch_read_pc (gdbarch
, read_pc
)
1077 struct gdbarch
*gdbarch
;
1078 gdbarch_read_pc_ftype read_pc
;
1080 gdbarch
->read_pc
= read_pc
;
1084 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, int pid
)
1086 if (gdbarch
->write_pc
== 0)
1087 fatal ("gdbarch: gdbarch_write_pc invalid");
1088 if (gdbarch_debug
>= 2)
1089 /* FIXME: gdb_std??? */
1090 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1091 gdbarch
->write_pc (val
, pid
);
1095 set_gdbarch_write_pc (gdbarch
, write_pc
)
1096 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 fatal ("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 (gdbarch
, read_fp
)
1115 struct gdbarch
*gdbarch
;
1116 gdbarch_read_fp_ftype read_fp
;
1118 gdbarch
->read_fp
= read_fp
;
1122 gdbarch_write_fp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1124 if (gdbarch
->write_fp
== 0)
1125 fatal ("gdbarch: gdbarch_write_fp invalid");
1126 if (gdbarch_debug
>= 2)
1127 /* FIXME: gdb_std??? */
1128 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_fp called\n");
1129 gdbarch
->write_fp (val
);
1133 set_gdbarch_write_fp (gdbarch
, write_fp
)
1134 struct gdbarch
*gdbarch
;
1135 gdbarch_write_fp_ftype write_fp
;
1137 gdbarch
->write_fp
= write_fp
;
1141 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1143 if (gdbarch
->read_sp
== 0)
1144 fatal ("gdbarch: gdbarch_read_sp invalid");
1145 if (gdbarch_debug
>= 2)
1146 /* FIXME: gdb_std??? */
1147 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1148 return gdbarch
->read_sp ();
1152 set_gdbarch_read_sp (gdbarch
, read_sp
)
1153 struct gdbarch
*gdbarch
;
1154 gdbarch_read_sp_ftype read_sp
;
1156 gdbarch
->read_sp
= read_sp
;
1160 gdbarch_write_sp (struct gdbarch
*gdbarch
, CORE_ADDR val
)
1162 if (gdbarch
->write_sp
== 0)
1163 fatal ("gdbarch: gdbarch_write_sp invalid");
1164 if (gdbarch_debug
>= 2)
1165 /* FIXME: gdb_std??? */
1166 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_sp called\n");
1167 gdbarch
->write_sp (val
);
1171 set_gdbarch_write_sp (gdbarch
, write_sp
)
1172 struct gdbarch
*gdbarch
;
1173 gdbarch_write_sp_ftype write_sp
;
1175 gdbarch
->write_sp
= write_sp
;
1179 gdbarch_num_regs (gdbarch
)
1180 struct gdbarch
*gdbarch
;
1182 if (gdbarch
->num_regs
== -1)
1183 fatal ("gdbarch: gdbarch_num_regs invalid");
1184 if (gdbarch_debug
>= 2)
1185 /* FIXME: gdb_std??? */
1186 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1187 return gdbarch
->num_regs
;
1191 set_gdbarch_num_regs (gdbarch
, num_regs
)
1192 struct gdbarch
*gdbarch
;
1195 gdbarch
->num_regs
= num_regs
;
1199 gdbarch_sp_regnum (gdbarch
)
1200 struct gdbarch
*gdbarch
;
1202 if (gdbarch
->sp_regnum
== -1)
1203 fatal ("gdbarch: gdbarch_sp_regnum invalid");
1204 if (gdbarch_debug
>= 2)
1205 /* FIXME: gdb_std??? */
1206 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1207 return gdbarch
->sp_regnum
;
1211 set_gdbarch_sp_regnum (gdbarch
, sp_regnum
)
1212 struct gdbarch
*gdbarch
;
1215 gdbarch
->sp_regnum
= sp_regnum
;
1219 gdbarch_fp_regnum (gdbarch
)
1220 struct gdbarch
*gdbarch
;
1222 if (gdbarch
->fp_regnum
== -1)
1223 fatal ("gdbarch: gdbarch_fp_regnum invalid");
1224 if (gdbarch_debug
>= 2)
1225 /* FIXME: gdb_std??? */
1226 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp_regnum called\n");
1227 return gdbarch
->fp_regnum
;
1231 set_gdbarch_fp_regnum (gdbarch
, fp_regnum
)
1232 struct gdbarch
*gdbarch
;
1235 gdbarch
->fp_regnum
= fp_regnum
;
1239 gdbarch_pc_regnum (gdbarch
)
1240 struct gdbarch
*gdbarch
;
1242 if (gdbarch
->pc_regnum
== -1)
1243 fatal ("gdbarch: gdbarch_pc_regnum invalid");
1244 if (gdbarch_debug
>= 2)
1245 /* FIXME: gdb_std??? */
1246 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1247 return gdbarch
->pc_regnum
;
1251 set_gdbarch_pc_regnum (gdbarch
, pc_regnum
)
1252 struct gdbarch
*gdbarch
;
1255 gdbarch
->pc_regnum
= pc_regnum
;
1259 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1261 if (gdbarch
->register_name
== 0)
1262 fatal ("gdbarch: gdbarch_register_name invalid");
1263 if (gdbarch_debug
>= 2)
1264 /* FIXME: gdb_std??? */
1265 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1266 return gdbarch
->register_name (regnr
);
1270 set_gdbarch_register_name (gdbarch
, register_name
)
1271 struct gdbarch
*gdbarch
;
1272 gdbarch_register_name_ftype register_name
;
1274 gdbarch
->register_name
= register_name
;
1278 gdbarch_register_size (gdbarch
)
1279 struct gdbarch
*gdbarch
;
1281 if (gdbarch
->register_size
== -1)
1282 fatal ("gdbarch: gdbarch_register_size invalid");
1283 if (gdbarch_debug
>= 2)
1284 /* FIXME: gdb_std??? */
1285 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_size called\n");
1286 return gdbarch
->register_size
;
1290 set_gdbarch_register_size (gdbarch
, register_size
)
1291 struct gdbarch
*gdbarch
;
1294 gdbarch
->register_size
= register_size
;
1298 gdbarch_register_bytes (gdbarch
)
1299 struct gdbarch
*gdbarch
;
1301 if (gdbarch
->register_bytes
== -1)
1302 fatal ("gdbarch: gdbarch_register_bytes invalid");
1303 if (gdbarch_debug
>= 2)
1304 /* FIXME: gdb_std??? */
1305 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes called\n");
1306 return gdbarch
->register_bytes
;
1310 set_gdbarch_register_bytes (gdbarch
, register_bytes
)
1311 struct gdbarch
*gdbarch
;
1314 gdbarch
->register_bytes
= register_bytes
;
1318 gdbarch_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
1320 if (gdbarch
->register_byte
== 0)
1321 fatal ("gdbarch: gdbarch_register_byte invalid");
1322 if (gdbarch_debug
>= 2)
1323 /* FIXME: gdb_std??? */
1324 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_byte called\n");
1325 return gdbarch
->register_byte (reg_nr
);
1329 set_gdbarch_register_byte (gdbarch
, register_byte
)
1330 struct gdbarch
*gdbarch
;
1331 gdbarch_register_byte_ftype register_byte
;
1333 gdbarch
->register_byte
= register_byte
;
1337 gdbarch_register_raw_size (struct gdbarch
*gdbarch
, int reg_nr
)
1339 if (gdbarch
->register_raw_size
== 0)
1340 fatal ("gdbarch: gdbarch_register_raw_size invalid");
1341 if (gdbarch_debug
>= 2)
1342 /* FIXME: gdb_std??? */
1343 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_raw_size called\n");
1344 return gdbarch
->register_raw_size (reg_nr
);
1348 set_gdbarch_register_raw_size (gdbarch
, register_raw_size
)
1349 struct gdbarch
*gdbarch
;
1350 gdbarch_register_raw_size_ftype register_raw_size
;
1352 gdbarch
->register_raw_size
= register_raw_size
;
1356 gdbarch_max_register_raw_size (gdbarch
)
1357 struct gdbarch
*gdbarch
;
1359 if (gdbarch
->max_register_raw_size
== -1)
1360 fatal ("gdbarch: gdbarch_max_register_raw_size invalid");
1361 if (gdbarch_debug
>= 2)
1362 /* FIXME: gdb_std??? */
1363 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_raw_size called\n");
1364 return gdbarch
->max_register_raw_size
;
1368 set_gdbarch_max_register_raw_size (gdbarch
, max_register_raw_size
)
1369 struct gdbarch
*gdbarch
;
1370 int max_register_raw_size
;
1372 gdbarch
->max_register_raw_size
= max_register_raw_size
;
1376 gdbarch_register_virtual_size (struct gdbarch
*gdbarch
, int reg_nr
)
1378 if (gdbarch
->register_virtual_size
== 0)
1379 fatal ("gdbarch: gdbarch_register_virtual_size invalid");
1380 if (gdbarch_debug
>= 2)
1381 /* FIXME: gdb_std??? */
1382 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_size called\n");
1383 return gdbarch
->register_virtual_size (reg_nr
);
1387 set_gdbarch_register_virtual_size (gdbarch
, register_virtual_size
)
1388 struct gdbarch
*gdbarch
;
1389 gdbarch_register_virtual_size_ftype register_virtual_size
;
1391 gdbarch
->register_virtual_size
= register_virtual_size
;
1395 gdbarch_max_register_virtual_size (gdbarch
)
1396 struct gdbarch
*gdbarch
;
1398 if (gdbarch
->max_register_virtual_size
== -1)
1399 fatal ("gdbarch: gdbarch_max_register_virtual_size invalid");
1400 if (gdbarch_debug
>= 2)
1401 /* FIXME: gdb_std??? */
1402 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_register_virtual_size called\n");
1403 return gdbarch
->max_register_virtual_size
;
1407 set_gdbarch_max_register_virtual_size (gdbarch
, max_register_virtual_size
)
1408 struct gdbarch
*gdbarch
;
1409 int max_register_virtual_size
;
1411 gdbarch
->max_register_virtual_size
= max_register_virtual_size
;
1415 gdbarch_register_virtual_type (struct gdbarch
*gdbarch
, int reg_nr
)
1417 if (gdbarch
->register_virtual_type
== 0)
1418 fatal ("gdbarch: gdbarch_register_virtual_type invalid");
1419 if (gdbarch_debug
>= 2)
1420 /* FIXME: gdb_std??? */
1421 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_virtual_type called\n");
1422 return gdbarch
->register_virtual_type (reg_nr
);
1426 set_gdbarch_register_virtual_type (gdbarch
, register_virtual_type
)
1427 struct gdbarch
*gdbarch
;
1428 gdbarch_register_virtual_type_ftype register_virtual_type
;
1430 gdbarch
->register_virtual_type
= register_virtual_type
;
1434 gdbarch_use_generic_dummy_frames (gdbarch
)
1435 struct gdbarch
*gdbarch
;
1437 if (gdbarch
->use_generic_dummy_frames
== -1)
1438 fatal ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1439 if (gdbarch_debug
>= 2)
1440 /* FIXME: gdb_std??? */
1441 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_generic_dummy_frames called\n");
1442 return gdbarch
->use_generic_dummy_frames
;
1446 set_gdbarch_use_generic_dummy_frames (gdbarch
, use_generic_dummy_frames
)
1447 struct gdbarch
*gdbarch
;
1448 int use_generic_dummy_frames
;
1450 gdbarch
->use_generic_dummy_frames
= use_generic_dummy_frames
;
1454 gdbarch_call_dummy_location (gdbarch
)
1455 struct gdbarch
*gdbarch
;
1457 if (gdbarch
->call_dummy_location
== 0)
1458 fatal ("gdbarch: gdbarch_call_dummy_location invalid");
1459 if (gdbarch_debug
>= 2)
1460 /* FIXME: gdb_std??? */
1461 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1462 return gdbarch
->call_dummy_location
;
1466 set_gdbarch_call_dummy_location (gdbarch
, call_dummy_location
)
1467 struct gdbarch
*gdbarch
;
1468 int call_dummy_location
;
1470 gdbarch
->call_dummy_location
= call_dummy_location
;
1474 gdbarch_call_dummy_address (struct gdbarch
*gdbarch
)
1476 if (gdbarch
->call_dummy_address
== 0)
1477 fatal ("gdbarch: gdbarch_call_dummy_address invalid");
1478 if (gdbarch_debug
>= 2)
1479 /* FIXME: gdb_std??? */
1480 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_address called\n");
1481 return gdbarch
->call_dummy_address ();
1485 set_gdbarch_call_dummy_address (gdbarch
, call_dummy_address
)
1486 struct gdbarch
*gdbarch
;
1487 gdbarch_call_dummy_address_ftype call_dummy_address
;
1489 gdbarch
->call_dummy_address
= call_dummy_address
;
1493 gdbarch_call_dummy_start_offset (gdbarch
)
1494 struct gdbarch
*gdbarch
;
1496 if (gdbarch
->call_dummy_start_offset
== -1)
1497 fatal ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1498 if (gdbarch_debug
>= 2)
1499 /* FIXME: gdb_std??? */
1500 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_start_offset called\n");
1501 return gdbarch
->call_dummy_start_offset
;
1505 set_gdbarch_call_dummy_start_offset (gdbarch
, call_dummy_start_offset
)
1506 struct gdbarch
*gdbarch
;
1507 CORE_ADDR call_dummy_start_offset
;
1509 gdbarch
->call_dummy_start_offset
= call_dummy_start_offset
;
1513 gdbarch_call_dummy_breakpoint_offset (gdbarch
)
1514 struct gdbarch
*gdbarch
;
1516 if (gdbarch
->call_dummy_breakpoint_offset
== -1)
1517 fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1518 if (gdbarch_debug
>= 2)
1519 /* FIXME: gdb_std??? */
1520 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset called\n");
1521 return gdbarch
->call_dummy_breakpoint_offset
;
1525 set_gdbarch_call_dummy_breakpoint_offset (gdbarch
, call_dummy_breakpoint_offset
)
1526 struct gdbarch
*gdbarch
;
1527 CORE_ADDR call_dummy_breakpoint_offset
;
1529 gdbarch
->call_dummy_breakpoint_offset
= call_dummy_breakpoint_offset
;
1533 gdbarch_call_dummy_breakpoint_offset_p (gdbarch
)
1534 struct gdbarch
*gdbarch
;
1536 if (gdbarch
->call_dummy_breakpoint_offset_p
== -1)
1537 fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1538 if (gdbarch_debug
>= 2)
1539 /* FIXME: gdb_std??? */
1540 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1541 return gdbarch
->call_dummy_breakpoint_offset_p
;
1545 set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch
, call_dummy_breakpoint_offset_p
)
1546 struct gdbarch
*gdbarch
;
1547 int call_dummy_breakpoint_offset_p
;
1549 gdbarch
->call_dummy_breakpoint_offset_p
= call_dummy_breakpoint_offset_p
;
1553 gdbarch_call_dummy_length (gdbarch
)
1554 struct gdbarch
*gdbarch
;
1556 if (gdbarch
->call_dummy_length
== -1)
1557 fatal ("gdbarch: gdbarch_call_dummy_length invalid");
1558 if (gdbarch_debug
>= 2)
1559 /* FIXME: gdb_std??? */
1560 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_length called\n");
1561 return gdbarch
->call_dummy_length
;
1565 set_gdbarch_call_dummy_length (gdbarch
, call_dummy_length
)
1566 struct gdbarch
*gdbarch
;
1567 int call_dummy_length
;
1569 gdbarch
->call_dummy_length
= call_dummy_length
;
1573 gdbarch_pc_in_call_dummy (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
, CORE_ADDR frame_address
)
1575 if (gdbarch
->pc_in_call_dummy
== 0)
1576 fatal ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1577 if (gdbarch_debug
>= 2)
1578 /* FIXME: gdb_std??? */
1579 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_in_call_dummy called\n");
1580 return gdbarch
->pc_in_call_dummy (pc
, sp
, frame_address
);
1584 set_gdbarch_pc_in_call_dummy (gdbarch
, pc_in_call_dummy
)
1585 struct gdbarch
*gdbarch
;
1586 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy
;
1588 gdbarch
->pc_in_call_dummy
= pc_in_call_dummy
;
1592 gdbarch_call_dummy_p (gdbarch
)
1593 struct gdbarch
*gdbarch
;
1595 if (gdbarch
->call_dummy_p
== -1)
1596 fatal ("gdbarch: gdbarch_call_dummy_p invalid");
1597 if (gdbarch_debug
>= 2)
1598 /* FIXME: gdb_std??? */
1599 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_p called\n");
1600 return gdbarch
->call_dummy_p
;
1604 set_gdbarch_call_dummy_p (gdbarch
, call_dummy_p
)
1605 struct gdbarch
*gdbarch
;
1608 gdbarch
->call_dummy_p
= call_dummy_p
;
1612 gdbarch_call_dummy_words (gdbarch
)
1613 struct gdbarch
*gdbarch
;
1615 if (gdbarch_debug
>= 2)
1616 /* FIXME: gdb_std??? */
1617 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_words called\n");
1618 return gdbarch
->call_dummy_words
;
1622 set_gdbarch_call_dummy_words (gdbarch
, call_dummy_words
)
1623 struct gdbarch
*gdbarch
;
1624 LONGEST
* call_dummy_words
;
1626 gdbarch
->call_dummy_words
= call_dummy_words
;
1630 gdbarch_sizeof_call_dummy_words (gdbarch
)
1631 struct gdbarch
*gdbarch
;
1633 if (gdbarch_debug
>= 2)
1634 /* FIXME: gdb_std??? */
1635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sizeof_call_dummy_words called\n");
1636 return gdbarch
->sizeof_call_dummy_words
;
1640 set_gdbarch_sizeof_call_dummy_words (gdbarch
, sizeof_call_dummy_words
)
1641 struct gdbarch
*gdbarch
;
1642 int sizeof_call_dummy_words
;
1644 gdbarch
->sizeof_call_dummy_words
= sizeof_call_dummy_words
;
1648 gdbarch_call_dummy_stack_adjust_p (gdbarch
)
1649 struct gdbarch
*gdbarch
;
1651 if (gdbarch
->call_dummy_stack_adjust_p
== -1)
1652 fatal ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1653 if (gdbarch_debug
>= 2)
1654 /* FIXME: gdb_std??? */
1655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust_p called\n");
1656 return gdbarch
->call_dummy_stack_adjust_p
;
1660 set_gdbarch_call_dummy_stack_adjust_p (gdbarch
, call_dummy_stack_adjust_p
)
1661 struct gdbarch
*gdbarch
;
1662 int call_dummy_stack_adjust_p
;
1664 gdbarch
->call_dummy_stack_adjust_p
= call_dummy_stack_adjust_p
;
1668 gdbarch_call_dummy_stack_adjust (gdbarch
)
1669 struct gdbarch
*gdbarch
;
1671 if (gdbarch
->call_dummy_stack_adjust_p
&& gdbarch
->call_dummy_stack_adjust
== 0)
1672 fatal ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1673 if (gdbarch_debug
>= 2)
1674 /* FIXME: gdb_std??? */
1675 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_stack_adjust called\n");
1676 return gdbarch
->call_dummy_stack_adjust
;
1680 set_gdbarch_call_dummy_stack_adjust (gdbarch
, call_dummy_stack_adjust
)
1681 struct gdbarch
*gdbarch
;
1682 int call_dummy_stack_adjust
;
1684 gdbarch
->call_dummy_stack_adjust
= call_dummy_stack_adjust
;
1688 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
)
1690 if (gdbarch
->fix_call_dummy
== 0)
1691 fatal ("gdbarch: gdbarch_fix_call_dummy invalid");
1692 if (gdbarch_debug
>= 2)
1693 /* FIXME: gdb_std??? */
1694 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fix_call_dummy called\n");
1695 gdbarch
->fix_call_dummy (dummy
, pc
, fun
, nargs
, args
, type
, gcc_p
);
1699 set_gdbarch_fix_call_dummy (gdbarch
, fix_call_dummy
)
1700 struct gdbarch
*gdbarch
;
1701 gdbarch_fix_call_dummy_ftype fix_call_dummy
;
1703 gdbarch
->fix_call_dummy
= fix_call_dummy
;
1707 gdbarch_believe_pcc_promotion (gdbarch
)
1708 struct gdbarch
*gdbarch
;
1710 if (gdbarch_debug
>= 2)
1711 /* FIXME: gdb_std??? */
1712 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1713 return gdbarch
->believe_pcc_promotion
;
1717 set_gdbarch_believe_pcc_promotion (gdbarch
, believe_pcc_promotion
)
1718 struct gdbarch
*gdbarch
;
1719 int believe_pcc_promotion
;
1721 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1725 gdbarch_believe_pcc_promotion_type (gdbarch
)
1726 struct gdbarch
*gdbarch
;
1728 if (gdbarch_debug
>= 2)
1729 /* FIXME: gdb_std??? */
1730 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion_type called\n");
1731 return gdbarch
->believe_pcc_promotion_type
;
1735 set_gdbarch_believe_pcc_promotion_type (gdbarch
, believe_pcc_promotion_type
)
1736 struct gdbarch
*gdbarch
;
1737 int believe_pcc_promotion_type
;
1739 gdbarch
->believe_pcc_promotion_type
= believe_pcc_promotion_type
;
1743 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
)
1745 if (gdbarch
->get_saved_register
== 0)
1746 fatal ("gdbarch: gdbarch_get_saved_register invalid");
1747 if (gdbarch_debug
>= 2)
1748 /* FIXME: gdb_std??? */
1749 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_saved_register called\n");
1750 gdbarch
->get_saved_register (raw_buffer
, optimized
, addrp
, frame
, regnum
, lval
);
1754 set_gdbarch_get_saved_register (gdbarch
, get_saved_register
)
1755 struct gdbarch
*gdbarch
;
1756 gdbarch_get_saved_register_ftype get_saved_register
;
1758 gdbarch
->get_saved_register
= get_saved_register
;
1762 gdbarch_register_convertible (struct gdbarch
*gdbarch
, int nr
)
1764 if (gdbarch
->register_convertible
== 0)
1765 fatal ("gdbarch: gdbarch_register_convertible invalid");
1766 if (gdbarch_debug
>= 2)
1767 /* FIXME: gdb_std??? */
1768 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convertible called\n");
1769 return gdbarch
->register_convertible (nr
);
1773 set_gdbarch_register_convertible (gdbarch
, register_convertible
)
1774 struct gdbarch
*gdbarch
;
1775 gdbarch_register_convertible_ftype register_convertible
;
1777 gdbarch
->register_convertible
= register_convertible
;
1781 gdbarch_register_convert_to_virtual (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
, char *from
, char *to
)
1783 if (gdbarch
->register_convert_to_virtual
== 0)
1784 fatal ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1785 if (gdbarch_debug
>= 2)
1786 /* FIXME: gdb_std??? */
1787 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_virtual called\n");
1788 gdbarch
->register_convert_to_virtual (regnum
, type
, from
, to
);
1792 set_gdbarch_register_convert_to_virtual (gdbarch
, register_convert_to_virtual
)
1793 struct gdbarch
*gdbarch
;
1794 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual
;
1796 gdbarch
->register_convert_to_virtual
= register_convert_to_virtual
;
1800 gdbarch_register_convert_to_raw (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, char *from
, char *to
)
1802 if (gdbarch
->register_convert_to_raw
== 0)
1803 fatal ("gdbarch: gdbarch_register_convert_to_raw invalid");
1804 if (gdbarch_debug
>= 2)
1805 /* FIXME: gdb_std??? */
1806 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_convert_to_raw called\n");
1807 gdbarch
->register_convert_to_raw (type
, regnum
, from
, to
);
1811 set_gdbarch_register_convert_to_raw (gdbarch
, register_convert_to_raw
)
1812 struct gdbarch
*gdbarch
;
1813 gdbarch_register_convert_to_raw_ftype register_convert_to_raw
;
1815 gdbarch
->register_convert_to_raw
= register_convert_to_raw
;
1819 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
1821 if (gdbarch
->extract_return_value
== 0)
1822 fatal ("gdbarch: gdbarch_extract_return_value invalid");
1823 if (gdbarch_debug
>= 2)
1824 /* FIXME: gdb_std??? */
1825 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
1826 gdbarch
->extract_return_value (type
, regbuf
, valbuf
);
1830 set_gdbarch_extract_return_value (gdbarch
, extract_return_value
)
1831 struct gdbarch
*gdbarch
;
1832 gdbarch_extract_return_value_ftype extract_return_value
;
1834 gdbarch
->extract_return_value
= extract_return_value
;
1838 gdbarch_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1840 if (gdbarch
->push_arguments
== 0)
1841 fatal ("gdbarch: gdbarch_push_arguments invalid");
1842 if (gdbarch_debug
>= 2)
1843 /* FIXME: gdb_std??? */
1844 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_arguments called\n");
1845 return gdbarch
->push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
1849 set_gdbarch_push_arguments (gdbarch
, push_arguments
)
1850 struct gdbarch
*gdbarch
;
1851 gdbarch_push_arguments_ftype push_arguments
;
1853 gdbarch
->push_arguments
= push_arguments
;
1857 gdbarch_push_dummy_frame (struct gdbarch
*gdbarch
)
1859 if (gdbarch
->push_dummy_frame
== 0)
1860 fatal ("gdbarch: gdbarch_push_dummy_frame invalid");
1861 if (gdbarch_debug
>= 2)
1862 /* FIXME: gdb_std??? */
1863 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_frame called\n");
1864 gdbarch
->push_dummy_frame ();
1868 set_gdbarch_push_dummy_frame (gdbarch
, push_dummy_frame
)
1869 struct gdbarch
*gdbarch
;
1870 gdbarch_push_dummy_frame_ftype push_dummy_frame
;
1872 gdbarch
->push_dummy_frame
= push_dummy_frame
;
1876 gdbarch_push_return_address (struct gdbarch
*gdbarch
, CORE_ADDR pc
, CORE_ADDR sp
)
1878 if (gdbarch
->push_return_address
== 0)
1879 fatal ("gdbarch: gdbarch_push_return_address invalid");
1880 if (gdbarch_debug
>= 2)
1881 /* FIXME: gdb_std??? */
1882 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_return_address called\n");
1883 return gdbarch
->push_return_address (pc
, sp
);
1887 set_gdbarch_push_return_address (gdbarch
, push_return_address
)
1888 struct gdbarch
*gdbarch
;
1889 gdbarch_push_return_address_ftype push_return_address
;
1891 gdbarch
->push_return_address
= push_return_address
;
1895 gdbarch_pop_frame (struct gdbarch
*gdbarch
)
1897 if (gdbarch
->pop_frame
== 0)
1898 fatal ("gdbarch: gdbarch_pop_frame invalid");
1899 if (gdbarch_debug
>= 2)
1900 /* FIXME: gdb_std??? */
1901 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pop_frame called\n");
1902 gdbarch
->pop_frame ();
1906 set_gdbarch_pop_frame (gdbarch
, pop_frame
)
1907 struct gdbarch
*gdbarch
;
1908 gdbarch_pop_frame_ftype pop_frame
;
1910 gdbarch
->pop_frame
= pop_frame
;
1914 gdbarch_d10v_make_daddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1916 if (gdbarch
->d10v_make_daddr
== 0)
1917 fatal ("gdbarch: gdbarch_d10v_make_daddr invalid");
1918 if (gdbarch_debug
>= 2)
1919 /* FIXME: gdb_std??? */
1920 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_daddr called\n");
1921 return gdbarch
->d10v_make_daddr (x
);
1925 set_gdbarch_d10v_make_daddr (gdbarch
, d10v_make_daddr
)
1926 struct gdbarch
*gdbarch
;
1927 gdbarch_d10v_make_daddr_ftype d10v_make_daddr
;
1929 gdbarch
->d10v_make_daddr
= d10v_make_daddr
;
1933 gdbarch_d10v_make_iaddr (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1935 if (gdbarch
->d10v_make_iaddr
== 0)
1936 fatal ("gdbarch: gdbarch_d10v_make_iaddr invalid");
1937 if (gdbarch_debug
>= 2)
1938 /* FIXME: gdb_std??? */
1939 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_make_iaddr called\n");
1940 return gdbarch
->d10v_make_iaddr (x
);
1944 set_gdbarch_d10v_make_iaddr (gdbarch
, d10v_make_iaddr
)
1945 struct gdbarch
*gdbarch
;
1946 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr
;
1948 gdbarch
->d10v_make_iaddr
= d10v_make_iaddr
;
1952 gdbarch_d10v_daddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1954 if (gdbarch
->d10v_daddr_p
== 0)
1955 fatal ("gdbarch: gdbarch_d10v_daddr_p invalid");
1956 if (gdbarch_debug
>= 2)
1957 /* FIXME: gdb_std??? */
1958 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_daddr_p called\n");
1959 return gdbarch
->d10v_daddr_p (x
);
1963 set_gdbarch_d10v_daddr_p (gdbarch
, d10v_daddr_p
)
1964 struct gdbarch
*gdbarch
;
1965 gdbarch_d10v_daddr_p_ftype d10v_daddr_p
;
1967 gdbarch
->d10v_daddr_p
= d10v_daddr_p
;
1971 gdbarch_d10v_iaddr_p (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1973 if (gdbarch
->d10v_iaddr_p
== 0)
1974 fatal ("gdbarch: gdbarch_d10v_iaddr_p invalid");
1975 if (gdbarch_debug
>= 2)
1976 /* FIXME: gdb_std??? */
1977 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_iaddr_p called\n");
1978 return gdbarch
->d10v_iaddr_p (x
);
1982 set_gdbarch_d10v_iaddr_p (gdbarch
, d10v_iaddr_p
)
1983 struct gdbarch
*gdbarch
;
1984 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p
;
1986 gdbarch
->d10v_iaddr_p
= d10v_iaddr_p
;
1990 gdbarch_d10v_convert_daddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
1992 if (gdbarch
->d10v_convert_daddr_to_raw
== 0)
1993 fatal ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
1994 if (gdbarch_debug
>= 2)
1995 /* FIXME: gdb_std??? */
1996 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_daddr_to_raw called\n");
1997 return gdbarch
->d10v_convert_daddr_to_raw (x
);
2001 set_gdbarch_d10v_convert_daddr_to_raw (gdbarch
, d10v_convert_daddr_to_raw
)
2002 struct gdbarch
*gdbarch
;
2003 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw
;
2005 gdbarch
->d10v_convert_daddr_to_raw
= d10v_convert_daddr_to_raw
;
2009 gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch
*gdbarch
, CORE_ADDR x
)
2011 if (gdbarch
->d10v_convert_iaddr_to_raw
== 0)
2012 fatal ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2013 if (gdbarch_debug
>= 2)
2014 /* FIXME: gdb_std??? */
2015 fprintf_unfiltered (gdb_stdlog
, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2016 return gdbarch
->d10v_convert_iaddr_to_raw (x
);
2020 set_gdbarch_d10v_convert_iaddr_to_raw (gdbarch
, d10v_convert_iaddr_to_raw
)
2021 struct gdbarch
*gdbarch
;
2022 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw
;
2024 gdbarch
->d10v_convert_iaddr_to_raw
= d10v_convert_iaddr_to_raw
;
2028 gdbarch_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2030 if (gdbarch
->store_struct_return
== 0)
2031 fatal ("gdbarch: gdbarch_store_struct_return invalid");
2032 if (gdbarch_debug
>= 2)
2033 /* FIXME: gdb_std??? */
2034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_struct_return called\n");
2035 gdbarch
->store_struct_return (addr
, sp
);
2039 set_gdbarch_store_struct_return (gdbarch
, store_struct_return
)
2040 struct gdbarch
*gdbarch
;
2041 gdbarch_store_struct_return_ftype store_struct_return
;
2043 gdbarch
->store_struct_return
= store_struct_return
;
2047 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2049 if (gdbarch
->store_return_value
== 0)
2050 fatal ("gdbarch: gdbarch_store_return_value invalid");
2051 if (gdbarch_debug
>= 2)
2052 /* FIXME: gdb_std??? */
2053 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2054 gdbarch
->store_return_value (type
, valbuf
);
2058 set_gdbarch_store_return_value (gdbarch
, store_return_value
)
2059 struct gdbarch
*gdbarch
;
2060 gdbarch_store_return_value_ftype store_return_value
;
2062 gdbarch
->store_return_value
= store_return_value
;
2066 gdbarch_extract_struct_value_address (struct gdbarch
*gdbarch
, char *regbuf
)
2068 if (gdbarch
->extract_struct_value_address
== 0)
2069 fatal ("gdbarch: gdbarch_extract_struct_value_address invalid");
2070 if (gdbarch_debug
>= 2)
2071 /* FIXME: gdb_std??? */
2072 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_struct_value_address called\n");
2073 return gdbarch
->extract_struct_value_address (regbuf
);
2077 set_gdbarch_extract_struct_value_address (gdbarch
, extract_struct_value_address
)
2078 struct gdbarch
*gdbarch
;
2079 gdbarch_extract_struct_value_address_ftype extract_struct_value_address
;
2081 gdbarch
->extract_struct_value_address
= extract_struct_value_address
;
2085 gdbarch_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2087 if (gdbarch
->use_struct_convention
== 0)
2088 fatal ("gdbarch: gdbarch_use_struct_convention invalid");
2089 if (gdbarch_debug
>= 2)
2090 /* FIXME: gdb_std??? */
2091 fprintf_unfiltered (gdb_stdlog
, "gdbarch_use_struct_convention called\n");
2092 return gdbarch
->use_struct_convention (gcc_p
, value_type
);
2096 set_gdbarch_use_struct_convention (gdbarch
, use_struct_convention
)
2097 struct gdbarch
*gdbarch
;
2098 gdbarch_use_struct_convention_ftype use_struct_convention
;
2100 gdbarch
->use_struct_convention
= use_struct_convention
;
2104 gdbarch_frame_init_saved_regs (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2106 if (gdbarch
->frame_init_saved_regs
== 0)
2107 fatal ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2108 if (gdbarch_debug
>= 2)
2109 /* FIXME: gdb_std??? */
2110 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_init_saved_regs called\n");
2111 gdbarch
->frame_init_saved_regs (frame
);
2115 set_gdbarch_frame_init_saved_regs (gdbarch
, frame_init_saved_regs
)
2116 struct gdbarch
*gdbarch
;
2117 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs
;
2119 gdbarch
->frame_init_saved_regs
= frame_init_saved_regs
;
2123 gdbarch_init_extra_frame_info (struct gdbarch
*gdbarch
, int fromleaf
, struct frame_info
*frame
)
2125 if (gdbarch
->init_extra_frame_info
== 0)
2126 fatal ("gdbarch: gdbarch_init_extra_frame_info invalid");
2127 if (gdbarch_debug
>= 2)
2128 /* FIXME: gdb_std??? */
2129 fprintf_unfiltered (gdb_stdlog
, "gdbarch_init_extra_frame_info called\n");
2130 gdbarch
->init_extra_frame_info (fromleaf
, frame
);
2134 set_gdbarch_init_extra_frame_info (gdbarch
, init_extra_frame_info
)
2135 struct gdbarch
*gdbarch
;
2136 gdbarch_init_extra_frame_info_ftype init_extra_frame_info
;
2138 gdbarch
->init_extra_frame_info
= init_extra_frame_info
;
2142 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2144 if (gdbarch
->skip_prologue
== 0)
2145 fatal ("gdbarch: gdbarch_skip_prologue invalid");
2146 if (gdbarch_debug
>= 2)
2147 /* FIXME: gdb_std??? */
2148 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2149 return gdbarch
->skip_prologue (ip
);
2153 set_gdbarch_skip_prologue (gdbarch
, skip_prologue
)
2154 struct gdbarch
*gdbarch
;
2155 gdbarch_skip_prologue_ftype skip_prologue
;
2157 gdbarch
->skip_prologue
= skip_prologue
;
2161 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2163 if (gdbarch
->inner_than
== 0)
2164 fatal ("gdbarch: gdbarch_inner_than invalid");
2165 if (gdbarch_debug
>= 2)
2166 /* FIXME: gdb_std??? */
2167 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2168 return gdbarch
->inner_than (lhs
, rhs
);
2172 set_gdbarch_inner_than (gdbarch
, inner_than
)
2173 struct gdbarch
*gdbarch
;
2174 gdbarch_inner_than_ftype inner_than
;
2176 gdbarch
->inner_than
= inner_than
;
2180 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2182 if (gdbarch
->breakpoint_from_pc
== 0)
2183 fatal ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2184 if (gdbarch_debug
>= 2)
2185 /* FIXME: gdb_std??? */
2186 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2187 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2191 set_gdbarch_breakpoint_from_pc (gdbarch
, breakpoint_from_pc
)
2192 struct gdbarch
*gdbarch
;
2193 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
;
2195 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2199 gdbarch_decr_pc_after_break (gdbarch
)
2200 struct gdbarch
*gdbarch
;
2202 if (gdbarch
->decr_pc_after_break
== -1)
2203 fatal ("gdbarch: gdbarch_decr_pc_after_break invalid");
2204 if (gdbarch_debug
>= 2)
2205 /* FIXME: gdb_std??? */
2206 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2207 return gdbarch
->decr_pc_after_break
;
2211 set_gdbarch_decr_pc_after_break (gdbarch
, decr_pc_after_break
)
2212 struct gdbarch
*gdbarch
;
2213 CORE_ADDR decr_pc_after_break
;
2215 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2219 gdbarch_function_start_offset (gdbarch
)
2220 struct gdbarch
*gdbarch
;
2222 if (gdbarch
->function_start_offset
== -1)
2223 fatal ("gdbarch: gdbarch_function_start_offset invalid");
2224 if (gdbarch_debug
>= 2)
2225 /* FIXME: gdb_std??? */
2226 fprintf_unfiltered (gdb_stdlog
, "gdbarch_function_start_offset called\n");
2227 return gdbarch
->function_start_offset
;
2231 set_gdbarch_function_start_offset (gdbarch
, function_start_offset
)
2232 struct gdbarch
*gdbarch
;
2233 CORE_ADDR function_start_offset
;
2235 gdbarch
->function_start_offset
= function_start_offset
;
2239 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2241 if (gdbarch
->remote_translate_xfer_address
== 0)
2242 fatal ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2243 if (gdbarch_debug
>= 2)
2244 /* FIXME: gdb_std??? */
2245 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2246 gdbarch
->remote_translate_xfer_address (gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2250 set_gdbarch_remote_translate_xfer_address (gdbarch
, remote_translate_xfer_address
)
2251 struct gdbarch
*gdbarch
;
2252 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
;
2254 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2258 gdbarch_frame_args_skip (gdbarch
)
2259 struct gdbarch
*gdbarch
;
2261 if (gdbarch
->frame_args_skip
== -1)
2262 fatal ("gdbarch: gdbarch_frame_args_skip invalid");
2263 if (gdbarch_debug
>= 2)
2264 /* FIXME: gdb_std??? */
2265 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2266 return gdbarch
->frame_args_skip
;
2270 set_gdbarch_frame_args_skip (gdbarch
, frame_args_skip
)
2271 struct gdbarch
*gdbarch
;
2272 CORE_ADDR frame_args_skip
;
2274 gdbarch
->frame_args_skip
= frame_args_skip
;
2278 gdbarch_frameless_function_invocation (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2280 if (gdbarch
->frameless_function_invocation
== 0)
2281 fatal ("gdbarch: gdbarch_frameless_function_invocation invalid");
2282 if (gdbarch_debug
>= 2)
2283 /* FIXME: gdb_std??? */
2284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frameless_function_invocation called\n");
2285 return gdbarch
->frameless_function_invocation (fi
);
2289 set_gdbarch_frameless_function_invocation (gdbarch
, frameless_function_invocation
)
2290 struct gdbarch
*gdbarch
;
2291 gdbarch_frameless_function_invocation_ftype frameless_function_invocation
;
2293 gdbarch
->frameless_function_invocation
= frameless_function_invocation
;
2297 gdbarch_frame_chain (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2299 if (gdbarch
->frame_chain
== 0)
2300 fatal ("gdbarch: gdbarch_frame_chain invalid");
2301 if (gdbarch_debug
>= 2)
2302 /* FIXME: gdb_std??? */
2303 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain called\n");
2304 return gdbarch
->frame_chain (frame
);
2308 set_gdbarch_frame_chain (gdbarch
, frame_chain
)
2309 struct gdbarch
*gdbarch
;
2310 gdbarch_frame_chain_ftype frame_chain
;
2312 gdbarch
->frame_chain
= frame_chain
;
2316 gdbarch_frame_chain_valid (struct gdbarch
*gdbarch
, CORE_ADDR chain
, struct frame_info
*thisframe
)
2318 if (gdbarch
->frame_chain_valid
== 0)
2319 fatal ("gdbarch: gdbarch_frame_chain_valid invalid");
2320 if (gdbarch_debug
>= 2)
2321 /* FIXME: gdb_std??? */
2322 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_chain_valid called\n");
2323 return gdbarch
->frame_chain_valid (chain
, thisframe
);
2327 set_gdbarch_frame_chain_valid (gdbarch
, frame_chain_valid
)
2328 struct gdbarch
*gdbarch
;
2329 gdbarch_frame_chain_valid_ftype frame_chain_valid
;
2331 gdbarch
->frame_chain_valid
= frame_chain_valid
;
2335 gdbarch_frame_saved_pc (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2337 if (gdbarch
->frame_saved_pc
== 0)
2338 fatal ("gdbarch: gdbarch_frame_saved_pc invalid");
2339 if (gdbarch_debug
>= 2)
2340 /* FIXME: gdb_std??? */
2341 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_saved_pc called\n");
2342 return gdbarch
->frame_saved_pc (fi
);
2346 set_gdbarch_frame_saved_pc (gdbarch
, frame_saved_pc
)
2347 struct gdbarch
*gdbarch
;
2348 gdbarch_frame_saved_pc_ftype frame_saved_pc
;
2350 gdbarch
->frame_saved_pc
= frame_saved_pc
;
2354 gdbarch_frame_args_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2356 if (gdbarch
->frame_args_address
== 0)
2357 fatal ("gdbarch: gdbarch_frame_args_address invalid");
2358 if (gdbarch_debug
>= 2)
2359 /* FIXME: gdb_std??? */
2360 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_address called\n");
2361 return gdbarch
->frame_args_address (fi
);
2365 set_gdbarch_frame_args_address (gdbarch
, frame_args_address
)
2366 struct gdbarch
*gdbarch
;
2367 gdbarch_frame_args_address_ftype frame_args_address
;
2369 gdbarch
->frame_args_address
= frame_args_address
;
2373 gdbarch_frame_locals_address (struct gdbarch
*gdbarch
, struct frame_info
*fi
)
2375 if (gdbarch
->frame_locals_address
== 0)
2376 fatal ("gdbarch: gdbarch_frame_locals_address invalid");
2377 if (gdbarch_debug
>= 2)
2378 /* FIXME: gdb_std??? */
2379 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_locals_address called\n");
2380 return gdbarch
->frame_locals_address (fi
);
2384 set_gdbarch_frame_locals_address (gdbarch
, frame_locals_address
)
2385 struct gdbarch
*gdbarch
;
2386 gdbarch_frame_locals_address_ftype frame_locals_address
;
2388 gdbarch
->frame_locals_address
= frame_locals_address
;
2392 gdbarch_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2394 if (gdbarch
->saved_pc_after_call
== 0)
2395 fatal ("gdbarch: gdbarch_saved_pc_after_call invalid");
2396 if (gdbarch_debug
>= 2)
2397 /* FIXME: gdb_std??? */
2398 fprintf_unfiltered (gdb_stdlog
, "gdbarch_saved_pc_after_call called\n");
2399 return gdbarch
->saved_pc_after_call (frame
);
2403 set_gdbarch_saved_pc_after_call (gdbarch
, saved_pc_after_call
)
2404 struct gdbarch
*gdbarch
;
2405 gdbarch_saved_pc_after_call_ftype saved_pc_after_call
;
2407 gdbarch
->saved_pc_after_call
= saved_pc_after_call
;
2411 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2413 if (gdbarch
->frame_num_args
== 0)
2414 fatal ("gdbarch: gdbarch_frame_num_args invalid");
2415 if (gdbarch_debug
>= 2)
2416 /* FIXME: gdb_std??? */
2417 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2418 return gdbarch
->frame_num_args (frame
);
2422 set_gdbarch_frame_num_args (gdbarch
, frame_num_args
)
2423 struct gdbarch
*gdbarch
;
2424 gdbarch_frame_num_args_ftype frame_num_args
;
2426 gdbarch
->frame_num_args
= frame_num_args
;
2430 /* Keep a registrary of per-architecture data-pointers required by GDB
2438 struct gdbarch_data_registration
2440 gdbarch_data_ftype
*init
;
2441 struct gdbarch_data
*data
;
2442 struct gdbarch_data_registration
*next
;
2445 struct gdbarch_data_registrary
2448 struct gdbarch_data_registration
*registrations
;
2451 struct gdbarch_data_registrary gdbarch_data_registrary
=
2456 struct gdbarch_data
*
2457 register_gdbarch_data (init
)
2458 gdbarch_data_ftype
*init
;
2460 struct gdbarch_data_registration
**curr
;
2461 for (curr
= &gdbarch_data_registrary
.registrations
;
2463 curr
= &(*curr
)->next
);
2464 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
2465 (*curr
)->next
= NULL
;
2466 (*curr
)->init
= init
;
2467 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
2468 (*curr
)->data
->index
= gdbarch_data_registrary
.nr
++;
2469 return (*curr
)->data
;
2473 /* Walk through all the registered users initializing each in turn. */
2475 static void init_gdbarch_data
PARAMS ((struct gdbarch
*));
2477 init_gdbarch_data (gdbarch
)
2478 struct gdbarch
*gdbarch
;
2480 struct gdbarch_data_registration
*rego
;
2481 gdbarch
->nr_data
= gdbarch_data_registrary
.nr
+ 1;
2482 gdbarch
->data
= xmalloc (sizeof (void*) * gdbarch
->nr_data
);
2483 for (rego
= gdbarch_data_registrary
.registrations
;
2487 if (rego
->data
->index
< gdbarch
->nr_data
)
2488 gdbarch
->data
[rego
->data
->index
] = rego
->init ();
2493 /* Return the current value of the specified per-architecture
2498 struct gdbarch_data
*data
;
2500 if (data
->index
>= current_gdbarch
->nr_data
)
2501 fatal ("gdbarch_data: request for non-existant data.");
2502 return current_gdbarch
->data
[data
->index
];
2507 /* Keep a registrary of swaped data required by GDB modules. */
2512 struct gdbarch_swap_registration
*source
;
2513 struct gdbarch_swap
*next
;
2516 struct gdbarch_swap_registration
2519 unsigned long sizeof_data
;
2520 gdbarch_swap_ftype
*init
;
2521 struct gdbarch_swap_registration
*next
;
2524 struct gdbarch_swap_registrary
2527 struct gdbarch_swap_registration
*registrations
;
2530 struct gdbarch_swap_registrary gdbarch_swap_registrary
=
2536 register_gdbarch_swap (data
, sizeof_data
, init
)
2538 unsigned long sizeof_data
;
2539 gdbarch_swap_ftype
*init
;
2541 struct gdbarch_swap_registration
**rego
;
2542 for (rego
= &gdbarch_swap_registrary
.registrations
;
2544 rego
= &(*rego
)->next
);
2545 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
2546 (*rego
)->next
= NULL
;
2547 (*rego
)->init
= init
;
2548 (*rego
)->data
= data
;
2549 (*rego
)->sizeof_data
= sizeof_data
;
2553 static void init_gdbarch_swap
PARAMS ((struct gdbarch
*));
2555 init_gdbarch_swap (gdbarch
)
2556 struct gdbarch
*gdbarch
;
2558 struct gdbarch_swap_registration
*rego
;
2559 struct gdbarch_swap
**curr
= &gdbarch
->swap
;
2560 for (rego
= gdbarch_swap_registrary
.registrations
;
2564 if (rego
->data
!= NULL
)
2566 (*curr
) = XMALLOC (struct gdbarch_swap
);
2567 (*curr
)->source
= rego
;
2568 (*curr
)->swap
= xmalloc (rego
->sizeof_data
);
2569 (*curr
)->next
= NULL
;
2570 memset (rego
->data
, 0, rego
->sizeof_data
);
2571 curr
= &(*curr
)->next
;
2573 if (rego
->init
!= NULL
)
2578 static void swapout_gdbarch_swap
PARAMS ((struct gdbarch
*));
2580 swapout_gdbarch_swap (gdbarch
)
2581 struct gdbarch
*gdbarch
;
2583 struct gdbarch_swap
*curr
;
2584 for (curr
= gdbarch
->swap
;
2587 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
2590 static void swapin_gdbarch_swap
PARAMS ((struct gdbarch
*));
2592 swapin_gdbarch_swap (gdbarch
)
2593 struct gdbarch
*gdbarch
;
2595 struct gdbarch_swap
*curr
;
2596 for (curr
= gdbarch
->swap
;
2599 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
2603 /* Keep a registrary of the architectures known by GDB. */
2605 struct gdbarch_init_registration
2607 enum bfd_architecture bfd_architecture
;
2608 gdbarch_init_ftype
*init
;
2609 struct gdbarch_list
*arches
;
2610 struct gdbarch_init_registration
*next
;
2613 static struct gdbarch_init_registration
*gdbarch_init_registrary
= NULL
;
2616 register_gdbarch_init (bfd_architecture
, init
)
2617 enum bfd_architecture bfd_architecture
;
2618 gdbarch_init_ftype
*init
;
2620 struct gdbarch_init_registration
**curr
;
2621 const struct bfd_arch_info
*bfd_arch_info
;
2622 /* Check that BFD reconizes this architecture */
2623 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
2624 if (bfd_arch_info
== NULL
)
2626 fatal ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture
);
2628 /* Check that we haven't seen this architecture before */
2629 for (curr
= &gdbarch_init_registrary
;
2631 curr
= &(*curr
)->next
)
2633 if (bfd_architecture
== (*curr
)->bfd_architecture
)
2634 fatal ("gdbarch: Duplicate registraration of architecture (%s)",
2635 bfd_arch_info
->printable_name
);
2639 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
2640 bfd_arch_info
->printable_name
,
2643 (*curr
) = XMALLOC (struct gdbarch_init_registration
);
2644 (*curr
)->bfd_architecture
= bfd_architecture
;
2645 (*curr
)->init
= init
;
2646 (*curr
)->arches
= NULL
;
2647 (*curr
)->next
= NULL
;
2652 /* Look for an architecture using gdbarch_info. Base search on only
2653 BFD_ARCH_INFO and BYTE_ORDER. */
2655 struct gdbarch_list
*
2656 gdbarch_list_lookup_by_info (arches
, info
)
2657 struct gdbarch_list
*arches
;
2658 const struct gdbarch_info
*info
;
2660 for (; arches
!= NULL
; arches
= arches
->next
)
2662 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
2664 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
2672 /* Update the current architecture. Return ZERO if the update request
2676 gdbarch_update (info
)
2677 struct gdbarch_info info
;
2679 struct gdbarch
*new_gdbarch
;
2680 struct gdbarch_list
**list
;
2681 struct gdbarch_init_registration
*rego
;
2683 /* Fill in any missing bits. Most important is the bfd_architecture
2684 which is used to select the target architecture. */
2685 if (info
.bfd_architecture
== bfd_arch_unknown
)
2687 if (info
.bfd_arch_info
!= NULL
)
2688 info
.bfd_architecture
= info
.bfd_arch_info
->arch
;
2689 else if (info
.abfd
!= NULL
)
2690 info
.bfd_architecture
= bfd_get_arch (info
.abfd
);
2691 /* FIXME - should query BFD for its default architecture. */
2693 info
.bfd_architecture
= current_gdbarch
->bfd_arch_info
->arch
;
2695 if (info
.bfd_arch_info
== NULL
)
2697 if (target_architecture_auto
&& info
.abfd
!= NULL
)
2698 info
.bfd_arch_info
= bfd_get_arch_info (info
.abfd
);
2700 info
.bfd_arch_info
= current_gdbarch
->bfd_arch_info
;
2702 if (info
.byte_order
== 0)
2704 if (target_byte_order_auto
&& info
.abfd
!= NULL
)
2705 info
.byte_order
= (bfd_big_endian (info
.abfd
) ? BIG_ENDIAN
2706 : bfd_little_endian (info
.abfd
) ? LITTLE_ENDIAN
2709 info
.byte_order
= current_gdbarch
->byte_order
;
2710 /* FIXME - should query BFD for its default byte-order. */
2712 /* A default for abfd? */
2714 /* Find the target that knows about this architecture. */
2715 for (rego
= gdbarch_init_registrary
;
2716 rego
!= NULL
&& rego
->bfd_architecture
!= info
.bfd_architecture
;
2721 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: No matching architecture\n");
2727 fprintf_unfiltered (gdb_stdlog
,
2728 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2729 info
.bfd_architecture
,
2730 bfd_lookup_arch (info
.bfd_architecture
, 0)->printable_name
);
2731 fprintf_unfiltered (gdb_stdlog
,
2732 "gdbarch_update: info.bfd_arch_info %s\n",
2733 (info
.bfd_arch_info
!= NULL
2734 ? info
.bfd_arch_info
->printable_name
2736 fprintf_unfiltered (gdb_stdlog
,
2737 "gdbarch_update: info.byte_order %d (%s)\n",
2739 (info
.byte_order
== BIG_ENDIAN
? "big"
2740 : info
.byte_order
== LITTLE_ENDIAN
? "little"
2742 fprintf_unfiltered (gdb_stdlog
,
2743 "gdbarch_update: info.abfd 0x%lx\n",
2745 fprintf_unfiltered (gdb_stdlog
,
2746 "gdbarch_update: info.tdep_info 0x%lx\n",
2747 (long) info
.tdep_info
);
2750 /* Ask the target for a replacement architecture. */
2751 new_gdbarch
= rego
->init (info
, rego
->arches
);
2753 /* Did the target like it? No. Reject the change. */
2754 if (new_gdbarch
== NULL
)
2757 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Target rejected architecture\n");
2761 /* Did the architecture change? No. Do nothing. */
2762 if (current_gdbarch
== new_gdbarch
)
2765 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2767 new_gdbarch
->bfd_arch_info
->printable_name
);
2771 /* Swap all data belonging to the old target out */
2772 swapout_gdbarch_swap (current_gdbarch
);
2774 /* Is this a pre-existing architecture? Yes. Swap it in. */
2775 for (list
= ®o
->arches
;
2777 list
= &(*list
)->next
)
2779 if ((*list
)->gdbarch
== new_gdbarch
)
2782 fprintf_unfiltered (gdb_stdlog
, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2784 new_gdbarch
->bfd_arch_info
->printable_name
);
2785 current_gdbarch
= new_gdbarch
;
2786 swapin_gdbarch_swap (new_gdbarch
);
2791 /* Append this new architecture to this targets list. */
2792 (*list
) = XMALLOC (struct gdbarch_list
);
2793 (*list
)->next
= NULL
;
2794 (*list
)->gdbarch
= new_gdbarch
;
2796 /* Switch to this new architecture. Dump it out. */
2797 current_gdbarch
= new_gdbarch
;
2800 fprintf_unfiltered (gdb_stdlog
,
2801 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
2803 new_gdbarch
->bfd_arch_info
->printable_name
);
2807 /* Check that the newly installed architecture is valid. */
2808 verify_gdbarch (new_gdbarch
);
2810 /* Initialize the per-architecture memory (swap) areas.
2811 CURRENT_GDBARCH must be update before these modules are
2813 init_gdbarch_swap (new_gdbarch
);
2815 /* Initialize the per-architecture data-pointer of all parties that
2816 registered an interest in this architecture. CURRENT_GDBARCH
2817 must be updated before these modules are called. */
2818 init_gdbarch_data (new_gdbarch
);
2825 /* Functions to manipulate the endianness of the target. */
2827 #ifdef TARGET_BYTE_ORDER_SELECTABLE
2828 /* compat - Catch old targets that expect a selectable byte-order to
2829 default to BIG_ENDIAN */
2830 #ifndef TARGET_BYTE_ORDER_DEFAULT
2831 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2834 #if !TARGET_BYTE_ORDER_SELECTABLE_P
2835 #ifndef TARGET_BYTE_ORDER_DEFAULT
2836 /* compat - Catch old non byte-order selectable targets that do not
2837 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2838 TARGET_BYTE_ORDER to be used as the default. For targets that
2839 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2840 below will get a strange compiler warning. */
2841 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2844 #ifndef TARGET_BYTE_ORDER_DEFAULT
2845 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
2847 int target_byte_order
= TARGET_BYTE_ORDER_DEFAULT
;
2848 int target_byte_order_auto
= 1;
2850 /* Chain containing the \"set endian\" commands. */
2851 static struct cmd_list_element
*endianlist
= NULL
;
2853 /* Called by ``show endian''. */
2854 static void show_endian
PARAMS ((char *, int));
2856 show_endian (args
, from_tty
)
2861 (TARGET_BYTE_ORDER_AUTO
2862 ? "The target endianness is set automatically (currently %s endian)\n"
2863 : "The target is assumed to be %s endian\n");
2864 printf_unfiltered (msg
, (TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little"));
2867 /* Called if the user enters ``set endian'' without an argument. */
2868 static void set_endian
PARAMS ((char *, int));
2870 set_endian (args
, from_tty
)
2874 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2875 show_endian (args
, from_tty
);
2878 /* Called by ``set endian big''. */
2879 static void set_endian_big
PARAMS ((char *, int));
2881 set_endian_big (args
, from_tty
)
2885 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2887 target_byte_order
= BIG_ENDIAN
;
2888 target_byte_order_auto
= 0;
2891 struct gdbarch_info info
;
2892 memset (&info
, 0, sizeof info
);
2893 info
.byte_order
= BIG_ENDIAN
;
2894 gdbarch_update (info
);
2899 printf_unfiltered ("Byte order is not selectable.");
2900 show_endian (args
, from_tty
);
2904 /* Called by ``set endian little''. */
2905 static void set_endian_little
PARAMS ((char *, int));
2907 set_endian_little (args
, from_tty
)
2911 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2913 target_byte_order
= LITTLE_ENDIAN
;
2914 target_byte_order_auto
= 0;
2917 struct gdbarch_info info
;
2918 memset (&info
, 0, sizeof info
);
2919 info
.byte_order
= LITTLE_ENDIAN
;
2920 gdbarch_update (info
);
2925 printf_unfiltered ("Byte order is not selectable.");
2926 show_endian (args
, from_tty
);
2930 /* Called by ``set endian auto''. */
2931 static void set_endian_auto
PARAMS ((char *, int));
2933 set_endian_auto (args
, from_tty
)
2937 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2939 target_byte_order_auto
= 1;
2943 printf_unfiltered ("Byte order is not selectable.");
2944 show_endian (args
, from_tty
);
2948 /* Set the endianness from a BFD. */
2949 static void set_endian_from_file
PARAMS ((bfd
*));
2951 set_endian_from_file (abfd
)
2954 if (TARGET_BYTE_ORDER_SELECTABLE_P
)
2958 if (bfd_big_endian (abfd
))
2961 want
= LITTLE_ENDIAN
;
2962 if (TARGET_BYTE_ORDER_AUTO
)
2963 target_byte_order
= want
;
2964 else if (TARGET_BYTE_ORDER
!= want
)
2965 warning ("%s endian file does not match %s endian target.",
2966 want
== BIG_ENDIAN
? "big" : "little",
2967 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2971 if (bfd_big_endian (abfd
)
2972 ? TARGET_BYTE_ORDER
!= BIG_ENDIAN
2973 : TARGET_BYTE_ORDER
== BIG_ENDIAN
)
2974 warning ("%s endian file does not match %s endian target.",
2975 bfd_big_endian (abfd
) ? "big" : "little",
2976 TARGET_BYTE_ORDER
== BIG_ENDIAN
? "big" : "little");
2982 /* Functions to manipulate the architecture of the target */
2984 int target_architecture_auto
= 1;
2985 extern const struct bfd_arch_info bfd_default_arch_struct
;
2986 const struct bfd_arch_info
*target_architecture
= &bfd_default_arch_struct
;
2987 int (*target_architecture_hook
) PARAMS ((const struct bfd_arch_info
*ap
));
2989 /* Do the real work of changing the current architecture */
2991 static int arch_ok
PARAMS ((const struct bfd_arch_info
*arch
));
2994 const struct bfd_arch_info
*arch
;
2996 /* Should be performing the more basic check that the binary is
2997 compatible with GDB. */
2998 /* Check with the target that the architecture is valid. */
2999 return (target_architecture_hook
== NULL
3000 || target_architecture_hook (arch
));
3003 enum set_arch
{ set_arch_auto
, set_arch_manual
};
3005 static void set_arch
PARAMS ((const struct bfd_arch_info
*arch
, enum set_arch type
));
3007 set_arch (arch
, type
)
3008 const struct bfd_arch_info
*arch
;
3014 if (!arch_ok (arch
))
3015 warning ("Target may not support %s architecture",
3016 arch
->printable_name
);
3017 target_architecture
= arch
;
3019 case set_arch_manual
:
3020 if (!arch_ok (arch
))
3022 printf_unfiltered ("Target does not support `%s' architecture.\n",
3023 arch
->printable_name
);
3027 target_architecture_auto
= 0;
3028 target_architecture
= arch
;
3036 /* Called if the user enters ``show architecture'' without an argument. */
3037 static void show_architecture
PARAMS ((char *, int));
3039 show_architecture (args
, from_tty
)
3044 arch
= TARGET_ARCHITECTURE
->printable_name
;
3045 if (target_architecture_auto
)
3046 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch
);
3048 printf_filtered ("The target architecture is assumed to be %s\n", arch
);
3051 /* Called if the user enters ``set architecture'' with or without an
3053 static void set_architecture
PARAMS ((char *, int));
3055 set_architecture (args
, from_tty
)
3061 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3063 else if (strcmp (args
, "auto") == 0)
3065 target_architecture_auto
= 1;
3067 else if (GDB_MULTI_ARCH
)
3069 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3071 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3074 struct gdbarch_info info
;
3075 memset (&info
, 0, sizeof info
);
3076 info
.bfd_arch_info
= arch
;
3077 if (gdbarch_update (info
))
3078 target_architecture_auto
= 0;
3080 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3085 const struct bfd_arch_info
*arch
= bfd_scan_arch (args
);
3087 set_arch (arch
, set_arch_manual
);
3089 printf_unfiltered ("Architecture `%s' not reconized.\n", args
);
3093 /* Called if the user enters ``info architecture'' without an argument. */
3094 static void info_architecture
PARAMS ((char *, int));
3096 info_architecture (args
, from_tty
)
3100 enum bfd_architecture a
;
3103 if (gdbarch_init_registrary
!= NULL
)
3105 struct gdbarch_init_registration
*rego
;
3106 printf_filtered ("Available architectures are:\n");
3107 for (rego
= gdbarch_init_registrary
;
3111 const struct bfd_arch_info
*ap
;
3112 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3117 printf_filtered (" %s", ap
->printable_name
);
3121 printf_filtered ("\n");
3127 printf_filtered ("There are no available architectures.\n");
3131 printf_filtered ("Available architectures are:\n");
3132 for (a
= bfd_arch_obscure
+ 1; a
< bfd_arch_last
; a
++)
3134 const struct bfd_arch_info
*ap
= bfd_lookup_arch (a
, 0);
3139 printf_filtered (" %s", ap
->printable_name
);
3143 printf_filtered ("\n");
3148 /* Set the architecture from arch/machine */
3150 set_architecture_from_arch_mach (arch
, mach
)
3151 enum bfd_architecture arch
;
3154 const struct bfd_arch_info
*wanted
= bfd_lookup_arch (arch
, mach
);
3156 set_arch (wanted
, set_arch_manual
);
3158 fatal ("gdbarch: hardwired architecture/machine not reconized");
3161 /* Set the architecture from a BFD */
3162 static void set_architecture_from_file
PARAMS ((bfd
*));
3164 set_architecture_from_file (abfd
)
3167 const struct bfd_arch_info
*wanted
= bfd_get_arch_info (abfd
);
3168 if (target_architecture_auto
)
3170 set_arch (wanted
, set_arch_auto
);
3172 else if (wanted
!= target_architecture
)
3174 warning ("%s architecture file may be incompatible with %s target.",
3175 wanted
->printable_name
,
3176 target_architecture
->printable_name
);
3181 /* Misc helper functions for targets. */
3184 frame_num_args_unknown (fi
)
3185 struct frame_info
*fi
;
3192 generic_register_convertible_not (num
)
3200 /* Pointer to the target-dependent disassembly function. */
3201 int (*tm_print_insn
) PARAMS ((bfd_vma
, disassemble_info
*));
3202 disassemble_info tm_print_insn_info
;
3206 /* Set the dynamic target-system-dependant parameters (architecture,
3207 byte-order) using information found in the BFD */
3210 set_gdbarch_from_file (abfd
)
3215 struct gdbarch_info info
;
3216 memset (&info
, 0, sizeof info
);
3218 gdbarch_update (info
);
3221 set_architecture_from_file (abfd
);
3222 set_endian_from_file (abfd
);
3226 #if defined (CALL_DUMMY)
3227 /* FIXME - this should go away */
3228 LONGEST call_dummy_words
[] = CALL_DUMMY
;
3229 int sizeof_call_dummy_words
= sizeof (call_dummy_words
);
3233 extern void _initialize_gdbarch
PARAMS ((void));
3235 _initialize_gdbarch ()
3237 add_prefix_cmd ("endian", class_support
, set_endian
,
3238 "Set endianness of target.",
3239 &endianlist
, "set endian ", 0, &setlist
);
3240 add_cmd ("big", class_support
, set_endian_big
,
3241 "Set target as being big endian.", &endianlist
);
3242 add_cmd ("little", class_support
, set_endian_little
,
3243 "Set target as being little endian.", &endianlist
);
3244 add_cmd ("auto", class_support
, set_endian_auto
,
3245 "Select target endianness automatically.", &endianlist
);
3246 add_cmd ("endian", class_support
, show_endian
,
3247 "Show endianness of target.", &showlist
);
3249 add_cmd ("architecture", class_support
, set_architecture
,
3250 "Set architecture of target.", &setlist
);
3251 add_alias_cmd ("processor", "architecture", class_support
, 1, &setlist
);
3252 add_cmd ("architecture", class_support
, show_architecture
,
3253 "Show architecture of target.", &showlist
);
3254 add_cmd ("architecture", class_support
, info_architecture
,
3255 "List supported target architectures", &infolist
);
3257 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info
, gdb_stdout
, (fprintf_ftype
)fprintf_filtered
);
3258 tm_print_insn_info
.flavour
= bfd_target_unknown_flavour
;
3259 tm_print_insn_info
.read_memory_func
= dis_asm_read_memory
;
3260 tm_print_insn_info
.memory_error_func
= dis_asm_memory_error
;
3261 tm_print_insn_info
.print_address_func
= dis_asm_print_address
;
3263 add_show_from_set (add_set_cmd ("archdebug",
3266 (char *)&gdbarch_debug
,
3267 "Set architecture debugging.\n\
3268 When non-zero, architecture debugging is enabled.", &setlist
),