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,
6 2007, 2008, 2009 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"
53 /* Static function declarations */
55 static void alloc_gdbarch_data (struct gdbarch *);
57 /* Non-zero if we want to trace architecture code. */
60 #define GDBARCH_DEBUG 0
62 int gdbarch_debug = GDBARCH_DEBUG;
64 show_gdbarch_debug (struct ui_file *file, int from_tty,
65 struct cmd_list_element *c, const char *value)
67 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
71 pformat (const struct floatformat **format)
76 /* Just print out one of them - this is only for diagnostics. */
77 return format[0]->name;
81 pstring (const char *string)
89 /* Maintain the struct gdbarch object. */
93 /* Has this architecture been fully initialized? */
96 /* An obstack bound to the lifetime of the architecture. */
97 struct obstack *obstack;
99 /* basic architectural information. */
100 const struct bfd_arch_info * bfd_arch_info;
102 int byte_order_for_code;
103 enum gdb_osabi osabi;
104 const struct target_desc * target_desc;
106 /* target specific vector. */
107 struct gdbarch_tdep *tdep;
108 gdbarch_dump_tdep_ftype *dump_tdep;
110 /* per-architecture data-pointers. */
114 /* per-architecture swap-regions. */
115 struct gdbarch_swap *swap;
117 /* Multi-arch values.
119 When extending this structure you must:
123 Declare set/get functions and define the corresponding
126 gdbarch_alloc(): If zero/NULL is not a suitable default,
127 initialize the new field.
129 verify_gdbarch(): Confirm that the target updated the field
132 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
135 ``startup_gdbarch()'': Append an initial value to the static
136 variable (base values on the host's c-type system).
138 get_gdbarch(): Implement the set/get functions (probably using
139 the macro's as shortcuts).
148 int long_long_align_bit;
150 const struct floatformat ** half_format;
152 const struct floatformat ** float_format;
154 const struct floatformat ** double_format;
156 const struct floatformat ** long_double_format;
159 int dwarf2_addr_size;
161 gdbarch_read_pc_ftype *read_pc;
162 gdbarch_write_pc_ftype *write_pc;
163 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
164 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
165 gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value;
166 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
169 gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect;
170 gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack;
175 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
176 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
177 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
178 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
179 gdbarch_register_name_ftype *register_name;
180 gdbarch_register_type_ftype *register_type;
181 gdbarch_dummy_id_ftype *dummy_id;
182 int deprecated_fp_regnum;
183 gdbarch_push_dummy_call_ftype *push_dummy_call;
184 int call_dummy_location;
185 gdbarch_push_dummy_code_ftype *push_dummy_code;
186 gdbarch_print_registers_info_ftype *print_registers_info;
187 gdbarch_print_float_info_ftype *print_float_info;
188 gdbarch_print_vector_info_ftype *print_vector_info;
189 gdbarch_register_sim_regno_ftype *register_sim_regno;
190 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
191 gdbarch_cannot_store_register_ftype *cannot_store_register;
192 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
193 int believe_pcc_promotion;
194 gdbarch_convert_register_p_ftype *convert_register_p;
195 gdbarch_register_to_value_ftype *register_to_value;
196 gdbarch_value_to_register_ftype *value_to_register;
197 gdbarch_value_from_register_ftype *value_from_register;
198 gdbarch_pointer_to_address_ftype *pointer_to_address;
199 gdbarch_address_to_pointer_ftype *address_to_pointer;
200 gdbarch_integer_to_address_ftype *integer_to_address;
201 gdbarch_return_value_ftype *return_value;
202 gdbarch_skip_prologue_ftype *skip_prologue;
203 gdbarch_skip_main_prologue_ftype *skip_main_prologue;
204 gdbarch_inner_than_ftype *inner_than;
205 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
206 gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
207 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
208 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
209 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
210 CORE_ADDR decr_pc_after_break;
211 CORE_ADDR deprecated_function_start_offset;
212 gdbarch_remote_register_number_ftype *remote_register_number;
213 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
214 CORE_ADDR frame_args_skip;
215 gdbarch_unwind_pc_ftype *unwind_pc;
216 gdbarch_unwind_sp_ftype *unwind_sp;
217 gdbarch_frame_num_args_ftype *frame_num_args;
218 gdbarch_frame_align_ftype *frame_align;
219 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
220 int frame_red_zone_size;
221 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
222 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
223 gdbarch_smash_text_address_ftype *smash_text_address;
224 gdbarch_software_single_step_ftype *software_single_step;
225 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
226 gdbarch_print_insn_ftype *print_insn;
227 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
228 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
229 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
230 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
231 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
232 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
233 int cannot_step_breakpoint;
234 int have_nonsteppable_watchpoint;
235 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
236 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
237 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
238 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
239 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
240 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
241 struct core_regset_section * core_regset_sections;
242 gdbarch_make_corefile_notes_ftype *make_corefile_notes;
243 gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
244 gdbarch_core_pid_to_str_ftype *core_pid_to_str;
245 const char * gcore_bfd_target;
246 int vtable_function_descriptors;
248 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
249 ULONGEST max_insn_length;
250 gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
251 gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
252 gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
253 gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
254 gdbarch_displaced_step_location_ftype *displaced_step_location;
255 gdbarch_relocate_instruction_ftype *relocate_instruction;
256 gdbarch_overlay_update_ftype *overlay_update;
257 gdbarch_core_read_description_ftype *core_read_description;
258 gdbarch_static_transform_name_ftype *static_transform_name;
259 int sofun_address_maybe_missing;
260 gdbarch_process_record_ftype *process_record;
261 gdbarch_process_record_signal_ftype *process_record_signal;
262 gdbarch_target_signal_from_host_ftype *target_signal_from_host;
263 gdbarch_target_signal_to_host_ftype *target_signal_to_host;
264 gdbarch_get_siginfo_type_ftype *get_siginfo_type;
265 gdbarch_record_special_symbol_ftype *record_special_symbol;
266 gdbarch_get_syscall_number_ftype *get_syscall_number;
267 int has_global_solist;
268 int has_global_breakpoints;
269 gdbarch_has_shared_address_space_ftype *has_shared_address_space;
270 gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
271 gdbarch_auto_charset_ftype *auto_charset;
272 gdbarch_auto_wide_charset_ftype *auto_wide_charset;
273 const char * solib_symbols_extension;
274 int has_dos_based_file_system;
275 gdbarch_gen_return_address_ftype *gen_return_address;
276 gdbarch_info_proc_ftype *info_proc;
280 /* The default architecture uses host values (for want of a better
283 extern const struct bfd_arch_info bfd_default_arch_struct;
285 struct gdbarch startup_gdbarch =
287 1, /* Always initialized. */
288 NULL, /* The obstack. */
289 /* basic architecture information. */
290 &bfd_default_arch_struct, /* bfd_arch_info */
291 BFD_ENDIAN_BIG, /* byte_order */
292 BFD_ENDIAN_BIG, /* byte_order_for_code */
293 GDB_OSABI_UNKNOWN, /* osabi */
295 /* target specific vector and its dump routine. */
297 /*per-architecture data-pointers and swap regions. */
299 /* Multi-arch values */
300 1, /* bits_big_endian */
301 8 * sizeof (short), /* short_bit */
302 8 * sizeof (int), /* int_bit */
303 8 * sizeof (long), /* long_bit */
304 8 * sizeof (LONGEST), /* long_long_bit */
305 8 * sizeof (LONGEST), /* long_long_align_bit */
308 8 * sizeof (float), /* float_bit */
309 0, /* float_format */
310 8 * sizeof (double), /* double_bit */
311 0, /* double_format */
312 8 * sizeof (long double), /* long_double_bit */
313 0, /* long_double_format */
314 8 * sizeof (void*), /* ptr_bit */
315 8 * sizeof (void*), /* addr_bit */
316 sizeof (void*), /* dwarf2_addr_size */
320 legacy_virtual_frame_pointer, /* virtual_frame_pointer */
321 0, /* pseudo_register_read */
322 0, /* pseudo_register_read_value */
323 0, /* pseudo_register_write */
325 0, /* num_pseudo_regs */
326 0, /* ax_pseudo_register_collect */
327 0, /* ax_pseudo_register_push_stack */
332 no_op_reg_to_regnum, /* stab_reg_to_regnum */
333 no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
334 no_op_reg_to_regnum, /* sdb_reg_to_regnum */
335 no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
336 0, /* register_name */
337 0, /* register_type */
339 -1, /* deprecated_fp_regnum */
340 0, /* push_dummy_call */
341 0, /* call_dummy_location */
342 0, /* push_dummy_code */
343 default_print_registers_info, /* print_registers_info */
344 0, /* print_float_info */
345 0, /* print_vector_info */
346 legacy_register_sim_regno, /* register_sim_regno */
347 cannot_register_not, /* cannot_fetch_register */
348 cannot_register_not, /* cannot_store_register */
349 0, /* get_longjmp_target */
350 0, /* believe_pcc_promotion */
351 generic_convert_register_p, /* convert_register_p */
352 0, /* register_to_value */
353 0, /* value_to_register */
354 0, /* value_from_register */
355 unsigned_pointer_to_address, /* pointer_to_address */
356 unsigned_address_to_pointer, /* address_to_pointer */
357 0, /* integer_to_address */
358 0, /* return_value */
359 0, /* skip_prologue */
360 0, /* skip_main_prologue */
362 0, /* breakpoint_from_pc */
363 default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */
364 0, /* adjust_breakpoint_address */
365 default_memory_insert_breakpoint, /* memory_insert_breakpoint */
366 default_memory_remove_breakpoint, /* memory_remove_breakpoint */
367 0, /* decr_pc_after_break */
368 0, /* deprecated_function_start_offset */
369 default_remote_register_number, /* remote_register_number */
370 0, /* fetch_tls_load_module_address */
371 0, /* frame_args_skip */
374 0, /* frame_num_args */
376 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
377 0, /* frame_red_zone_size */
378 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
379 core_addr_identity, /* addr_bits_remove */
380 core_addr_identity, /* smash_text_address */
381 0, /* software_single_step */
382 0, /* single_step_through_delay */
384 0, /* skip_trampoline_code */
385 generic_skip_solib_resolver, /* skip_solib_resolver */
386 generic_in_solib_return_trampoline, /* in_solib_return_trampoline */
387 generic_in_function_epilogue_p, /* in_function_epilogue_p */
388 0, /* elf_make_msymbol_special */
389 0, /* coff_make_msymbol_special */
390 0, /* cannot_step_breakpoint */
391 0, /* have_nonsteppable_watchpoint */
392 0, /* address_class_type_flags */
393 0, /* address_class_type_flags_to_name */
394 0, /* address_class_name_to_type_flags */
395 default_register_reggroup_p, /* register_reggroup_p */
396 0, /* fetch_pointer_argument */
397 0, /* regset_from_core_section */
398 0, /* core_regset_sections */
399 0, /* make_corefile_notes */
400 0, /* core_xfer_shared_libraries */
401 0, /* core_pid_to_str */
402 0, /* gcore_bfd_target */
403 0, /* vtable_function_descriptors */
404 0, /* vbit_in_delta */
405 0, /* skip_permanent_breakpoint */
406 0, /* max_insn_length */
407 0, /* displaced_step_copy_insn */
408 default_displaced_step_hw_singlestep, /* displaced_step_hw_singlestep */
409 0, /* displaced_step_fixup */
410 NULL, /* displaced_step_free_closure */
411 NULL, /* displaced_step_location */
412 0, /* relocate_instruction */
413 0, /* overlay_update */
414 0, /* core_read_description */
415 0, /* static_transform_name */
416 0, /* sofun_address_maybe_missing */
417 0, /* process_record */
418 0, /* process_record_signal */
419 default_target_signal_from_host, /* target_signal_from_host */
420 default_target_signal_to_host, /* target_signal_to_host */
421 0, /* get_siginfo_type */
422 0, /* record_special_symbol */
423 0, /* get_syscall_number */
424 0, /* has_global_solist */
425 0, /* has_global_breakpoints */
426 default_has_shared_address_space, /* has_shared_address_space */
427 default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
428 default_auto_charset, /* auto_charset */
429 default_auto_wide_charset, /* auto_wide_charset */
430 0, /* solib_symbols_extension */
431 0, /* has_dos_based_file_system */
432 default_gen_return_address, /* gen_return_address */
434 /* startup_gdbarch() */
437 struct gdbarch *target_gdbarch = &startup_gdbarch;
439 /* Create a new ``struct gdbarch'' based on information provided by
440 ``struct gdbarch_info''. */
443 gdbarch_alloc (const struct gdbarch_info *info,
444 struct gdbarch_tdep *tdep)
446 struct gdbarch *gdbarch;
448 /* Create an obstack for allocating all the per-architecture memory,
449 then use that to allocate the architecture vector. */
450 struct obstack *obstack = XMALLOC (struct obstack);
451 obstack_init (obstack);
452 gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
453 memset (gdbarch, 0, sizeof (*gdbarch));
454 gdbarch->obstack = obstack;
456 alloc_gdbarch_data (gdbarch);
458 gdbarch->tdep = tdep;
460 gdbarch->bfd_arch_info = info->bfd_arch_info;
461 gdbarch->byte_order = info->byte_order;
462 gdbarch->byte_order_for_code = info->byte_order_for_code;
463 gdbarch->osabi = info->osabi;
464 gdbarch->target_desc = info->target_desc;
466 /* Force the explicit initialization of these. */
467 gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
468 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
469 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
470 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
471 gdbarch->long_long_bit = 2*gdbarch->long_bit;
472 gdbarch->long_long_align_bit = 2*gdbarch->long_bit;
473 gdbarch->half_bit = 2*TARGET_CHAR_BIT;
474 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
475 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
476 gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
477 gdbarch->ptr_bit = gdbarch->int_bit;
478 gdbarch->char_signed = -1;
479 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
480 gdbarch->num_regs = -1;
481 gdbarch->sp_regnum = -1;
482 gdbarch->pc_regnum = -1;
483 gdbarch->ps_regnum = -1;
484 gdbarch->fp0_regnum = -1;
485 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
486 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
487 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
488 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
489 gdbarch->deprecated_fp_regnum = -1;
490 gdbarch->call_dummy_location = AT_ENTRY_POINT;
491 gdbarch->print_registers_info = default_print_registers_info;
492 gdbarch->register_sim_regno = legacy_register_sim_regno;
493 gdbarch->cannot_fetch_register = cannot_register_not;
494 gdbarch->cannot_store_register = cannot_register_not;
495 gdbarch->convert_register_p = generic_convert_register_p;
496 gdbarch->value_from_register = default_value_from_register;
497 gdbarch->pointer_to_address = unsigned_pointer_to_address;
498 gdbarch->address_to_pointer = unsigned_address_to_pointer;
499 gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
500 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
501 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
502 gdbarch->remote_register_number = default_remote_register_number;
503 gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
504 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
505 gdbarch->addr_bits_remove = core_addr_identity;
506 gdbarch->smash_text_address = core_addr_identity;
507 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
508 gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
509 gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
510 gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
511 gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
512 gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
513 gdbarch->register_reggroup_p = default_register_reggroup_p;
514 gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
515 gdbarch->displaced_step_fixup = NULL;
516 gdbarch->displaced_step_free_closure = NULL;
517 gdbarch->displaced_step_location = NULL;
518 gdbarch->relocate_instruction = NULL;
519 gdbarch->target_signal_from_host = default_target_signal_from_host;
520 gdbarch->target_signal_to_host = default_target_signal_to_host;
521 gdbarch->has_shared_address_space = default_has_shared_address_space;
522 gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
523 gdbarch->auto_charset = default_auto_charset;
524 gdbarch->auto_wide_charset = default_auto_wide_charset;
525 gdbarch->gen_return_address = default_gen_return_address;
526 /* gdbarch_alloc() */
532 /* Allocate extra space using the per-architecture obstack. */
535 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
537 void *data = obstack_alloc (arch->obstack, size);
539 memset (data, 0, size);
544 /* Free a gdbarch struct. This should never happen in normal
545 operation --- once you've created a gdbarch, you keep it around.
546 However, if an architecture's init function encounters an error
547 building the structure, it may need to clean up a partially
548 constructed gdbarch. */
551 gdbarch_free (struct gdbarch *arch)
553 struct obstack *obstack;
555 gdb_assert (arch != NULL);
556 gdb_assert (!arch->initialized_p);
557 obstack = arch->obstack;
558 obstack_free (obstack, 0); /* Includes the ARCH. */
563 /* Ensure that all values in a GDBARCH are reasonable. */
566 verify_gdbarch (struct gdbarch *gdbarch)
569 struct cleanup *cleanups;
573 log = mem_fileopen ();
574 cleanups = make_cleanup_ui_file_delete (log);
576 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
577 fprintf_unfiltered (log, "\n\tbyte-order");
578 if (gdbarch->bfd_arch_info == NULL)
579 fprintf_unfiltered (log, "\n\tbfd_arch_info");
580 /* Check those that need to be defined for the given multi-arch level. */
581 /* Skip verify of bits_big_endian, invalid_p == 0 */
582 /* Skip verify of short_bit, invalid_p == 0 */
583 /* Skip verify of int_bit, invalid_p == 0 */
584 /* Skip verify of long_bit, invalid_p == 0 */
585 /* Skip verify of long_long_bit, invalid_p == 0 */
586 /* Skip verify of long_long_align_bit, invalid_p == 0 */
587 /* Skip verify of half_bit, invalid_p == 0 */
588 if (gdbarch->half_format == 0)
589 gdbarch->half_format = floatformats_ieee_half;
590 /* Skip verify of float_bit, invalid_p == 0 */
591 if (gdbarch->float_format == 0)
592 gdbarch->float_format = floatformats_ieee_single;
593 /* Skip verify of double_bit, invalid_p == 0 */
594 if (gdbarch->double_format == 0)
595 gdbarch->double_format = floatformats_ieee_double;
596 /* Skip verify of long_double_bit, invalid_p == 0 */
597 if (gdbarch->long_double_format == 0)
598 gdbarch->long_double_format = floatformats_ieee_double;
599 /* Skip verify of ptr_bit, invalid_p == 0 */
600 if (gdbarch->addr_bit == 0)
601 gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
602 if (gdbarch->dwarf2_addr_size == 0)
603 gdbarch->dwarf2_addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
604 if (gdbarch->char_signed == -1)
605 gdbarch->char_signed = 1;
606 /* Skip verify of read_pc, has predicate. */
607 /* Skip verify of write_pc, has predicate. */
608 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
609 /* Skip verify of pseudo_register_read, has predicate. */
610 /* Skip verify of pseudo_register_read_value, has predicate. */
611 /* Skip verify of pseudo_register_write, has predicate. */
612 if (gdbarch->num_regs == -1)
613 fprintf_unfiltered (log, "\n\tnum_regs");
614 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
615 /* Skip verify of ax_pseudo_register_collect, has predicate. */
616 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
617 /* Skip verify of sp_regnum, invalid_p == 0 */
618 /* Skip verify of pc_regnum, invalid_p == 0 */
619 /* Skip verify of ps_regnum, invalid_p == 0 */
620 /* Skip verify of fp0_regnum, invalid_p == 0 */
621 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
622 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
623 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
624 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
625 if (gdbarch->register_name == 0)
626 fprintf_unfiltered (log, "\n\tregister_name");
627 /* Skip verify of register_type, has predicate. */
628 /* Skip verify of dummy_id, has predicate. */
629 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
630 /* Skip verify of push_dummy_call, has predicate. */
631 /* Skip verify of call_dummy_location, invalid_p == 0 */
632 /* Skip verify of push_dummy_code, has predicate. */
633 /* Skip verify of print_registers_info, invalid_p == 0 */
634 /* Skip verify of print_float_info, has predicate. */
635 /* Skip verify of print_vector_info, has predicate. */
636 /* Skip verify of register_sim_regno, invalid_p == 0 */
637 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
638 /* Skip verify of cannot_store_register, invalid_p == 0 */
639 /* Skip verify of get_longjmp_target, has predicate. */
640 /* Skip verify of convert_register_p, invalid_p == 0 */
641 /* Skip verify of value_from_register, invalid_p == 0 */
642 /* Skip verify of pointer_to_address, invalid_p == 0 */
643 /* Skip verify of address_to_pointer, invalid_p == 0 */
644 /* Skip verify of integer_to_address, has predicate. */
645 /* Skip verify of return_value, has predicate. */
646 if (gdbarch->skip_prologue == 0)
647 fprintf_unfiltered (log, "\n\tskip_prologue");
648 /* Skip verify of skip_main_prologue, has predicate. */
649 if (gdbarch->inner_than == 0)
650 fprintf_unfiltered (log, "\n\tinner_than");
651 if (gdbarch->breakpoint_from_pc == 0)
652 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
653 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
654 /* Skip verify of adjust_breakpoint_address, has predicate. */
655 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
656 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
657 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
658 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
659 /* Skip verify of remote_register_number, invalid_p == 0 */
660 /* Skip verify of fetch_tls_load_module_address, has predicate. */
661 /* Skip verify of frame_args_skip, invalid_p == 0 */
662 /* Skip verify of unwind_pc, has predicate. */
663 /* Skip verify of unwind_sp, has predicate. */
664 /* Skip verify of frame_num_args, has predicate. */
665 /* Skip verify of frame_align, has predicate. */
666 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
667 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
668 /* Skip verify of addr_bits_remove, invalid_p == 0 */
669 /* Skip verify of smash_text_address, invalid_p == 0 */
670 /* Skip verify of software_single_step, has predicate. */
671 /* Skip verify of single_step_through_delay, has predicate. */
672 if (gdbarch->print_insn == 0)
673 fprintf_unfiltered (log, "\n\tprint_insn");
674 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
675 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
676 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
677 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
678 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
679 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
680 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
681 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
682 /* Skip verify of address_class_type_flags, has predicate. */
683 /* Skip verify of address_class_type_flags_to_name, has predicate. */
684 /* Skip verify of address_class_name_to_type_flags, has predicate. */
685 /* Skip verify of register_reggroup_p, invalid_p == 0 */
686 /* Skip verify of fetch_pointer_argument, has predicate. */
687 /* Skip verify of regset_from_core_section, has predicate. */
688 /* Skip verify of make_corefile_notes, has predicate. */
689 /* Skip verify of core_xfer_shared_libraries, has predicate. */
690 /* Skip verify of core_pid_to_str, has predicate. */
691 /* Skip verify of gcore_bfd_target, has predicate. */
692 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
693 /* Skip verify of vbit_in_delta, invalid_p == 0 */
694 /* Skip verify of skip_permanent_breakpoint, has predicate. */
695 /* Skip verify of max_insn_length, has predicate. */
696 /* Skip verify of displaced_step_copy_insn, has predicate. */
697 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
698 /* Skip verify of displaced_step_fixup, has predicate. */
699 if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
700 fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
701 if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
702 fprintf_unfiltered (log, "\n\tdisplaced_step_location");
703 /* Skip verify of relocate_instruction, has predicate. */
704 /* Skip verify of overlay_update, has predicate. */
705 /* Skip verify of core_read_description, has predicate. */
706 /* Skip verify of static_transform_name, has predicate. */
707 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
708 /* Skip verify of process_record, has predicate. */
709 /* Skip verify of process_record_signal, has predicate. */
710 /* Skip verify of target_signal_from_host, invalid_p == 0 */
711 /* Skip verify of target_signal_to_host, invalid_p == 0 */
712 /* Skip verify of get_siginfo_type, has predicate. */
713 /* Skip verify of record_special_symbol, has predicate. */
714 /* Skip verify of get_syscall_number, has predicate. */
715 /* Skip verify of has_global_solist, invalid_p == 0 */
716 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
717 /* Skip verify of has_shared_address_space, invalid_p == 0 */
718 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
719 /* Skip verify of auto_charset, invalid_p == 0 */
720 /* Skip verify of auto_wide_charset, invalid_p == 0 */
721 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
722 /* Skip verify of gen_return_address, invalid_p == 0 */
723 /* Skip verify of info_proc, has predicate. */
724 buf = ui_file_xstrdup (log, &length);
725 make_cleanup (xfree, buf);
727 internal_error (__FILE__, __LINE__,
728 _("verify_gdbarch: the following are invalid ...%s"),
730 do_cleanups (cleanups);
734 /* Print out the details of the current architecture. */
737 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
739 const char *gdb_nm_file = "<not-defined>";
741 #if defined (GDB_NM_FILE)
742 gdb_nm_file = GDB_NM_FILE;
744 fprintf_unfiltered (file,
745 "gdbarch_dump: GDB_NM_FILE = %s\n",
747 fprintf_unfiltered (file,
748 "gdbarch_dump: addr_bit = %s\n",
749 plongest (gdbarch->addr_bit));
750 fprintf_unfiltered (file,
751 "gdbarch_dump: addr_bits_remove = <%s>\n",
752 host_address_to_string (gdbarch->addr_bits_remove));
753 fprintf_unfiltered (file,
754 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
755 gdbarch_address_class_name_to_type_flags_p (gdbarch));
756 fprintf_unfiltered (file,
757 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
758 host_address_to_string (gdbarch->address_class_name_to_type_flags));
759 fprintf_unfiltered (file,
760 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
761 gdbarch_address_class_type_flags_p (gdbarch));
762 fprintf_unfiltered (file,
763 "gdbarch_dump: address_class_type_flags = <%s>\n",
764 host_address_to_string (gdbarch->address_class_type_flags));
765 fprintf_unfiltered (file,
766 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
767 gdbarch_address_class_type_flags_to_name_p (gdbarch));
768 fprintf_unfiltered (file,
769 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
770 host_address_to_string (gdbarch->address_class_type_flags_to_name));
771 fprintf_unfiltered (file,
772 "gdbarch_dump: address_to_pointer = <%s>\n",
773 host_address_to_string (gdbarch->address_to_pointer));
774 fprintf_unfiltered (file,
775 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
776 gdbarch_adjust_breakpoint_address_p (gdbarch));
777 fprintf_unfiltered (file,
778 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
779 host_address_to_string (gdbarch->adjust_breakpoint_address));
780 fprintf_unfiltered (file,
781 "gdbarch_dump: auto_charset = <%s>\n",
782 host_address_to_string (gdbarch->auto_charset));
783 fprintf_unfiltered (file,
784 "gdbarch_dump: auto_wide_charset = <%s>\n",
785 host_address_to_string (gdbarch->auto_wide_charset));
786 fprintf_unfiltered (file,
787 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
788 gdbarch_ax_pseudo_register_collect_p (gdbarch));
789 fprintf_unfiltered (file,
790 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
791 host_address_to_string (gdbarch->ax_pseudo_register_collect));
792 fprintf_unfiltered (file,
793 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
794 gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
795 fprintf_unfiltered (file,
796 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
797 host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
798 fprintf_unfiltered (file,
799 "gdbarch_dump: believe_pcc_promotion = %s\n",
800 plongest (gdbarch->believe_pcc_promotion));
801 fprintf_unfiltered (file,
802 "gdbarch_dump: bfd_arch_info = %s\n",
803 gdbarch_bfd_arch_info (gdbarch)->printable_name);
804 fprintf_unfiltered (file,
805 "gdbarch_dump: bits_big_endian = %s\n",
806 plongest (gdbarch->bits_big_endian));
807 fprintf_unfiltered (file,
808 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
809 host_address_to_string (gdbarch->breakpoint_from_pc));
810 fprintf_unfiltered (file,
811 "gdbarch_dump: byte_order = %s\n",
812 plongest (gdbarch->byte_order));
813 fprintf_unfiltered (file,
814 "gdbarch_dump: byte_order_for_code = %s\n",
815 plongest (gdbarch->byte_order_for_code));
816 fprintf_unfiltered (file,
817 "gdbarch_dump: call_dummy_location = %s\n",
818 plongest (gdbarch->call_dummy_location));
819 fprintf_unfiltered (file,
820 "gdbarch_dump: cannot_fetch_register = <%s>\n",
821 host_address_to_string (gdbarch->cannot_fetch_register));
822 fprintf_unfiltered (file,
823 "gdbarch_dump: cannot_step_breakpoint = %s\n",
824 plongest (gdbarch->cannot_step_breakpoint));
825 fprintf_unfiltered (file,
826 "gdbarch_dump: cannot_store_register = <%s>\n",
827 host_address_to_string (gdbarch->cannot_store_register));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: char_signed = %s\n",
830 plongest (gdbarch->char_signed));
831 fprintf_unfiltered (file,
832 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
833 host_address_to_string (gdbarch->coff_make_msymbol_special));
834 fprintf_unfiltered (file,
835 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
836 host_address_to_string (gdbarch->convert_from_func_ptr_addr));
837 fprintf_unfiltered (file,
838 "gdbarch_dump: convert_register_p = <%s>\n",
839 host_address_to_string (gdbarch->convert_register_p));
840 fprintf_unfiltered (file,
841 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
842 gdbarch_core_pid_to_str_p (gdbarch));
843 fprintf_unfiltered (file,
844 "gdbarch_dump: core_pid_to_str = <%s>\n",
845 host_address_to_string (gdbarch->core_pid_to_str));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
848 gdbarch_core_read_description_p (gdbarch));
849 fprintf_unfiltered (file,
850 "gdbarch_dump: core_read_description = <%s>\n",
851 host_address_to_string (gdbarch->core_read_description));
852 fprintf_unfiltered (file,
853 "gdbarch_dump: core_regset_sections = %s\n",
854 host_address_to_string (gdbarch->core_regset_sections));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
857 gdbarch_core_xfer_shared_libraries_p (gdbarch));
858 fprintf_unfiltered (file,
859 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
860 host_address_to_string (gdbarch->core_xfer_shared_libraries));
861 fprintf_unfiltered (file,
862 "gdbarch_dump: decr_pc_after_break = %s\n",
863 core_addr_to_string_nz (gdbarch->decr_pc_after_break));
864 fprintf_unfiltered (file,
865 "gdbarch_dump: deprecated_fp_regnum = %s\n",
866 plongest (gdbarch->deprecated_fp_regnum));
867 fprintf_unfiltered (file,
868 "gdbarch_dump: deprecated_function_start_offset = %s\n",
869 core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
870 fprintf_unfiltered (file,
871 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
872 gdbarch_displaced_step_copy_insn_p (gdbarch));
873 fprintf_unfiltered (file,
874 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
875 host_address_to_string (gdbarch->displaced_step_copy_insn));
876 fprintf_unfiltered (file,
877 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
878 gdbarch_displaced_step_fixup_p (gdbarch));
879 fprintf_unfiltered (file,
880 "gdbarch_dump: displaced_step_fixup = <%s>\n",
881 host_address_to_string (gdbarch->displaced_step_fixup));
882 fprintf_unfiltered (file,
883 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
884 host_address_to_string (gdbarch->displaced_step_free_closure));
885 fprintf_unfiltered (file,
886 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
887 host_address_to_string (gdbarch->displaced_step_hw_singlestep));
888 fprintf_unfiltered (file,
889 "gdbarch_dump: displaced_step_location = <%s>\n",
890 host_address_to_string (gdbarch->displaced_step_location));
891 fprintf_unfiltered (file,
892 "gdbarch_dump: double_bit = %s\n",
893 plongest (gdbarch->double_bit));
894 fprintf_unfiltered (file,
895 "gdbarch_dump: double_format = %s\n",
896 pformat (gdbarch->double_format));
897 fprintf_unfiltered (file,
898 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
899 gdbarch_dummy_id_p (gdbarch));
900 fprintf_unfiltered (file,
901 "gdbarch_dump: dummy_id = <%s>\n",
902 host_address_to_string (gdbarch->dummy_id));
903 fprintf_unfiltered (file,
904 "gdbarch_dump: dwarf2_addr_size = %s\n",
905 plongest (gdbarch->dwarf2_addr_size));
906 fprintf_unfiltered (file,
907 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
908 host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
909 fprintf_unfiltered (file,
910 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
911 host_address_to_string (gdbarch->ecoff_reg_to_regnum));
912 fprintf_unfiltered (file,
913 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
914 host_address_to_string (gdbarch->elf_make_msymbol_special));
915 fprintf_unfiltered (file,
916 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
917 host_address_to_string (gdbarch->fast_tracepoint_valid_at));
918 fprintf_unfiltered (file,
919 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
920 gdbarch_fetch_pointer_argument_p (gdbarch));
921 fprintf_unfiltered (file,
922 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
923 host_address_to_string (gdbarch->fetch_pointer_argument));
924 fprintf_unfiltered (file,
925 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
926 gdbarch_fetch_tls_load_module_address_p (gdbarch));
927 fprintf_unfiltered (file,
928 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
929 host_address_to_string (gdbarch->fetch_tls_load_module_address));
930 fprintf_unfiltered (file,
931 "gdbarch_dump: float_bit = %s\n",
932 plongest (gdbarch->float_bit));
933 fprintf_unfiltered (file,
934 "gdbarch_dump: float_format = %s\n",
935 pformat (gdbarch->float_format));
936 fprintf_unfiltered (file,
937 "gdbarch_dump: fp0_regnum = %s\n",
938 plongest (gdbarch->fp0_regnum));
939 fprintf_unfiltered (file,
940 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
941 gdbarch_frame_align_p (gdbarch));
942 fprintf_unfiltered (file,
943 "gdbarch_dump: frame_align = <%s>\n",
944 host_address_to_string (gdbarch->frame_align));
945 fprintf_unfiltered (file,
946 "gdbarch_dump: frame_args_skip = %s\n",
947 core_addr_to_string_nz (gdbarch->frame_args_skip));
948 fprintf_unfiltered (file,
949 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
950 gdbarch_frame_num_args_p (gdbarch));
951 fprintf_unfiltered (file,
952 "gdbarch_dump: frame_num_args = <%s>\n",
953 host_address_to_string (gdbarch->frame_num_args));
954 fprintf_unfiltered (file,
955 "gdbarch_dump: frame_red_zone_size = %s\n",
956 plongest (gdbarch->frame_red_zone_size));
957 fprintf_unfiltered (file,
958 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
959 gdbarch_gcore_bfd_target_p (gdbarch));
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gcore_bfd_target = %s\n",
962 pstring (gdbarch->gcore_bfd_target));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: gen_return_address = <%s>\n",
965 host_address_to_string (gdbarch->gen_return_address));
966 fprintf_unfiltered (file,
967 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
968 gdbarch_get_longjmp_target_p (gdbarch));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: get_longjmp_target = <%s>\n",
971 host_address_to_string (gdbarch->get_longjmp_target));
972 fprintf_unfiltered (file,
973 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
974 gdbarch_get_siginfo_type_p (gdbarch));
975 fprintf_unfiltered (file,
976 "gdbarch_dump: get_siginfo_type = <%s>\n",
977 host_address_to_string (gdbarch->get_siginfo_type));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
980 gdbarch_get_syscall_number_p (gdbarch));
981 fprintf_unfiltered (file,
982 "gdbarch_dump: get_syscall_number = <%s>\n",
983 host_address_to_string (gdbarch->get_syscall_number));
984 fprintf_unfiltered (file,
985 "gdbarch_dump: half_bit = %s\n",
986 plongest (gdbarch->half_bit));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: half_format = %s\n",
989 pformat (gdbarch->half_format));
990 fprintf_unfiltered (file,
991 "gdbarch_dump: has_dos_based_file_system = %s\n",
992 plongest (gdbarch->has_dos_based_file_system));
993 fprintf_unfiltered (file,
994 "gdbarch_dump: has_global_breakpoints = %s\n",
995 plongest (gdbarch->has_global_breakpoints));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: has_global_solist = %s\n",
998 plongest (gdbarch->has_global_solist));
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: has_shared_address_space = <%s>\n",
1001 host_address_to_string (gdbarch->has_shared_address_space));
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1004 plongest (gdbarch->have_nonsteppable_watchpoint));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
1007 host_address_to_string (gdbarch->in_function_epilogue_p));
1008 fprintf_unfiltered (file,
1009 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
1010 host_address_to_string (gdbarch->in_solib_return_trampoline));
1011 fprintf_unfiltered (file,
1012 "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
1013 gdbarch_info_proc_p (gdbarch));
1014 fprintf_unfiltered (file,
1015 "gdbarch_dump: info_proc = <%s>\n",
1016 host_address_to_string (gdbarch->info_proc));
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: inner_than = <%s>\n",
1019 host_address_to_string (gdbarch->inner_than));
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: int_bit = %s\n",
1022 plongest (gdbarch->int_bit));
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1025 gdbarch_integer_to_address_p (gdbarch));
1026 fprintf_unfiltered (file,
1027 "gdbarch_dump: integer_to_address = <%s>\n",
1028 host_address_to_string (gdbarch->integer_to_address));
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: long_bit = %s\n",
1031 plongest (gdbarch->long_bit));
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: long_double_bit = %s\n",
1034 plongest (gdbarch->long_double_bit));
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: long_double_format = %s\n",
1037 pformat (gdbarch->long_double_format));
1038 fprintf_unfiltered (file,
1039 "gdbarch_dump: long_long_align_bit = %s\n",
1040 plongest (gdbarch->long_long_align_bit));
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: long_long_bit = %s\n",
1043 plongest (gdbarch->long_long_bit));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
1046 gdbarch_make_corefile_notes_p (gdbarch));
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: make_corefile_notes = <%s>\n",
1049 host_address_to_string (gdbarch->make_corefile_notes));
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1052 gdbarch_max_insn_length_p (gdbarch));
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: max_insn_length = %s\n",
1055 plongest (gdbarch->max_insn_length));
1056 fprintf_unfiltered (file,
1057 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1058 host_address_to_string (gdbarch->memory_insert_breakpoint));
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1061 host_address_to_string (gdbarch->memory_remove_breakpoint));
1062 fprintf_unfiltered (file,
1063 "gdbarch_dump: num_pseudo_regs = %s\n",
1064 plongest (gdbarch->num_pseudo_regs));
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: num_regs = %s\n",
1067 plongest (gdbarch->num_regs));
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: osabi = %s\n",
1070 plongest (gdbarch->osabi));
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1073 gdbarch_overlay_update_p (gdbarch));
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: overlay_update = <%s>\n",
1076 host_address_to_string (gdbarch->overlay_update));
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: pc_regnum = %s\n",
1079 plongest (gdbarch->pc_regnum));
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: pointer_to_address = <%s>\n",
1082 host_address_to_string (gdbarch->pointer_to_address));
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1085 gdbarch_print_float_info_p (gdbarch));
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: print_float_info = <%s>\n",
1088 host_address_to_string (gdbarch->print_float_info));
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: print_insn = <%s>\n",
1091 host_address_to_string (gdbarch->print_insn));
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: print_registers_info = <%s>\n",
1094 host_address_to_string (gdbarch->print_registers_info));
1095 fprintf_unfiltered (file,
1096 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1097 gdbarch_print_vector_info_p (gdbarch));
1098 fprintf_unfiltered (file,
1099 "gdbarch_dump: print_vector_info = <%s>\n",
1100 host_address_to_string (gdbarch->print_vector_info));
1101 fprintf_unfiltered (file,
1102 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1103 gdbarch_process_record_p (gdbarch));
1104 fprintf_unfiltered (file,
1105 "gdbarch_dump: process_record = <%s>\n",
1106 host_address_to_string (gdbarch->process_record));
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1109 gdbarch_process_record_signal_p (gdbarch));
1110 fprintf_unfiltered (file,
1111 "gdbarch_dump: process_record_signal = <%s>\n",
1112 host_address_to_string (gdbarch->process_record_signal));
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: ps_regnum = %s\n",
1115 plongest (gdbarch->ps_regnum));
1116 fprintf_unfiltered (file,
1117 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1118 gdbarch_pseudo_register_read_p (gdbarch));
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: pseudo_register_read = <%s>\n",
1121 host_address_to_string (gdbarch->pseudo_register_read));
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1124 gdbarch_pseudo_register_read_value_p (gdbarch));
1125 fprintf_unfiltered (file,
1126 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1127 host_address_to_string (gdbarch->pseudo_register_read_value));
1128 fprintf_unfiltered (file,
1129 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1130 gdbarch_pseudo_register_write_p (gdbarch));
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: pseudo_register_write = <%s>\n",
1133 host_address_to_string (gdbarch->pseudo_register_write));
1134 fprintf_unfiltered (file,
1135 "gdbarch_dump: ptr_bit = %s\n",
1136 plongest (gdbarch->ptr_bit));
1137 fprintf_unfiltered (file,
1138 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1139 gdbarch_push_dummy_call_p (gdbarch));
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: push_dummy_call = <%s>\n",
1142 host_address_to_string (gdbarch->push_dummy_call));
1143 fprintf_unfiltered (file,
1144 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1145 gdbarch_push_dummy_code_p (gdbarch));
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: push_dummy_code = <%s>\n",
1148 host_address_to_string (gdbarch->push_dummy_code));
1149 fprintf_unfiltered (file,
1150 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1151 gdbarch_read_pc_p (gdbarch));
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: read_pc = <%s>\n",
1154 host_address_to_string (gdbarch->read_pc));
1155 fprintf_unfiltered (file,
1156 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1157 gdbarch_record_special_symbol_p (gdbarch));
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: record_special_symbol = <%s>\n",
1160 host_address_to_string (gdbarch->record_special_symbol));
1161 fprintf_unfiltered (file,
1162 "gdbarch_dump: register_name = <%s>\n",
1163 host_address_to_string (gdbarch->register_name));
1164 fprintf_unfiltered (file,
1165 "gdbarch_dump: register_reggroup_p = <%s>\n",
1166 host_address_to_string (gdbarch->register_reggroup_p));
1167 fprintf_unfiltered (file,
1168 "gdbarch_dump: register_sim_regno = <%s>\n",
1169 host_address_to_string (gdbarch->register_sim_regno));
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: register_to_value = <%s>\n",
1172 host_address_to_string (gdbarch->register_to_value));
1173 fprintf_unfiltered (file,
1174 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1175 gdbarch_register_type_p (gdbarch));
1176 fprintf_unfiltered (file,
1177 "gdbarch_dump: register_type = <%s>\n",
1178 host_address_to_string (gdbarch->register_type));
1179 fprintf_unfiltered (file,
1180 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1181 gdbarch_regset_from_core_section_p (gdbarch));
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: regset_from_core_section = <%s>\n",
1184 host_address_to_string (gdbarch->regset_from_core_section));
1185 fprintf_unfiltered (file,
1186 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1187 gdbarch_relocate_instruction_p (gdbarch));
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: relocate_instruction = <%s>\n",
1190 host_address_to_string (gdbarch->relocate_instruction));
1191 fprintf_unfiltered (file,
1192 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1193 host_address_to_string (gdbarch->remote_breakpoint_from_pc));
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: remote_register_number = <%s>\n",
1196 host_address_to_string (gdbarch->remote_register_number));
1197 fprintf_unfiltered (file,
1198 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1199 gdbarch_return_value_p (gdbarch));
1200 fprintf_unfiltered (file,
1201 "gdbarch_dump: return_value = <%s>\n",
1202 host_address_to_string (gdbarch->return_value));
1203 fprintf_unfiltered (file,
1204 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1205 host_address_to_string (gdbarch->sdb_reg_to_regnum));
1206 fprintf_unfiltered (file,
1207 "gdbarch_dump: short_bit = %s\n",
1208 plongest (gdbarch->short_bit));
1209 fprintf_unfiltered (file,
1210 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1211 gdbarch_single_step_through_delay_p (gdbarch));
1212 fprintf_unfiltered (file,
1213 "gdbarch_dump: single_step_through_delay = <%s>\n",
1214 host_address_to_string (gdbarch->single_step_through_delay));
1215 fprintf_unfiltered (file,
1216 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1217 gdbarch_skip_main_prologue_p (gdbarch));
1218 fprintf_unfiltered (file,
1219 "gdbarch_dump: skip_main_prologue = <%s>\n",
1220 host_address_to_string (gdbarch->skip_main_prologue));
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1223 gdbarch_skip_permanent_breakpoint_p (gdbarch));
1224 fprintf_unfiltered (file,
1225 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1226 host_address_to_string (gdbarch->skip_permanent_breakpoint));
1227 fprintf_unfiltered (file,
1228 "gdbarch_dump: skip_prologue = <%s>\n",
1229 host_address_to_string (gdbarch->skip_prologue));
1230 fprintf_unfiltered (file,
1231 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1232 host_address_to_string (gdbarch->skip_solib_resolver));
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1235 host_address_to_string (gdbarch->skip_trampoline_code));
1236 fprintf_unfiltered (file,
1237 "gdbarch_dump: smash_text_address = <%s>\n",
1238 host_address_to_string (gdbarch->smash_text_address));
1239 fprintf_unfiltered (file,
1240 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1241 gdbarch_software_single_step_p (gdbarch));
1242 fprintf_unfiltered (file,
1243 "gdbarch_dump: software_single_step = <%s>\n",
1244 host_address_to_string (gdbarch->software_single_step));
1245 fprintf_unfiltered (file,
1246 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1247 plongest (gdbarch->sofun_address_maybe_missing));
1248 fprintf_unfiltered (file,
1249 "gdbarch_dump: solib_symbols_extension = %s\n",
1250 pstring (gdbarch->solib_symbols_extension));
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: sp_regnum = %s\n",
1253 plongest (gdbarch->sp_regnum));
1254 fprintf_unfiltered (file,
1255 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1256 host_address_to_string (gdbarch->stab_reg_to_regnum));
1257 fprintf_unfiltered (file,
1258 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1259 host_address_to_string (gdbarch->stabs_argument_has_addr));
1260 fprintf_unfiltered (file,
1261 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1262 gdbarch_static_transform_name_p (gdbarch));
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: static_transform_name = <%s>\n",
1265 host_address_to_string (gdbarch->static_transform_name));
1266 fprintf_unfiltered (file,
1267 "gdbarch_dump: target_desc = %s\n",
1268 host_address_to_string (gdbarch->target_desc));
1269 fprintf_unfiltered (file,
1270 "gdbarch_dump: target_signal_from_host = <%s>\n",
1271 host_address_to_string (gdbarch->target_signal_from_host));
1272 fprintf_unfiltered (file,
1273 "gdbarch_dump: target_signal_to_host = <%s>\n",
1274 host_address_to_string (gdbarch->target_signal_to_host));
1275 fprintf_unfiltered (file,
1276 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1277 gdbarch_unwind_pc_p (gdbarch));
1278 fprintf_unfiltered (file,
1279 "gdbarch_dump: unwind_pc = <%s>\n",
1280 host_address_to_string (gdbarch->unwind_pc));
1281 fprintf_unfiltered (file,
1282 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1283 gdbarch_unwind_sp_p (gdbarch));
1284 fprintf_unfiltered (file,
1285 "gdbarch_dump: unwind_sp = <%s>\n",
1286 host_address_to_string (gdbarch->unwind_sp));
1287 fprintf_unfiltered (file,
1288 "gdbarch_dump: value_from_register = <%s>\n",
1289 host_address_to_string (gdbarch->value_from_register));
1290 fprintf_unfiltered (file,
1291 "gdbarch_dump: value_to_register = <%s>\n",
1292 host_address_to_string (gdbarch->value_to_register));
1293 fprintf_unfiltered (file,
1294 "gdbarch_dump: vbit_in_delta = %s\n",
1295 plongest (gdbarch->vbit_in_delta));
1296 fprintf_unfiltered (file,
1297 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1298 host_address_to_string (gdbarch->virtual_frame_pointer));
1299 fprintf_unfiltered (file,
1300 "gdbarch_dump: vtable_function_descriptors = %s\n",
1301 plongest (gdbarch->vtable_function_descriptors));
1302 fprintf_unfiltered (file,
1303 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1304 gdbarch_write_pc_p (gdbarch));
1305 fprintf_unfiltered (file,
1306 "gdbarch_dump: write_pc = <%s>\n",
1307 host_address_to_string (gdbarch->write_pc));
1308 if (gdbarch->dump_tdep != NULL)
1309 gdbarch->dump_tdep (gdbarch, file);
1312 struct gdbarch_tdep *
1313 gdbarch_tdep (struct gdbarch *gdbarch)
1315 if (gdbarch_debug >= 2)
1316 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1317 return gdbarch->tdep;
1321 const struct bfd_arch_info *
1322 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1324 gdb_assert (gdbarch != NULL);
1325 if (gdbarch_debug >= 2)
1326 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1327 return gdbarch->bfd_arch_info;
1331 gdbarch_byte_order (struct gdbarch *gdbarch)
1333 gdb_assert (gdbarch != NULL);
1334 if (gdbarch_debug >= 2)
1335 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1336 return gdbarch->byte_order;
1340 gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
1342 gdb_assert (gdbarch != NULL);
1343 if (gdbarch_debug >= 2)
1344 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
1345 return gdbarch->byte_order_for_code;
1349 gdbarch_osabi (struct gdbarch *gdbarch)
1351 gdb_assert (gdbarch != NULL);
1352 if (gdbarch_debug >= 2)
1353 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1354 return gdbarch->osabi;
1357 const struct target_desc *
1358 gdbarch_target_desc (struct gdbarch *gdbarch)
1360 gdb_assert (gdbarch != NULL);
1361 if (gdbarch_debug >= 2)
1362 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1363 return gdbarch->target_desc;
1367 gdbarch_bits_big_endian (struct gdbarch *gdbarch)
1369 gdb_assert (gdbarch != NULL);
1370 /* Skip verify of bits_big_endian, invalid_p == 0 */
1371 if (gdbarch_debug >= 2)
1372 fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
1373 return gdbarch->bits_big_endian;
1377 set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
1378 int bits_big_endian)
1380 gdbarch->bits_big_endian = bits_big_endian;
1384 gdbarch_short_bit (struct gdbarch *gdbarch)
1386 gdb_assert (gdbarch != NULL);
1387 /* Skip verify of short_bit, invalid_p == 0 */
1388 if (gdbarch_debug >= 2)
1389 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1390 return gdbarch->short_bit;
1394 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1397 gdbarch->short_bit = short_bit;
1401 gdbarch_int_bit (struct gdbarch *gdbarch)
1403 gdb_assert (gdbarch != NULL);
1404 /* Skip verify of int_bit, invalid_p == 0 */
1405 if (gdbarch_debug >= 2)
1406 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1407 return gdbarch->int_bit;
1411 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1414 gdbarch->int_bit = int_bit;
1418 gdbarch_long_bit (struct gdbarch *gdbarch)
1420 gdb_assert (gdbarch != NULL);
1421 /* Skip verify of long_bit, invalid_p == 0 */
1422 if (gdbarch_debug >= 2)
1423 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1424 return gdbarch->long_bit;
1428 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1431 gdbarch->long_bit = long_bit;
1435 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1437 gdb_assert (gdbarch != NULL);
1438 /* Skip verify of long_long_bit, invalid_p == 0 */
1439 if (gdbarch_debug >= 2)
1440 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1441 return gdbarch->long_long_bit;
1445 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1448 gdbarch->long_long_bit = long_long_bit;
1452 gdbarch_long_long_align_bit (struct gdbarch *gdbarch)
1454 gdb_assert (gdbarch != NULL);
1455 /* Skip verify of long_long_align_bit, invalid_p == 0 */
1456 if (gdbarch_debug >= 2)
1457 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_align_bit called\n");
1458 return gdbarch->long_long_align_bit;
1462 set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch,
1463 int long_long_align_bit)
1465 gdbarch->long_long_align_bit = long_long_align_bit;
1469 gdbarch_half_bit (struct gdbarch *gdbarch)
1471 gdb_assert (gdbarch != NULL);
1472 /* Skip verify of half_bit, invalid_p == 0 */
1473 if (gdbarch_debug >= 2)
1474 fprintf_unfiltered (gdb_stdlog, "gdbarch_half_bit called\n");
1475 return gdbarch->half_bit;
1479 set_gdbarch_half_bit (struct gdbarch *gdbarch,
1482 gdbarch->half_bit = half_bit;
1485 const struct floatformat **
1486 gdbarch_half_format (struct gdbarch *gdbarch)
1488 gdb_assert (gdbarch != NULL);
1489 if (gdbarch_debug >= 2)
1490 fprintf_unfiltered (gdb_stdlog, "gdbarch_half_format called\n");
1491 return gdbarch->half_format;
1495 set_gdbarch_half_format (struct gdbarch *gdbarch,
1496 const struct floatformat ** half_format)
1498 gdbarch->half_format = half_format;
1502 gdbarch_float_bit (struct gdbarch *gdbarch)
1504 gdb_assert (gdbarch != NULL);
1505 /* Skip verify of float_bit, invalid_p == 0 */
1506 if (gdbarch_debug >= 2)
1507 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1508 return gdbarch->float_bit;
1512 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1515 gdbarch->float_bit = float_bit;
1518 const struct floatformat **
1519 gdbarch_float_format (struct gdbarch *gdbarch)
1521 gdb_assert (gdbarch != NULL);
1522 if (gdbarch_debug >= 2)
1523 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1524 return gdbarch->float_format;
1528 set_gdbarch_float_format (struct gdbarch *gdbarch,
1529 const struct floatformat ** float_format)
1531 gdbarch->float_format = float_format;
1535 gdbarch_double_bit (struct gdbarch *gdbarch)
1537 gdb_assert (gdbarch != NULL);
1538 /* Skip verify of double_bit, invalid_p == 0 */
1539 if (gdbarch_debug >= 2)
1540 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1541 return gdbarch->double_bit;
1545 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1548 gdbarch->double_bit = double_bit;
1551 const struct floatformat **
1552 gdbarch_double_format (struct gdbarch *gdbarch)
1554 gdb_assert (gdbarch != NULL);
1555 if (gdbarch_debug >= 2)
1556 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1557 return gdbarch->double_format;
1561 set_gdbarch_double_format (struct gdbarch *gdbarch,
1562 const struct floatformat ** double_format)
1564 gdbarch->double_format = double_format;
1568 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1570 gdb_assert (gdbarch != NULL);
1571 /* Skip verify of long_double_bit, invalid_p == 0 */
1572 if (gdbarch_debug >= 2)
1573 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1574 return gdbarch->long_double_bit;
1578 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1579 int long_double_bit)
1581 gdbarch->long_double_bit = long_double_bit;
1584 const struct floatformat **
1585 gdbarch_long_double_format (struct gdbarch *gdbarch)
1587 gdb_assert (gdbarch != NULL);
1588 if (gdbarch_debug >= 2)
1589 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1590 return gdbarch->long_double_format;
1594 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1595 const struct floatformat ** long_double_format)
1597 gdbarch->long_double_format = long_double_format;
1601 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1603 gdb_assert (gdbarch != NULL);
1604 /* Skip verify of ptr_bit, invalid_p == 0 */
1605 if (gdbarch_debug >= 2)
1606 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1607 return gdbarch->ptr_bit;
1611 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1614 gdbarch->ptr_bit = ptr_bit;
1618 gdbarch_addr_bit (struct gdbarch *gdbarch)
1620 gdb_assert (gdbarch != NULL);
1621 /* Check variable changed from pre-default. */
1622 gdb_assert (gdbarch->addr_bit != 0);
1623 if (gdbarch_debug >= 2)
1624 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1625 return gdbarch->addr_bit;
1629 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1632 gdbarch->addr_bit = addr_bit;
1636 gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch)
1638 gdb_assert (gdbarch != NULL);
1639 /* Check variable changed from pre-default. */
1640 gdb_assert (gdbarch->dwarf2_addr_size != 0);
1641 if (gdbarch_debug >= 2)
1642 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_addr_size called\n");
1643 return gdbarch->dwarf2_addr_size;
1647 set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch,
1648 int dwarf2_addr_size)
1650 gdbarch->dwarf2_addr_size = dwarf2_addr_size;
1654 gdbarch_char_signed (struct gdbarch *gdbarch)
1656 gdb_assert (gdbarch != NULL);
1657 /* Check variable changed from pre-default. */
1658 gdb_assert (gdbarch->char_signed != -1);
1659 if (gdbarch_debug >= 2)
1660 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1661 return gdbarch->char_signed;
1665 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1668 gdbarch->char_signed = char_signed;
1672 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1674 gdb_assert (gdbarch != NULL);
1675 return gdbarch->read_pc != NULL;
1679 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1681 gdb_assert (gdbarch != NULL);
1682 gdb_assert (gdbarch->read_pc != NULL);
1683 if (gdbarch_debug >= 2)
1684 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1685 return gdbarch->read_pc (regcache);
1689 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1690 gdbarch_read_pc_ftype read_pc)
1692 gdbarch->read_pc = read_pc;
1696 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1698 gdb_assert (gdbarch != NULL);
1699 return gdbarch->write_pc != NULL;
1703 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1705 gdb_assert (gdbarch != NULL);
1706 gdb_assert (gdbarch->write_pc != NULL);
1707 if (gdbarch_debug >= 2)
1708 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1709 gdbarch->write_pc (regcache, val);
1713 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1714 gdbarch_write_pc_ftype write_pc)
1716 gdbarch->write_pc = write_pc;
1720 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1722 gdb_assert (gdbarch != NULL);
1723 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1724 if (gdbarch_debug >= 2)
1725 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1726 gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
1730 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1731 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1733 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1737 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1739 gdb_assert (gdbarch != NULL);
1740 return gdbarch->pseudo_register_read != NULL;
1743 enum register_status
1744 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1746 gdb_assert (gdbarch != NULL);
1747 gdb_assert (gdbarch->pseudo_register_read != NULL);
1748 if (gdbarch_debug >= 2)
1749 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1750 return gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1754 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1755 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1757 gdbarch->pseudo_register_read = pseudo_register_read;
1761 gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch)
1763 gdb_assert (gdbarch != NULL);
1764 return gdbarch->pseudo_register_read_value != NULL;
1768 gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum)
1770 gdb_assert (gdbarch != NULL);
1771 gdb_assert (gdbarch->pseudo_register_read_value != NULL);
1772 if (gdbarch_debug >= 2)
1773 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read_value called\n");
1774 return gdbarch->pseudo_register_read_value (gdbarch, regcache, cookednum);
1778 set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch,
1779 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value)
1781 gdbarch->pseudo_register_read_value = pseudo_register_read_value;
1785 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1787 gdb_assert (gdbarch != NULL);
1788 return gdbarch->pseudo_register_write != NULL;
1792 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1794 gdb_assert (gdbarch != NULL);
1795 gdb_assert (gdbarch->pseudo_register_write != NULL);
1796 if (gdbarch_debug >= 2)
1797 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1798 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1802 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1803 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1805 gdbarch->pseudo_register_write = pseudo_register_write;
1809 gdbarch_num_regs (struct gdbarch *gdbarch)
1811 gdb_assert (gdbarch != NULL);
1812 /* Check variable changed from pre-default. */
1813 gdb_assert (gdbarch->num_regs != -1);
1814 if (gdbarch_debug >= 2)
1815 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1816 return gdbarch->num_regs;
1820 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1823 gdbarch->num_regs = num_regs;
1827 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1829 gdb_assert (gdbarch != NULL);
1830 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1831 if (gdbarch_debug >= 2)
1832 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1833 return gdbarch->num_pseudo_regs;
1837 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1838 int num_pseudo_regs)
1840 gdbarch->num_pseudo_regs = num_pseudo_regs;
1844 gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch)
1846 gdb_assert (gdbarch != NULL);
1847 return gdbarch->ax_pseudo_register_collect != NULL;
1851 gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
1853 gdb_assert (gdbarch != NULL);
1854 gdb_assert (gdbarch->ax_pseudo_register_collect != NULL);
1855 if (gdbarch_debug >= 2)
1856 fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_collect called\n");
1857 return gdbarch->ax_pseudo_register_collect (gdbarch, ax, reg);
1861 set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch,
1862 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
1864 gdbarch->ax_pseudo_register_collect = ax_pseudo_register_collect;
1868 gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch)
1870 gdb_assert (gdbarch != NULL);
1871 return gdbarch->ax_pseudo_register_push_stack != NULL;
1875 gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
1877 gdb_assert (gdbarch != NULL);
1878 gdb_assert (gdbarch->ax_pseudo_register_push_stack != NULL);
1879 if (gdbarch_debug >= 2)
1880 fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_push_stack called\n");
1881 return gdbarch->ax_pseudo_register_push_stack (gdbarch, ax, reg);
1885 set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
1886 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack)
1888 gdbarch->ax_pseudo_register_push_stack = ax_pseudo_register_push_stack;
1892 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1894 gdb_assert (gdbarch != NULL);
1895 /* Skip verify of sp_regnum, invalid_p == 0 */
1896 if (gdbarch_debug >= 2)
1897 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1898 return gdbarch->sp_regnum;
1902 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1905 gdbarch->sp_regnum = sp_regnum;
1909 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1911 gdb_assert (gdbarch != NULL);
1912 /* Skip verify of pc_regnum, invalid_p == 0 */
1913 if (gdbarch_debug >= 2)
1914 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1915 return gdbarch->pc_regnum;
1919 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1922 gdbarch->pc_regnum = pc_regnum;
1926 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1928 gdb_assert (gdbarch != NULL);
1929 /* Skip verify of ps_regnum, invalid_p == 0 */
1930 if (gdbarch_debug >= 2)
1931 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1932 return gdbarch->ps_regnum;
1936 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1939 gdbarch->ps_regnum = ps_regnum;
1943 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1945 gdb_assert (gdbarch != NULL);
1946 /* Skip verify of fp0_regnum, invalid_p == 0 */
1947 if (gdbarch_debug >= 2)
1948 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1949 return gdbarch->fp0_regnum;
1953 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1956 gdbarch->fp0_regnum = fp0_regnum;
1960 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1962 gdb_assert (gdbarch != NULL);
1963 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1964 if (gdbarch_debug >= 2)
1965 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1966 return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
1970 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1971 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1973 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1977 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1979 gdb_assert (gdbarch != NULL);
1980 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1981 if (gdbarch_debug >= 2)
1982 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1983 return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
1987 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1988 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1990 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1994 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1996 gdb_assert (gdbarch != NULL);
1997 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1998 if (gdbarch_debug >= 2)
1999 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2000 return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
2004 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2005 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2007 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2011 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2013 gdb_assert (gdbarch != NULL);
2014 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2015 if (gdbarch_debug >= 2)
2016 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2017 return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
2021 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2022 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2024 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2028 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2030 gdb_assert (gdbarch != NULL);
2031 gdb_assert (gdbarch->register_name != NULL);
2032 if (gdbarch_debug >= 2)
2033 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2034 return gdbarch->register_name (gdbarch, regnr);
2038 set_gdbarch_register_name (struct gdbarch *gdbarch,
2039 gdbarch_register_name_ftype register_name)
2041 gdbarch->register_name = register_name;
2045 gdbarch_register_type_p (struct gdbarch *gdbarch)
2047 gdb_assert (gdbarch != NULL);
2048 return gdbarch->register_type != NULL;
2052 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2054 gdb_assert (gdbarch != NULL);
2055 gdb_assert (gdbarch->register_type != NULL);
2056 if (gdbarch_debug >= 2)
2057 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2058 return gdbarch->register_type (gdbarch, reg_nr);
2062 set_gdbarch_register_type (struct gdbarch *gdbarch,
2063 gdbarch_register_type_ftype register_type)
2065 gdbarch->register_type = register_type;
2069 gdbarch_dummy_id_p (struct gdbarch *gdbarch)
2071 gdb_assert (gdbarch != NULL);
2072 return gdbarch->dummy_id != NULL;
2076 gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
2078 gdb_assert (gdbarch != NULL);
2079 gdb_assert (gdbarch->dummy_id != NULL);
2080 if (gdbarch_debug >= 2)
2081 fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
2082 return gdbarch->dummy_id (gdbarch, this_frame);
2086 set_gdbarch_dummy_id (struct gdbarch *gdbarch,
2087 gdbarch_dummy_id_ftype dummy_id)
2089 gdbarch->dummy_id = dummy_id;
2093 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2095 gdb_assert (gdbarch != NULL);
2096 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2097 if (gdbarch_debug >= 2)
2098 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2099 return gdbarch->deprecated_fp_regnum;
2103 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2104 int deprecated_fp_regnum)
2106 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2110 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2112 gdb_assert (gdbarch != NULL);
2113 return gdbarch->push_dummy_call != NULL;
2117 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)
2119 gdb_assert (gdbarch != NULL);
2120 gdb_assert (gdbarch->push_dummy_call != NULL);
2121 if (gdbarch_debug >= 2)
2122 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2123 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2127 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2128 gdbarch_push_dummy_call_ftype push_dummy_call)
2130 gdbarch->push_dummy_call = push_dummy_call;
2134 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2136 gdb_assert (gdbarch != NULL);
2137 /* Skip verify of call_dummy_location, invalid_p == 0 */
2138 if (gdbarch_debug >= 2)
2139 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2140 return gdbarch->call_dummy_location;
2144 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2145 int call_dummy_location)
2147 gdbarch->call_dummy_location = call_dummy_location;
2151 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2153 gdb_assert (gdbarch != NULL);
2154 return gdbarch->push_dummy_code != NULL;
2158 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)
2160 gdb_assert (gdbarch != NULL);
2161 gdb_assert (gdbarch->push_dummy_code != NULL);
2162 if (gdbarch_debug >= 2)
2163 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2164 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
2168 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2169 gdbarch_push_dummy_code_ftype push_dummy_code)
2171 gdbarch->push_dummy_code = push_dummy_code;
2175 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2177 gdb_assert (gdbarch != NULL);
2178 gdb_assert (gdbarch->print_registers_info != NULL);
2179 if (gdbarch_debug >= 2)
2180 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2181 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2185 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2186 gdbarch_print_registers_info_ftype print_registers_info)
2188 gdbarch->print_registers_info = print_registers_info;
2192 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2194 gdb_assert (gdbarch != NULL);
2195 return gdbarch->print_float_info != NULL;
2199 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2201 gdb_assert (gdbarch != NULL);
2202 gdb_assert (gdbarch->print_float_info != NULL);
2203 if (gdbarch_debug >= 2)
2204 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2205 gdbarch->print_float_info (gdbarch, file, frame, args);
2209 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2210 gdbarch_print_float_info_ftype print_float_info)
2212 gdbarch->print_float_info = print_float_info;
2216 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2218 gdb_assert (gdbarch != NULL);
2219 return gdbarch->print_vector_info != NULL;
2223 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2225 gdb_assert (gdbarch != NULL);
2226 gdb_assert (gdbarch->print_vector_info != NULL);
2227 if (gdbarch_debug >= 2)
2228 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2229 gdbarch->print_vector_info (gdbarch, file, frame, args);
2233 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2234 gdbarch_print_vector_info_ftype print_vector_info)
2236 gdbarch->print_vector_info = print_vector_info;
2240 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2242 gdb_assert (gdbarch != NULL);
2243 gdb_assert (gdbarch->register_sim_regno != NULL);
2244 if (gdbarch_debug >= 2)
2245 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2246 return gdbarch->register_sim_regno (gdbarch, reg_nr);
2250 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2251 gdbarch_register_sim_regno_ftype register_sim_regno)
2253 gdbarch->register_sim_regno = register_sim_regno;
2257 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2259 gdb_assert (gdbarch != NULL);
2260 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2261 if (gdbarch_debug >= 2)
2262 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2263 return gdbarch->cannot_fetch_register (gdbarch, regnum);
2267 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2268 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2270 gdbarch->cannot_fetch_register = cannot_fetch_register;
2274 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2276 gdb_assert (gdbarch != NULL);
2277 gdb_assert (gdbarch->cannot_store_register != NULL);
2278 if (gdbarch_debug >= 2)
2279 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2280 return gdbarch->cannot_store_register (gdbarch, regnum);
2284 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2285 gdbarch_cannot_store_register_ftype cannot_store_register)
2287 gdbarch->cannot_store_register = cannot_store_register;
2291 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2293 gdb_assert (gdbarch != NULL);
2294 return gdbarch->get_longjmp_target != NULL;
2298 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
2300 gdb_assert (gdbarch != NULL);
2301 gdb_assert (gdbarch->get_longjmp_target != NULL);
2302 if (gdbarch_debug >= 2)
2303 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2304 return gdbarch->get_longjmp_target (frame, pc);
2308 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2309 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2311 gdbarch->get_longjmp_target = get_longjmp_target;
2315 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2317 gdb_assert (gdbarch != NULL);
2318 if (gdbarch_debug >= 2)
2319 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2320 return gdbarch->believe_pcc_promotion;
2324 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2325 int believe_pcc_promotion)
2327 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2331 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2333 gdb_assert (gdbarch != NULL);
2334 gdb_assert (gdbarch->convert_register_p != NULL);
2335 if (gdbarch_debug >= 2)
2336 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2337 return gdbarch->convert_register_p (gdbarch, regnum, type);
2341 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2342 gdbarch_convert_register_p_ftype convert_register_p)
2344 gdbarch->convert_register_p = convert_register_p;
2348 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep)
2350 gdb_assert (gdbarch != NULL);
2351 gdb_assert (gdbarch->register_to_value != NULL);
2352 if (gdbarch_debug >= 2)
2353 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2354 return gdbarch->register_to_value (frame, regnum, type, buf, optimizedp, unavailablep);
2358 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2359 gdbarch_register_to_value_ftype register_to_value)
2361 gdbarch->register_to_value = register_to_value;
2365 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2367 gdb_assert (gdbarch != NULL);
2368 gdb_assert (gdbarch->value_to_register != NULL);
2369 if (gdbarch_debug >= 2)
2370 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2371 gdbarch->value_to_register (frame, regnum, type, buf);
2375 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2376 gdbarch_value_to_register_ftype value_to_register)
2378 gdbarch->value_to_register = value_to_register;
2382 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2384 gdb_assert (gdbarch != NULL);
2385 gdb_assert (gdbarch->value_from_register != NULL);
2386 if (gdbarch_debug >= 2)
2387 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2388 return gdbarch->value_from_register (type, regnum, frame);
2392 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2393 gdbarch_value_from_register_ftype value_from_register)
2395 gdbarch->value_from_register = value_from_register;
2399 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2401 gdb_assert (gdbarch != NULL);
2402 gdb_assert (gdbarch->pointer_to_address != NULL);
2403 if (gdbarch_debug >= 2)
2404 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2405 return gdbarch->pointer_to_address (gdbarch, type, buf);
2409 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2410 gdbarch_pointer_to_address_ftype pointer_to_address)
2412 gdbarch->pointer_to_address = pointer_to_address;
2416 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2418 gdb_assert (gdbarch != NULL);
2419 gdb_assert (gdbarch->address_to_pointer != NULL);
2420 if (gdbarch_debug >= 2)
2421 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2422 gdbarch->address_to_pointer (gdbarch, type, buf, addr);
2426 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2427 gdbarch_address_to_pointer_ftype address_to_pointer)
2429 gdbarch->address_to_pointer = address_to_pointer;
2433 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2435 gdb_assert (gdbarch != NULL);
2436 return gdbarch->integer_to_address != NULL;
2440 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2442 gdb_assert (gdbarch != NULL);
2443 gdb_assert (gdbarch->integer_to_address != NULL);
2444 if (gdbarch_debug >= 2)
2445 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2446 return gdbarch->integer_to_address (gdbarch, type, buf);
2450 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2451 gdbarch_integer_to_address_ftype integer_to_address)
2453 gdbarch->integer_to_address = integer_to_address;
2457 gdbarch_return_value_p (struct gdbarch *gdbarch)
2459 gdb_assert (gdbarch != NULL);
2460 return gdbarch->return_value != NULL;
2463 enum return_value_convention
2464 gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2466 gdb_assert (gdbarch != NULL);
2467 gdb_assert (gdbarch->return_value != NULL);
2468 if (gdbarch_debug >= 2)
2469 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2470 return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
2474 set_gdbarch_return_value (struct gdbarch *gdbarch,
2475 gdbarch_return_value_ftype return_value)
2477 gdbarch->return_value = return_value;
2481 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2483 gdb_assert (gdbarch != NULL);
2484 gdb_assert (gdbarch->skip_prologue != NULL);
2485 if (gdbarch_debug >= 2)
2486 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2487 return gdbarch->skip_prologue (gdbarch, ip);
2491 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2492 gdbarch_skip_prologue_ftype skip_prologue)
2494 gdbarch->skip_prologue = skip_prologue;
2498 gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
2500 gdb_assert (gdbarch != NULL);
2501 return gdbarch->skip_main_prologue != NULL;
2505 gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2507 gdb_assert (gdbarch != NULL);
2508 gdb_assert (gdbarch->skip_main_prologue != NULL);
2509 if (gdbarch_debug >= 2)
2510 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
2511 return gdbarch->skip_main_prologue (gdbarch, ip);
2515 set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
2516 gdbarch_skip_main_prologue_ftype skip_main_prologue)
2518 gdbarch->skip_main_prologue = skip_main_prologue;
2522 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2524 gdb_assert (gdbarch != NULL);
2525 gdb_assert (gdbarch->inner_than != NULL);
2526 if (gdbarch_debug >= 2)
2527 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2528 return gdbarch->inner_than (lhs, rhs);
2532 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2533 gdbarch_inner_than_ftype inner_than)
2535 gdbarch->inner_than = inner_than;
2539 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2541 gdb_assert (gdbarch != NULL);
2542 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2543 if (gdbarch_debug >= 2)
2544 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2545 return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
2549 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2550 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2552 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2556 gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
2558 gdb_assert (gdbarch != NULL);
2559 gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
2560 if (gdbarch_debug >= 2)
2561 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
2562 gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
2566 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
2567 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
2569 gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
2573 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2575 gdb_assert (gdbarch != NULL);
2576 return gdbarch->adjust_breakpoint_address != NULL;
2580 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2582 gdb_assert (gdbarch != NULL);
2583 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2584 if (gdbarch_debug >= 2)
2585 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2586 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2590 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2591 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2593 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2597 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2599 gdb_assert (gdbarch != NULL);
2600 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2601 if (gdbarch_debug >= 2)
2602 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2603 return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
2607 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2608 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2610 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2614 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2616 gdb_assert (gdbarch != NULL);
2617 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2618 if (gdbarch_debug >= 2)
2619 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2620 return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
2624 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2625 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2627 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2631 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2633 gdb_assert (gdbarch != NULL);
2634 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2635 if (gdbarch_debug >= 2)
2636 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2637 return gdbarch->decr_pc_after_break;
2641 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2642 CORE_ADDR decr_pc_after_break)
2644 gdbarch->decr_pc_after_break = decr_pc_after_break;
2648 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2650 gdb_assert (gdbarch != NULL);
2651 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2652 if (gdbarch_debug >= 2)
2653 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2654 return gdbarch->deprecated_function_start_offset;
2658 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2659 CORE_ADDR deprecated_function_start_offset)
2661 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2665 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2667 gdb_assert (gdbarch != NULL);
2668 gdb_assert (gdbarch->remote_register_number != NULL);
2669 if (gdbarch_debug >= 2)
2670 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2671 return gdbarch->remote_register_number (gdbarch, regno);
2675 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2676 gdbarch_remote_register_number_ftype remote_register_number)
2678 gdbarch->remote_register_number = remote_register_number;
2682 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2684 gdb_assert (gdbarch != NULL);
2685 return gdbarch->fetch_tls_load_module_address != NULL;
2689 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2691 gdb_assert (gdbarch != NULL);
2692 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2693 if (gdbarch_debug >= 2)
2694 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2695 return gdbarch->fetch_tls_load_module_address (objfile);
2699 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2700 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2702 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2706 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2708 gdb_assert (gdbarch != NULL);
2709 /* Skip verify of frame_args_skip, invalid_p == 0 */
2710 if (gdbarch_debug >= 2)
2711 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2712 return gdbarch->frame_args_skip;
2716 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2717 CORE_ADDR frame_args_skip)
2719 gdbarch->frame_args_skip = frame_args_skip;
2723 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2725 gdb_assert (gdbarch != NULL);
2726 return gdbarch->unwind_pc != NULL;
2730 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2732 gdb_assert (gdbarch != NULL);
2733 gdb_assert (gdbarch->unwind_pc != NULL);
2734 if (gdbarch_debug >= 2)
2735 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2736 return gdbarch->unwind_pc (gdbarch, next_frame);
2740 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2741 gdbarch_unwind_pc_ftype unwind_pc)
2743 gdbarch->unwind_pc = unwind_pc;
2747 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2749 gdb_assert (gdbarch != NULL);
2750 return gdbarch->unwind_sp != NULL;
2754 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2756 gdb_assert (gdbarch != NULL);
2757 gdb_assert (gdbarch->unwind_sp != NULL);
2758 if (gdbarch_debug >= 2)
2759 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2760 return gdbarch->unwind_sp (gdbarch, next_frame);
2764 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2765 gdbarch_unwind_sp_ftype unwind_sp)
2767 gdbarch->unwind_sp = unwind_sp;
2771 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2773 gdb_assert (gdbarch != NULL);
2774 return gdbarch->frame_num_args != NULL;
2778 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2780 gdb_assert (gdbarch != NULL);
2781 gdb_assert (gdbarch->frame_num_args != NULL);
2782 if (gdbarch_debug >= 2)
2783 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2784 return gdbarch->frame_num_args (frame);
2788 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2789 gdbarch_frame_num_args_ftype frame_num_args)
2791 gdbarch->frame_num_args = frame_num_args;
2795 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2797 gdb_assert (gdbarch != NULL);
2798 return gdbarch->frame_align != NULL;
2802 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2804 gdb_assert (gdbarch != NULL);
2805 gdb_assert (gdbarch->frame_align != NULL);
2806 if (gdbarch_debug >= 2)
2807 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2808 return gdbarch->frame_align (gdbarch, address);
2812 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2813 gdbarch_frame_align_ftype frame_align)
2815 gdbarch->frame_align = frame_align;
2819 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2821 gdb_assert (gdbarch != NULL);
2822 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2823 if (gdbarch_debug >= 2)
2824 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2825 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2829 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2830 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2832 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2836 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2838 gdb_assert (gdbarch != NULL);
2839 if (gdbarch_debug >= 2)
2840 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2841 return gdbarch->frame_red_zone_size;
2845 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2846 int frame_red_zone_size)
2848 gdbarch->frame_red_zone_size = frame_red_zone_size;
2852 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2854 gdb_assert (gdbarch != NULL);
2855 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2856 if (gdbarch_debug >= 2)
2857 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2858 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2862 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2863 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2865 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2869 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2871 gdb_assert (gdbarch != NULL);
2872 gdb_assert (gdbarch->addr_bits_remove != NULL);
2873 if (gdbarch_debug >= 2)
2874 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2875 return gdbarch->addr_bits_remove (gdbarch, addr);
2879 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2880 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2882 gdbarch->addr_bits_remove = addr_bits_remove;
2886 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2888 gdb_assert (gdbarch != NULL);
2889 gdb_assert (gdbarch->smash_text_address != NULL);
2890 if (gdbarch_debug >= 2)
2891 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2892 return gdbarch->smash_text_address (gdbarch, addr);
2896 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2897 gdbarch_smash_text_address_ftype smash_text_address)
2899 gdbarch->smash_text_address = smash_text_address;
2903 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2905 gdb_assert (gdbarch != NULL);
2906 return gdbarch->software_single_step != NULL;
2910 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2912 gdb_assert (gdbarch != NULL);
2913 gdb_assert (gdbarch->software_single_step != NULL);
2914 if (gdbarch_debug >= 2)
2915 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2916 return gdbarch->software_single_step (frame);
2920 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2921 gdbarch_software_single_step_ftype software_single_step)
2923 gdbarch->software_single_step = software_single_step;
2927 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2929 gdb_assert (gdbarch != NULL);
2930 return gdbarch->single_step_through_delay != NULL;
2934 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2936 gdb_assert (gdbarch != NULL);
2937 gdb_assert (gdbarch->single_step_through_delay != NULL);
2938 if (gdbarch_debug >= 2)
2939 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2940 return gdbarch->single_step_through_delay (gdbarch, frame);
2944 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2945 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2947 gdbarch->single_step_through_delay = single_step_through_delay;
2951 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2953 gdb_assert (gdbarch != NULL);
2954 gdb_assert (gdbarch->print_insn != NULL);
2955 if (gdbarch_debug >= 2)
2956 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2957 return gdbarch->print_insn (vma, info);
2961 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2962 gdbarch_print_insn_ftype print_insn)
2964 gdbarch->print_insn = print_insn;
2968 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2970 gdb_assert (gdbarch != NULL);
2971 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2972 if (gdbarch_debug >= 2)
2973 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2974 return gdbarch->skip_trampoline_code (frame, pc);
2978 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2979 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2981 gdbarch->skip_trampoline_code = skip_trampoline_code;
2985 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2987 gdb_assert (gdbarch != NULL);
2988 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2989 if (gdbarch_debug >= 2)
2990 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2991 return gdbarch->skip_solib_resolver (gdbarch, pc);
2995 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2996 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2998 gdbarch->skip_solib_resolver = skip_solib_resolver;
3002 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3004 gdb_assert (gdbarch != NULL);
3005 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3006 if (gdbarch_debug >= 2)
3007 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3008 return gdbarch->in_solib_return_trampoline (gdbarch, pc, name);
3012 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3013 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3015 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3019 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3021 gdb_assert (gdbarch != NULL);
3022 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3023 if (gdbarch_debug >= 2)
3024 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3025 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3029 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3030 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3032 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3036 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3038 gdb_assert (gdbarch != NULL);
3039 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3040 if (gdbarch_debug >= 2)
3041 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3042 gdbarch->elf_make_msymbol_special (sym, msym);
3046 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3047 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3049 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3053 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3055 gdb_assert (gdbarch != NULL);
3056 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3057 if (gdbarch_debug >= 2)
3058 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3059 gdbarch->coff_make_msymbol_special (val, msym);
3063 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3064 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3066 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3070 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3072 gdb_assert (gdbarch != NULL);
3073 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3074 if (gdbarch_debug >= 2)
3075 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3076 return gdbarch->cannot_step_breakpoint;
3080 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3081 int cannot_step_breakpoint)
3083 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3087 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3089 gdb_assert (gdbarch != NULL);
3090 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3091 if (gdbarch_debug >= 2)
3092 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3093 return gdbarch->have_nonsteppable_watchpoint;
3097 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3098 int have_nonsteppable_watchpoint)
3100 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3104 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3106 gdb_assert (gdbarch != NULL);
3107 return gdbarch->address_class_type_flags != NULL;
3111 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3113 gdb_assert (gdbarch != NULL);
3114 gdb_assert (gdbarch->address_class_type_flags != NULL);
3115 if (gdbarch_debug >= 2)
3116 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3117 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3121 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3122 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3124 gdbarch->address_class_type_flags = address_class_type_flags;
3128 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3130 gdb_assert (gdbarch != NULL);
3131 return gdbarch->address_class_type_flags_to_name != NULL;
3135 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3137 gdb_assert (gdbarch != NULL);
3138 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3139 if (gdbarch_debug >= 2)
3140 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3141 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3145 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3146 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3148 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3152 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3154 gdb_assert (gdbarch != NULL);
3155 return gdbarch->address_class_name_to_type_flags != NULL;
3159 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3161 gdb_assert (gdbarch != NULL);
3162 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3163 if (gdbarch_debug >= 2)
3164 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3165 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3169 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3170 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3172 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3176 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3178 gdb_assert (gdbarch != NULL);
3179 gdb_assert (gdbarch->register_reggroup_p != NULL);
3180 if (gdbarch_debug >= 2)
3181 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3182 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3186 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3187 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3189 gdbarch->register_reggroup_p = register_reggroup_p;
3193 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3195 gdb_assert (gdbarch != NULL);
3196 return gdbarch->fetch_pointer_argument != NULL;
3200 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3202 gdb_assert (gdbarch != NULL);
3203 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3204 if (gdbarch_debug >= 2)
3205 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3206 return gdbarch->fetch_pointer_argument (frame, argi, type);
3210 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3211 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3213 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3217 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3219 gdb_assert (gdbarch != NULL);
3220 return gdbarch->regset_from_core_section != NULL;
3223 const struct regset *
3224 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3226 gdb_assert (gdbarch != NULL);
3227 gdb_assert (gdbarch->regset_from_core_section != NULL);
3228 if (gdbarch_debug >= 2)
3229 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3230 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3234 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3235 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3237 gdbarch->regset_from_core_section = regset_from_core_section;
3240 struct core_regset_section *
3241 gdbarch_core_regset_sections (struct gdbarch *gdbarch)
3243 gdb_assert (gdbarch != NULL);
3244 if (gdbarch_debug >= 2)
3245 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
3246 return gdbarch->core_regset_sections;
3250 set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
3251 struct core_regset_section * core_regset_sections)
3253 gdbarch->core_regset_sections = core_regset_sections;
3257 gdbarch_make_corefile_notes_p (struct gdbarch *gdbarch)
3259 gdb_assert (gdbarch != NULL);
3260 return gdbarch->make_corefile_notes != NULL;
3264 gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
3266 gdb_assert (gdbarch != NULL);
3267 gdb_assert (gdbarch->make_corefile_notes != NULL);
3268 if (gdbarch_debug >= 2)
3269 fprintf_unfiltered (gdb_stdlog, "gdbarch_make_corefile_notes called\n");
3270 return gdbarch->make_corefile_notes (gdbarch, obfd, note_size);
3274 set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch,
3275 gdbarch_make_corefile_notes_ftype make_corefile_notes)
3277 gdbarch->make_corefile_notes = make_corefile_notes;
3281 gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
3283 gdb_assert (gdbarch != NULL);
3284 return gdbarch->core_xfer_shared_libraries != NULL;
3288 gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
3290 gdb_assert (gdbarch != NULL);
3291 gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
3292 if (gdbarch_debug >= 2)
3293 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
3294 return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
3298 set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
3299 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
3301 gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
3305 gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch)
3307 gdb_assert (gdbarch != NULL);
3308 return gdbarch->core_pid_to_str != NULL;
3312 gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
3314 gdb_assert (gdbarch != NULL);
3315 gdb_assert (gdbarch->core_pid_to_str != NULL);
3316 if (gdbarch_debug >= 2)
3317 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_pid_to_str called\n");
3318 return gdbarch->core_pid_to_str (gdbarch, ptid);
3322 set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch,
3323 gdbarch_core_pid_to_str_ftype core_pid_to_str)
3325 gdbarch->core_pid_to_str = core_pid_to_str;
3329 gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
3331 gdb_assert (gdbarch != NULL);
3332 return gdbarch->gcore_bfd_target != 0;
3336 gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
3338 gdb_assert (gdbarch != NULL);
3339 /* Check variable changed from pre-default. */
3340 gdb_assert (gdbarch->gcore_bfd_target != 0);
3341 if (gdbarch_debug >= 2)
3342 fprintf_unfiltered (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
3343 return gdbarch->gcore_bfd_target;
3347 set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch,
3348 const char * gcore_bfd_target)
3350 gdbarch->gcore_bfd_target = gcore_bfd_target;
3354 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3356 gdb_assert (gdbarch != NULL);
3357 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3358 if (gdbarch_debug >= 2)
3359 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3360 return gdbarch->vtable_function_descriptors;
3364 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3365 int vtable_function_descriptors)
3367 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3371 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3373 gdb_assert (gdbarch != NULL);
3374 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3375 if (gdbarch_debug >= 2)
3376 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3377 return gdbarch->vbit_in_delta;
3381 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3384 gdbarch->vbit_in_delta = vbit_in_delta;
3388 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3390 gdb_assert (gdbarch != NULL);
3391 return gdbarch->skip_permanent_breakpoint != NULL;
3395 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3397 gdb_assert (gdbarch != NULL);
3398 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3399 if (gdbarch_debug >= 2)
3400 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3401 gdbarch->skip_permanent_breakpoint (regcache);
3405 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3406 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3408 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3412 gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
3414 gdb_assert (gdbarch != NULL);
3415 return gdbarch->max_insn_length != 0;
3419 gdbarch_max_insn_length (struct gdbarch *gdbarch)
3421 gdb_assert (gdbarch != NULL);
3422 /* Check variable changed from pre-default. */
3423 gdb_assert (gdbarch->max_insn_length != 0);
3424 if (gdbarch_debug >= 2)
3425 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
3426 return gdbarch->max_insn_length;
3430 set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
3431 ULONGEST max_insn_length)
3433 gdbarch->max_insn_length = max_insn_length;
3437 gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
3439 gdb_assert (gdbarch != NULL);
3440 return gdbarch->displaced_step_copy_insn != NULL;
3443 struct displaced_step_closure *
3444 gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3446 gdb_assert (gdbarch != NULL);
3447 gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
3448 if (gdbarch_debug >= 2)
3449 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
3450 return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
3454 set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
3455 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
3457 gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
3461 gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3463 gdb_assert (gdbarch != NULL);
3464 gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
3465 if (gdbarch_debug >= 2)
3466 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n");
3467 return gdbarch->displaced_step_hw_singlestep (gdbarch, closure);
3471 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
3472 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep)
3474 gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep;
3478 gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
3480 gdb_assert (gdbarch != NULL);
3481 return gdbarch->displaced_step_fixup != NULL;
3485 gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3487 gdb_assert (gdbarch != NULL);
3488 gdb_assert (gdbarch->displaced_step_fixup != NULL);
3489 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3490 if (gdbarch_debug >= 2)
3491 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
3492 gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
3496 set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
3497 gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
3499 gdbarch->displaced_step_fixup = displaced_step_fixup;
3503 gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3505 gdb_assert (gdbarch != NULL);
3506 gdb_assert (gdbarch->displaced_step_free_closure != NULL);
3507 if (gdbarch_debug >= 2)
3508 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
3509 gdbarch->displaced_step_free_closure (gdbarch, closure);
3513 set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
3514 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
3516 gdbarch->displaced_step_free_closure = displaced_step_free_closure;
3520 gdbarch_displaced_step_location (struct gdbarch *gdbarch)
3522 gdb_assert (gdbarch != NULL);
3523 gdb_assert (gdbarch->displaced_step_location != NULL);
3524 if (gdbarch_debug >= 2)
3525 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
3526 return gdbarch->displaced_step_location (gdbarch);
3530 set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
3531 gdbarch_displaced_step_location_ftype displaced_step_location)
3533 gdbarch->displaced_step_location = displaced_step_location;
3537 gdbarch_relocate_instruction_p (struct gdbarch *gdbarch)
3539 gdb_assert (gdbarch != NULL);
3540 return gdbarch->relocate_instruction != NULL;
3544 gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from)
3546 gdb_assert (gdbarch != NULL);
3547 gdb_assert (gdbarch->relocate_instruction != NULL);
3548 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3549 if (gdbarch_debug >= 2)
3550 fprintf_unfiltered (gdb_stdlog, "gdbarch_relocate_instruction called\n");
3551 gdbarch->relocate_instruction (gdbarch, to, from);
3555 set_gdbarch_relocate_instruction (struct gdbarch *gdbarch,
3556 gdbarch_relocate_instruction_ftype relocate_instruction)
3558 gdbarch->relocate_instruction = relocate_instruction;
3562 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3564 gdb_assert (gdbarch != NULL);
3565 return gdbarch->overlay_update != NULL;
3569 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3571 gdb_assert (gdbarch != NULL);
3572 gdb_assert (gdbarch->overlay_update != NULL);
3573 if (gdbarch_debug >= 2)
3574 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3575 gdbarch->overlay_update (osect);
3579 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3580 gdbarch_overlay_update_ftype overlay_update)
3582 gdbarch->overlay_update = overlay_update;
3586 gdbarch_core_read_description_p (struct gdbarch *gdbarch)
3588 gdb_assert (gdbarch != NULL);
3589 return gdbarch->core_read_description != NULL;
3592 const struct target_desc *
3593 gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
3595 gdb_assert (gdbarch != NULL);
3596 gdb_assert (gdbarch->core_read_description != NULL);
3597 if (gdbarch_debug >= 2)
3598 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
3599 return gdbarch->core_read_description (gdbarch, target, abfd);
3603 set_gdbarch_core_read_description (struct gdbarch *gdbarch,
3604 gdbarch_core_read_description_ftype core_read_description)
3606 gdbarch->core_read_description = core_read_description;
3610 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
3612 gdb_assert (gdbarch != NULL);
3613 return gdbarch->static_transform_name != NULL;
3617 gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name)
3619 gdb_assert (gdbarch != NULL);
3620 gdb_assert (gdbarch->static_transform_name != NULL);
3621 if (gdbarch_debug >= 2)
3622 fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
3623 return gdbarch->static_transform_name (name);
3627 set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
3628 gdbarch_static_transform_name_ftype static_transform_name)
3630 gdbarch->static_transform_name = static_transform_name;
3634 gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
3636 gdb_assert (gdbarch != NULL);
3637 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3638 if (gdbarch_debug >= 2)
3639 fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
3640 return gdbarch->sofun_address_maybe_missing;
3644 set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
3645 int sofun_address_maybe_missing)
3647 gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
3651 gdbarch_process_record_p (struct gdbarch *gdbarch)
3653 gdb_assert (gdbarch != NULL);
3654 return gdbarch->process_record != NULL;
3658 gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
3660 gdb_assert (gdbarch != NULL);
3661 gdb_assert (gdbarch->process_record != NULL);
3662 if (gdbarch_debug >= 2)
3663 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
3664 return gdbarch->process_record (gdbarch, regcache, addr);
3668 set_gdbarch_process_record (struct gdbarch *gdbarch,
3669 gdbarch_process_record_ftype process_record)
3671 gdbarch->process_record = process_record;
3675 gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
3677 gdb_assert (gdbarch != NULL);
3678 return gdbarch->process_record_signal != NULL;
3682 gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal)
3684 gdb_assert (gdbarch != NULL);
3685 gdb_assert (gdbarch->process_record_signal != NULL);
3686 if (gdbarch_debug >= 2)
3687 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n");
3688 return gdbarch->process_record_signal (gdbarch, regcache, signal);
3692 set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
3693 gdbarch_process_record_signal_ftype process_record_signal)
3695 gdbarch->process_record_signal = process_record_signal;
3699 gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
3701 gdb_assert (gdbarch != NULL);
3702 gdb_assert (gdbarch->target_signal_from_host != NULL);
3703 if (gdbarch_debug >= 2)
3704 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n");
3705 return gdbarch->target_signal_from_host (gdbarch, signo);
3709 set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
3710 gdbarch_target_signal_from_host_ftype target_signal_from_host)
3712 gdbarch->target_signal_from_host = target_signal_from_host;
3716 gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
3718 gdb_assert (gdbarch != NULL);
3719 gdb_assert (gdbarch->target_signal_to_host != NULL);
3720 if (gdbarch_debug >= 2)
3721 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n");
3722 return gdbarch->target_signal_to_host (gdbarch, ts);
3726 set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch,
3727 gdbarch_target_signal_to_host_ftype target_signal_to_host)
3729 gdbarch->target_signal_to_host = target_signal_to_host;
3733 gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
3735 gdb_assert (gdbarch != NULL);
3736 return gdbarch->get_siginfo_type != NULL;
3740 gdbarch_get_siginfo_type (struct gdbarch *gdbarch)
3742 gdb_assert (gdbarch != NULL);
3743 gdb_assert (gdbarch->get_siginfo_type != NULL);
3744 if (gdbarch_debug >= 2)
3745 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n");
3746 return gdbarch->get_siginfo_type (gdbarch);
3750 set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch,
3751 gdbarch_get_siginfo_type_ftype get_siginfo_type)
3753 gdbarch->get_siginfo_type = get_siginfo_type;
3757 gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
3759 gdb_assert (gdbarch != NULL);
3760 return gdbarch->record_special_symbol != NULL;
3764 gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
3766 gdb_assert (gdbarch != NULL);
3767 gdb_assert (gdbarch->record_special_symbol != NULL);
3768 if (gdbarch_debug >= 2)
3769 fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
3770 gdbarch->record_special_symbol (gdbarch, objfile, sym);
3774 set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
3775 gdbarch_record_special_symbol_ftype record_special_symbol)
3777 gdbarch->record_special_symbol = record_special_symbol;
3781 gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
3783 gdb_assert (gdbarch != NULL);
3784 return gdbarch->get_syscall_number != NULL;
3788 gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
3790 gdb_assert (gdbarch != NULL);
3791 gdb_assert (gdbarch->get_syscall_number != NULL);
3792 if (gdbarch_debug >= 2)
3793 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
3794 return gdbarch->get_syscall_number (gdbarch, ptid);
3798 set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
3799 gdbarch_get_syscall_number_ftype get_syscall_number)
3801 gdbarch->get_syscall_number = get_syscall_number;
3805 gdbarch_has_global_solist (struct gdbarch *gdbarch)
3807 gdb_assert (gdbarch != NULL);
3808 /* Skip verify of has_global_solist, invalid_p == 0 */
3809 if (gdbarch_debug >= 2)
3810 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
3811 return gdbarch->has_global_solist;
3815 set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
3816 int has_global_solist)
3818 gdbarch->has_global_solist = has_global_solist;
3822 gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
3824 gdb_assert (gdbarch != NULL);
3825 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3826 if (gdbarch_debug >= 2)
3827 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
3828 return gdbarch->has_global_breakpoints;
3832 set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
3833 int has_global_breakpoints)
3835 gdbarch->has_global_breakpoints = has_global_breakpoints;
3839 gdbarch_has_shared_address_space (struct gdbarch *gdbarch)
3841 gdb_assert (gdbarch != NULL);
3842 gdb_assert (gdbarch->has_shared_address_space != NULL);
3843 if (gdbarch_debug >= 2)
3844 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_shared_address_space called\n");
3845 return gdbarch->has_shared_address_space (gdbarch);
3849 set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
3850 gdbarch_has_shared_address_space_ftype has_shared_address_space)
3852 gdbarch->has_shared_address_space = has_shared_address_space;
3856 gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
3858 gdb_assert (gdbarch != NULL);
3859 gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
3860 if (gdbarch_debug >= 2)
3861 fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
3862 return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
3866 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
3867 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
3869 gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
3873 gdbarch_auto_charset (struct gdbarch *gdbarch)
3875 gdb_assert (gdbarch != NULL);
3876 gdb_assert (gdbarch->auto_charset != NULL);
3877 if (gdbarch_debug >= 2)
3878 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_charset called\n");
3879 return gdbarch->auto_charset ();
3883 set_gdbarch_auto_charset (struct gdbarch *gdbarch,
3884 gdbarch_auto_charset_ftype auto_charset)
3886 gdbarch->auto_charset = auto_charset;
3890 gdbarch_auto_wide_charset (struct gdbarch *gdbarch)
3892 gdb_assert (gdbarch != NULL);
3893 gdb_assert (gdbarch->auto_wide_charset != NULL);
3894 if (gdbarch_debug >= 2)
3895 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
3896 return gdbarch->auto_wide_charset ();
3900 set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
3901 gdbarch_auto_wide_charset_ftype auto_wide_charset)
3903 gdbarch->auto_wide_charset = auto_wide_charset;
3907 gdbarch_solib_symbols_extension (struct gdbarch *gdbarch)
3909 gdb_assert (gdbarch != NULL);
3910 if (gdbarch_debug >= 2)
3911 fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n");
3912 return gdbarch->solib_symbols_extension;
3916 set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch,
3917 const char * solib_symbols_extension)
3919 gdbarch->solib_symbols_extension = solib_symbols_extension;
3923 gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
3925 gdb_assert (gdbarch != NULL);
3926 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
3927 if (gdbarch_debug >= 2)
3928 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_dos_based_file_system called\n");
3929 return gdbarch->has_dos_based_file_system;
3933 set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
3934 int has_dos_based_file_system)
3936 gdbarch->has_dos_based_file_system = has_dos_based_file_system;
3940 gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope)
3942 gdb_assert (gdbarch != NULL);
3943 gdb_assert (gdbarch->gen_return_address != NULL);
3944 if (gdbarch_debug >= 2)
3945 fprintf_unfiltered (gdb_stdlog, "gdbarch_gen_return_address called\n");
3946 gdbarch->gen_return_address (gdbarch, ax, value, scope);
3950 set_gdbarch_gen_return_address (struct gdbarch *gdbarch,
3951 gdbarch_gen_return_address_ftype gen_return_address)
3953 gdbarch->gen_return_address = gen_return_address;
3957 gdbarch_info_proc_p (struct gdbarch *gdbarch)
3959 gdb_assert (gdbarch != NULL);
3960 return gdbarch->info_proc != NULL;
3964 gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
3966 gdb_assert (gdbarch != NULL);
3967 gdb_assert (gdbarch->info_proc != NULL);
3968 if (gdbarch_debug >= 2)
3969 fprintf_unfiltered (gdb_stdlog, "gdbarch_info_proc called\n");
3970 gdbarch->info_proc (gdbarch, args, what);
3974 set_gdbarch_info_proc (struct gdbarch *gdbarch,
3975 gdbarch_info_proc_ftype info_proc)
3977 gdbarch->info_proc = info_proc;
3981 /* Keep a registry of per-architecture data-pointers required by GDB
3988 gdbarch_data_pre_init_ftype *pre_init;
3989 gdbarch_data_post_init_ftype *post_init;
3992 struct gdbarch_data_registration
3994 struct gdbarch_data *data;
3995 struct gdbarch_data_registration *next;
3998 struct gdbarch_data_registry
4001 struct gdbarch_data_registration *registrations;
4004 struct gdbarch_data_registry gdbarch_data_registry =
4009 static struct gdbarch_data *
4010 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
4011 gdbarch_data_post_init_ftype *post_init)
4013 struct gdbarch_data_registration **curr;
4015 /* Append the new registration. */
4016 for (curr = &gdbarch_data_registry.registrations;
4018 curr = &(*curr)->next);
4019 (*curr) = XMALLOC (struct gdbarch_data_registration);
4020 (*curr)->next = NULL;
4021 (*curr)->data = XMALLOC (struct gdbarch_data);
4022 (*curr)->data->index = gdbarch_data_registry.nr++;
4023 (*curr)->data->pre_init = pre_init;
4024 (*curr)->data->post_init = post_init;
4025 (*curr)->data->init_p = 1;
4026 return (*curr)->data;
4029 struct gdbarch_data *
4030 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
4032 return gdbarch_data_register (pre_init, NULL);
4035 struct gdbarch_data *
4036 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
4038 return gdbarch_data_register (NULL, post_init);
4041 /* Create/delete the gdbarch data vector. */
4044 alloc_gdbarch_data (struct gdbarch *gdbarch)
4046 gdb_assert (gdbarch->data == NULL);
4047 gdbarch->nr_data = gdbarch_data_registry.nr;
4048 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
4051 /* Initialize the current value of the specified per-architecture
4055 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
4056 struct gdbarch_data *data,
4059 gdb_assert (data->index < gdbarch->nr_data);
4060 gdb_assert (gdbarch->data[data->index] == NULL);
4061 gdb_assert (data->pre_init == NULL);
4062 gdbarch->data[data->index] = pointer;
4065 /* Return the current value of the specified per-architecture
4069 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
4071 gdb_assert (data->index < gdbarch->nr_data);
4072 if (gdbarch->data[data->index] == NULL)
4074 /* The data-pointer isn't initialized, call init() to get a
4076 if (data->pre_init != NULL)
4077 /* Mid architecture creation: pass just the obstack, and not
4078 the entire architecture, as that way it isn't possible for
4079 pre-init code to refer to undefined architecture
4081 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
4082 else if (gdbarch->initialized_p
4083 && data->post_init != NULL)
4084 /* Post architecture creation: pass the entire architecture
4085 (as all fields are valid), but be careful to also detect
4086 recursive references. */
4088 gdb_assert (data->init_p);
4090 gdbarch->data[data->index] = data->post_init (gdbarch);
4094 /* The architecture initialization hasn't completed - punt -
4095 hope that the caller knows what they are doing. Once
4096 deprecated_set_gdbarch_data has been initialized, this can be
4097 changed to an internal error. */
4099 gdb_assert (gdbarch->data[data->index] != NULL);
4101 return gdbarch->data[data->index];
4105 /* Keep a registry of the architectures known by GDB. */
4107 struct gdbarch_registration
4109 enum bfd_architecture bfd_architecture;
4110 gdbarch_init_ftype *init;
4111 gdbarch_dump_tdep_ftype *dump_tdep;
4112 struct gdbarch_list *arches;
4113 struct gdbarch_registration *next;
4116 static struct gdbarch_registration *gdbarch_registry = NULL;
4119 append_name (const char ***buf, int *nr, const char *name)
4121 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4127 gdbarch_printable_names (void)
4129 /* Accumulate a list of names based on the registed list of
4132 const char **arches = NULL;
4133 struct gdbarch_registration *rego;
4135 for (rego = gdbarch_registry;
4139 const struct bfd_arch_info *ap;
4140 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4142 internal_error (__FILE__, __LINE__,
4143 _("gdbarch_architecture_names: multi-arch unknown"));
4146 append_name (&arches, &nr_arches, ap->printable_name);
4151 append_name (&arches, &nr_arches, NULL);
4157 gdbarch_register (enum bfd_architecture bfd_architecture,
4158 gdbarch_init_ftype *init,
4159 gdbarch_dump_tdep_ftype *dump_tdep)
4161 struct gdbarch_registration **curr;
4162 const struct bfd_arch_info *bfd_arch_info;
4164 /* Check that BFD recognizes this architecture */
4165 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4166 if (bfd_arch_info == NULL)
4168 internal_error (__FILE__, __LINE__,
4169 _("gdbarch: Attempt to register "
4170 "unknown architecture (%d)"),
4173 /* Check that we haven't seen this architecture before. */
4174 for (curr = &gdbarch_registry;
4176 curr = &(*curr)->next)
4178 if (bfd_architecture == (*curr)->bfd_architecture)
4179 internal_error (__FILE__, __LINE__,
4180 _("gdbarch: Duplicate registration "
4181 "of architecture (%s)"),
4182 bfd_arch_info->printable_name);
4186 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
4187 bfd_arch_info->printable_name,
4188 host_address_to_string (init));
4190 (*curr) = XMALLOC (struct gdbarch_registration);
4191 (*curr)->bfd_architecture = bfd_architecture;
4192 (*curr)->init = init;
4193 (*curr)->dump_tdep = dump_tdep;
4194 (*curr)->arches = NULL;
4195 (*curr)->next = NULL;
4199 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4200 gdbarch_init_ftype *init)
4202 gdbarch_register (bfd_architecture, init, NULL);
4206 /* Look for an architecture using gdbarch_info. */
4208 struct gdbarch_list *
4209 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4210 const struct gdbarch_info *info)
4212 for (; arches != NULL; arches = arches->next)
4214 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4216 if (info->byte_order != arches->gdbarch->byte_order)
4218 if (info->osabi != arches->gdbarch->osabi)
4220 if (info->target_desc != arches->gdbarch->target_desc)
4228 /* Find an architecture that matches the specified INFO. Create a new
4229 architecture if needed. Return that new architecture. */
4232 gdbarch_find_by_info (struct gdbarch_info info)
4234 struct gdbarch *new_gdbarch;
4235 struct gdbarch_registration *rego;
4237 /* Fill in missing parts of the INFO struct using a number of
4238 sources: "set ..."; INFOabfd supplied; and the global
4240 gdbarch_info_fill (&info);
4242 /* Must have found some sort of architecture. */
4243 gdb_assert (info.bfd_arch_info != NULL);
4247 fprintf_unfiltered (gdb_stdlog,
4248 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4249 (info.bfd_arch_info != NULL
4250 ? info.bfd_arch_info->printable_name
4252 fprintf_unfiltered (gdb_stdlog,
4253 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4255 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4256 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4258 fprintf_unfiltered (gdb_stdlog,
4259 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4260 info.osabi, gdbarch_osabi_name (info.osabi));
4261 fprintf_unfiltered (gdb_stdlog,
4262 "gdbarch_find_by_info: info.abfd %s\n",
4263 host_address_to_string (info.abfd));
4264 fprintf_unfiltered (gdb_stdlog,
4265 "gdbarch_find_by_info: info.tdep_info %s\n",
4266 host_address_to_string (info.tdep_info));
4269 /* Find the tdep code that knows about this architecture. */
4270 for (rego = gdbarch_registry;
4273 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4278 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4279 "No matching architecture\n");
4283 /* Ask the tdep code for an architecture that matches "info". */
4284 new_gdbarch = rego->init (info, rego->arches);
4286 /* Did the tdep code like it? No. Reject the change and revert to
4287 the old architecture. */
4288 if (new_gdbarch == NULL)
4291 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4292 "Target rejected architecture\n");
4296 /* Is this a pre-existing architecture (as determined by already
4297 being initialized)? Move it to the front of the architecture
4298 list (keeping the list sorted Most Recently Used). */
4299 if (new_gdbarch->initialized_p)
4301 struct gdbarch_list **list;
4302 struct gdbarch_list *this;
4304 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4305 "Previous architecture %s (%s) selected\n",
4306 host_address_to_string (new_gdbarch),
4307 new_gdbarch->bfd_arch_info->printable_name);
4308 /* Find the existing arch in the list. */
4309 for (list = ®o->arches;
4310 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4311 list = &(*list)->next);
4312 /* It had better be in the list of architectures. */
4313 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4316 (*list) = this->next;
4317 /* Insert THIS at the front. */
4318 this->next = rego->arches;
4319 rego->arches = this;
4324 /* It's a new architecture. */
4326 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4327 "New architecture %s (%s) selected\n",
4328 host_address_to_string (new_gdbarch),
4329 new_gdbarch->bfd_arch_info->printable_name);
4331 /* Insert the new architecture into the front of the architecture
4332 list (keep the list sorted Most Recently Used). */
4334 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4335 this->next = rego->arches;
4336 this->gdbarch = new_gdbarch;
4337 rego->arches = this;
4340 /* Check that the newly installed architecture is valid. Plug in
4341 any post init values. */
4342 new_gdbarch->dump_tdep = rego->dump_tdep;
4343 verify_gdbarch (new_gdbarch);
4344 new_gdbarch->initialized_p = 1;
4347 gdbarch_dump (new_gdbarch, gdb_stdlog);
4352 /* Make the specified architecture current. */
4355 deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4357 gdb_assert (new_gdbarch != NULL);
4358 gdb_assert (new_gdbarch->initialized_p);
4359 target_gdbarch = new_gdbarch;
4360 observer_notify_architecture_changed (new_gdbarch);
4361 registers_changed ();
4364 extern void _initialize_gdbarch (void);
4367 _initialize_gdbarch (void)
4369 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
4370 Set architecture debugging."), _("\
4371 Show architecture debugging."), _("\
4372 When non-zero, architecture debugging is enabled."),
4375 &setdebuglist, &showdebuglist);