1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
6 Free Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* This file was created with the aid of ``gdbarch.sh''.
25 The Bourne shell script ``gdbarch.sh'' creates the files
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
30 If editing this file, please also run gdbarch.sh and merge any
31 changes into that script. Conversely, when making sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
37 #include "arch-utils.h"
43 #include "floatformat.h"
45 #include "gdb_assert.h"
46 #include "gdb_string.h"
47 #include "reggroups.h"
49 #include "gdb_obstack.h"
52 /* Static function declarations */
54 static void alloc_gdbarch_data (struct gdbarch
*);
56 /* Non-zero if we want to trace architecture code. */
59 #define GDBARCH_DEBUG 0
61 int gdbarch_debug
= GDBARCH_DEBUG
;
63 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
64 struct cmd_list_element
*c
, const char *value
)
66 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
70 pformat (const struct floatformat
**format
)
75 /* Just print out one of them - this is only for diagnostics. */
76 return format
[0]->name
;
80 /* Maintain the struct gdbarch object */
84 /* Has this architecture been fully initialized? */
87 /* An obstack bound to the lifetime of the architecture. */
88 struct obstack
*obstack
;
90 /* basic architectural information */
91 const struct bfd_arch_info
* bfd_arch_info
;
93 int byte_order_for_code
;
95 const struct target_desc
* target_desc
;
97 /* target specific vector. */
98 struct gdbarch_tdep
*tdep
;
99 gdbarch_dump_tdep_ftype
*dump_tdep
;
101 /* per-architecture data-pointers */
105 /* per-architecture swap-regions */
106 struct gdbarch_swap
*swap
;
108 /* Multi-arch values.
110 When extending this structure you must:
114 Declare set/get functions and define the corresponding
117 gdbarch_alloc(): If zero/NULL is not a suitable default,
118 initialize the new field.
120 verify_gdbarch(): Confirm that the target updated the field
123 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
126 ``startup_gdbarch()'': Append an initial value to the static
127 variable (base values on the host's c-type system).
129 get_gdbarch(): Implement the set/get functions (probably using
130 the macro's as shortcuts).
140 const struct floatformat
** float_format
;
142 const struct floatformat
** double_format
;
144 const struct floatformat
** long_double_format
;
148 gdbarch_read_pc_ftype
*read_pc
;
149 gdbarch_write_pc_ftype
*write_pc
;
150 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
151 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
152 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
159 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
160 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
161 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
162 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
163 gdbarch_register_name_ftype
*register_name
;
164 gdbarch_register_type_ftype
*register_type
;
165 gdbarch_dummy_id_ftype
*dummy_id
;
166 int deprecated_fp_regnum
;
167 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
168 int call_dummy_location
;
169 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
170 gdbarch_print_registers_info_ftype
*print_registers_info
;
171 gdbarch_print_float_info_ftype
*print_float_info
;
172 gdbarch_print_vector_info_ftype
*print_vector_info
;
173 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
174 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
175 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
176 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
177 int believe_pcc_promotion
;
178 gdbarch_convert_register_p_ftype
*convert_register_p
;
179 gdbarch_register_to_value_ftype
*register_to_value
;
180 gdbarch_value_to_register_ftype
*value_to_register
;
181 gdbarch_value_from_register_ftype
*value_from_register
;
182 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
183 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
184 gdbarch_integer_to_address_ftype
*integer_to_address
;
185 gdbarch_return_value_ftype
*return_value
;
186 gdbarch_skip_prologue_ftype
*skip_prologue
;
187 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
188 gdbarch_inner_than_ftype
*inner_than
;
189 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
190 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
191 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
192 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
193 CORE_ADDR decr_pc_after_break
;
194 CORE_ADDR deprecated_function_start_offset
;
195 gdbarch_remote_register_number_ftype
*remote_register_number
;
196 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
197 CORE_ADDR frame_args_skip
;
198 gdbarch_unwind_pc_ftype
*unwind_pc
;
199 gdbarch_unwind_sp_ftype
*unwind_sp
;
200 gdbarch_frame_num_args_ftype
*frame_num_args
;
201 gdbarch_frame_align_ftype
*frame_align
;
202 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
203 int frame_red_zone_size
;
204 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
205 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
206 gdbarch_smash_text_address_ftype
*smash_text_address
;
207 gdbarch_software_single_step_ftype
*software_single_step
;
208 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
209 gdbarch_print_insn_ftype
*print_insn
;
210 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
211 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
212 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
213 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
214 gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
;
215 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
216 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
217 const char * name_of_malloc
;
218 int cannot_step_breakpoint
;
219 int have_nonsteppable_watchpoint
;
220 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
221 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
222 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
223 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
224 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
225 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
226 struct core_regset_section
* core_regset_sections
;
227 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
228 int vtable_function_descriptors
;
230 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
231 ULONGEST max_insn_length
;
232 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
233 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
234 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
235 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
236 gdbarch_overlay_update_ftype
*overlay_update
;
237 gdbarch_core_read_description_ftype
*core_read_description
;
238 gdbarch_static_transform_name_ftype
*static_transform_name
;
239 int sofun_address_maybe_missing
;
240 gdbarch_target_signal_from_host_ftype
*target_signal_from_host
;
241 gdbarch_target_signal_to_host_ftype
*target_signal_to_host
;
242 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
246 /* The default architecture uses host values (for want of a better
249 extern const struct bfd_arch_info bfd_default_arch_struct
;
251 struct gdbarch startup_gdbarch
=
253 1, /* Always initialized. */
254 NULL
, /* The obstack. */
255 /* basic architecture information */
256 &bfd_default_arch_struct
, /* bfd_arch_info */
257 BFD_ENDIAN_BIG
, /* byte_order */
258 BFD_ENDIAN_BIG
, /* byte_order_for_code */
259 GDB_OSABI_UNKNOWN
, /* osabi */
261 /* target specific vector and its dump routine */
263 /*per-architecture data-pointers and swap regions */
265 /* Multi-arch values */
266 1, /* bits_big_endian */
267 8 * sizeof (short), /* short_bit */
268 8 * sizeof (int), /* int_bit */
269 8 * sizeof (long), /* long_bit */
270 8 * sizeof (LONGEST
), /* long_long_bit */
271 8 * sizeof (float), /* float_bit */
272 0, /* float_format */
273 8 * sizeof (double), /* double_bit */
274 0, /* double_format */
275 8 * sizeof (long double), /* long_double_bit */
276 0, /* long_double_format */
277 8 * sizeof (void*), /* ptr_bit */
278 8 * sizeof (void*), /* addr_bit */
282 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
283 0, /* pseudo_register_read */
284 0, /* pseudo_register_write */
286 0, /* num_pseudo_regs */
291 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
292 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
293 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
294 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
295 0, /* register_name */
296 0, /* register_type */
298 -1, /* deprecated_fp_regnum */
299 0, /* push_dummy_call */
300 0, /* call_dummy_location */
301 0, /* push_dummy_code */
302 default_print_registers_info
, /* print_registers_info */
303 0, /* print_float_info */
304 0, /* print_vector_info */
305 legacy_register_sim_regno
, /* register_sim_regno */
306 cannot_register_not
, /* cannot_fetch_register */
307 cannot_register_not
, /* cannot_store_register */
308 0, /* get_longjmp_target */
309 0, /* believe_pcc_promotion */
310 generic_convert_register_p
, /* convert_register_p */
311 0, /* register_to_value */
312 0, /* value_to_register */
313 0, /* value_from_register */
314 0, /* pointer_to_address */
315 0, /* address_to_pointer */
316 0, /* integer_to_address */
317 0, /* return_value */
318 0, /* skip_prologue */
319 0, /* skip_main_prologue */
321 0, /* breakpoint_from_pc */
322 0, /* adjust_breakpoint_address */
323 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
324 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
325 0, /* decr_pc_after_break */
326 0, /* deprecated_function_start_offset */
327 default_remote_register_number
, /* remote_register_number */
328 0, /* fetch_tls_load_module_address */
329 0, /* frame_args_skip */
332 0, /* frame_num_args */
334 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
335 0, /* frame_red_zone_size */
336 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
337 0, /* addr_bits_remove */
338 0, /* smash_text_address */
339 0, /* software_single_step */
340 0, /* single_step_through_delay */
342 0, /* skip_trampoline_code */
343 generic_skip_solib_resolver
, /* skip_solib_resolver */
344 0, /* in_solib_return_trampoline */
345 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
346 construct_inferior_arguments
, /* construct_inferior_arguments */
347 0, /* elf_make_msymbol_special */
348 0, /* coff_make_msymbol_special */
349 "malloc", /* name_of_malloc */
350 0, /* cannot_step_breakpoint */
351 0, /* have_nonsteppable_watchpoint */
352 0, /* address_class_type_flags */
353 0, /* address_class_type_flags_to_name */
354 0, /* address_class_name_to_type_flags */
355 default_register_reggroup_p
, /* register_reggroup_p */
356 0, /* fetch_pointer_argument */
357 0, /* regset_from_core_section */
358 0, /* core_regset_sections */
359 0, /* core_xfer_shared_libraries */
360 0, /* vtable_function_descriptors */
361 0, /* vbit_in_delta */
362 0, /* skip_permanent_breakpoint */
363 0, /* max_insn_length */
364 0, /* displaced_step_copy_insn */
365 0, /* displaced_step_fixup */
366 NULL
, /* displaced_step_free_closure */
367 NULL
, /* displaced_step_location */
368 0, /* overlay_update */
369 0, /* core_read_description */
370 0, /* static_transform_name */
371 0, /* sofun_address_maybe_missing */
372 default_target_signal_from_host
, /* target_signal_from_host */
373 default_target_signal_to_host
, /* target_signal_to_host */
374 0, /* record_special_symbol */
375 /* startup_gdbarch() */
378 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
380 /* Create a new ``struct gdbarch'' based on information provided by
381 ``struct gdbarch_info''. */
384 gdbarch_alloc (const struct gdbarch_info
*info
,
385 struct gdbarch_tdep
*tdep
)
387 struct gdbarch
*gdbarch
;
389 /* Create an obstack for allocating all the per-architecture memory,
390 then use that to allocate the architecture vector. */
391 struct obstack
*obstack
= XMALLOC (struct obstack
);
392 obstack_init (obstack
);
393 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
394 memset (gdbarch
, 0, sizeof (*gdbarch
));
395 gdbarch
->obstack
= obstack
;
397 alloc_gdbarch_data (gdbarch
);
399 gdbarch
->tdep
= tdep
;
401 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
402 gdbarch
->byte_order
= info
->byte_order
;
403 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
404 gdbarch
->osabi
= info
->osabi
;
405 gdbarch
->target_desc
= info
->target_desc
;
407 /* Force the explicit initialization of these. */
408 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
409 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
410 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
411 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
412 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
413 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
414 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
415 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
416 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
417 gdbarch
->char_signed
= -1;
418 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
419 gdbarch
->num_regs
= -1;
420 gdbarch
->sp_regnum
= -1;
421 gdbarch
->pc_regnum
= -1;
422 gdbarch
->ps_regnum
= -1;
423 gdbarch
->fp0_regnum
= -1;
424 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
425 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
426 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
427 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
428 gdbarch
->deprecated_fp_regnum
= -1;
429 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
430 gdbarch
->print_registers_info
= default_print_registers_info
;
431 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
432 gdbarch
->cannot_fetch_register
= cannot_register_not
;
433 gdbarch
->cannot_store_register
= cannot_register_not
;
434 gdbarch
->convert_register_p
= generic_convert_register_p
;
435 gdbarch
->value_from_register
= default_value_from_register
;
436 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
437 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
438 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
439 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
440 gdbarch
->remote_register_number
= default_remote_register_number
;
441 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
442 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
443 gdbarch
->addr_bits_remove
= core_addr_identity
;
444 gdbarch
->smash_text_address
= core_addr_identity
;
445 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
446 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
447 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
448 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
449 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
450 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
451 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
452 gdbarch
->name_of_malloc
= "malloc";
453 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
454 gdbarch
->displaced_step_fixup
= NULL
;
455 gdbarch
->displaced_step_free_closure
= NULL
;
456 gdbarch
->displaced_step_location
= NULL
;
457 gdbarch
->target_signal_from_host
= default_target_signal_from_host
;
458 gdbarch
->target_signal_to_host
= default_target_signal_to_host
;
459 /* gdbarch_alloc() */
465 /* Allocate extra space using the per-architecture obstack. */
468 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
470 void *data
= obstack_alloc (arch
->obstack
, size
);
471 memset (data
, 0, size
);
476 /* Free a gdbarch struct. This should never happen in normal
477 operation --- once you've created a gdbarch, you keep it around.
478 However, if an architecture's init function encounters an error
479 building the structure, it may need to clean up a partially
480 constructed gdbarch. */
483 gdbarch_free (struct gdbarch
*arch
)
485 struct obstack
*obstack
;
486 gdb_assert (arch
!= NULL
);
487 gdb_assert (!arch
->initialized_p
);
488 obstack
= arch
->obstack
;
489 obstack_free (obstack
, 0); /* Includes the ARCH. */
494 /* Ensure that all values in a GDBARCH are reasonable. */
497 verify_gdbarch (struct gdbarch
*gdbarch
)
500 struct cleanup
*cleanups
;
503 log
= mem_fileopen ();
504 cleanups
= make_cleanup_ui_file_delete (log
);
506 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
507 fprintf_unfiltered (log
, "\n\tbyte-order");
508 if (gdbarch
->bfd_arch_info
== NULL
)
509 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
510 /* Check those that need to be defined for the given multi-arch level. */
511 /* Skip verify of bits_big_endian, invalid_p == 0 */
512 /* Skip verify of short_bit, invalid_p == 0 */
513 /* Skip verify of int_bit, invalid_p == 0 */
514 /* Skip verify of long_bit, invalid_p == 0 */
515 /* Skip verify of long_long_bit, invalid_p == 0 */
516 /* Skip verify of float_bit, invalid_p == 0 */
517 if (gdbarch
->float_format
== 0)
518 gdbarch
->float_format
= floatformats_ieee_single
;
519 /* Skip verify of double_bit, invalid_p == 0 */
520 if (gdbarch
->double_format
== 0)
521 gdbarch
->double_format
= floatformats_ieee_double
;
522 /* Skip verify of long_double_bit, invalid_p == 0 */
523 if (gdbarch
->long_double_format
== 0)
524 gdbarch
->long_double_format
= floatformats_ieee_double
;
525 /* Skip verify of ptr_bit, invalid_p == 0 */
526 if (gdbarch
->addr_bit
== 0)
527 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
528 if (gdbarch
->char_signed
== -1)
529 gdbarch
->char_signed
= 1;
530 /* Skip verify of read_pc, has predicate */
531 /* Skip verify of write_pc, has predicate */
532 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
533 /* Skip verify of pseudo_register_read, has predicate */
534 /* Skip verify of pseudo_register_write, has predicate */
535 if (gdbarch
->num_regs
== -1)
536 fprintf_unfiltered (log
, "\n\tnum_regs");
537 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
538 /* Skip verify of sp_regnum, invalid_p == 0 */
539 /* Skip verify of pc_regnum, invalid_p == 0 */
540 /* Skip verify of ps_regnum, invalid_p == 0 */
541 /* Skip verify of fp0_regnum, invalid_p == 0 */
542 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
543 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
544 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
545 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
546 if (gdbarch
->register_name
== 0)
547 fprintf_unfiltered (log
, "\n\tregister_name");
548 /* Skip verify of register_type, has predicate */
549 /* Skip verify of dummy_id, has predicate */
550 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
551 /* Skip verify of push_dummy_call, has predicate */
552 /* Skip verify of call_dummy_location, invalid_p == 0 */
553 /* Skip verify of push_dummy_code, has predicate */
554 /* Skip verify of print_registers_info, invalid_p == 0 */
555 /* Skip verify of print_float_info, has predicate */
556 /* Skip verify of print_vector_info, has predicate */
557 /* Skip verify of register_sim_regno, invalid_p == 0 */
558 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
559 /* Skip verify of cannot_store_register, invalid_p == 0 */
560 /* Skip verify of get_longjmp_target, has predicate */
561 /* Skip verify of convert_register_p, invalid_p == 0 */
562 /* Skip verify of value_from_register, invalid_p == 0 */
563 /* Skip verify of pointer_to_address, invalid_p == 0 */
564 /* Skip verify of address_to_pointer, invalid_p == 0 */
565 /* Skip verify of integer_to_address, has predicate */
566 /* Skip verify of return_value, has predicate */
567 if (gdbarch
->skip_prologue
== 0)
568 fprintf_unfiltered (log
, "\n\tskip_prologue");
569 /* Skip verify of skip_main_prologue, has predicate */
570 if (gdbarch
->inner_than
== 0)
571 fprintf_unfiltered (log
, "\n\tinner_than");
572 if (gdbarch
->breakpoint_from_pc
== 0)
573 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
574 /* Skip verify of adjust_breakpoint_address, has predicate */
575 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
576 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
577 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
578 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
579 /* Skip verify of remote_register_number, invalid_p == 0 */
580 /* Skip verify of fetch_tls_load_module_address, has predicate */
581 /* Skip verify of frame_args_skip, invalid_p == 0 */
582 /* Skip verify of unwind_pc, has predicate */
583 /* Skip verify of unwind_sp, has predicate */
584 /* Skip verify of frame_num_args, has predicate */
585 /* Skip verify of frame_align, has predicate */
586 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
587 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
588 /* Skip verify of addr_bits_remove, invalid_p == 0 */
589 /* Skip verify of smash_text_address, invalid_p == 0 */
590 /* Skip verify of software_single_step, has predicate */
591 /* Skip verify of single_step_through_delay, has predicate */
592 if (gdbarch
->print_insn
== 0)
593 fprintf_unfiltered (log
, "\n\tprint_insn");
594 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
595 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
596 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
597 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
598 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
599 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
600 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
601 /* Skip verify of name_of_malloc, invalid_p == 0 */
602 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
603 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
604 /* Skip verify of address_class_type_flags, has predicate */
605 /* Skip verify of address_class_type_flags_to_name, has predicate */
606 /* Skip verify of address_class_name_to_type_flags, has predicate */
607 /* Skip verify of register_reggroup_p, invalid_p == 0 */
608 /* Skip verify of fetch_pointer_argument, has predicate */
609 /* Skip verify of regset_from_core_section, has predicate */
610 /* Skip verify of core_xfer_shared_libraries, has predicate */
611 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
612 /* Skip verify of vbit_in_delta, invalid_p == 0 */
613 /* Skip verify of skip_permanent_breakpoint, has predicate */
614 /* Skip verify of max_insn_length, has predicate */
615 /* Skip verify of displaced_step_copy_insn, has predicate */
616 /* Skip verify of displaced_step_fixup, has predicate */
617 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
618 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
619 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
620 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
621 /* Skip verify of overlay_update, has predicate */
622 /* Skip verify of core_read_description, has predicate */
623 /* Skip verify of static_transform_name, has predicate */
624 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
625 /* Skip verify of target_signal_from_host, invalid_p == 0 */
626 /* Skip verify of target_signal_to_host, invalid_p == 0 */
627 /* Skip verify of record_special_symbol, has predicate */
628 buf
= ui_file_xstrdup (log
, &dummy
);
629 make_cleanup (xfree
, buf
);
630 if (strlen (buf
) > 0)
631 internal_error (__FILE__
, __LINE__
,
632 _("verify_gdbarch: the following are invalid ...%s"),
634 do_cleanups (cleanups
);
638 /* Print out the details of the current architecture. */
641 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
643 const char *gdb_nm_file
= "<not-defined>";
644 #if defined (GDB_NM_FILE)
645 gdb_nm_file
= GDB_NM_FILE
;
647 fprintf_unfiltered (file
,
648 "gdbarch_dump: GDB_NM_FILE = %s\n",
650 fprintf_unfiltered (file
,
651 "gdbarch_dump: addr_bit = %s\n",
652 paddr_d (gdbarch
->addr_bit
));
653 fprintf_unfiltered (file
,
654 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
655 (long) gdbarch
->addr_bits_remove
);
656 fprintf_unfiltered (file
,
657 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
658 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
659 fprintf_unfiltered (file
,
660 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
661 (long) gdbarch
->address_class_name_to_type_flags
);
662 fprintf_unfiltered (file
,
663 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
664 gdbarch_address_class_type_flags_p (gdbarch
));
665 fprintf_unfiltered (file
,
666 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
667 (long) gdbarch
->address_class_type_flags
);
668 fprintf_unfiltered (file
,
669 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
670 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
671 fprintf_unfiltered (file
,
672 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
673 (long) gdbarch
->address_class_type_flags_to_name
);
674 fprintf_unfiltered (file
,
675 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
676 (long) gdbarch
->address_to_pointer
);
677 fprintf_unfiltered (file
,
678 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
679 gdbarch_adjust_breakpoint_address_p (gdbarch
));
680 fprintf_unfiltered (file
,
681 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
682 (long) gdbarch
->adjust_breakpoint_address
);
683 fprintf_unfiltered (file
,
684 "gdbarch_dump: believe_pcc_promotion = %s\n",
685 paddr_d (gdbarch
->believe_pcc_promotion
));
686 fprintf_unfiltered (file
,
687 "gdbarch_dump: bfd_arch_info = %s\n",
688 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
689 fprintf_unfiltered (file
,
690 "gdbarch_dump: bits_big_endian = %s\n",
691 paddr_d (gdbarch
->bits_big_endian
));
692 fprintf_unfiltered (file
,
693 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
694 (long) gdbarch
->breakpoint_from_pc
);
695 fprintf_unfiltered (file
,
696 "gdbarch_dump: byte_order = %s\n",
697 paddr_d (gdbarch
->byte_order
));
698 fprintf_unfiltered (file
,
699 "gdbarch_dump: byte_order_for_code = %s\n",
700 paddr_d (gdbarch
->byte_order_for_code
));
701 fprintf_unfiltered (file
,
702 "gdbarch_dump: call_dummy_location = %s\n",
703 paddr_d (gdbarch
->call_dummy_location
));
704 fprintf_unfiltered (file
,
705 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
706 (long) gdbarch
->cannot_fetch_register
);
707 fprintf_unfiltered (file
,
708 "gdbarch_dump: cannot_step_breakpoint = %s\n",
709 paddr_d (gdbarch
->cannot_step_breakpoint
));
710 fprintf_unfiltered (file
,
711 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
712 (long) gdbarch
->cannot_store_register
);
713 fprintf_unfiltered (file
,
714 "gdbarch_dump: char_signed = %s\n",
715 paddr_d (gdbarch
->char_signed
));
716 fprintf_unfiltered (file
,
717 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
718 (long) gdbarch
->coff_make_msymbol_special
);
719 fprintf_unfiltered (file
,
720 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
721 (long) gdbarch
->construct_inferior_arguments
);
722 fprintf_unfiltered (file
,
723 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
724 (long) gdbarch
->convert_from_func_ptr_addr
);
725 fprintf_unfiltered (file
,
726 "gdbarch_dump: convert_register_p = <0x%lx>\n",
727 (long) gdbarch
->convert_register_p
);
728 fprintf_unfiltered (file
,
729 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
730 gdbarch_core_read_description_p (gdbarch
));
731 fprintf_unfiltered (file
,
732 "gdbarch_dump: core_read_description = <0x%lx>\n",
733 (long) gdbarch
->core_read_description
);
734 fprintf_unfiltered (file
,
735 "gdbarch_dump: core_regset_sections = %s\n",
736 host_address_to_string (gdbarch
->core_regset_sections
));
737 fprintf_unfiltered (file
,
738 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
739 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
740 fprintf_unfiltered (file
,
741 "gdbarch_dump: core_xfer_shared_libraries = <0x%lx>\n",
742 (long) gdbarch
->core_xfer_shared_libraries
);
743 fprintf_unfiltered (file
,
744 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
745 paddr_nz (gdbarch
->decr_pc_after_break
));
746 fprintf_unfiltered (file
,
747 "gdbarch_dump: deprecated_fp_regnum = %s\n",
748 paddr_d (gdbarch
->deprecated_fp_regnum
));
749 fprintf_unfiltered (file
,
750 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
751 paddr_nz (gdbarch
->deprecated_function_start_offset
));
752 fprintf_unfiltered (file
,
753 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
754 gdbarch_displaced_step_copy_insn_p (gdbarch
));
755 fprintf_unfiltered (file
,
756 "gdbarch_dump: displaced_step_copy_insn = <0x%lx>\n",
757 (long) gdbarch
->displaced_step_copy_insn
);
758 fprintf_unfiltered (file
,
759 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
760 gdbarch_displaced_step_fixup_p (gdbarch
));
761 fprintf_unfiltered (file
,
762 "gdbarch_dump: displaced_step_fixup = <0x%lx>\n",
763 (long) gdbarch
->displaced_step_fixup
);
764 fprintf_unfiltered (file
,
765 "gdbarch_dump: displaced_step_free_closure = <0x%lx>\n",
766 (long) gdbarch
->displaced_step_free_closure
);
767 fprintf_unfiltered (file
,
768 "gdbarch_dump: displaced_step_location = <0x%lx>\n",
769 (long) gdbarch
->displaced_step_location
);
770 fprintf_unfiltered (file
,
771 "gdbarch_dump: double_bit = %s\n",
772 paddr_d (gdbarch
->double_bit
));
773 fprintf_unfiltered (file
,
774 "gdbarch_dump: double_format = %s\n",
775 pformat (gdbarch
->double_format
));
776 fprintf_unfiltered (file
,
777 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
778 gdbarch_dummy_id_p (gdbarch
));
779 fprintf_unfiltered (file
,
780 "gdbarch_dump: dummy_id = <0x%lx>\n",
781 (long) gdbarch
->dummy_id
);
782 fprintf_unfiltered (file
,
783 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
784 (long) gdbarch
->dwarf2_reg_to_regnum
);
785 fprintf_unfiltered (file
,
786 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
787 (long) gdbarch
->ecoff_reg_to_regnum
);
788 fprintf_unfiltered (file
,
789 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
790 (long) gdbarch
->elf_make_msymbol_special
);
791 fprintf_unfiltered (file
,
792 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
793 gdbarch_fetch_pointer_argument_p (gdbarch
));
794 fprintf_unfiltered (file
,
795 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
796 (long) gdbarch
->fetch_pointer_argument
);
797 fprintf_unfiltered (file
,
798 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
799 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
800 fprintf_unfiltered (file
,
801 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
802 (long) gdbarch
->fetch_tls_load_module_address
);
803 fprintf_unfiltered (file
,
804 "gdbarch_dump: float_bit = %s\n",
805 paddr_d (gdbarch
->float_bit
));
806 fprintf_unfiltered (file
,
807 "gdbarch_dump: float_format = %s\n",
808 pformat (gdbarch
->float_format
));
809 fprintf_unfiltered (file
,
810 "gdbarch_dump: fp0_regnum = %s\n",
811 paddr_d (gdbarch
->fp0_regnum
));
812 fprintf_unfiltered (file
,
813 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
814 gdbarch_frame_align_p (gdbarch
));
815 fprintf_unfiltered (file
,
816 "gdbarch_dump: frame_align = <0x%lx>\n",
817 (long) gdbarch
->frame_align
);
818 fprintf_unfiltered (file
,
819 "gdbarch_dump: frame_args_skip = 0x%s\n",
820 paddr_nz (gdbarch
->frame_args_skip
));
821 fprintf_unfiltered (file
,
822 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
823 gdbarch_frame_num_args_p (gdbarch
));
824 fprintf_unfiltered (file
,
825 "gdbarch_dump: frame_num_args = <0x%lx>\n",
826 (long) gdbarch
->frame_num_args
);
827 fprintf_unfiltered (file
,
828 "gdbarch_dump: frame_red_zone_size = %s\n",
829 paddr_d (gdbarch
->frame_red_zone_size
));
830 fprintf_unfiltered (file
,
831 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
832 gdbarch_get_longjmp_target_p (gdbarch
));
833 fprintf_unfiltered (file
,
834 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
835 (long) gdbarch
->get_longjmp_target
);
836 fprintf_unfiltered (file
,
837 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
838 paddr_d (gdbarch
->have_nonsteppable_watchpoint
));
839 fprintf_unfiltered (file
,
840 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
841 (long) gdbarch
->in_function_epilogue_p
);
842 fprintf_unfiltered (file
,
843 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
844 (long) gdbarch
->in_solib_return_trampoline
);
845 fprintf_unfiltered (file
,
846 "gdbarch_dump: inner_than = <0x%lx>\n",
847 (long) gdbarch
->inner_than
);
848 fprintf_unfiltered (file
,
849 "gdbarch_dump: int_bit = %s\n",
850 paddr_d (gdbarch
->int_bit
));
851 fprintf_unfiltered (file
,
852 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
853 gdbarch_integer_to_address_p (gdbarch
));
854 fprintf_unfiltered (file
,
855 "gdbarch_dump: integer_to_address = <0x%lx>\n",
856 (long) gdbarch
->integer_to_address
);
857 fprintf_unfiltered (file
,
858 "gdbarch_dump: long_bit = %s\n",
859 paddr_d (gdbarch
->long_bit
));
860 fprintf_unfiltered (file
,
861 "gdbarch_dump: long_double_bit = %s\n",
862 paddr_d (gdbarch
->long_double_bit
));
863 fprintf_unfiltered (file
,
864 "gdbarch_dump: long_double_format = %s\n",
865 pformat (gdbarch
->long_double_format
));
866 fprintf_unfiltered (file
,
867 "gdbarch_dump: long_long_bit = %s\n",
868 paddr_d (gdbarch
->long_long_bit
));
869 fprintf_unfiltered (file
,
870 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
871 gdbarch_max_insn_length_p (gdbarch
));
872 fprintf_unfiltered (file
,
873 "gdbarch_dump: max_insn_length = %s\n",
874 paddr_d (gdbarch
->max_insn_length
));
875 fprintf_unfiltered (file
,
876 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
877 (long) gdbarch
->memory_insert_breakpoint
);
878 fprintf_unfiltered (file
,
879 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
880 (long) gdbarch
->memory_remove_breakpoint
);
881 fprintf_unfiltered (file
,
882 "gdbarch_dump: name_of_malloc = %s\n",
883 gdbarch
->name_of_malloc
);
884 fprintf_unfiltered (file
,
885 "gdbarch_dump: num_pseudo_regs = %s\n",
886 paddr_d (gdbarch
->num_pseudo_regs
));
887 fprintf_unfiltered (file
,
888 "gdbarch_dump: num_regs = %s\n",
889 paddr_d (gdbarch
->num_regs
));
890 fprintf_unfiltered (file
,
891 "gdbarch_dump: osabi = %s\n",
892 paddr_d (gdbarch
->osabi
));
893 fprintf_unfiltered (file
,
894 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
895 gdbarch_overlay_update_p (gdbarch
));
896 fprintf_unfiltered (file
,
897 "gdbarch_dump: overlay_update = <0x%lx>\n",
898 (long) gdbarch
->overlay_update
);
899 fprintf_unfiltered (file
,
900 "gdbarch_dump: pc_regnum = %s\n",
901 paddr_d (gdbarch
->pc_regnum
));
902 fprintf_unfiltered (file
,
903 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
904 (long) gdbarch
->pointer_to_address
);
905 fprintf_unfiltered (file
,
906 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
907 gdbarch_print_float_info_p (gdbarch
));
908 fprintf_unfiltered (file
,
909 "gdbarch_dump: print_float_info = <0x%lx>\n",
910 (long) gdbarch
->print_float_info
);
911 fprintf_unfiltered (file
,
912 "gdbarch_dump: print_insn = <0x%lx>\n",
913 (long) gdbarch
->print_insn
);
914 fprintf_unfiltered (file
,
915 "gdbarch_dump: print_registers_info = <0x%lx>\n",
916 (long) gdbarch
->print_registers_info
);
917 fprintf_unfiltered (file
,
918 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
919 gdbarch_print_vector_info_p (gdbarch
));
920 fprintf_unfiltered (file
,
921 "gdbarch_dump: print_vector_info = <0x%lx>\n",
922 (long) gdbarch
->print_vector_info
);
923 fprintf_unfiltered (file
,
924 "gdbarch_dump: ps_regnum = %s\n",
925 paddr_d (gdbarch
->ps_regnum
));
926 fprintf_unfiltered (file
,
927 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
928 gdbarch_pseudo_register_read_p (gdbarch
));
929 fprintf_unfiltered (file
,
930 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
931 (long) gdbarch
->pseudo_register_read
);
932 fprintf_unfiltered (file
,
933 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
934 gdbarch_pseudo_register_write_p (gdbarch
));
935 fprintf_unfiltered (file
,
936 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
937 (long) gdbarch
->pseudo_register_write
);
938 fprintf_unfiltered (file
,
939 "gdbarch_dump: ptr_bit = %s\n",
940 paddr_d (gdbarch
->ptr_bit
));
941 fprintf_unfiltered (file
,
942 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
943 gdbarch_push_dummy_call_p (gdbarch
));
944 fprintf_unfiltered (file
,
945 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
946 (long) gdbarch
->push_dummy_call
);
947 fprintf_unfiltered (file
,
948 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
949 gdbarch_push_dummy_code_p (gdbarch
));
950 fprintf_unfiltered (file
,
951 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
952 (long) gdbarch
->push_dummy_code
);
953 fprintf_unfiltered (file
,
954 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
955 gdbarch_read_pc_p (gdbarch
));
956 fprintf_unfiltered (file
,
957 "gdbarch_dump: read_pc = <0x%lx>\n",
958 (long) gdbarch
->read_pc
);
959 fprintf_unfiltered (file
,
960 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
961 gdbarch_record_special_symbol_p (gdbarch
));
962 fprintf_unfiltered (file
,
963 "gdbarch_dump: record_special_symbol = <0x%lx>\n",
964 (long) gdbarch
->record_special_symbol
);
965 fprintf_unfiltered (file
,
966 "gdbarch_dump: register_name = <0x%lx>\n",
967 (long) gdbarch
->register_name
);
968 fprintf_unfiltered (file
,
969 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
970 (long) gdbarch
->register_reggroup_p
);
971 fprintf_unfiltered (file
,
972 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
973 (long) gdbarch
->register_sim_regno
);
974 fprintf_unfiltered (file
,
975 "gdbarch_dump: register_to_value = <0x%lx>\n",
976 (long) gdbarch
->register_to_value
);
977 fprintf_unfiltered (file
,
978 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
979 gdbarch_register_type_p (gdbarch
));
980 fprintf_unfiltered (file
,
981 "gdbarch_dump: register_type = <0x%lx>\n",
982 (long) gdbarch
->register_type
);
983 fprintf_unfiltered (file
,
984 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
985 gdbarch_regset_from_core_section_p (gdbarch
));
986 fprintf_unfiltered (file
,
987 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
988 (long) gdbarch
->regset_from_core_section
);
989 fprintf_unfiltered (file
,
990 "gdbarch_dump: remote_register_number = <0x%lx>\n",
991 (long) gdbarch
->remote_register_number
);
992 fprintf_unfiltered (file
,
993 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
994 gdbarch_return_value_p (gdbarch
));
995 fprintf_unfiltered (file
,
996 "gdbarch_dump: return_value = <0x%lx>\n",
997 (long) gdbarch
->return_value
);
998 fprintf_unfiltered (file
,
999 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1000 (long) gdbarch
->sdb_reg_to_regnum
);
1001 fprintf_unfiltered (file
,
1002 "gdbarch_dump: short_bit = %s\n",
1003 paddr_d (gdbarch
->short_bit
));
1004 fprintf_unfiltered (file
,
1005 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1006 gdbarch_single_step_through_delay_p (gdbarch
));
1007 fprintf_unfiltered (file
,
1008 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1009 (long) gdbarch
->single_step_through_delay
);
1010 fprintf_unfiltered (file
,
1011 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1012 gdbarch_skip_main_prologue_p (gdbarch
));
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: skip_main_prologue = <0x%lx>\n",
1015 (long) gdbarch
->skip_main_prologue
);
1016 fprintf_unfiltered (file
,
1017 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1018 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1019 fprintf_unfiltered (file
,
1020 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1021 (long) gdbarch
->skip_permanent_breakpoint
);
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1024 (long) gdbarch
->skip_prologue
);
1025 fprintf_unfiltered (file
,
1026 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1027 (long) gdbarch
->skip_solib_resolver
);
1028 fprintf_unfiltered (file
,
1029 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1030 (long) gdbarch
->skip_trampoline_code
);
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1033 (long) gdbarch
->smash_text_address
);
1034 fprintf_unfiltered (file
,
1035 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1036 gdbarch_software_single_step_p (gdbarch
));
1037 fprintf_unfiltered (file
,
1038 "gdbarch_dump: software_single_step = <0x%lx>\n",
1039 (long) gdbarch
->software_single_step
);
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1042 paddr_d (gdbarch
->sofun_address_maybe_missing
));
1043 fprintf_unfiltered (file
,
1044 "gdbarch_dump: sp_regnum = %s\n",
1045 paddr_d (gdbarch
->sp_regnum
));
1046 fprintf_unfiltered (file
,
1047 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1048 (long) gdbarch
->stab_reg_to_regnum
);
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1051 (long) gdbarch
->stabs_argument_has_addr
);
1052 fprintf_unfiltered (file
,
1053 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1054 gdbarch_static_transform_name_p (gdbarch
));
1055 fprintf_unfiltered (file
,
1056 "gdbarch_dump: static_transform_name = <0x%lx>\n",
1057 (long) gdbarch
->static_transform_name
);
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: target_desc = %s\n",
1060 paddr_d ((long) gdbarch
->target_desc
));
1061 fprintf_unfiltered (file
,
1062 "gdbarch_dump: target_signal_from_host = <0x%lx>\n",
1063 (long) gdbarch
->target_signal_from_host
);
1064 fprintf_unfiltered (file
,
1065 "gdbarch_dump: target_signal_to_host = <0x%lx>\n",
1066 (long) gdbarch
->target_signal_to_host
);
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1069 gdbarch_unwind_pc_p (gdbarch
));
1070 fprintf_unfiltered (file
,
1071 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1072 (long) gdbarch
->unwind_pc
);
1073 fprintf_unfiltered (file
,
1074 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1075 gdbarch_unwind_sp_p (gdbarch
));
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1078 (long) gdbarch
->unwind_sp
);
1079 fprintf_unfiltered (file
,
1080 "gdbarch_dump: value_from_register = <0x%lx>\n",
1081 (long) gdbarch
->value_from_register
);
1082 fprintf_unfiltered (file
,
1083 "gdbarch_dump: value_to_register = <0x%lx>\n",
1084 (long) gdbarch
->value_to_register
);
1085 fprintf_unfiltered (file
,
1086 "gdbarch_dump: vbit_in_delta = %s\n",
1087 paddr_d (gdbarch
->vbit_in_delta
));
1088 fprintf_unfiltered (file
,
1089 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1090 (long) gdbarch
->virtual_frame_pointer
);
1091 fprintf_unfiltered (file
,
1092 "gdbarch_dump: vtable_function_descriptors = %s\n",
1093 paddr_d (gdbarch
->vtable_function_descriptors
));
1094 fprintf_unfiltered (file
,
1095 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1096 gdbarch_write_pc_p (gdbarch
));
1097 fprintf_unfiltered (file
,
1098 "gdbarch_dump: write_pc = <0x%lx>\n",
1099 (long) gdbarch
->write_pc
);
1100 if (gdbarch
->dump_tdep
!= NULL
)
1101 gdbarch
->dump_tdep (gdbarch
, file
);
1104 struct gdbarch_tdep
*
1105 gdbarch_tdep (struct gdbarch
*gdbarch
)
1107 if (gdbarch_debug
>= 2)
1108 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1109 return gdbarch
->tdep
;
1113 const struct bfd_arch_info
*
1114 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1116 gdb_assert (gdbarch
!= NULL
);
1117 if (gdbarch_debug
>= 2)
1118 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1119 return gdbarch
->bfd_arch_info
;
1123 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1125 gdb_assert (gdbarch
!= NULL
);
1126 if (gdbarch_debug
>= 2)
1127 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1128 return gdbarch
->byte_order
;
1132 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1134 gdb_assert (gdbarch
!= NULL
);
1135 if (gdbarch_debug
>= 2)
1136 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1137 return gdbarch
->byte_order_for_code
;
1141 gdbarch_osabi (struct gdbarch
*gdbarch
)
1143 gdb_assert (gdbarch
!= NULL
);
1144 if (gdbarch_debug
>= 2)
1145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1146 return gdbarch
->osabi
;
1149 const struct target_desc
*
1150 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1152 gdb_assert (gdbarch
!= NULL
);
1153 if (gdbarch_debug
>= 2)
1154 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1155 return gdbarch
->target_desc
;
1159 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1161 gdb_assert (gdbarch
!= NULL
);
1162 /* Skip verify of bits_big_endian, invalid_p == 0 */
1163 if (gdbarch_debug
>= 2)
1164 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1165 return gdbarch
->bits_big_endian
;
1169 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1170 int bits_big_endian
)
1172 gdbarch
->bits_big_endian
= bits_big_endian
;
1176 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1178 gdb_assert (gdbarch
!= NULL
);
1179 /* Skip verify of short_bit, invalid_p == 0 */
1180 if (gdbarch_debug
>= 2)
1181 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1182 return gdbarch
->short_bit
;
1186 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1189 gdbarch
->short_bit
= short_bit
;
1193 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1195 gdb_assert (gdbarch
!= NULL
);
1196 /* Skip verify of int_bit, invalid_p == 0 */
1197 if (gdbarch_debug
>= 2)
1198 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1199 return gdbarch
->int_bit
;
1203 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1206 gdbarch
->int_bit
= int_bit
;
1210 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1212 gdb_assert (gdbarch
!= NULL
);
1213 /* Skip verify of long_bit, invalid_p == 0 */
1214 if (gdbarch_debug
>= 2)
1215 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1216 return gdbarch
->long_bit
;
1220 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1223 gdbarch
->long_bit
= long_bit
;
1227 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1229 gdb_assert (gdbarch
!= NULL
);
1230 /* Skip verify of long_long_bit, invalid_p == 0 */
1231 if (gdbarch_debug
>= 2)
1232 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1233 return gdbarch
->long_long_bit
;
1237 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1240 gdbarch
->long_long_bit
= long_long_bit
;
1244 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1246 gdb_assert (gdbarch
!= NULL
);
1247 /* Skip verify of float_bit, invalid_p == 0 */
1248 if (gdbarch_debug
>= 2)
1249 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1250 return gdbarch
->float_bit
;
1254 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1257 gdbarch
->float_bit
= float_bit
;
1260 const struct floatformat
**
1261 gdbarch_float_format (struct gdbarch
*gdbarch
)
1263 gdb_assert (gdbarch
!= NULL
);
1264 if (gdbarch_debug
>= 2)
1265 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1266 return gdbarch
->float_format
;
1270 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1271 const struct floatformat
** float_format
)
1273 gdbarch
->float_format
= float_format
;
1277 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1279 gdb_assert (gdbarch
!= NULL
);
1280 /* Skip verify of double_bit, invalid_p == 0 */
1281 if (gdbarch_debug
>= 2)
1282 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1283 return gdbarch
->double_bit
;
1287 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1290 gdbarch
->double_bit
= double_bit
;
1293 const struct floatformat
**
1294 gdbarch_double_format (struct gdbarch
*gdbarch
)
1296 gdb_assert (gdbarch
!= NULL
);
1297 if (gdbarch_debug
>= 2)
1298 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1299 return gdbarch
->double_format
;
1303 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1304 const struct floatformat
** double_format
)
1306 gdbarch
->double_format
= double_format
;
1310 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1312 gdb_assert (gdbarch
!= NULL
);
1313 /* Skip verify of long_double_bit, invalid_p == 0 */
1314 if (gdbarch_debug
>= 2)
1315 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1316 return gdbarch
->long_double_bit
;
1320 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1321 int long_double_bit
)
1323 gdbarch
->long_double_bit
= long_double_bit
;
1326 const struct floatformat
**
1327 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1329 gdb_assert (gdbarch
!= NULL
);
1330 if (gdbarch_debug
>= 2)
1331 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1332 return gdbarch
->long_double_format
;
1336 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1337 const struct floatformat
** long_double_format
)
1339 gdbarch
->long_double_format
= long_double_format
;
1343 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1345 gdb_assert (gdbarch
!= NULL
);
1346 /* Skip verify of ptr_bit, invalid_p == 0 */
1347 if (gdbarch_debug
>= 2)
1348 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1349 return gdbarch
->ptr_bit
;
1353 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1356 gdbarch
->ptr_bit
= ptr_bit
;
1360 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1362 gdb_assert (gdbarch
!= NULL
);
1363 /* Check variable changed from pre-default. */
1364 gdb_assert (gdbarch
->addr_bit
!= 0);
1365 if (gdbarch_debug
>= 2)
1366 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1367 return gdbarch
->addr_bit
;
1371 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1374 gdbarch
->addr_bit
= addr_bit
;
1378 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1380 gdb_assert (gdbarch
!= NULL
);
1381 /* Check variable changed from pre-default. */
1382 gdb_assert (gdbarch
->char_signed
!= -1);
1383 if (gdbarch_debug
>= 2)
1384 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1385 return gdbarch
->char_signed
;
1389 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1392 gdbarch
->char_signed
= char_signed
;
1396 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1398 gdb_assert (gdbarch
!= NULL
);
1399 return gdbarch
->read_pc
!= NULL
;
1403 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1405 gdb_assert (gdbarch
!= NULL
);
1406 gdb_assert (gdbarch
->read_pc
!= NULL
);
1407 if (gdbarch_debug
>= 2)
1408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1409 return gdbarch
->read_pc (regcache
);
1413 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1414 gdbarch_read_pc_ftype read_pc
)
1416 gdbarch
->read_pc
= read_pc
;
1420 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1422 gdb_assert (gdbarch
!= NULL
);
1423 return gdbarch
->write_pc
!= NULL
;
1427 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1429 gdb_assert (gdbarch
!= NULL
);
1430 gdb_assert (gdbarch
->write_pc
!= NULL
);
1431 if (gdbarch_debug
>= 2)
1432 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1433 gdbarch
->write_pc (regcache
, val
);
1437 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1438 gdbarch_write_pc_ftype write_pc
)
1440 gdbarch
->write_pc
= write_pc
;
1444 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1446 gdb_assert (gdbarch
!= NULL
);
1447 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1448 if (gdbarch_debug
>= 2)
1449 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1450 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1454 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1455 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1457 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1461 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1463 gdb_assert (gdbarch
!= NULL
);
1464 return gdbarch
->pseudo_register_read
!= NULL
;
1468 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1470 gdb_assert (gdbarch
!= NULL
);
1471 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1472 if (gdbarch_debug
>= 2)
1473 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1474 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1478 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1479 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1481 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1485 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1487 gdb_assert (gdbarch
!= NULL
);
1488 return gdbarch
->pseudo_register_write
!= NULL
;
1492 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1494 gdb_assert (gdbarch
!= NULL
);
1495 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1496 if (gdbarch_debug
>= 2)
1497 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1498 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1502 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1503 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1505 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1509 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1511 gdb_assert (gdbarch
!= NULL
);
1512 /* Check variable changed from pre-default. */
1513 gdb_assert (gdbarch
->num_regs
!= -1);
1514 if (gdbarch_debug
>= 2)
1515 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1516 return gdbarch
->num_regs
;
1520 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1523 gdbarch
->num_regs
= num_regs
;
1527 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1529 gdb_assert (gdbarch
!= NULL
);
1530 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1531 if (gdbarch_debug
>= 2)
1532 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1533 return gdbarch
->num_pseudo_regs
;
1537 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1538 int num_pseudo_regs
)
1540 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1544 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1546 gdb_assert (gdbarch
!= NULL
);
1547 /* Skip verify of sp_regnum, invalid_p == 0 */
1548 if (gdbarch_debug
>= 2)
1549 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1550 return gdbarch
->sp_regnum
;
1554 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1557 gdbarch
->sp_regnum
= sp_regnum
;
1561 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1563 gdb_assert (gdbarch
!= NULL
);
1564 /* Skip verify of pc_regnum, invalid_p == 0 */
1565 if (gdbarch_debug
>= 2)
1566 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1567 return gdbarch
->pc_regnum
;
1571 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1574 gdbarch
->pc_regnum
= pc_regnum
;
1578 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1580 gdb_assert (gdbarch
!= NULL
);
1581 /* Skip verify of ps_regnum, invalid_p == 0 */
1582 if (gdbarch_debug
>= 2)
1583 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1584 return gdbarch
->ps_regnum
;
1588 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1591 gdbarch
->ps_regnum
= ps_regnum
;
1595 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1597 gdb_assert (gdbarch
!= NULL
);
1598 /* Skip verify of fp0_regnum, invalid_p == 0 */
1599 if (gdbarch_debug
>= 2)
1600 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1601 return gdbarch
->fp0_regnum
;
1605 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1608 gdbarch
->fp0_regnum
= fp0_regnum
;
1612 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1614 gdb_assert (gdbarch
!= NULL
);
1615 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1616 if (gdbarch_debug
>= 2)
1617 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1618 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
1622 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1623 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1625 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1629 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1631 gdb_assert (gdbarch
!= NULL
);
1632 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1633 if (gdbarch_debug
>= 2)
1634 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1635 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
1639 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1640 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1642 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1646 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1648 gdb_assert (gdbarch
!= NULL
);
1649 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1650 if (gdbarch_debug
>= 2)
1651 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1652 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
1656 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1657 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1659 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1663 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1665 gdb_assert (gdbarch
!= NULL
);
1666 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1667 if (gdbarch_debug
>= 2)
1668 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1669 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
1673 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1674 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1676 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1680 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1682 gdb_assert (gdbarch
!= NULL
);
1683 gdb_assert (gdbarch
->register_name
!= NULL
);
1684 if (gdbarch_debug
>= 2)
1685 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1686 return gdbarch
->register_name (gdbarch
, regnr
);
1690 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1691 gdbarch_register_name_ftype register_name
)
1693 gdbarch
->register_name
= register_name
;
1697 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1699 gdb_assert (gdbarch
!= NULL
);
1700 return gdbarch
->register_type
!= NULL
;
1704 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
1706 gdb_assert (gdbarch
!= NULL
);
1707 gdb_assert (gdbarch
->register_type
!= NULL
);
1708 if (gdbarch_debug
>= 2)
1709 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
1710 return gdbarch
->register_type (gdbarch
, reg_nr
);
1714 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
1715 gdbarch_register_type_ftype register_type
)
1717 gdbarch
->register_type
= register_type
;
1721 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
1723 gdb_assert (gdbarch
!= NULL
);
1724 return gdbarch
->dummy_id
!= NULL
;
1728 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
1730 gdb_assert (gdbarch
!= NULL
);
1731 gdb_assert (gdbarch
->dummy_id
!= NULL
);
1732 if (gdbarch_debug
>= 2)
1733 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
1734 return gdbarch
->dummy_id (gdbarch
, this_frame
);
1738 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
1739 gdbarch_dummy_id_ftype dummy_id
)
1741 gdbarch
->dummy_id
= dummy_id
;
1745 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
1747 gdb_assert (gdbarch
!= NULL
);
1748 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1749 if (gdbarch_debug
>= 2)
1750 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
1751 return gdbarch
->deprecated_fp_regnum
;
1755 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
1756 int deprecated_fp_regnum
)
1758 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
1762 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
1764 gdb_assert (gdbarch
!= NULL
);
1765 return gdbarch
->push_dummy_call
!= NULL
;
1769 gdbarch_push_dummy_call (struct gdbarch
*gdbarch
, struct value
*function
, struct regcache
*regcache
, CORE_ADDR bp_addr
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
1771 gdb_assert (gdbarch
!= NULL
);
1772 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
1773 if (gdbarch_debug
>= 2)
1774 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
1775 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
1779 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
1780 gdbarch_push_dummy_call_ftype push_dummy_call
)
1782 gdbarch
->push_dummy_call
= push_dummy_call
;
1786 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1788 gdb_assert (gdbarch
!= NULL
);
1789 /* Skip verify of call_dummy_location, invalid_p == 0 */
1790 if (gdbarch_debug
>= 2)
1791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1792 return gdbarch
->call_dummy_location
;
1796 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1797 int call_dummy_location
)
1799 gdbarch
->call_dummy_location
= call_dummy_location
;
1803 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
1805 gdb_assert (gdbarch
!= NULL
);
1806 return gdbarch
->push_dummy_code
!= NULL
;
1810 gdbarch_push_dummy_code (struct gdbarch
*gdbarch
, CORE_ADDR sp
, CORE_ADDR funaddr
, struct value
**args
, int nargs
, struct type
*value_type
, CORE_ADDR
*real_pc
, CORE_ADDR
*bp_addr
, struct regcache
*regcache
)
1812 gdb_assert (gdbarch
!= NULL
);
1813 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
1814 if (gdbarch_debug
>= 2)
1815 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
1816 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
1820 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
1821 gdbarch_push_dummy_code_ftype push_dummy_code
)
1823 gdbarch
->push_dummy_code
= push_dummy_code
;
1827 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
1829 gdb_assert (gdbarch
!= NULL
);
1830 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
1831 if (gdbarch_debug
>= 2)
1832 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
1833 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
1837 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
1838 gdbarch_print_registers_info_ftype print_registers_info
)
1840 gdbarch
->print_registers_info
= print_registers_info
;
1844 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
1846 gdb_assert (gdbarch
!= NULL
);
1847 return gdbarch
->print_float_info
!= NULL
;
1851 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1853 gdb_assert (gdbarch
!= NULL
);
1854 gdb_assert (gdbarch
->print_float_info
!= NULL
);
1855 if (gdbarch_debug
>= 2)
1856 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
1857 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
1861 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
1862 gdbarch_print_float_info_ftype print_float_info
)
1864 gdbarch
->print_float_info
= print_float_info
;
1868 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
1870 gdb_assert (gdbarch
!= NULL
);
1871 return gdbarch
->print_vector_info
!= NULL
;
1875 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1877 gdb_assert (gdbarch
!= NULL
);
1878 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
1879 if (gdbarch_debug
>= 2)
1880 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
1881 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
1885 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
1886 gdbarch_print_vector_info_ftype print_vector_info
)
1888 gdbarch
->print_vector_info
= print_vector_info
;
1892 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
1894 gdb_assert (gdbarch
!= NULL
);
1895 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
1896 if (gdbarch_debug
>= 2)
1897 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
1898 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
1902 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
1903 gdbarch_register_sim_regno_ftype register_sim_regno
)
1905 gdbarch
->register_sim_regno
= register_sim_regno
;
1909 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
1911 gdb_assert (gdbarch
!= NULL
);
1912 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
1913 if (gdbarch_debug
>= 2)
1914 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
1915 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
1919 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
1920 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
1922 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
1926 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
1928 gdb_assert (gdbarch
!= NULL
);
1929 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
1930 if (gdbarch_debug
>= 2)
1931 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
1932 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
1936 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
1937 gdbarch_cannot_store_register_ftype cannot_store_register
)
1939 gdbarch
->cannot_store_register
= cannot_store_register
;
1943 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
1945 gdb_assert (gdbarch
!= NULL
);
1946 return gdbarch
->get_longjmp_target
!= NULL
;
1950 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
1952 gdb_assert (gdbarch
!= NULL
);
1953 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
1954 if (gdbarch_debug
>= 2)
1955 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
1956 return gdbarch
->get_longjmp_target (frame
, pc
);
1960 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
1961 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
1963 gdbarch
->get_longjmp_target
= get_longjmp_target
;
1967 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1969 gdb_assert (gdbarch
!= NULL
);
1970 if (gdbarch_debug
>= 2)
1971 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1972 return gdbarch
->believe_pcc_promotion
;
1976 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1977 int believe_pcc_promotion
)
1979 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1983 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
1985 gdb_assert (gdbarch
!= NULL
);
1986 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
1987 if (gdbarch_debug
>= 2)
1988 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
1989 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
1993 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
1994 gdbarch_convert_register_p_ftype convert_register_p
)
1996 gdbarch
->convert_register_p
= convert_register_p
;
2000 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2002 gdb_assert (gdbarch
!= NULL
);
2003 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2004 if (gdbarch_debug
>= 2)
2005 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2006 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2010 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2011 gdbarch_register_to_value_ftype register_to_value
)
2013 gdbarch
->register_to_value
= register_to_value
;
2017 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2019 gdb_assert (gdbarch
!= NULL
);
2020 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2021 if (gdbarch_debug
>= 2)
2022 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2023 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2027 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2028 gdbarch_value_to_register_ftype value_to_register
)
2030 gdbarch
->value_to_register
= value_to_register
;
2034 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2036 gdb_assert (gdbarch
!= NULL
);
2037 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2038 if (gdbarch_debug
>= 2)
2039 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2040 return gdbarch
->value_from_register (type
, regnum
, frame
);
2044 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2045 gdbarch_value_from_register_ftype value_from_register
)
2047 gdbarch
->value_from_register
= value_from_register
;
2051 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2053 gdb_assert (gdbarch
!= NULL
);
2054 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2055 if (gdbarch_debug
>= 2)
2056 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2057 return gdbarch
->pointer_to_address (type
, buf
);
2061 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2062 gdbarch_pointer_to_address_ftype pointer_to_address
)
2064 gdbarch
->pointer_to_address
= pointer_to_address
;
2068 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2070 gdb_assert (gdbarch
!= NULL
);
2071 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2072 if (gdbarch_debug
>= 2)
2073 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2074 gdbarch
->address_to_pointer (type
, buf
, addr
);
2078 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2079 gdbarch_address_to_pointer_ftype address_to_pointer
)
2081 gdbarch
->address_to_pointer
= address_to_pointer
;
2085 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2087 gdb_assert (gdbarch
!= NULL
);
2088 return gdbarch
->integer_to_address
!= NULL
;
2092 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2094 gdb_assert (gdbarch
!= NULL
);
2095 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2096 if (gdbarch_debug
>= 2)
2097 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2098 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2102 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2103 gdbarch_integer_to_address_ftype integer_to_address
)
2105 gdbarch
->integer_to_address
= integer_to_address
;
2109 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2111 gdb_assert (gdbarch
!= NULL
);
2112 return gdbarch
->return_value
!= NULL
;
2115 enum return_value_convention
2116 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*functype
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2118 gdb_assert (gdbarch
!= NULL
);
2119 gdb_assert (gdbarch
->return_value
!= NULL
);
2120 if (gdbarch_debug
>= 2)
2121 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2122 return gdbarch
->return_value (gdbarch
, functype
, valtype
, regcache
, readbuf
, writebuf
);
2126 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2127 gdbarch_return_value_ftype return_value
)
2129 gdbarch
->return_value
= return_value
;
2133 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2135 gdb_assert (gdbarch
!= NULL
);
2136 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2137 if (gdbarch_debug
>= 2)
2138 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2139 return gdbarch
->skip_prologue (gdbarch
, ip
);
2143 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2144 gdbarch_skip_prologue_ftype skip_prologue
)
2146 gdbarch
->skip_prologue
= skip_prologue
;
2150 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2152 gdb_assert (gdbarch
!= NULL
);
2153 return gdbarch
->skip_main_prologue
!= NULL
;
2157 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2159 gdb_assert (gdbarch
!= NULL
);
2160 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2161 if (gdbarch_debug
>= 2)
2162 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2163 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2167 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2168 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2170 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2174 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2176 gdb_assert (gdbarch
!= NULL
);
2177 gdb_assert (gdbarch
->inner_than
!= NULL
);
2178 if (gdbarch_debug
>= 2)
2179 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2180 return gdbarch
->inner_than (lhs
, rhs
);
2184 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2185 gdbarch_inner_than_ftype inner_than
)
2187 gdbarch
->inner_than
= inner_than
;
2191 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2193 gdb_assert (gdbarch
!= NULL
);
2194 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2195 if (gdbarch_debug
>= 2)
2196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2197 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2201 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2202 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2204 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2208 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2210 gdb_assert (gdbarch
!= NULL
);
2211 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2215 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2217 gdb_assert (gdbarch
!= NULL
);
2218 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2219 if (gdbarch_debug
>= 2)
2220 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2221 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2225 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2226 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2228 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2232 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2234 gdb_assert (gdbarch
!= NULL
);
2235 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2236 if (gdbarch_debug
>= 2)
2237 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2238 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2242 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2243 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2245 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2249 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2251 gdb_assert (gdbarch
!= NULL
);
2252 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2253 if (gdbarch_debug
>= 2)
2254 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2255 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2259 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2260 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2262 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2266 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2268 gdb_assert (gdbarch
!= NULL
);
2269 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2270 if (gdbarch_debug
>= 2)
2271 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2272 return gdbarch
->decr_pc_after_break
;
2276 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2277 CORE_ADDR decr_pc_after_break
)
2279 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2283 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2285 gdb_assert (gdbarch
!= NULL
);
2286 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2287 if (gdbarch_debug
>= 2)
2288 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2289 return gdbarch
->deprecated_function_start_offset
;
2293 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2294 CORE_ADDR deprecated_function_start_offset
)
2296 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2300 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2302 gdb_assert (gdbarch
!= NULL
);
2303 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2304 if (gdbarch_debug
>= 2)
2305 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2306 return gdbarch
->remote_register_number (gdbarch
, regno
);
2310 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2311 gdbarch_remote_register_number_ftype remote_register_number
)
2313 gdbarch
->remote_register_number
= remote_register_number
;
2317 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2319 gdb_assert (gdbarch
!= NULL
);
2320 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2324 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2326 gdb_assert (gdbarch
!= NULL
);
2327 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2328 if (gdbarch_debug
>= 2)
2329 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2330 return gdbarch
->fetch_tls_load_module_address (objfile
);
2334 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2335 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2337 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2341 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2343 gdb_assert (gdbarch
!= NULL
);
2344 /* Skip verify of frame_args_skip, invalid_p == 0 */
2345 if (gdbarch_debug
>= 2)
2346 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2347 return gdbarch
->frame_args_skip
;
2351 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2352 CORE_ADDR frame_args_skip
)
2354 gdbarch
->frame_args_skip
= frame_args_skip
;
2358 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2360 gdb_assert (gdbarch
!= NULL
);
2361 return gdbarch
->unwind_pc
!= NULL
;
2365 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2367 gdb_assert (gdbarch
!= NULL
);
2368 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2369 if (gdbarch_debug
>= 2)
2370 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2371 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2375 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2376 gdbarch_unwind_pc_ftype unwind_pc
)
2378 gdbarch
->unwind_pc
= unwind_pc
;
2382 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2384 gdb_assert (gdbarch
!= NULL
);
2385 return gdbarch
->unwind_sp
!= NULL
;
2389 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2391 gdb_assert (gdbarch
!= NULL
);
2392 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2393 if (gdbarch_debug
>= 2)
2394 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2395 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2399 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2400 gdbarch_unwind_sp_ftype unwind_sp
)
2402 gdbarch
->unwind_sp
= unwind_sp
;
2406 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2408 gdb_assert (gdbarch
!= NULL
);
2409 return gdbarch
->frame_num_args
!= NULL
;
2413 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2415 gdb_assert (gdbarch
!= NULL
);
2416 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2417 if (gdbarch_debug
>= 2)
2418 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2419 return gdbarch
->frame_num_args (frame
);
2423 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2424 gdbarch_frame_num_args_ftype frame_num_args
)
2426 gdbarch
->frame_num_args
= frame_num_args
;
2430 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2432 gdb_assert (gdbarch
!= NULL
);
2433 return gdbarch
->frame_align
!= NULL
;
2437 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2439 gdb_assert (gdbarch
!= NULL
);
2440 gdb_assert (gdbarch
->frame_align
!= NULL
);
2441 if (gdbarch_debug
>= 2)
2442 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2443 return gdbarch
->frame_align (gdbarch
, address
);
2447 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2448 gdbarch_frame_align_ftype frame_align
)
2450 gdbarch
->frame_align
= frame_align
;
2454 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2456 gdb_assert (gdbarch
!= NULL
);
2457 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2458 if (gdbarch_debug
>= 2)
2459 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2460 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2464 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2465 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2467 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2471 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2473 gdb_assert (gdbarch
!= NULL
);
2474 if (gdbarch_debug
>= 2)
2475 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2476 return gdbarch
->frame_red_zone_size
;
2480 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2481 int frame_red_zone_size
)
2483 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2487 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2489 gdb_assert (gdbarch
!= NULL
);
2490 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2491 if (gdbarch_debug
>= 2)
2492 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2493 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2497 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2498 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2500 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2504 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2506 gdb_assert (gdbarch
!= NULL
);
2507 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2508 if (gdbarch_debug
>= 2)
2509 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2510 return gdbarch
->addr_bits_remove (addr
);
2514 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2515 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2517 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2521 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2523 gdb_assert (gdbarch
!= NULL
);
2524 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2525 if (gdbarch_debug
>= 2)
2526 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2527 return gdbarch
->smash_text_address (addr
);
2531 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2532 gdbarch_smash_text_address_ftype smash_text_address
)
2534 gdbarch
->smash_text_address
= smash_text_address
;
2538 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2540 gdb_assert (gdbarch
!= NULL
);
2541 return gdbarch
->software_single_step
!= NULL
;
2545 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2547 gdb_assert (gdbarch
!= NULL
);
2548 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2549 if (gdbarch_debug
>= 2)
2550 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2551 return gdbarch
->software_single_step (frame
);
2555 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2556 gdbarch_software_single_step_ftype software_single_step
)
2558 gdbarch
->software_single_step
= software_single_step
;
2562 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2564 gdb_assert (gdbarch
!= NULL
);
2565 return gdbarch
->single_step_through_delay
!= NULL
;
2569 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2571 gdb_assert (gdbarch
!= NULL
);
2572 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2573 if (gdbarch_debug
>= 2)
2574 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2575 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2579 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2580 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2582 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2586 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2588 gdb_assert (gdbarch
!= NULL
);
2589 gdb_assert (gdbarch
->print_insn
!= NULL
);
2590 if (gdbarch_debug
>= 2)
2591 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2592 return gdbarch
->print_insn (vma
, info
);
2596 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2597 gdbarch_print_insn_ftype print_insn
)
2599 gdbarch
->print_insn
= print_insn
;
2603 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2605 gdb_assert (gdbarch
!= NULL
);
2606 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2607 if (gdbarch_debug
>= 2)
2608 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2609 return gdbarch
->skip_trampoline_code (frame
, pc
);
2613 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2614 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2616 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2620 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2622 gdb_assert (gdbarch
!= NULL
);
2623 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2624 if (gdbarch_debug
>= 2)
2625 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2626 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2630 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2631 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2633 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2637 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2639 gdb_assert (gdbarch
!= NULL
);
2640 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2641 if (gdbarch_debug
>= 2)
2642 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2643 return gdbarch
->in_solib_return_trampoline (pc
, name
);
2647 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2648 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2650 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2654 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2656 gdb_assert (gdbarch
!= NULL
);
2657 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2658 if (gdbarch_debug
>= 2)
2659 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2660 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2664 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2665 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2667 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2671 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
2673 gdb_assert (gdbarch
!= NULL
);
2674 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
2675 if (gdbarch_debug
>= 2)
2676 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
2677 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
2681 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
2682 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
2684 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
2688 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2690 gdb_assert (gdbarch
!= NULL
);
2691 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2692 if (gdbarch_debug
>= 2)
2693 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2694 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2698 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2699 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
2701 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
2705 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
2707 gdb_assert (gdbarch
!= NULL
);
2708 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
2709 if (gdbarch_debug
>= 2)
2710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
2711 gdbarch
->coff_make_msymbol_special (val
, msym
);
2715 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
2716 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
2718 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
2722 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
2724 gdb_assert (gdbarch
!= NULL
);
2725 /* Skip verify of name_of_malloc, invalid_p == 0 */
2726 if (gdbarch_debug
>= 2)
2727 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
2728 return gdbarch
->name_of_malloc
;
2732 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
2733 const char * name_of_malloc
)
2735 gdbarch
->name_of_malloc
= name_of_malloc
;
2739 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
2741 gdb_assert (gdbarch
!= NULL
);
2742 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2743 if (gdbarch_debug
>= 2)
2744 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
2745 return gdbarch
->cannot_step_breakpoint
;
2749 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
2750 int cannot_step_breakpoint
)
2752 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
2756 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
2758 gdb_assert (gdbarch
!= NULL
);
2759 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2760 if (gdbarch_debug
>= 2)
2761 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
2762 return gdbarch
->have_nonsteppable_watchpoint
;
2766 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
2767 int have_nonsteppable_watchpoint
)
2769 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
2773 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
2775 gdb_assert (gdbarch
!= NULL
);
2776 return gdbarch
->address_class_type_flags
!= NULL
;
2780 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
2782 gdb_assert (gdbarch
!= NULL
);
2783 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
2784 if (gdbarch_debug
>= 2)
2785 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
2786 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
2790 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
2791 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
2793 gdbarch
->address_class_type_flags
= address_class_type_flags
;
2797 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
2799 gdb_assert (gdbarch
!= NULL
);
2800 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
2804 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
2806 gdb_assert (gdbarch
!= NULL
);
2807 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
2808 if (gdbarch_debug
>= 2)
2809 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
2810 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
2814 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
2815 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
2817 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
2821 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
2823 gdb_assert (gdbarch
!= NULL
);
2824 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
2828 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
2830 gdb_assert (gdbarch
!= NULL
);
2831 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
2832 if (gdbarch_debug
>= 2)
2833 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
2834 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
2838 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
2839 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
2841 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
2845 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
2847 gdb_assert (gdbarch
!= NULL
);
2848 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
2849 if (gdbarch_debug
>= 2)
2850 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
2851 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
2855 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
2856 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
2858 gdbarch
->register_reggroup_p
= register_reggroup_p
;
2862 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
2864 gdb_assert (gdbarch
!= NULL
);
2865 return gdbarch
->fetch_pointer_argument
!= NULL
;
2869 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
2871 gdb_assert (gdbarch
!= NULL
);
2872 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
2873 if (gdbarch_debug
>= 2)
2874 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
2875 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
2879 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
2880 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
2882 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
2886 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
2888 gdb_assert (gdbarch
!= NULL
);
2889 return gdbarch
->regset_from_core_section
!= NULL
;
2892 const struct regset
*
2893 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
2895 gdb_assert (gdbarch
!= NULL
);
2896 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
2897 if (gdbarch_debug
>= 2)
2898 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
2899 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
2903 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
2904 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
2906 gdbarch
->regset_from_core_section
= regset_from_core_section
;
2909 struct core_regset_section
*
2910 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
2912 gdb_assert (gdbarch
!= NULL
);
2913 if (gdbarch_debug
>= 2)
2914 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
2915 return gdbarch
->core_regset_sections
;
2919 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
2920 struct core_regset_section
* core_regset_sections
)
2922 gdbarch
->core_regset_sections
= core_regset_sections
;
2926 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
2928 gdb_assert (gdbarch
!= NULL
);
2929 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
2933 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
2935 gdb_assert (gdbarch
!= NULL
);
2936 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
2937 if (gdbarch_debug
>= 2)
2938 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
2939 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
2943 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
2944 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
2946 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
2950 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
2952 gdb_assert (gdbarch
!= NULL
);
2953 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2954 if (gdbarch_debug
>= 2)
2955 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
2956 return gdbarch
->vtable_function_descriptors
;
2960 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
2961 int vtable_function_descriptors
)
2963 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
2967 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
2969 gdb_assert (gdbarch
!= NULL
);
2970 /* Skip verify of vbit_in_delta, invalid_p == 0 */
2971 if (gdbarch_debug
>= 2)
2972 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
2973 return gdbarch
->vbit_in_delta
;
2977 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
2980 gdbarch
->vbit_in_delta
= vbit_in_delta
;
2984 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
2986 gdb_assert (gdbarch
!= NULL
);
2987 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
2991 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
2993 gdb_assert (gdbarch
!= NULL
);
2994 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
2995 if (gdbarch_debug
>= 2)
2996 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
2997 gdbarch
->skip_permanent_breakpoint (regcache
);
3001 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3002 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3004 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3008 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3010 gdb_assert (gdbarch
!= NULL
);
3011 return gdbarch
->max_insn_length
!= 0;
3015 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3017 gdb_assert (gdbarch
!= NULL
);
3018 /* Check variable changed from pre-default. */
3019 gdb_assert (gdbarch
->max_insn_length
!= 0);
3020 if (gdbarch_debug
>= 2)
3021 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3022 return gdbarch
->max_insn_length
;
3026 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3027 ULONGEST max_insn_length
)
3029 gdbarch
->max_insn_length
= max_insn_length
;
3033 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3035 gdb_assert (gdbarch
!= NULL
);
3036 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3039 struct displaced_step_closure
*
3040 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3042 gdb_assert (gdbarch
!= NULL
);
3043 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3044 if (gdbarch_debug
>= 2)
3045 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3046 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3050 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3051 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3053 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3057 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3059 gdb_assert (gdbarch
!= NULL
);
3060 return gdbarch
->displaced_step_fixup
!= NULL
;
3064 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3066 gdb_assert (gdbarch
!= NULL
);
3067 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3068 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3069 if (gdbarch_debug
>= 2)
3070 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3071 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3075 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3076 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3078 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3082 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3084 gdb_assert (gdbarch
!= NULL
);
3085 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3086 if (gdbarch_debug
>= 2)
3087 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3088 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3092 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3093 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3095 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3099 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3101 gdb_assert (gdbarch
!= NULL
);
3102 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3103 if (gdbarch_debug
>= 2)
3104 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3105 return gdbarch
->displaced_step_location (gdbarch
);
3109 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3110 gdbarch_displaced_step_location_ftype displaced_step_location
)
3112 gdbarch
->displaced_step_location
= displaced_step_location
;
3116 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3118 gdb_assert (gdbarch
!= NULL
);
3119 return gdbarch
->overlay_update
!= NULL
;
3123 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3125 gdb_assert (gdbarch
!= NULL
);
3126 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3127 if (gdbarch_debug
>= 2)
3128 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3129 gdbarch
->overlay_update (osect
);
3133 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3134 gdbarch_overlay_update_ftype overlay_update
)
3136 gdbarch
->overlay_update
= overlay_update
;
3140 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3142 gdb_assert (gdbarch
!= NULL
);
3143 return gdbarch
->core_read_description
!= NULL
;
3146 const struct target_desc
*
3147 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3149 gdb_assert (gdbarch
!= NULL
);
3150 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3151 if (gdbarch_debug
>= 2)
3152 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3153 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3157 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3158 gdbarch_core_read_description_ftype core_read_description
)
3160 gdbarch
->core_read_description
= core_read_description
;
3164 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3166 gdb_assert (gdbarch
!= NULL
);
3167 return gdbarch
->static_transform_name
!= NULL
;
3171 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, char *name
)
3173 gdb_assert (gdbarch
!= NULL
);
3174 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3175 if (gdbarch_debug
>= 2)
3176 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3177 return gdbarch
->static_transform_name (name
);
3181 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3182 gdbarch_static_transform_name_ftype static_transform_name
)
3184 gdbarch
->static_transform_name
= static_transform_name
;
3188 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3190 gdb_assert (gdbarch
!= NULL
);
3191 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3192 if (gdbarch_debug
>= 2)
3193 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3194 return gdbarch
->sofun_address_maybe_missing
;
3198 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3199 int sofun_address_maybe_missing
)
3201 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3205 gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
, int signo
)
3207 gdb_assert (gdbarch
!= NULL
);
3208 gdb_assert (gdbarch
->target_signal_from_host
!= NULL
);
3209 if (gdbarch_debug
>= 2)
3210 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_from_host called\n");
3211 return gdbarch
->target_signal_from_host (gdbarch
, signo
);
3215 set_gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
,
3216 gdbarch_target_signal_from_host_ftype target_signal_from_host
)
3218 gdbarch
->target_signal_from_host
= target_signal_from_host
;
3222 gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
, enum target_signal ts
)
3224 gdb_assert (gdbarch
!= NULL
);
3225 gdb_assert (gdbarch
->target_signal_to_host
!= NULL
);
3226 if (gdbarch_debug
>= 2)
3227 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_to_host called\n");
3228 return gdbarch
->target_signal_to_host (gdbarch
, ts
);
3232 set_gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
,
3233 gdbarch_target_signal_to_host_ftype target_signal_to_host
)
3235 gdbarch
->target_signal_to_host
= target_signal_to_host
;
3239 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3241 gdb_assert (gdbarch
!= NULL
);
3242 return gdbarch
->record_special_symbol
!= NULL
;
3246 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3248 gdb_assert (gdbarch
!= NULL
);
3249 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3250 if (gdbarch_debug
>= 2)
3251 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3252 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3256 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3257 gdbarch_record_special_symbol_ftype record_special_symbol
)
3259 gdbarch
->record_special_symbol
= record_special_symbol
;
3263 /* Keep a registry of per-architecture data-pointers required by GDB
3270 gdbarch_data_pre_init_ftype
*pre_init
;
3271 gdbarch_data_post_init_ftype
*post_init
;
3274 struct gdbarch_data_registration
3276 struct gdbarch_data
*data
;
3277 struct gdbarch_data_registration
*next
;
3280 struct gdbarch_data_registry
3283 struct gdbarch_data_registration
*registrations
;
3286 struct gdbarch_data_registry gdbarch_data_registry
=
3291 static struct gdbarch_data
*
3292 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3293 gdbarch_data_post_init_ftype
*post_init
)
3295 struct gdbarch_data_registration
**curr
;
3296 /* Append the new registraration. */
3297 for (curr
= &gdbarch_data_registry
.registrations
;
3299 curr
= &(*curr
)->next
);
3300 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3301 (*curr
)->next
= NULL
;
3302 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3303 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3304 (*curr
)->data
->pre_init
= pre_init
;
3305 (*curr
)->data
->post_init
= post_init
;
3306 (*curr
)->data
->init_p
= 1;
3307 return (*curr
)->data
;
3310 struct gdbarch_data
*
3311 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3313 return gdbarch_data_register (pre_init
, NULL
);
3316 struct gdbarch_data
*
3317 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3319 return gdbarch_data_register (NULL
, post_init
);
3322 /* Create/delete the gdbarch data vector. */
3325 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3327 gdb_assert (gdbarch
->data
== NULL
);
3328 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3329 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3332 /* Initialize the current value of the specified per-architecture
3336 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3337 struct gdbarch_data
*data
,
3340 gdb_assert (data
->index
< gdbarch
->nr_data
);
3341 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3342 gdb_assert (data
->pre_init
== NULL
);
3343 gdbarch
->data
[data
->index
] = pointer
;
3346 /* Return the current value of the specified per-architecture
3350 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3352 gdb_assert (data
->index
< gdbarch
->nr_data
);
3353 if (gdbarch
->data
[data
->index
] == NULL
)
3355 /* The data-pointer isn't initialized, call init() to get a
3357 if (data
->pre_init
!= NULL
)
3358 /* Mid architecture creation: pass just the obstack, and not
3359 the entire architecture, as that way it isn't possible for
3360 pre-init code to refer to undefined architecture
3362 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3363 else if (gdbarch
->initialized_p
3364 && data
->post_init
!= NULL
)
3365 /* Post architecture creation: pass the entire architecture
3366 (as all fields are valid), but be careful to also detect
3367 recursive references. */
3369 gdb_assert (data
->init_p
);
3371 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3375 /* The architecture initialization hasn't completed - punt -
3376 hope that the caller knows what they are doing. Once
3377 deprecated_set_gdbarch_data has been initialized, this can be
3378 changed to an internal error. */
3380 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3382 return gdbarch
->data
[data
->index
];
3386 /* Keep a registry of the architectures known by GDB. */
3388 struct gdbarch_registration
3390 enum bfd_architecture bfd_architecture
;
3391 gdbarch_init_ftype
*init
;
3392 gdbarch_dump_tdep_ftype
*dump_tdep
;
3393 struct gdbarch_list
*arches
;
3394 struct gdbarch_registration
*next
;
3397 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3400 append_name (const char ***buf
, int *nr
, const char *name
)
3402 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3408 gdbarch_printable_names (void)
3410 /* Accumulate a list of names based on the registed list of
3412 enum bfd_architecture a
;
3414 const char **arches
= NULL
;
3415 struct gdbarch_registration
*rego
;
3416 for (rego
= gdbarch_registry
;
3420 const struct bfd_arch_info
*ap
;
3421 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3423 internal_error (__FILE__
, __LINE__
,
3424 _("gdbarch_architecture_names: multi-arch unknown"));
3427 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3432 append_name (&arches
, &nr_arches
, NULL
);
3438 gdbarch_register (enum bfd_architecture bfd_architecture
,
3439 gdbarch_init_ftype
*init
,
3440 gdbarch_dump_tdep_ftype
*dump_tdep
)
3442 struct gdbarch_registration
**curr
;
3443 const struct bfd_arch_info
*bfd_arch_info
;
3444 /* Check that BFD recognizes this architecture */
3445 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3446 if (bfd_arch_info
== NULL
)
3448 internal_error (__FILE__
, __LINE__
,
3449 _("gdbarch: Attempt to register unknown architecture (%d)"),
3452 /* Check that we haven't seen this architecture before */
3453 for (curr
= &gdbarch_registry
;
3455 curr
= &(*curr
)->next
)
3457 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3458 internal_error (__FILE__
, __LINE__
,
3459 _("gdbarch: Duplicate registraration of architecture (%s)"),
3460 bfd_arch_info
->printable_name
);
3464 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3465 bfd_arch_info
->printable_name
,
3468 (*curr
) = XMALLOC (struct gdbarch_registration
);
3469 (*curr
)->bfd_architecture
= bfd_architecture
;
3470 (*curr
)->init
= init
;
3471 (*curr
)->dump_tdep
= dump_tdep
;
3472 (*curr
)->arches
= NULL
;
3473 (*curr
)->next
= NULL
;
3477 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3478 gdbarch_init_ftype
*init
)
3480 gdbarch_register (bfd_architecture
, init
, NULL
);
3484 /* Look for an architecture using gdbarch_info. */
3486 struct gdbarch_list
*
3487 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3488 const struct gdbarch_info
*info
)
3490 for (; arches
!= NULL
; arches
= arches
->next
)
3492 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3494 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3496 if (info
->osabi
!= arches
->gdbarch
->osabi
)
3498 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
3506 /* Find an architecture that matches the specified INFO. Create a new
3507 architecture if needed. Return that new architecture. Assumes
3508 that there is no current architecture. */
3510 static struct gdbarch
*
3511 find_arch_by_info (struct gdbarch_info info
)
3513 struct gdbarch
*new_gdbarch
;
3514 struct gdbarch_registration
*rego
;
3516 /* The existing architecture has been swapped out - all this code
3517 works from a clean slate. */
3518 gdb_assert (current_gdbarch
== NULL
);
3520 /* Fill in missing parts of the INFO struct using a number of
3521 sources: "set ..."; INFOabfd supplied; and the global
3523 gdbarch_info_fill (&info
);
3525 /* Must have found some sort of architecture. */
3526 gdb_assert (info
.bfd_arch_info
!= NULL
);
3530 fprintf_unfiltered (gdb_stdlog
,
3531 "find_arch_by_info: info.bfd_arch_info %s\n",
3532 (info
.bfd_arch_info
!= NULL
3533 ? info
.bfd_arch_info
->printable_name
3535 fprintf_unfiltered (gdb_stdlog
,
3536 "find_arch_by_info: info.byte_order %d (%s)\n",
3538 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
3539 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
3541 fprintf_unfiltered (gdb_stdlog
,
3542 "find_arch_by_info: info.osabi %d (%s)\n",
3543 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
3544 fprintf_unfiltered (gdb_stdlog
,
3545 "find_arch_by_info: info.abfd 0x%lx\n",
3547 fprintf_unfiltered (gdb_stdlog
,
3548 "find_arch_by_info: info.tdep_info 0x%lx\n",
3549 (long) info
.tdep_info
);
3552 /* Find the tdep code that knows about this architecture. */
3553 for (rego
= gdbarch_registry
;
3556 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
3561 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3562 "No matching architecture\n");
3566 /* Ask the tdep code for an architecture that matches "info". */
3567 new_gdbarch
= rego
->init (info
, rego
->arches
);
3569 /* Did the tdep code like it? No. Reject the change and revert to
3570 the old architecture. */
3571 if (new_gdbarch
== NULL
)
3574 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3575 "Target rejected architecture\n");
3579 /* Is this a pre-existing architecture (as determined by already
3580 being initialized)? Move it to the front of the architecture
3581 list (keeping the list sorted Most Recently Used). */
3582 if (new_gdbarch
->initialized_p
)
3584 struct gdbarch_list
**list
;
3585 struct gdbarch_list
*this;
3587 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3588 "Previous architecture 0x%08lx (%s) selected\n",
3590 new_gdbarch
->bfd_arch_info
->printable_name
);
3591 /* Find the existing arch in the list. */
3592 for (list
= ®o
->arches
;
3593 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
3594 list
= &(*list
)->next
);
3595 /* It had better be in the list of architectures. */
3596 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
3599 (*list
) = this->next
;
3600 /* Insert THIS at the front. */
3601 this->next
= rego
->arches
;
3602 rego
->arches
= this;
3607 /* It's a new architecture. */
3609 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3610 "New architecture 0x%08lx (%s) selected\n",
3612 new_gdbarch
->bfd_arch_info
->printable_name
);
3614 /* Insert the new architecture into the front of the architecture
3615 list (keep the list sorted Most Recently Used). */
3617 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
3618 this->next
= rego
->arches
;
3619 this->gdbarch
= new_gdbarch
;
3620 rego
->arches
= this;
3623 /* Check that the newly installed architecture is valid. Plug in
3624 any post init values. */
3625 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
3626 verify_gdbarch (new_gdbarch
);
3627 new_gdbarch
->initialized_p
= 1;
3630 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
3636 gdbarch_find_by_info (struct gdbarch_info info
)
3638 struct gdbarch
*new_gdbarch
;
3640 /* Save the previously selected architecture, setting the global to
3641 NULL. This stops things like gdbarch->init() trying to use the
3642 previous architecture's configuration. The previous architecture
3643 may not even be of the same architecture family. The most recent
3644 architecture of the same family is found at the head of the
3645 rego->arches list. */
3646 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3647 current_gdbarch
= NULL
;
3649 /* Find the specified architecture. */
3650 new_gdbarch
= find_arch_by_info (info
);
3652 /* Restore the existing architecture. */
3653 gdb_assert (current_gdbarch
== NULL
);
3654 current_gdbarch
= old_gdbarch
;
3659 /* Make the specified architecture current. */
3662 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
3664 gdb_assert (new_gdbarch
!= NULL
);
3665 gdb_assert (current_gdbarch
!= NULL
);
3666 gdb_assert (new_gdbarch
->initialized_p
);
3667 current_gdbarch
= new_gdbarch
;
3668 observer_notify_architecture_changed (new_gdbarch
);
3669 reinit_frame_cache ();
3672 extern void _initialize_gdbarch (void);
3675 _initialize_gdbarch (void)
3677 struct cmd_list_element
*c
;
3679 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
3680 Set architecture debugging."), _("\
3681 Show architecture debugging."), _("\
3682 When non-zero, architecture debugging is enabled."),
3685 &setdebuglist
, &showdebuglist
);