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).
149 const struct floatformat ** float_format;
151 const struct floatformat ** double_format;
153 const struct floatformat ** long_double_format;
157 gdbarch_read_pc_ftype *read_pc;
158 gdbarch_write_pc_ftype *write_pc;
159 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
160 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
161 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
168 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
169 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
170 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
171 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
172 gdbarch_register_name_ftype *register_name;
173 gdbarch_register_type_ftype *register_type;
174 gdbarch_dummy_id_ftype *dummy_id;
175 int deprecated_fp_regnum;
176 gdbarch_push_dummy_call_ftype *push_dummy_call;
177 int call_dummy_location;
178 gdbarch_push_dummy_code_ftype *push_dummy_code;
179 gdbarch_print_registers_info_ftype *print_registers_info;
180 gdbarch_print_float_info_ftype *print_float_info;
181 gdbarch_print_vector_info_ftype *print_vector_info;
182 gdbarch_register_sim_regno_ftype *register_sim_regno;
183 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
184 gdbarch_cannot_store_register_ftype *cannot_store_register;
185 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
186 int believe_pcc_promotion;
187 gdbarch_convert_register_p_ftype *convert_register_p;
188 gdbarch_register_to_value_ftype *register_to_value;
189 gdbarch_value_to_register_ftype *value_to_register;
190 gdbarch_value_from_register_ftype *value_from_register;
191 gdbarch_pointer_to_address_ftype *pointer_to_address;
192 gdbarch_address_to_pointer_ftype *address_to_pointer;
193 gdbarch_integer_to_address_ftype *integer_to_address;
194 gdbarch_return_value_ftype *return_value;
195 gdbarch_skip_prologue_ftype *skip_prologue;
196 gdbarch_skip_main_prologue_ftype *skip_main_prologue;
197 gdbarch_inner_than_ftype *inner_than;
198 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
199 gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
200 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
201 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
202 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
203 CORE_ADDR decr_pc_after_break;
204 CORE_ADDR deprecated_function_start_offset;
205 gdbarch_remote_register_number_ftype *remote_register_number;
206 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
207 CORE_ADDR frame_args_skip;
208 gdbarch_unwind_pc_ftype *unwind_pc;
209 gdbarch_unwind_sp_ftype *unwind_sp;
210 gdbarch_frame_num_args_ftype *frame_num_args;
211 gdbarch_frame_align_ftype *frame_align;
212 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
213 int frame_red_zone_size;
214 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
215 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
216 gdbarch_smash_text_address_ftype *smash_text_address;
217 gdbarch_software_single_step_ftype *software_single_step;
218 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
219 gdbarch_print_insn_ftype *print_insn;
220 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
221 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
222 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
223 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
224 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
225 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
226 int cannot_step_breakpoint;
227 int have_nonsteppable_watchpoint;
228 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
229 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
230 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
231 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
232 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
233 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
234 int core_reg_section_encodes_pid;
235 struct core_regset_section * core_regset_sections;
236 gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
237 gdbarch_core_pid_to_str_ftype *core_pid_to_str;
238 const char * gcore_bfd_target;
239 int vtable_function_descriptors;
241 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
242 ULONGEST max_insn_length;
243 gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
244 gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
245 gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
246 gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
247 gdbarch_displaced_step_location_ftype *displaced_step_location;
248 gdbarch_overlay_update_ftype *overlay_update;
249 gdbarch_core_read_description_ftype *core_read_description;
250 gdbarch_static_transform_name_ftype *static_transform_name;
251 int sofun_address_maybe_missing;
252 gdbarch_process_record_ftype *process_record;
253 gdbarch_process_record_signal_ftype *process_record_signal;
254 gdbarch_target_signal_from_host_ftype *target_signal_from_host;
255 gdbarch_target_signal_to_host_ftype *target_signal_to_host;
256 gdbarch_get_siginfo_type_ftype *get_siginfo_type;
257 gdbarch_record_special_symbol_ftype *record_special_symbol;
258 gdbarch_get_syscall_number_ftype *get_syscall_number;
259 int has_global_solist;
260 int has_global_breakpoints;
261 gdbarch_has_shared_address_space_ftype *has_shared_address_space;
262 gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
263 gdbarch_auto_charset_ftype *auto_charset;
264 gdbarch_auto_wide_charset_ftype *auto_wide_charset;
265 const char * solib_symbols_extension;
266 int has_dos_based_file_system;
270 /* The default architecture uses host values (for want of a better
273 extern const struct bfd_arch_info bfd_default_arch_struct;
275 struct gdbarch startup_gdbarch =
277 1, /* Always initialized. */
278 NULL, /* The obstack. */
279 /* basic architecture information */
280 &bfd_default_arch_struct, /* bfd_arch_info */
281 BFD_ENDIAN_BIG, /* byte_order */
282 BFD_ENDIAN_BIG, /* byte_order_for_code */
283 GDB_OSABI_UNKNOWN, /* osabi */
285 /* target specific vector and its dump routine */
287 /*per-architecture data-pointers and swap regions */
289 /* Multi-arch values */
290 1, /* bits_big_endian */
291 8 * sizeof (short), /* short_bit */
292 8 * sizeof (int), /* int_bit */
293 8 * sizeof (long), /* long_bit */
294 8 * sizeof (LONGEST), /* long_long_bit */
295 8 * sizeof (float), /* float_bit */
296 0, /* float_format */
297 8 * sizeof (double), /* double_bit */
298 0, /* double_format */
299 8 * sizeof (long double), /* long_double_bit */
300 0, /* long_double_format */
301 8 * sizeof (void*), /* ptr_bit */
302 8 * sizeof (void*), /* addr_bit */
306 legacy_virtual_frame_pointer, /* virtual_frame_pointer */
307 0, /* pseudo_register_read */
308 0, /* pseudo_register_write */
310 0, /* num_pseudo_regs */
315 no_op_reg_to_regnum, /* stab_reg_to_regnum */
316 no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
317 no_op_reg_to_regnum, /* sdb_reg_to_regnum */
318 no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
319 0, /* register_name */
320 0, /* register_type */
322 -1, /* deprecated_fp_regnum */
323 0, /* push_dummy_call */
324 0, /* call_dummy_location */
325 0, /* push_dummy_code */
326 default_print_registers_info, /* print_registers_info */
327 0, /* print_float_info */
328 0, /* print_vector_info */
329 legacy_register_sim_regno, /* register_sim_regno */
330 cannot_register_not, /* cannot_fetch_register */
331 cannot_register_not, /* cannot_store_register */
332 0, /* get_longjmp_target */
333 0, /* believe_pcc_promotion */
334 generic_convert_register_p, /* convert_register_p */
335 0, /* register_to_value */
336 0, /* value_to_register */
337 0, /* value_from_register */
338 unsigned_pointer_to_address, /* pointer_to_address */
339 unsigned_address_to_pointer, /* address_to_pointer */
340 0, /* integer_to_address */
341 0, /* return_value */
342 0, /* skip_prologue */
343 0, /* skip_main_prologue */
345 0, /* breakpoint_from_pc */
346 default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */
347 0, /* adjust_breakpoint_address */
348 default_memory_insert_breakpoint, /* memory_insert_breakpoint */
349 default_memory_remove_breakpoint, /* memory_remove_breakpoint */
350 0, /* decr_pc_after_break */
351 0, /* deprecated_function_start_offset */
352 default_remote_register_number, /* remote_register_number */
353 0, /* fetch_tls_load_module_address */
354 0, /* frame_args_skip */
357 0, /* frame_num_args */
359 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
360 0, /* frame_red_zone_size */
361 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
362 core_addr_identity, /* addr_bits_remove */
363 core_addr_identity, /* smash_text_address */
364 0, /* software_single_step */
365 0, /* single_step_through_delay */
367 0, /* skip_trampoline_code */
368 generic_skip_solib_resolver, /* skip_solib_resolver */
369 generic_in_solib_return_trampoline, /* in_solib_return_trampoline */
370 generic_in_function_epilogue_p, /* in_function_epilogue_p */
371 0, /* elf_make_msymbol_special */
372 0, /* coff_make_msymbol_special */
373 0, /* cannot_step_breakpoint */
374 0, /* have_nonsteppable_watchpoint */
375 0, /* address_class_type_flags */
376 0, /* address_class_type_flags_to_name */
377 0, /* address_class_name_to_type_flags */
378 default_register_reggroup_p, /* register_reggroup_p */
379 0, /* fetch_pointer_argument */
380 0, /* regset_from_core_section */
381 0, /* core_reg_section_encodes_pid */
382 0, /* core_regset_sections */
383 0, /* core_xfer_shared_libraries */
384 0, /* core_pid_to_str */
385 0, /* gcore_bfd_target */
386 0, /* vtable_function_descriptors */
387 0, /* vbit_in_delta */
388 0, /* skip_permanent_breakpoint */
389 0, /* max_insn_length */
390 0, /* displaced_step_copy_insn */
391 default_displaced_step_hw_singlestep, /* displaced_step_hw_singlestep */
392 0, /* displaced_step_fixup */
393 NULL, /* displaced_step_free_closure */
394 NULL, /* displaced_step_location */
395 0, /* overlay_update */
396 0, /* core_read_description */
397 0, /* static_transform_name */
398 0, /* sofun_address_maybe_missing */
399 0, /* process_record */
400 0, /* process_record_signal */
401 default_target_signal_from_host, /* target_signal_from_host */
402 default_target_signal_to_host, /* target_signal_to_host */
403 0, /* get_siginfo_type */
404 0, /* record_special_symbol */
405 0, /* get_syscall_number */
406 0, /* has_global_solist */
407 0, /* has_global_breakpoints */
408 default_has_shared_address_space, /* has_shared_address_space */
409 default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
410 default_auto_charset, /* auto_charset */
411 default_auto_wide_charset, /* auto_wide_charset */
412 0, /* solib_symbols_extension */
413 0, /* has_dos_based_file_system */
414 /* startup_gdbarch() */
417 struct gdbarch *target_gdbarch = &startup_gdbarch;
419 /* Create a new ``struct gdbarch'' based on information provided by
420 ``struct gdbarch_info''. */
423 gdbarch_alloc (const struct gdbarch_info *info,
424 struct gdbarch_tdep *tdep)
426 struct gdbarch *gdbarch;
428 /* Create an obstack for allocating all the per-architecture memory,
429 then use that to allocate the architecture vector. */
430 struct obstack *obstack = XMALLOC (struct obstack);
431 obstack_init (obstack);
432 gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
433 memset (gdbarch, 0, sizeof (*gdbarch));
434 gdbarch->obstack = obstack;
436 alloc_gdbarch_data (gdbarch);
438 gdbarch->tdep = tdep;
440 gdbarch->bfd_arch_info = info->bfd_arch_info;
441 gdbarch->byte_order = info->byte_order;
442 gdbarch->byte_order_for_code = info->byte_order_for_code;
443 gdbarch->osabi = info->osabi;
444 gdbarch->target_desc = info->target_desc;
446 /* Force the explicit initialization of these. */
447 gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
448 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
449 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
450 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
451 gdbarch->long_long_bit = 2*gdbarch->long_bit;
452 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
453 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
454 gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
455 gdbarch->ptr_bit = gdbarch->int_bit;
456 gdbarch->char_signed = -1;
457 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
458 gdbarch->num_regs = -1;
459 gdbarch->sp_regnum = -1;
460 gdbarch->pc_regnum = -1;
461 gdbarch->ps_regnum = -1;
462 gdbarch->fp0_regnum = -1;
463 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
464 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
465 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
466 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
467 gdbarch->deprecated_fp_regnum = -1;
468 gdbarch->call_dummy_location = AT_ENTRY_POINT;
469 gdbarch->print_registers_info = default_print_registers_info;
470 gdbarch->register_sim_regno = legacy_register_sim_regno;
471 gdbarch->cannot_fetch_register = cannot_register_not;
472 gdbarch->cannot_store_register = cannot_register_not;
473 gdbarch->convert_register_p = generic_convert_register_p;
474 gdbarch->value_from_register = default_value_from_register;
475 gdbarch->pointer_to_address = unsigned_pointer_to_address;
476 gdbarch->address_to_pointer = unsigned_address_to_pointer;
477 gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
478 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
479 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
480 gdbarch->remote_register_number = default_remote_register_number;
481 gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
482 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
483 gdbarch->addr_bits_remove = core_addr_identity;
484 gdbarch->smash_text_address = core_addr_identity;
485 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
486 gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
487 gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
488 gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
489 gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
490 gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
491 gdbarch->register_reggroup_p = default_register_reggroup_p;
492 gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
493 gdbarch->displaced_step_fixup = NULL;
494 gdbarch->displaced_step_free_closure = NULL;
495 gdbarch->displaced_step_location = NULL;
496 gdbarch->target_signal_from_host = default_target_signal_from_host;
497 gdbarch->target_signal_to_host = default_target_signal_to_host;
498 gdbarch->has_shared_address_space = default_has_shared_address_space;
499 gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
500 gdbarch->auto_charset = default_auto_charset;
501 gdbarch->auto_wide_charset = default_auto_wide_charset;
502 /* gdbarch_alloc() */
508 /* Allocate extra space using the per-architecture obstack. */
511 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
513 void *data = obstack_alloc (arch->obstack, size);
515 memset (data, 0, size);
520 /* Free a gdbarch struct. This should never happen in normal
521 operation --- once you've created a gdbarch, you keep it around.
522 However, if an architecture's init function encounters an error
523 building the structure, it may need to clean up a partially
524 constructed gdbarch. */
527 gdbarch_free (struct gdbarch *arch)
529 struct obstack *obstack;
531 gdb_assert (arch != NULL);
532 gdb_assert (!arch->initialized_p);
533 obstack = arch->obstack;
534 obstack_free (obstack, 0); /* Includes the ARCH. */
539 /* Ensure that all values in a GDBARCH are reasonable. */
542 verify_gdbarch (struct gdbarch *gdbarch)
545 struct cleanup *cleanups;
549 log = mem_fileopen ();
550 cleanups = make_cleanup_ui_file_delete (log);
552 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
553 fprintf_unfiltered (log, "\n\tbyte-order");
554 if (gdbarch->bfd_arch_info == NULL)
555 fprintf_unfiltered (log, "\n\tbfd_arch_info");
556 /* Check those that need to be defined for the given multi-arch level. */
557 /* Skip verify of bits_big_endian, invalid_p == 0 */
558 /* Skip verify of short_bit, invalid_p == 0 */
559 /* Skip verify of int_bit, invalid_p == 0 */
560 /* Skip verify of long_bit, invalid_p == 0 */
561 /* Skip verify of long_long_bit, invalid_p == 0 */
562 /* Skip verify of float_bit, invalid_p == 0 */
563 if (gdbarch->float_format == 0)
564 gdbarch->float_format = floatformats_ieee_single;
565 /* Skip verify of double_bit, invalid_p == 0 */
566 if (gdbarch->double_format == 0)
567 gdbarch->double_format = floatformats_ieee_double;
568 /* Skip verify of long_double_bit, invalid_p == 0 */
569 if (gdbarch->long_double_format == 0)
570 gdbarch->long_double_format = floatformats_ieee_double;
571 /* Skip verify of ptr_bit, invalid_p == 0 */
572 if (gdbarch->addr_bit == 0)
573 gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
574 if (gdbarch->char_signed == -1)
575 gdbarch->char_signed = 1;
576 /* Skip verify of read_pc, has predicate */
577 /* Skip verify of write_pc, has predicate */
578 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
579 /* Skip verify of pseudo_register_read, has predicate */
580 /* Skip verify of pseudo_register_write, has predicate */
581 if (gdbarch->num_regs == -1)
582 fprintf_unfiltered (log, "\n\tnum_regs");
583 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
584 /* Skip verify of sp_regnum, invalid_p == 0 */
585 /* Skip verify of pc_regnum, invalid_p == 0 */
586 /* Skip verify of ps_regnum, invalid_p == 0 */
587 /* Skip verify of fp0_regnum, invalid_p == 0 */
588 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
589 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
590 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
591 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
592 if (gdbarch->register_name == 0)
593 fprintf_unfiltered (log, "\n\tregister_name");
594 /* Skip verify of register_type, has predicate */
595 /* Skip verify of dummy_id, has predicate */
596 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
597 /* Skip verify of push_dummy_call, has predicate */
598 /* Skip verify of call_dummy_location, invalid_p == 0 */
599 /* Skip verify of push_dummy_code, has predicate */
600 /* Skip verify of print_registers_info, invalid_p == 0 */
601 /* Skip verify of print_float_info, has predicate */
602 /* Skip verify of print_vector_info, has predicate */
603 /* Skip verify of register_sim_regno, invalid_p == 0 */
604 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
605 /* Skip verify of cannot_store_register, invalid_p == 0 */
606 /* Skip verify of get_longjmp_target, has predicate */
607 /* Skip verify of convert_register_p, invalid_p == 0 */
608 /* Skip verify of value_from_register, invalid_p == 0 */
609 /* Skip verify of pointer_to_address, invalid_p == 0 */
610 /* Skip verify of address_to_pointer, invalid_p == 0 */
611 /* Skip verify of integer_to_address, has predicate */
612 /* Skip verify of return_value, has predicate */
613 if (gdbarch->skip_prologue == 0)
614 fprintf_unfiltered (log, "\n\tskip_prologue");
615 /* Skip verify of skip_main_prologue, has predicate */
616 if (gdbarch->inner_than == 0)
617 fprintf_unfiltered (log, "\n\tinner_than");
618 if (gdbarch->breakpoint_from_pc == 0)
619 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
620 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
621 /* Skip verify of adjust_breakpoint_address, has predicate */
622 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
623 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
624 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
625 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
626 /* Skip verify of remote_register_number, invalid_p == 0 */
627 /* Skip verify of fetch_tls_load_module_address, has predicate */
628 /* Skip verify of frame_args_skip, invalid_p == 0 */
629 /* Skip verify of unwind_pc, has predicate */
630 /* Skip verify of unwind_sp, has predicate */
631 /* Skip verify of frame_num_args, has predicate */
632 /* Skip verify of frame_align, has predicate */
633 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
634 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
635 /* Skip verify of addr_bits_remove, invalid_p == 0 */
636 /* Skip verify of smash_text_address, invalid_p == 0 */
637 /* Skip verify of software_single_step, has predicate */
638 /* Skip verify of single_step_through_delay, has predicate */
639 if (gdbarch->print_insn == 0)
640 fprintf_unfiltered (log, "\n\tprint_insn");
641 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
642 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
643 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
644 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
645 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
646 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
647 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
648 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
649 /* Skip verify of address_class_type_flags, has predicate */
650 /* Skip verify of address_class_type_flags_to_name, has predicate */
651 /* Skip verify of address_class_name_to_type_flags, has predicate */
652 /* Skip verify of register_reggroup_p, invalid_p == 0 */
653 /* Skip verify of fetch_pointer_argument, has predicate */
654 /* Skip verify of regset_from_core_section, has predicate */
655 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
656 /* Skip verify of core_xfer_shared_libraries, has predicate */
657 /* Skip verify of core_pid_to_str, has predicate */
658 /* Skip verify of gcore_bfd_target, has predicate */
659 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
660 /* Skip verify of vbit_in_delta, invalid_p == 0 */
661 /* Skip verify of skip_permanent_breakpoint, has predicate */
662 /* Skip verify of max_insn_length, has predicate */
663 /* Skip verify of displaced_step_copy_insn, has predicate */
664 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
665 /* Skip verify of displaced_step_fixup, has predicate */
666 if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
667 fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
668 if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
669 fprintf_unfiltered (log, "\n\tdisplaced_step_location");
670 /* Skip verify of overlay_update, has predicate */
671 /* Skip verify of core_read_description, has predicate */
672 /* Skip verify of static_transform_name, has predicate */
673 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
674 /* Skip verify of process_record, has predicate */
675 /* Skip verify of process_record_signal, has predicate */
676 /* Skip verify of target_signal_from_host, invalid_p == 0 */
677 /* Skip verify of target_signal_to_host, invalid_p == 0 */
678 /* Skip verify of get_siginfo_type, has predicate */
679 /* Skip verify of record_special_symbol, has predicate */
680 /* Skip verify of get_syscall_number, has predicate */
681 /* Skip verify of has_global_solist, invalid_p == 0 */
682 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
683 /* Skip verify of has_shared_address_space, invalid_p == 0 */
684 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
685 /* Skip verify of auto_charset, invalid_p == 0 */
686 /* Skip verify of auto_wide_charset, invalid_p == 0 */
687 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
688 buf = ui_file_xstrdup (log, &length);
689 make_cleanup (xfree, buf);
691 internal_error (__FILE__, __LINE__,
692 _("verify_gdbarch: the following are invalid ...%s"),
694 do_cleanups (cleanups);
698 /* Print out the details of the current architecture. */
701 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
703 const char *gdb_nm_file = "<not-defined>";
705 #if defined (GDB_NM_FILE)
706 gdb_nm_file = GDB_NM_FILE;
708 fprintf_unfiltered (file,
709 "gdbarch_dump: GDB_NM_FILE = %s\n",
711 fprintf_unfiltered (file,
712 "gdbarch_dump: addr_bit = %s\n",
713 plongest (gdbarch->addr_bit));
714 fprintf_unfiltered (file,
715 "gdbarch_dump: addr_bits_remove = <%s>\n",
716 host_address_to_string (gdbarch->addr_bits_remove));
717 fprintf_unfiltered (file,
718 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
719 gdbarch_address_class_name_to_type_flags_p (gdbarch));
720 fprintf_unfiltered (file,
721 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
722 host_address_to_string (gdbarch->address_class_name_to_type_flags));
723 fprintf_unfiltered (file,
724 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
725 gdbarch_address_class_type_flags_p (gdbarch));
726 fprintf_unfiltered (file,
727 "gdbarch_dump: address_class_type_flags = <%s>\n",
728 host_address_to_string (gdbarch->address_class_type_flags));
729 fprintf_unfiltered (file,
730 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
731 gdbarch_address_class_type_flags_to_name_p (gdbarch));
732 fprintf_unfiltered (file,
733 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
734 host_address_to_string (gdbarch->address_class_type_flags_to_name));
735 fprintf_unfiltered (file,
736 "gdbarch_dump: address_to_pointer = <%s>\n",
737 host_address_to_string (gdbarch->address_to_pointer));
738 fprintf_unfiltered (file,
739 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
740 gdbarch_adjust_breakpoint_address_p (gdbarch));
741 fprintf_unfiltered (file,
742 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
743 host_address_to_string (gdbarch->adjust_breakpoint_address));
744 fprintf_unfiltered (file,
745 "gdbarch_dump: auto_charset = <%s>\n",
746 host_address_to_string (gdbarch->auto_charset));
747 fprintf_unfiltered (file,
748 "gdbarch_dump: auto_wide_charset = <%s>\n",
749 host_address_to_string (gdbarch->auto_wide_charset));
750 fprintf_unfiltered (file,
751 "gdbarch_dump: believe_pcc_promotion = %s\n",
752 plongest (gdbarch->believe_pcc_promotion));
753 fprintf_unfiltered (file,
754 "gdbarch_dump: bfd_arch_info = %s\n",
755 gdbarch_bfd_arch_info (gdbarch)->printable_name);
756 fprintf_unfiltered (file,
757 "gdbarch_dump: bits_big_endian = %s\n",
758 plongest (gdbarch->bits_big_endian));
759 fprintf_unfiltered (file,
760 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
761 host_address_to_string (gdbarch->breakpoint_from_pc));
762 fprintf_unfiltered (file,
763 "gdbarch_dump: byte_order = %s\n",
764 plongest (gdbarch->byte_order));
765 fprintf_unfiltered (file,
766 "gdbarch_dump: byte_order_for_code = %s\n",
767 plongest (gdbarch->byte_order_for_code));
768 fprintf_unfiltered (file,
769 "gdbarch_dump: call_dummy_location = %s\n",
770 plongest (gdbarch->call_dummy_location));
771 fprintf_unfiltered (file,
772 "gdbarch_dump: cannot_fetch_register = <%s>\n",
773 host_address_to_string (gdbarch->cannot_fetch_register));
774 fprintf_unfiltered (file,
775 "gdbarch_dump: cannot_step_breakpoint = %s\n",
776 plongest (gdbarch->cannot_step_breakpoint));
777 fprintf_unfiltered (file,
778 "gdbarch_dump: cannot_store_register = <%s>\n",
779 host_address_to_string (gdbarch->cannot_store_register));
780 fprintf_unfiltered (file,
781 "gdbarch_dump: char_signed = %s\n",
782 plongest (gdbarch->char_signed));
783 fprintf_unfiltered (file,
784 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
785 host_address_to_string (gdbarch->coff_make_msymbol_special));
786 fprintf_unfiltered (file,
787 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
788 host_address_to_string (gdbarch->convert_from_func_ptr_addr));
789 fprintf_unfiltered (file,
790 "gdbarch_dump: convert_register_p = <%s>\n",
791 host_address_to_string (gdbarch->convert_register_p));
792 fprintf_unfiltered (file,
793 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
794 gdbarch_core_pid_to_str_p (gdbarch));
795 fprintf_unfiltered (file,
796 "gdbarch_dump: core_pid_to_str = <%s>\n",
797 host_address_to_string (gdbarch->core_pid_to_str));
798 fprintf_unfiltered (file,
799 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
800 gdbarch_core_read_description_p (gdbarch));
801 fprintf_unfiltered (file,
802 "gdbarch_dump: core_read_description = <%s>\n",
803 host_address_to_string (gdbarch->core_read_description));
804 fprintf_unfiltered (file,
805 "gdbarch_dump: core_reg_section_encodes_pid = %s\n",
806 plongest (gdbarch->core_reg_section_encodes_pid));
807 fprintf_unfiltered (file,
808 "gdbarch_dump: core_regset_sections = %s\n",
809 host_address_to_string (gdbarch->core_regset_sections));
810 fprintf_unfiltered (file,
811 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
812 gdbarch_core_xfer_shared_libraries_p (gdbarch));
813 fprintf_unfiltered (file,
814 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
815 host_address_to_string (gdbarch->core_xfer_shared_libraries));
816 fprintf_unfiltered (file,
817 "gdbarch_dump: decr_pc_after_break = %s\n",
818 core_addr_to_string_nz (gdbarch->decr_pc_after_break));
819 fprintf_unfiltered (file,
820 "gdbarch_dump: deprecated_fp_regnum = %s\n",
821 plongest (gdbarch->deprecated_fp_regnum));
822 fprintf_unfiltered (file,
823 "gdbarch_dump: deprecated_function_start_offset = %s\n",
824 core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
825 fprintf_unfiltered (file,
826 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
827 gdbarch_displaced_step_copy_insn_p (gdbarch));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
830 host_address_to_string (gdbarch->displaced_step_copy_insn));
831 fprintf_unfiltered (file,
832 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
833 gdbarch_displaced_step_fixup_p (gdbarch));
834 fprintf_unfiltered (file,
835 "gdbarch_dump: displaced_step_fixup = <%s>\n",
836 host_address_to_string (gdbarch->displaced_step_fixup));
837 fprintf_unfiltered (file,
838 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
839 host_address_to_string (gdbarch->displaced_step_free_closure));
840 fprintf_unfiltered (file,
841 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
842 host_address_to_string (gdbarch->displaced_step_hw_singlestep));
843 fprintf_unfiltered (file,
844 "gdbarch_dump: displaced_step_location = <%s>\n",
845 host_address_to_string (gdbarch->displaced_step_location));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: double_bit = %s\n",
848 plongest (gdbarch->double_bit));
849 fprintf_unfiltered (file,
850 "gdbarch_dump: double_format = %s\n",
851 pformat (gdbarch->double_format));
852 fprintf_unfiltered (file,
853 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
854 gdbarch_dummy_id_p (gdbarch));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: dummy_id = <%s>\n",
857 host_address_to_string (gdbarch->dummy_id));
858 fprintf_unfiltered (file,
859 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
860 host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
861 fprintf_unfiltered (file,
862 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
863 host_address_to_string (gdbarch->ecoff_reg_to_regnum));
864 fprintf_unfiltered (file,
865 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
866 host_address_to_string (gdbarch->elf_make_msymbol_special));
867 fprintf_unfiltered (file,
868 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
869 host_address_to_string (gdbarch->fast_tracepoint_valid_at));
870 fprintf_unfiltered (file,
871 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
872 gdbarch_fetch_pointer_argument_p (gdbarch));
873 fprintf_unfiltered (file,
874 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
875 host_address_to_string (gdbarch->fetch_pointer_argument));
876 fprintf_unfiltered (file,
877 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
878 gdbarch_fetch_tls_load_module_address_p (gdbarch));
879 fprintf_unfiltered (file,
880 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
881 host_address_to_string (gdbarch->fetch_tls_load_module_address));
882 fprintf_unfiltered (file,
883 "gdbarch_dump: float_bit = %s\n",
884 plongest (gdbarch->float_bit));
885 fprintf_unfiltered (file,
886 "gdbarch_dump: float_format = %s\n",
887 pformat (gdbarch->float_format));
888 fprintf_unfiltered (file,
889 "gdbarch_dump: fp0_regnum = %s\n",
890 plongest (gdbarch->fp0_regnum));
891 fprintf_unfiltered (file,
892 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
893 gdbarch_frame_align_p (gdbarch));
894 fprintf_unfiltered (file,
895 "gdbarch_dump: frame_align = <%s>\n",
896 host_address_to_string (gdbarch->frame_align));
897 fprintf_unfiltered (file,
898 "gdbarch_dump: frame_args_skip = %s\n",
899 core_addr_to_string_nz (gdbarch->frame_args_skip));
900 fprintf_unfiltered (file,
901 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
902 gdbarch_frame_num_args_p (gdbarch));
903 fprintf_unfiltered (file,
904 "gdbarch_dump: frame_num_args = <%s>\n",
905 host_address_to_string (gdbarch->frame_num_args));
906 fprintf_unfiltered (file,
907 "gdbarch_dump: frame_red_zone_size = %s\n",
908 plongest (gdbarch->frame_red_zone_size));
909 fprintf_unfiltered (file,
910 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
911 gdbarch_gcore_bfd_target_p (gdbarch));
912 fprintf_unfiltered (file,
913 "gdbarch_dump: gcore_bfd_target = %s\n",
914 gdbarch->gcore_bfd_target);
915 fprintf_unfiltered (file,
916 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
917 gdbarch_get_longjmp_target_p (gdbarch));
918 fprintf_unfiltered (file,
919 "gdbarch_dump: get_longjmp_target = <%s>\n",
920 host_address_to_string (gdbarch->get_longjmp_target));
921 fprintf_unfiltered (file,
922 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
923 gdbarch_get_siginfo_type_p (gdbarch));
924 fprintf_unfiltered (file,
925 "gdbarch_dump: get_siginfo_type = <%s>\n",
926 host_address_to_string (gdbarch->get_siginfo_type));
927 fprintf_unfiltered (file,
928 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
929 gdbarch_get_syscall_number_p (gdbarch));
930 fprintf_unfiltered (file,
931 "gdbarch_dump: get_syscall_number = <%s>\n",
932 host_address_to_string (gdbarch->get_syscall_number));
933 fprintf_unfiltered (file,
934 "gdbarch_dump: has_dos_based_file_system = %s\n",
935 plongest (gdbarch->has_dos_based_file_system));
936 fprintf_unfiltered (file,
937 "gdbarch_dump: has_global_breakpoints = %s\n",
938 plongest (gdbarch->has_global_breakpoints));
939 fprintf_unfiltered (file,
940 "gdbarch_dump: has_global_solist = %s\n",
941 plongest (gdbarch->has_global_solist));
942 fprintf_unfiltered (file,
943 "gdbarch_dump: has_shared_address_space = <%s>\n",
944 host_address_to_string (gdbarch->has_shared_address_space));
945 fprintf_unfiltered (file,
946 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
947 plongest (gdbarch->have_nonsteppable_watchpoint));
948 fprintf_unfiltered (file,
949 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
950 host_address_to_string (gdbarch->in_function_epilogue_p));
951 fprintf_unfiltered (file,
952 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
953 host_address_to_string (gdbarch->in_solib_return_trampoline));
954 fprintf_unfiltered (file,
955 "gdbarch_dump: inner_than = <%s>\n",
956 host_address_to_string (gdbarch->inner_than));
957 fprintf_unfiltered (file,
958 "gdbarch_dump: int_bit = %s\n",
959 plongest (gdbarch->int_bit));
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
962 gdbarch_integer_to_address_p (gdbarch));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: integer_to_address = <%s>\n",
965 host_address_to_string (gdbarch->integer_to_address));
966 fprintf_unfiltered (file,
967 "gdbarch_dump: long_bit = %s\n",
968 plongest (gdbarch->long_bit));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: long_double_bit = %s\n",
971 plongest (gdbarch->long_double_bit));
972 fprintf_unfiltered (file,
973 "gdbarch_dump: long_double_format = %s\n",
974 pformat (gdbarch->long_double_format));
975 fprintf_unfiltered (file,
976 "gdbarch_dump: long_long_bit = %s\n",
977 plongest (gdbarch->long_long_bit));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
980 gdbarch_max_insn_length_p (gdbarch));
981 fprintf_unfiltered (file,
982 "gdbarch_dump: max_insn_length = %s\n",
983 plongest (gdbarch->max_insn_length));
984 fprintf_unfiltered (file,
985 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
986 host_address_to_string (gdbarch->memory_insert_breakpoint));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
989 host_address_to_string (gdbarch->memory_remove_breakpoint));
990 fprintf_unfiltered (file,
991 "gdbarch_dump: num_pseudo_regs = %s\n",
992 plongest (gdbarch->num_pseudo_regs));
993 fprintf_unfiltered (file,
994 "gdbarch_dump: num_regs = %s\n",
995 plongest (gdbarch->num_regs));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: osabi = %s\n",
998 plongest (gdbarch->osabi));
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1001 gdbarch_overlay_update_p (gdbarch));
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: overlay_update = <%s>\n",
1004 host_address_to_string (gdbarch->overlay_update));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: pc_regnum = %s\n",
1007 plongest (gdbarch->pc_regnum));
1008 fprintf_unfiltered (file,
1009 "gdbarch_dump: pointer_to_address = <%s>\n",
1010 host_address_to_string (gdbarch->pointer_to_address));
1011 fprintf_unfiltered (file,
1012 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1013 gdbarch_print_float_info_p (gdbarch));
1014 fprintf_unfiltered (file,
1015 "gdbarch_dump: print_float_info = <%s>\n",
1016 host_address_to_string (gdbarch->print_float_info));
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: print_insn = <%s>\n",
1019 host_address_to_string (gdbarch->print_insn));
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: print_registers_info = <%s>\n",
1022 host_address_to_string (gdbarch->print_registers_info));
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1025 gdbarch_print_vector_info_p (gdbarch));
1026 fprintf_unfiltered (file,
1027 "gdbarch_dump: print_vector_info = <%s>\n",
1028 host_address_to_string (gdbarch->print_vector_info));
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1031 gdbarch_process_record_p (gdbarch));
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: process_record = <%s>\n",
1034 host_address_to_string (gdbarch->process_record));
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1037 gdbarch_process_record_signal_p (gdbarch));
1038 fprintf_unfiltered (file,
1039 "gdbarch_dump: process_record_signal = <%s>\n",
1040 host_address_to_string (gdbarch->process_record_signal));
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: ps_regnum = %s\n",
1043 plongest (gdbarch->ps_regnum));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1046 gdbarch_pseudo_register_read_p (gdbarch));
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: pseudo_register_read = <%s>\n",
1049 host_address_to_string (gdbarch->pseudo_register_read));
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1052 gdbarch_pseudo_register_write_p (gdbarch));
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: pseudo_register_write = <%s>\n",
1055 host_address_to_string (gdbarch->pseudo_register_write));
1056 fprintf_unfiltered (file,
1057 "gdbarch_dump: ptr_bit = %s\n",
1058 plongest (gdbarch->ptr_bit));
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1061 gdbarch_push_dummy_call_p (gdbarch));
1062 fprintf_unfiltered (file,
1063 "gdbarch_dump: push_dummy_call = <%s>\n",
1064 host_address_to_string (gdbarch->push_dummy_call));
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1067 gdbarch_push_dummy_code_p (gdbarch));
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: push_dummy_code = <%s>\n",
1070 host_address_to_string (gdbarch->push_dummy_code));
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1073 gdbarch_read_pc_p (gdbarch));
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: read_pc = <%s>\n",
1076 host_address_to_string (gdbarch->read_pc));
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1079 gdbarch_record_special_symbol_p (gdbarch));
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: record_special_symbol = <%s>\n",
1082 host_address_to_string (gdbarch->record_special_symbol));
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: register_name = <%s>\n",
1085 host_address_to_string (gdbarch->register_name));
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: register_reggroup_p = <%s>\n",
1088 host_address_to_string (gdbarch->register_reggroup_p));
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: register_sim_regno = <%s>\n",
1091 host_address_to_string (gdbarch->register_sim_regno));
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: register_to_value = <%s>\n",
1094 host_address_to_string (gdbarch->register_to_value));
1095 fprintf_unfiltered (file,
1096 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1097 gdbarch_register_type_p (gdbarch));
1098 fprintf_unfiltered (file,
1099 "gdbarch_dump: register_type = <%s>\n",
1100 host_address_to_string (gdbarch->register_type));
1101 fprintf_unfiltered (file,
1102 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1103 gdbarch_regset_from_core_section_p (gdbarch));
1104 fprintf_unfiltered (file,
1105 "gdbarch_dump: regset_from_core_section = <%s>\n",
1106 host_address_to_string (gdbarch->regset_from_core_section));
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1109 host_address_to_string (gdbarch->remote_breakpoint_from_pc));
1110 fprintf_unfiltered (file,
1111 "gdbarch_dump: remote_register_number = <%s>\n",
1112 host_address_to_string (gdbarch->remote_register_number));
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1115 gdbarch_return_value_p (gdbarch));
1116 fprintf_unfiltered (file,
1117 "gdbarch_dump: return_value = <%s>\n",
1118 host_address_to_string (gdbarch->return_value));
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1121 host_address_to_string (gdbarch->sdb_reg_to_regnum));
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: short_bit = %s\n",
1124 plongest (gdbarch->short_bit));
1125 fprintf_unfiltered (file,
1126 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1127 gdbarch_single_step_through_delay_p (gdbarch));
1128 fprintf_unfiltered (file,
1129 "gdbarch_dump: single_step_through_delay = <%s>\n",
1130 host_address_to_string (gdbarch->single_step_through_delay));
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1133 gdbarch_skip_main_prologue_p (gdbarch));
1134 fprintf_unfiltered (file,
1135 "gdbarch_dump: skip_main_prologue = <%s>\n",
1136 host_address_to_string (gdbarch->skip_main_prologue));
1137 fprintf_unfiltered (file,
1138 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1139 gdbarch_skip_permanent_breakpoint_p (gdbarch));
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1142 host_address_to_string (gdbarch->skip_permanent_breakpoint));
1143 fprintf_unfiltered (file,
1144 "gdbarch_dump: skip_prologue = <%s>\n",
1145 host_address_to_string (gdbarch->skip_prologue));
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1148 host_address_to_string (gdbarch->skip_solib_resolver));
1149 fprintf_unfiltered (file,
1150 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1151 host_address_to_string (gdbarch->skip_trampoline_code));
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: smash_text_address = <%s>\n",
1154 host_address_to_string (gdbarch->smash_text_address));
1155 fprintf_unfiltered (file,
1156 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1157 gdbarch_software_single_step_p (gdbarch));
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: software_single_step = <%s>\n",
1160 host_address_to_string (gdbarch->software_single_step));
1161 fprintf_unfiltered (file,
1162 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1163 plongest (gdbarch->sofun_address_maybe_missing));
1164 fprintf_unfiltered (file,
1165 "gdbarch_dump: solib_symbols_extension = %s\n",
1166 pstring (gdbarch->solib_symbols_extension));
1167 fprintf_unfiltered (file,
1168 "gdbarch_dump: sp_regnum = %s\n",
1169 plongest (gdbarch->sp_regnum));
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1172 host_address_to_string (gdbarch->stab_reg_to_regnum));
1173 fprintf_unfiltered (file,
1174 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1175 host_address_to_string (gdbarch->stabs_argument_has_addr));
1176 fprintf_unfiltered (file,
1177 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1178 gdbarch_static_transform_name_p (gdbarch));
1179 fprintf_unfiltered (file,
1180 "gdbarch_dump: static_transform_name = <%s>\n",
1181 host_address_to_string (gdbarch->static_transform_name));
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: target_desc = %s\n",
1184 host_address_to_string (gdbarch->target_desc));
1185 fprintf_unfiltered (file,
1186 "gdbarch_dump: target_signal_from_host = <%s>\n",
1187 host_address_to_string (gdbarch->target_signal_from_host));
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: target_signal_to_host = <%s>\n",
1190 host_address_to_string (gdbarch->target_signal_to_host));
1191 fprintf_unfiltered (file,
1192 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1193 gdbarch_unwind_pc_p (gdbarch));
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: unwind_pc = <%s>\n",
1196 host_address_to_string (gdbarch->unwind_pc));
1197 fprintf_unfiltered (file,
1198 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1199 gdbarch_unwind_sp_p (gdbarch));
1200 fprintf_unfiltered (file,
1201 "gdbarch_dump: unwind_sp = <%s>\n",
1202 host_address_to_string (gdbarch->unwind_sp));
1203 fprintf_unfiltered (file,
1204 "gdbarch_dump: value_from_register = <%s>\n",
1205 host_address_to_string (gdbarch->value_from_register));
1206 fprintf_unfiltered (file,
1207 "gdbarch_dump: value_to_register = <%s>\n",
1208 host_address_to_string (gdbarch->value_to_register));
1209 fprintf_unfiltered (file,
1210 "gdbarch_dump: vbit_in_delta = %s\n",
1211 plongest (gdbarch->vbit_in_delta));
1212 fprintf_unfiltered (file,
1213 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1214 host_address_to_string (gdbarch->virtual_frame_pointer));
1215 fprintf_unfiltered (file,
1216 "gdbarch_dump: vtable_function_descriptors = %s\n",
1217 plongest (gdbarch->vtable_function_descriptors));
1218 fprintf_unfiltered (file,
1219 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1220 gdbarch_write_pc_p (gdbarch));
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: write_pc = <%s>\n",
1223 host_address_to_string (gdbarch->write_pc));
1224 if (gdbarch->dump_tdep != NULL)
1225 gdbarch->dump_tdep (gdbarch, file);
1228 struct gdbarch_tdep *
1229 gdbarch_tdep (struct gdbarch *gdbarch)
1231 if (gdbarch_debug >= 2)
1232 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1233 return gdbarch->tdep;
1237 const struct bfd_arch_info *
1238 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1240 gdb_assert (gdbarch != NULL);
1241 if (gdbarch_debug >= 2)
1242 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1243 return gdbarch->bfd_arch_info;
1247 gdbarch_byte_order (struct gdbarch *gdbarch)
1249 gdb_assert (gdbarch != NULL);
1250 if (gdbarch_debug >= 2)
1251 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1252 return gdbarch->byte_order;
1256 gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
1258 gdb_assert (gdbarch != NULL);
1259 if (gdbarch_debug >= 2)
1260 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
1261 return gdbarch->byte_order_for_code;
1265 gdbarch_osabi (struct gdbarch *gdbarch)
1267 gdb_assert (gdbarch != NULL);
1268 if (gdbarch_debug >= 2)
1269 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1270 return gdbarch->osabi;
1273 const struct target_desc *
1274 gdbarch_target_desc (struct gdbarch *gdbarch)
1276 gdb_assert (gdbarch != NULL);
1277 if (gdbarch_debug >= 2)
1278 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1279 return gdbarch->target_desc;
1283 gdbarch_bits_big_endian (struct gdbarch *gdbarch)
1285 gdb_assert (gdbarch != NULL);
1286 /* Skip verify of bits_big_endian, invalid_p == 0 */
1287 if (gdbarch_debug >= 2)
1288 fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
1289 return gdbarch->bits_big_endian;
1293 set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
1294 int bits_big_endian)
1296 gdbarch->bits_big_endian = bits_big_endian;
1300 gdbarch_short_bit (struct gdbarch *gdbarch)
1302 gdb_assert (gdbarch != NULL);
1303 /* Skip verify of short_bit, invalid_p == 0 */
1304 if (gdbarch_debug >= 2)
1305 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1306 return gdbarch->short_bit;
1310 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1313 gdbarch->short_bit = short_bit;
1317 gdbarch_int_bit (struct gdbarch *gdbarch)
1319 gdb_assert (gdbarch != NULL);
1320 /* Skip verify of int_bit, invalid_p == 0 */
1321 if (gdbarch_debug >= 2)
1322 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1323 return gdbarch->int_bit;
1327 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1330 gdbarch->int_bit = int_bit;
1334 gdbarch_long_bit (struct gdbarch *gdbarch)
1336 gdb_assert (gdbarch != NULL);
1337 /* Skip verify of long_bit, invalid_p == 0 */
1338 if (gdbarch_debug >= 2)
1339 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1340 return gdbarch->long_bit;
1344 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1347 gdbarch->long_bit = long_bit;
1351 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1353 gdb_assert (gdbarch != NULL);
1354 /* Skip verify of long_long_bit, invalid_p == 0 */
1355 if (gdbarch_debug >= 2)
1356 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1357 return gdbarch->long_long_bit;
1361 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1364 gdbarch->long_long_bit = long_long_bit;
1368 gdbarch_float_bit (struct gdbarch *gdbarch)
1370 gdb_assert (gdbarch != NULL);
1371 /* Skip verify of float_bit, invalid_p == 0 */
1372 if (gdbarch_debug >= 2)
1373 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1374 return gdbarch->float_bit;
1378 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1381 gdbarch->float_bit = float_bit;
1384 const struct floatformat **
1385 gdbarch_float_format (struct gdbarch *gdbarch)
1387 gdb_assert (gdbarch != NULL);
1388 if (gdbarch_debug >= 2)
1389 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1390 return gdbarch->float_format;
1394 set_gdbarch_float_format (struct gdbarch *gdbarch,
1395 const struct floatformat ** float_format)
1397 gdbarch->float_format = float_format;
1401 gdbarch_double_bit (struct gdbarch *gdbarch)
1403 gdb_assert (gdbarch != NULL);
1404 /* Skip verify of double_bit, invalid_p == 0 */
1405 if (gdbarch_debug >= 2)
1406 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1407 return gdbarch->double_bit;
1411 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1414 gdbarch->double_bit = double_bit;
1417 const struct floatformat **
1418 gdbarch_double_format (struct gdbarch *gdbarch)
1420 gdb_assert (gdbarch != NULL);
1421 if (gdbarch_debug >= 2)
1422 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1423 return gdbarch->double_format;
1427 set_gdbarch_double_format (struct gdbarch *gdbarch,
1428 const struct floatformat ** double_format)
1430 gdbarch->double_format = double_format;
1434 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1436 gdb_assert (gdbarch != NULL);
1437 /* Skip verify of long_double_bit, invalid_p == 0 */
1438 if (gdbarch_debug >= 2)
1439 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1440 return gdbarch->long_double_bit;
1444 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1445 int long_double_bit)
1447 gdbarch->long_double_bit = long_double_bit;
1450 const struct floatformat **
1451 gdbarch_long_double_format (struct gdbarch *gdbarch)
1453 gdb_assert (gdbarch != NULL);
1454 if (gdbarch_debug >= 2)
1455 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1456 return gdbarch->long_double_format;
1460 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1461 const struct floatformat ** long_double_format)
1463 gdbarch->long_double_format = long_double_format;
1467 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1469 gdb_assert (gdbarch != NULL);
1470 /* Skip verify of ptr_bit, invalid_p == 0 */
1471 if (gdbarch_debug >= 2)
1472 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1473 return gdbarch->ptr_bit;
1477 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1480 gdbarch->ptr_bit = ptr_bit;
1484 gdbarch_addr_bit (struct gdbarch *gdbarch)
1486 gdb_assert (gdbarch != NULL);
1487 /* Check variable changed from pre-default. */
1488 gdb_assert (gdbarch->addr_bit != 0);
1489 if (gdbarch_debug >= 2)
1490 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1491 return gdbarch->addr_bit;
1495 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1498 gdbarch->addr_bit = addr_bit;
1502 gdbarch_char_signed (struct gdbarch *gdbarch)
1504 gdb_assert (gdbarch != NULL);
1505 /* Check variable changed from pre-default. */
1506 gdb_assert (gdbarch->char_signed != -1);
1507 if (gdbarch_debug >= 2)
1508 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1509 return gdbarch->char_signed;
1513 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1516 gdbarch->char_signed = char_signed;
1520 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1522 gdb_assert (gdbarch != NULL);
1523 return gdbarch->read_pc != NULL;
1527 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1529 gdb_assert (gdbarch != NULL);
1530 gdb_assert (gdbarch->read_pc != NULL);
1531 if (gdbarch_debug >= 2)
1532 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1533 return gdbarch->read_pc (regcache);
1537 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1538 gdbarch_read_pc_ftype read_pc)
1540 gdbarch->read_pc = read_pc;
1544 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1546 gdb_assert (gdbarch != NULL);
1547 return gdbarch->write_pc != NULL;
1551 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1553 gdb_assert (gdbarch != NULL);
1554 gdb_assert (gdbarch->write_pc != NULL);
1555 if (gdbarch_debug >= 2)
1556 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1557 gdbarch->write_pc (regcache, val);
1561 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1562 gdbarch_write_pc_ftype write_pc)
1564 gdbarch->write_pc = write_pc;
1568 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1570 gdb_assert (gdbarch != NULL);
1571 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1572 if (gdbarch_debug >= 2)
1573 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1574 gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
1578 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1579 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1581 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1585 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1587 gdb_assert (gdbarch != NULL);
1588 return gdbarch->pseudo_register_read != NULL;
1592 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1594 gdb_assert (gdbarch != NULL);
1595 gdb_assert (gdbarch->pseudo_register_read != NULL);
1596 if (gdbarch_debug >= 2)
1597 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1598 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1602 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1603 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1605 gdbarch->pseudo_register_read = pseudo_register_read;
1609 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1611 gdb_assert (gdbarch != NULL);
1612 return gdbarch->pseudo_register_write != NULL;
1616 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1618 gdb_assert (gdbarch != NULL);
1619 gdb_assert (gdbarch->pseudo_register_write != NULL);
1620 if (gdbarch_debug >= 2)
1621 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1622 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1626 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1627 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1629 gdbarch->pseudo_register_write = pseudo_register_write;
1633 gdbarch_num_regs (struct gdbarch *gdbarch)
1635 gdb_assert (gdbarch != NULL);
1636 /* Check variable changed from pre-default. */
1637 gdb_assert (gdbarch->num_regs != -1);
1638 if (gdbarch_debug >= 2)
1639 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1640 return gdbarch->num_regs;
1644 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1647 gdbarch->num_regs = num_regs;
1651 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1653 gdb_assert (gdbarch != NULL);
1654 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1655 if (gdbarch_debug >= 2)
1656 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1657 return gdbarch->num_pseudo_regs;
1661 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1662 int num_pseudo_regs)
1664 gdbarch->num_pseudo_regs = num_pseudo_regs;
1668 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1670 gdb_assert (gdbarch != NULL);
1671 /* Skip verify of sp_regnum, invalid_p == 0 */
1672 if (gdbarch_debug >= 2)
1673 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1674 return gdbarch->sp_regnum;
1678 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1681 gdbarch->sp_regnum = sp_regnum;
1685 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1687 gdb_assert (gdbarch != NULL);
1688 /* Skip verify of pc_regnum, invalid_p == 0 */
1689 if (gdbarch_debug >= 2)
1690 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1691 return gdbarch->pc_regnum;
1695 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1698 gdbarch->pc_regnum = pc_regnum;
1702 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1704 gdb_assert (gdbarch != NULL);
1705 /* Skip verify of ps_regnum, invalid_p == 0 */
1706 if (gdbarch_debug >= 2)
1707 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1708 return gdbarch->ps_regnum;
1712 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1715 gdbarch->ps_regnum = ps_regnum;
1719 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1721 gdb_assert (gdbarch != NULL);
1722 /* Skip verify of fp0_regnum, invalid_p == 0 */
1723 if (gdbarch_debug >= 2)
1724 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1725 return gdbarch->fp0_regnum;
1729 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1732 gdbarch->fp0_regnum = fp0_regnum;
1736 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1738 gdb_assert (gdbarch != NULL);
1739 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1740 if (gdbarch_debug >= 2)
1741 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1742 return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
1746 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1747 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1749 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1753 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1755 gdb_assert (gdbarch != NULL);
1756 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1757 if (gdbarch_debug >= 2)
1758 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1759 return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
1763 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1764 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1766 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1770 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1772 gdb_assert (gdbarch != NULL);
1773 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1774 if (gdbarch_debug >= 2)
1775 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1776 return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
1780 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1781 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1783 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1787 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1789 gdb_assert (gdbarch != NULL);
1790 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1791 if (gdbarch_debug >= 2)
1792 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1793 return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
1797 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1798 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1800 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1804 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1806 gdb_assert (gdbarch != NULL);
1807 gdb_assert (gdbarch->register_name != NULL);
1808 if (gdbarch_debug >= 2)
1809 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1810 return gdbarch->register_name (gdbarch, regnr);
1814 set_gdbarch_register_name (struct gdbarch *gdbarch,
1815 gdbarch_register_name_ftype register_name)
1817 gdbarch->register_name = register_name;
1821 gdbarch_register_type_p (struct gdbarch *gdbarch)
1823 gdb_assert (gdbarch != NULL);
1824 return gdbarch->register_type != NULL;
1828 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1830 gdb_assert (gdbarch != NULL);
1831 gdb_assert (gdbarch->register_type != NULL);
1832 if (gdbarch_debug >= 2)
1833 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1834 return gdbarch->register_type (gdbarch, reg_nr);
1838 set_gdbarch_register_type (struct gdbarch *gdbarch,
1839 gdbarch_register_type_ftype register_type)
1841 gdbarch->register_type = register_type;
1845 gdbarch_dummy_id_p (struct gdbarch *gdbarch)
1847 gdb_assert (gdbarch != NULL);
1848 return gdbarch->dummy_id != NULL;
1852 gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
1854 gdb_assert (gdbarch != NULL);
1855 gdb_assert (gdbarch->dummy_id != NULL);
1856 if (gdbarch_debug >= 2)
1857 fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
1858 return gdbarch->dummy_id (gdbarch, this_frame);
1862 set_gdbarch_dummy_id (struct gdbarch *gdbarch,
1863 gdbarch_dummy_id_ftype dummy_id)
1865 gdbarch->dummy_id = dummy_id;
1869 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1871 gdb_assert (gdbarch != NULL);
1872 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1873 if (gdbarch_debug >= 2)
1874 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1875 return gdbarch->deprecated_fp_regnum;
1879 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1880 int deprecated_fp_regnum)
1882 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1886 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1888 gdb_assert (gdbarch != NULL);
1889 return gdbarch->push_dummy_call != NULL;
1893 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)
1895 gdb_assert (gdbarch != NULL);
1896 gdb_assert (gdbarch->push_dummy_call != NULL);
1897 if (gdbarch_debug >= 2)
1898 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1899 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1903 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1904 gdbarch_push_dummy_call_ftype push_dummy_call)
1906 gdbarch->push_dummy_call = push_dummy_call;
1910 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1912 gdb_assert (gdbarch != NULL);
1913 /* Skip verify of call_dummy_location, invalid_p == 0 */
1914 if (gdbarch_debug >= 2)
1915 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1916 return gdbarch->call_dummy_location;
1920 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1921 int call_dummy_location)
1923 gdbarch->call_dummy_location = call_dummy_location;
1927 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1929 gdb_assert (gdbarch != NULL);
1930 return gdbarch->push_dummy_code != NULL;
1934 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)
1936 gdb_assert (gdbarch != NULL);
1937 gdb_assert (gdbarch->push_dummy_code != NULL);
1938 if (gdbarch_debug >= 2)
1939 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1940 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
1944 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1945 gdbarch_push_dummy_code_ftype push_dummy_code)
1947 gdbarch->push_dummy_code = push_dummy_code;
1951 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1953 gdb_assert (gdbarch != NULL);
1954 gdb_assert (gdbarch->print_registers_info != NULL);
1955 if (gdbarch_debug >= 2)
1956 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1957 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1961 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1962 gdbarch_print_registers_info_ftype print_registers_info)
1964 gdbarch->print_registers_info = print_registers_info;
1968 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1970 gdb_assert (gdbarch != NULL);
1971 return gdbarch->print_float_info != NULL;
1975 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1977 gdb_assert (gdbarch != NULL);
1978 gdb_assert (gdbarch->print_float_info != NULL);
1979 if (gdbarch_debug >= 2)
1980 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1981 gdbarch->print_float_info (gdbarch, file, frame, args);
1985 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1986 gdbarch_print_float_info_ftype print_float_info)
1988 gdbarch->print_float_info = print_float_info;
1992 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1994 gdb_assert (gdbarch != NULL);
1995 return gdbarch->print_vector_info != NULL;
1999 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2001 gdb_assert (gdbarch != NULL);
2002 gdb_assert (gdbarch->print_vector_info != NULL);
2003 if (gdbarch_debug >= 2)
2004 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2005 gdbarch->print_vector_info (gdbarch, file, frame, args);
2009 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2010 gdbarch_print_vector_info_ftype print_vector_info)
2012 gdbarch->print_vector_info = print_vector_info;
2016 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2018 gdb_assert (gdbarch != NULL);
2019 gdb_assert (gdbarch->register_sim_regno != NULL);
2020 if (gdbarch_debug >= 2)
2021 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2022 return gdbarch->register_sim_regno (gdbarch, reg_nr);
2026 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2027 gdbarch_register_sim_regno_ftype register_sim_regno)
2029 gdbarch->register_sim_regno = register_sim_regno;
2033 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2035 gdb_assert (gdbarch != NULL);
2036 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2037 if (gdbarch_debug >= 2)
2038 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2039 return gdbarch->cannot_fetch_register (gdbarch, regnum);
2043 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2044 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2046 gdbarch->cannot_fetch_register = cannot_fetch_register;
2050 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2052 gdb_assert (gdbarch != NULL);
2053 gdb_assert (gdbarch->cannot_store_register != NULL);
2054 if (gdbarch_debug >= 2)
2055 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2056 return gdbarch->cannot_store_register (gdbarch, regnum);
2060 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2061 gdbarch_cannot_store_register_ftype cannot_store_register)
2063 gdbarch->cannot_store_register = cannot_store_register;
2067 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2069 gdb_assert (gdbarch != NULL);
2070 return gdbarch->get_longjmp_target != NULL;
2074 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
2076 gdb_assert (gdbarch != NULL);
2077 gdb_assert (gdbarch->get_longjmp_target != NULL);
2078 if (gdbarch_debug >= 2)
2079 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2080 return gdbarch->get_longjmp_target (frame, pc);
2084 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2085 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2087 gdbarch->get_longjmp_target = get_longjmp_target;
2091 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2093 gdb_assert (gdbarch != NULL);
2094 if (gdbarch_debug >= 2)
2095 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2096 return gdbarch->believe_pcc_promotion;
2100 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2101 int believe_pcc_promotion)
2103 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2107 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2109 gdb_assert (gdbarch != NULL);
2110 gdb_assert (gdbarch->convert_register_p != NULL);
2111 if (gdbarch_debug >= 2)
2112 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2113 return gdbarch->convert_register_p (gdbarch, regnum, type);
2117 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2118 gdbarch_convert_register_p_ftype convert_register_p)
2120 gdbarch->convert_register_p = convert_register_p;
2124 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2126 gdb_assert (gdbarch != NULL);
2127 gdb_assert (gdbarch->register_to_value != NULL);
2128 if (gdbarch_debug >= 2)
2129 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2130 gdbarch->register_to_value (frame, regnum, type, buf);
2134 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2135 gdbarch_register_to_value_ftype register_to_value)
2137 gdbarch->register_to_value = register_to_value;
2141 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2143 gdb_assert (gdbarch != NULL);
2144 gdb_assert (gdbarch->value_to_register != NULL);
2145 if (gdbarch_debug >= 2)
2146 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2147 gdbarch->value_to_register (frame, regnum, type, buf);
2151 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2152 gdbarch_value_to_register_ftype value_to_register)
2154 gdbarch->value_to_register = value_to_register;
2158 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2160 gdb_assert (gdbarch != NULL);
2161 gdb_assert (gdbarch->value_from_register != NULL);
2162 if (gdbarch_debug >= 2)
2163 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2164 return gdbarch->value_from_register (type, regnum, frame);
2168 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2169 gdbarch_value_from_register_ftype value_from_register)
2171 gdbarch->value_from_register = value_from_register;
2175 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2177 gdb_assert (gdbarch != NULL);
2178 gdb_assert (gdbarch->pointer_to_address != NULL);
2179 if (gdbarch_debug >= 2)
2180 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2181 return gdbarch->pointer_to_address (gdbarch, type, buf);
2185 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2186 gdbarch_pointer_to_address_ftype pointer_to_address)
2188 gdbarch->pointer_to_address = pointer_to_address;
2192 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2194 gdb_assert (gdbarch != NULL);
2195 gdb_assert (gdbarch->address_to_pointer != NULL);
2196 if (gdbarch_debug >= 2)
2197 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2198 gdbarch->address_to_pointer (gdbarch, type, buf, addr);
2202 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2203 gdbarch_address_to_pointer_ftype address_to_pointer)
2205 gdbarch->address_to_pointer = address_to_pointer;
2209 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2211 gdb_assert (gdbarch != NULL);
2212 return gdbarch->integer_to_address != NULL;
2216 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2218 gdb_assert (gdbarch != NULL);
2219 gdb_assert (gdbarch->integer_to_address != NULL);
2220 if (gdbarch_debug >= 2)
2221 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2222 return gdbarch->integer_to_address (gdbarch, type, buf);
2226 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2227 gdbarch_integer_to_address_ftype integer_to_address)
2229 gdbarch->integer_to_address = integer_to_address;
2233 gdbarch_return_value_p (struct gdbarch *gdbarch)
2235 gdb_assert (gdbarch != NULL);
2236 return gdbarch->return_value != NULL;
2239 enum return_value_convention
2240 gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2242 gdb_assert (gdbarch != NULL);
2243 gdb_assert (gdbarch->return_value != NULL);
2244 if (gdbarch_debug >= 2)
2245 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2246 return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
2250 set_gdbarch_return_value (struct gdbarch *gdbarch,
2251 gdbarch_return_value_ftype return_value)
2253 gdbarch->return_value = return_value;
2257 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2259 gdb_assert (gdbarch != NULL);
2260 gdb_assert (gdbarch->skip_prologue != NULL);
2261 if (gdbarch_debug >= 2)
2262 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2263 return gdbarch->skip_prologue (gdbarch, ip);
2267 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2268 gdbarch_skip_prologue_ftype skip_prologue)
2270 gdbarch->skip_prologue = skip_prologue;
2274 gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
2276 gdb_assert (gdbarch != NULL);
2277 return gdbarch->skip_main_prologue != NULL;
2281 gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2283 gdb_assert (gdbarch != NULL);
2284 gdb_assert (gdbarch->skip_main_prologue != NULL);
2285 if (gdbarch_debug >= 2)
2286 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
2287 return gdbarch->skip_main_prologue (gdbarch, ip);
2291 set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
2292 gdbarch_skip_main_prologue_ftype skip_main_prologue)
2294 gdbarch->skip_main_prologue = skip_main_prologue;
2298 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2300 gdb_assert (gdbarch != NULL);
2301 gdb_assert (gdbarch->inner_than != NULL);
2302 if (gdbarch_debug >= 2)
2303 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2304 return gdbarch->inner_than (lhs, rhs);
2308 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2309 gdbarch_inner_than_ftype inner_than)
2311 gdbarch->inner_than = inner_than;
2315 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2317 gdb_assert (gdbarch != NULL);
2318 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2319 if (gdbarch_debug >= 2)
2320 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2321 return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
2325 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2326 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2328 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2332 gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
2334 gdb_assert (gdbarch != NULL);
2335 gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
2336 if (gdbarch_debug >= 2)
2337 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
2338 gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
2342 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
2343 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
2345 gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
2349 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2351 gdb_assert (gdbarch != NULL);
2352 return gdbarch->adjust_breakpoint_address != NULL;
2356 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2358 gdb_assert (gdbarch != NULL);
2359 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2360 if (gdbarch_debug >= 2)
2361 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2362 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2366 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2367 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2369 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2373 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2375 gdb_assert (gdbarch != NULL);
2376 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2377 if (gdbarch_debug >= 2)
2378 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2379 return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
2383 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2384 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2386 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2390 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2392 gdb_assert (gdbarch != NULL);
2393 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2394 if (gdbarch_debug >= 2)
2395 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2396 return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
2400 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2401 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2403 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2407 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2409 gdb_assert (gdbarch != NULL);
2410 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2411 if (gdbarch_debug >= 2)
2412 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2413 return gdbarch->decr_pc_after_break;
2417 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2418 CORE_ADDR decr_pc_after_break)
2420 gdbarch->decr_pc_after_break = decr_pc_after_break;
2424 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2426 gdb_assert (gdbarch != NULL);
2427 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2428 if (gdbarch_debug >= 2)
2429 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2430 return gdbarch->deprecated_function_start_offset;
2434 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2435 CORE_ADDR deprecated_function_start_offset)
2437 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2441 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2443 gdb_assert (gdbarch != NULL);
2444 gdb_assert (gdbarch->remote_register_number != NULL);
2445 if (gdbarch_debug >= 2)
2446 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2447 return gdbarch->remote_register_number (gdbarch, regno);
2451 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2452 gdbarch_remote_register_number_ftype remote_register_number)
2454 gdbarch->remote_register_number = remote_register_number;
2458 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2460 gdb_assert (gdbarch != NULL);
2461 return gdbarch->fetch_tls_load_module_address != NULL;
2465 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2467 gdb_assert (gdbarch != NULL);
2468 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2469 if (gdbarch_debug >= 2)
2470 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2471 return gdbarch->fetch_tls_load_module_address (objfile);
2475 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2476 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2478 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2482 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2484 gdb_assert (gdbarch != NULL);
2485 /* Skip verify of frame_args_skip, invalid_p == 0 */
2486 if (gdbarch_debug >= 2)
2487 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2488 return gdbarch->frame_args_skip;
2492 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2493 CORE_ADDR frame_args_skip)
2495 gdbarch->frame_args_skip = frame_args_skip;
2499 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2501 gdb_assert (gdbarch != NULL);
2502 return gdbarch->unwind_pc != NULL;
2506 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2508 gdb_assert (gdbarch != NULL);
2509 gdb_assert (gdbarch->unwind_pc != NULL);
2510 if (gdbarch_debug >= 2)
2511 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2512 return gdbarch->unwind_pc (gdbarch, next_frame);
2516 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2517 gdbarch_unwind_pc_ftype unwind_pc)
2519 gdbarch->unwind_pc = unwind_pc;
2523 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2525 gdb_assert (gdbarch != NULL);
2526 return gdbarch->unwind_sp != NULL;
2530 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2532 gdb_assert (gdbarch != NULL);
2533 gdb_assert (gdbarch->unwind_sp != NULL);
2534 if (gdbarch_debug >= 2)
2535 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2536 return gdbarch->unwind_sp (gdbarch, next_frame);
2540 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2541 gdbarch_unwind_sp_ftype unwind_sp)
2543 gdbarch->unwind_sp = unwind_sp;
2547 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2549 gdb_assert (gdbarch != NULL);
2550 return gdbarch->frame_num_args != NULL;
2554 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2556 gdb_assert (gdbarch != NULL);
2557 gdb_assert (gdbarch->frame_num_args != NULL);
2558 if (gdbarch_debug >= 2)
2559 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2560 return gdbarch->frame_num_args (frame);
2564 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2565 gdbarch_frame_num_args_ftype frame_num_args)
2567 gdbarch->frame_num_args = frame_num_args;
2571 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2573 gdb_assert (gdbarch != NULL);
2574 return gdbarch->frame_align != NULL;
2578 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2580 gdb_assert (gdbarch != NULL);
2581 gdb_assert (gdbarch->frame_align != NULL);
2582 if (gdbarch_debug >= 2)
2583 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2584 return gdbarch->frame_align (gdbarch, address);
2588 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2589 gdbarch_frame_align_ftype frame_align)
2591 gdbarch->frame_align = frame_align;
2595 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2597 gdb_assert (gdbarch != NULL);
2598 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2599 if (gdbarch_debug >= 2)
2600 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2601 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2605 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2606 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2608 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2612 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2614 gdb_assert (gdbarch != NULL);
2615 if (gdbarch_debug >= 2)
2616 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2617 return gdbarch->frame_red_zone_size;
2621 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2622 int frame_red_zone_size)
2624 gdbarch->frame_red_zone_size = frame_red_zone_size;
2628 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2630 gdb_assert (gdbarch != NULL);
2631 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2632 if (gdbarch_debug >= 2)
2633 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2634 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2638 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2639 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2641 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2645 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2647 gdb_assert (gdbarch != NULL);
2648 gdb_assert (gdbarch->addr_bits_remove != NULL);
2649 if (gdbarch_debug >= 2)
2650 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2651 return gdbarch->addr_bits_remove (gdbarch, addr);
2655 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2656 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2658 gdbarch->addr_bits_remove = addr_bits_remove;
2662 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2664 gdb_assert (gdbarch != NULL);
2665 gdb_assert (gdbarch->smash_text_address != NULL);
2666 if (gdbarch_debug >= 2)
2667 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2668 return gdbarch->smash_text_address (gdbarch, addr);
2672 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2673 gdbarch_smash_text_address_ftype smash_text_address)
2675 gdbarch->smash_text_address = smash_text_address;
2679 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2681 gdb_assert (gdbarch != NULL);
2682 return gdbarch->software_single_step != NULL;
2686 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2688 gdb_assert (gdbarch != NULL);
2689 gdb_assert (gdbarch->software_single_step != NULL);
2690 if (gdbarch_debug >= 2)
2691 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2692 return gdbarch->software_single_step (frame);
2696 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2697 gdbarch_software_single_step_ftype software_single_step)
2699 gdbarch->software_single_step = software_single_step;
2703 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2705 gdb_assert (gdbarch != NULL);
2706 return gdbarch->single_step_through_delay != NULL;
2710 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2712 gdb_assert (gdbarch != NULL);
2713 gdb_assert (gdbarch->single_step_through_delay != NULL);
2714 if (gdbarch_debug >= 2)
2715 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2716 return gdbarch->single_step_through_delay (gdbarch, frame);
2720 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2721 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2723 gdbarch->single_step_through_delay = single_step_through_delay;
2727 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2729 gdb_assert (gdbarch != NULL);
2730 gdb_assert (gdbarch->print_insn != NULL);
2731 if (gdbarch_debug >= 2)
2732 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2733 return gdbarch->print_insn (vma, info);
2737 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2738 gdbarch_print_insn_ftype print_insn)
2740 gdbarch->print_insn = print_insn;
2744 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2746 gdb_assert (gdbarch != NULL);
2747 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2748 if (gdbarch_debug >= 2)
2749 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2750 return gdbarch->skip_trampoline_code (frame, pc);
2754 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2755 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2757 gdbarch->skip_trampoline_code = skip_trampoline_code;
2761 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2763 gdb_assert (gdbarch != NULL);
2764 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2765 if (gdbarch_debug >= 2)
2766 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2767 return gdbarch->skip_solib_resolver (gdbarch, pc);
2771 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2772 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2774 gdbarch->skip_solib_resolver = skip_solib_resolver;
2778 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2780 gdb_assert (gdbarch != NULL);
2781 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2782 if (gdbarch_debug >= 2)
2783 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2784 return gdbarch->in_solib_return_trampoline (gdbarch, pc, name);
2788 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2789 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2791 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2795 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2797 gdb_assert (gdbarch != NULL);
2798 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2799 if (gdbarch_debug >= 2)
2800 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2801 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2805 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2806 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2808 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2812 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2814 gdb_assert (gdbarch != NULL);
2815 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2816 if (gdbarch_debug >= 2)
2817 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2818 gdbarch->elf_make_msymbol_special (sym, msym);
2822 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2823 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2825 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2829 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2831 gdb_assert (gdbarch != NULL);
2832 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2833 if (gdbarch_debug >= 2)
2834 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2835 gdbarch->coff_make_msymbol_special (val, msym);
2839 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2840 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2842 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2846 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2848 gdb_assert (gdbarch != NULL);
2849 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2850 if (gdbarch_debug >= 2)
2851 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2852 return gdbarch->cannot_step_breakpoint;
2856 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2857 int cannot_step_breakpoint)
2859 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2863 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2865 gdb_assert (gdbarch != NULL);
2866 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2867 if (gdbarch_debug >= 2)
2868 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2869 return gdbarch->have_nonsteppable_watchpoint;
2873 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2874 int have_nonsteppable_watchpoint)
2876 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2880 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2882 gdb_assert (gdbarch != NULL);
2883 return gdbarch->address_class_type_flags != NULL;
2887 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2889 gdb_assert (gdbarch != NULL);
2890 gdb_assert (gdbarch->address_class_type_flags != NULL);
2891 if (gdbarch_debug >= 2)
2892 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2893 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2897 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2898 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2900 gdbarch->address_class_type_flags = address_class_type_flags;
2904 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2906 gdb_assert (gdbarch != NULL);
2907 return gdbarch->address_class_type_flags_to_name != NULL;
2911 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2913 gdb_assert (gdbarch != NULL);
2914 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2915 if (gdbarch_debug >= 2)
2916 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2917 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2921 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2922 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2924 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2928 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2930 gdb_assert (gdbarch != NULL);
2931 return gdbarch->address_class_name_to_type_flags != NULL;
2935 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2937 gdb_assert (gdbarch != NULL);
2938 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2939 if (gdbarch_debug >= 2)
2940 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2941 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2945 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2946 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2948 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2952 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2954 gdb_assert (gdbarch != NULL);
2955 gdb_assert (gdbarch->register_reggroup_p != NULL);
2956 if (gdbarch_debug >= 2)
2957 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2958 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2962 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2963 gdbarch_register_reggroup_p_ftype register_reggroup_p)
2965 gdbarch->register_reggroup_p = register_reggroup_p;
2969 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
2971 gdb_assert (gdbarch != NULL);
2972 return gdbarch->fetch_pointer_argument != NULL;
2976 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
2978 gdb_assert (gdbarch != NULL);
2979 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
2980 if (gdbarch_debug >= 2)
2981 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
2982 return gdbarch->fetch_pointer_argument (frame, argi, type);
2986 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
2987 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
2989 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
2993 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
2995 gdb_assert (gdbarch != NULL);
2996 return gdbarch->regset_from_core_section != NULL;
2999 const struct regset *
3000 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3002 gdb_assert (gdbarch != NULL);
3003 gdb_assert (gdbarch->regset_from_core_section != NULL);
3004 if (gdbarch_debug >= 2)
3005 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3006 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3010 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3011 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3013 gdbarch->regset_from_core_section = regset_from_core_section;
3017 gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch)
3019 gdb_assert (gdbarch != NULL);
3020 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
3021 if (gdbarch_debug >= 2)
3022 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_reg_section_encodes_pid called\n");
3023 return gdbarch->core_reg_section_encodes_pid;
3027 set_gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch,
3028 int core_reg_section_encodes_pid)
3030 gdbarch->core_reg_section_encodes_pid = core_reg_section_encodes_pid;
3033 struct core_regset_section *
3034 gdbarch_core_regset_sections (struct gdbarch *gdbarch)
3036 gdb_assert (gdbarch != NULL);
3037 if (gdbarch_debug >= 2)
3038 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
3039 return gdbarch->core_regset_sections;
3043 set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
3044 struct core_regset_section * core_regset_sections)
3046 gdbarch->core_regset_sections = core_regset_sections;
3050 gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
3052 gdb_assert (gdbarch != NULL);
3053 return gdbarch->core_xfer_shared_libraries != NULL;
3057 gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
3059 gdb_assert (gdbarch != NULL);
3060 gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
3061 if (gdbarch_debug >= 2)
3062 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
3063 return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
3067 set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
3068 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
3070 gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
3074 gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch)
3076 gdb_assert (gdbarch != NULL);
3077 return gdbarch->core_pid_to_str != NULL;
3081 gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
3083 gdb_assert (gdbarch != NULL);
3084 gdb_assert (gdbarch->core_pid_to_str != NULL);
3085 if (gdbarch_debug >= 2)
3086 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_pid_to_str called\n");
3087 return gdbarch->core_pid_to_str (gdbarch, ptid);
3091 set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch,
3092 gdbarch_core_pid_to_str_ftype core_pid_to_str)
3094 gdbarch->core_pid_to_str = core_pid_to_str;
3098 gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
3100 gdb_assert (gdbarch != NULL);
3101 return gdbarch->gcore_bfd_target != 0;
3105 gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
3107 gdb_assert (gdbarch != NULL);
3108 /* Check variable changed from pre-default. */
3109 gdb_assert (gdbarch->gcore_bfd_target != 0);
3110 if (gdbarch_debug >= 2)
3111 fprintf_unfiltered (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
3112 return gdbarch->gcore_bfd_target;
3116 set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch,
3117 const char * gcore_bfd_target)
3119 gdbarch->gcore_bfd_target = gcore_bfd_target;
3123 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3125 gdb_assert (gdbarch != NULL);
3126 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3127 if (gdbarch_debug >= 2)
3128 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3129 return gdbarch->vtable_function_descriptors;
3133 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3134 int vtable_function_descriptors)
3136 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3140 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3142 gdb_assert (gdbarch != NULL);
3143 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3144 if (gdbarch_debug >= 2)
3145 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3146 return gdbarch->vbit_in_delta;
3150 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3153 gdbarch->vbit_in_delta = vbit_in_delta;
3157 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3159 gdb_assert (gdbarch != NULL);
3160 return gdbarch->skip_permanent_breakpoint != NULL;
3164 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3166 gdb_assert (gdbarch != NULL);
3167 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3168 if (gdbarch_debug >= 2)
3169 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3170 gdbarch->skip_permanent_breakpoint (regcache);
3174 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3175 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3177 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3181 gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
3183 gdb_assert (gdbarch != NULL);
3184 return gdbarch->max_insn_length != 0;
3188 gdbarch_max_insn_length (struct gdbarch *gdbarch)
3190 gdb_assert (gdbarch != NULL);
3191 /* Check variable changed from pre-default. */
3192 gdb_assert (gdbarch->max_insn_length != 0);
3193 if (gdbarch_debug >= 2)
3194 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
3195 return gdbarch->max_insn_length;
3199 set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
3200 ULONGEST max_insn_length)
3202 gdbarch->max_insn_length = max_insn_length;
3206 gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
3208 gdb_assert (gdbarch != NULL);
3209 return gdbarch->displaced_step_copy_insn != NULL;
3212 struct displaced_step_closure *
3213 gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3215 gdb_assert (gdbarch != NULL);
3216 gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
3217 if (gdbarch_debug >= 2)
3218 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
3219 return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
3223 set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
3224 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
3226 gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
3230 gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3232 gdb_assert (gdbarch != NULL);
3233 gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
3234 if (gdbarch_debug >= 2)
3235 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n");
3236 return gdbarch->displaced_step_hw_singlestep (gdbarch, closure);
3240 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
3241 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep)
3243 gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep;
3247 gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
3249 gdb_assert (gdbarch != NULL);
3250 return gdbarch->displaced_step_fixup != NULL;
3254 gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3256 gdb_assert (gdbarch != NULL);
3257 gdb_assert (gdbarch->displaced_step_fixup != NULL);
3258 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3259 if (gdbarch_debug >= 2)
3260 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
3261 gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
3265 set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
3266 gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
3268 gdbarch->displaced_step_fixup = displaced_step_fixup;
3272 gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3274 gdb_assert (gdbarch != NULL);
3275 gdb_assert (gdbarch->displaced_step_free_closure != NULL);
3276 if (gdbarch_debug >= 2)
3277 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
3278 gdbarch->displaced_step_free_closure (gdbarch, closure);
3282 set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
3283 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
3285 gdbarch->displaced_step_free_closure = displaced_step_free_closure;
3289 gdbarch_displaced_step_location (struct gdbarch *gdbarch)
3291 gdb_assert (gdbarch != NULL);
3292 gdb_assert (gdbarch->displaced_step_location != NULL);
3293 if (gdbarch_debug >= 2)
3294 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
3295 return gdbarch->displaced_step_location (gdbarch);
3299 set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
3300 gdbarch_displaced_step_location_ftype displaced_step_location)
3302 gdbarch->displaced_step_location = displaced_step_location;
3306 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3308 gdb_assert (gdbarch != NULL);
3309 return gdbarch->overlay_update != NULL;
3313 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3315 gdb_assert (gdbarch != NULL);
3316 gdb_assert (gdbarch->overlay_update != NULL);
3317 if (gdbarch_debug >= 2)
3318 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3319 gdbarch->overlay_update (osect);
3323 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3324 gdbarch_overlay_update_ftype overlay_update)
3326 gdbarch->overlay_update = overlay_update;
3330 gdbarch_core_read_description_p (struct gdbarch *gdbarch)
3332 gdb_assert (gdbarch != NULL);
3333 return gdbarch->core_read_description != NULL;
3336 const struct target_desc *
3337 gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
3339 gdb_assert (gdbarch != NULL);
3340 gdb_assert (gdbarch->core_read_description != NULL);
3341 if (gdbarch_debug >= 2)
3342 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
3343 return gdbarch->core_read_description (gdbarch, target, abfd);
3347 set_gdbarch_core_read_description (struct gdbarch *gdbarch,
3348 gdbarch_core_read_description_ftype core_read_description)
3350 gdbarch->core_read_description = core_read_description;
3354 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
3356 gdb_assert (gdbarch != NULL);
3357 return gdbarch->static_transform_name != NULL;
3361 gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name)
3363 gdb_assert (gdbarch != NULL);
3364 gdb_assert (gdbarch->static_transform_name != NULL);
3365 if (gdbarch_debug >= 2)
3366 fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
3367 return gdbarch->static_transform_name (name);
3371 set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
3372 gdbarch_static_transform_name_ftype static_transform_name)
3374 gdbarch->static_transform_name = static_transform_name;
3378 gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
3380 gdb_assert (gdbarch != NULL);
3381 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3382 if (gdbarch_debug >= 2)
3383 fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
3384 return gdbarch->sofun_address_maybe_missing;
3388 set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
3389 int sofun_address_maybe_missing)
3391 gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
3395 gdbarch_process_record_p (struct gdbarch *gdbarch)
3397 gdb_assert (gdbarch != NULL);
3398 return gdbarch->process_record != NULL;
3402 gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
3404 gdb_assert (gdbarch != NULL);
3405 gdb_assert (gdbarch->process_record != NULL);
3406 if (gdbarch_debug >= 2)
3407 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
3408 return gdbarch->process_record (gdbarch, regcache, addr);
3412 set_gdbarch_process_record (struct gdbarch *gdbarch,
3413 gdbarch_process_record_ftype process_record)
3415 gdbarch->process_record = process_record;
3419 gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
3421 gdb_assert (gdbarch != NULL);
3422 return gdbarch->process_record_signal != NULL;
3426 gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal)
3428 gdb_assert (gdbarch != NULL);
3429 gdb_assert (gdbarch->process_record_signal != NULL);
3430 if (gdbarch_debug >= 2)
3431 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n");
3432 return gdbarch->process_record_signal (gdbarch, regcache, signal);
3436 set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
3437 gdbarch_process_record_signal_ftype process_record_signal)
3439 gdbarch->process_record_signal = process_record_signal;
3443 gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
3445 gdb_assert (gdbarch != NULL);
3446 gdb_assert (gdbarch->target_signal_from_host != NULL);
3447 if (gdbarch_debug >= 2)
3448 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n");
3449 return gdbarch->target_signal_from_host (gdbarch, signo);
3453 set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
3454 gdbarch_target_signal_from_host_ftype target_signal_from_host)
3456 gdbarch->target_signal_from_host = target_signal_from_host;
3460 gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
3462 gdb_assert (gdbarch != NULL);
3463 gdb_assert (gdbarch->target_signal_to_host != NULL);
3464 if (gdbarch_debug >= 2)
3465 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n");
3466 return gdbarch->target_signal_to_host (gdbarch, ts);
3470 set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch,
3471 gdbarch_target_signal_to_host_ftype target_signal_to_host)
3473 gdbarch->target_signal_to_host = target_signal_to_host;
3477 gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
3479 gdb_assert (gdbarch != NULL);
3480 return gdbarch->get_siginfo_type != NULL;
3484 gdbarch_get_siginfo_type (struct gdbarch *gdbarch)
3486 gdb_assert (gdbarch != NULL);
3487 gdb_assert (gdbarch->get_siginfo_type != NULL);
3488 if (gdbarch_debug >= 2)
3489 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n");
3490 return gdbarch->get_siginfo_type (gdbarch);
3494 set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch,
3495 gdbarch_get_siginfo_type_ftype get_siginfo_type)
3497 gdbarch->get_siginfo_type = get_siginfo_type;
3501 gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
3503 gdb_assert (gdbarch != NULL);
3504 return gdbarch->record_special_symbol != NULL;
3508 gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
3510 gdb_assert (gdbarch != NULL);
3511 gdb_assert (gdbarch->record_special_symbol != NULL);
3512 if (gdbarch_debug >= 2)
3513 fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
3514 gdbarch->record_special_symbol (gdbarch, objfile, sym);
3518 set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
3519 gdbarch_record_special_symbol_ftype record_special_symbol)
3521 gdbarch->record_special_symbol = record_special_symbol;
3525 gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
3527 gdb_assert (gdbarch != NULL);
3528 return gdbarch->get_syscall_number != NULL;
3532 gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
3534 gdb_assert (gdbarch != NULL);
3535 gdb_assert (gdbarch->get_syscall_number != NULL);
3536 if (gdbarch_debug >= 2)
3537 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
3538 return gdbarch->get_syscall_number (gdbarch, ptid);
3542 set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
3543 gdbarch_get_syscall_number_ftype get_syscall_number)
3545 gdbarch->get_syscall_number = get_syscall_number;
3549 gdbarch_has_global_solist (struct gdbarch *gdbarch)
3551 gdb_assert (gdbarch != NULL);
3552 /* Skip verify of has_global_solist, invalid_p == 0 */
3553 if (gdbarch_debug >= 2)
3554 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
3555 return gdbarch->has_global_solist;
3559 set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
3560 int has_global_solist)
3562 gdbarch->has_global_solist = has_global_solist;
3566 gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
3568 gdb_assert (gdbarch != NULL);
3569 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3570 if (gdbarch_debug >= 2)
3571 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
3572 return gdbarch->has_global_breakpoints;
3576 set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
3577 int has_global_breakpoints)
3579 gdbarch->has_global_breakpoints = has_global_breakpoints;
3583 gdbarch_has_shared_address_space (struct gdbarch *gdbarch)
3585 gdb_assert (gdbarch != NULL);
3586 gdb_assert (gdbarch->has_shared_address_space != NULL);
3587 if (gdbarch_debug >= 2)
3588 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_shared_address_space called\n");
3589 return gdbarch->has_shared_address_space (gdbarch);
3593 set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
3594 gdbarch_has_shared_address_space_ftype has_shared_address_space)
3596 gdbarch->has_shared_address_space = has_shared_address_space;
3600 gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
3602 gdb_assert (gdbarch != NULL);
3603 gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
3604 if (gdbarch_debug >= 2)
3605 fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
3606 return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
3610 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
3611 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
3613 gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
3617 gdbarch_auto_charset (struct gdbarch *gdbarch)
3619 gdb_assert (gdbarch != NULL);
3620 gdb_assert (gdbarch->auto_charset != NULL);
3621 if (gdbarch_debug >= 2)
3622 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_charset called\n");
3623 return gdbarch->auto_charset ();
3627 set_gdbarch_auto_charset (struct gdbarch *gdbarch,
3628 gdbarch_auto_charset_ftype auto_charset)
3630 gdbarch->auto_charset = auto_charset;
3634 gdbarch_auto_wide_charset (struct gdbarch *gdbarch)
3636 gdb_assert (gdbarch != NULL);
3637 gdb_assert (gdbarch->auto_wide_charset != NULL);
3638 if (gdbarch_debug >= 2)
3639 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
3640 return gdbarch->auto_wide_charset ();
3644 set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
3645 gdbarch_auto_wide_charset_ftype auto_wide_charset)
3647 gdbarch->auto_wide_charset = auto_wide_charset;
3651 gdbarch_solib_symbols_extension (struct gdbarch *gdbarch)
3653 gdb_assert (gdbarch != NULL);
3654 if (gdbarch_debug >= 2)
3655 fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n");
3656 return gdbarch->solib_symbols_extension;
3660 set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch,
3661 const char * solib_symbols_extension)
3663 gdbarch->solib_symbols_extension = solib_symbols_extension;
3667 gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
3669 gdb_assert (gdbarch != NULL);
3670 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
3671 if (gdbarch_debug >= 2)
3672 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_dos_based_file_system called\n");
3673 return gdbarch->has_dos_based_file_system;
3677 set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
3678 int has_dos_based_file_system)
3680 gdbarch->has_dos_based_file_system = has_dos_based_file_system;
3684 /* Keep a registry of per-architecture data-pointers required by GDB
3691 gdbarch_data_pre_init_ftype *pre_init;
3692 gdbarch_data_post_init_ftype *post_init;
3695 struct gdbarch_data_registration
3697 struct gdbarch_data *data;
3698 struct gdbarch_data_registration *next;
3701 struct gdbarch_data_registry
3704 struct gdbarch_data_registration *registrations;
3707 struct gdbarch_data_registry gdbarch_data_registry =
3712 static struct gdbarch_data *
3713 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3714 gdbarch_data_post_init_ftype *post_init)
3716 struct gdbarch_data_registration **curr;
3718 /* Append the new registration. */
3719 for (curr = &gdbarch_data_registry.registrations;
3721 curr = &(*curr)->next);
3722 (*curr) = XMALLOC (struct gdbarch_data_registration);
3723 (*curr)->next = NULL;
3724 (*curr)->data = XMALLOC (struct gdbarch_data);
3725 (*curr)->data->index = gdbarch_data_registry.nr++;
3726 (*curr)->data->pre_init = pre_init;
3727 (*curr)->data->post_init = post_init;
3728 (*curr)->data->init_p = 1;
3729 return (*curr)->data;
3732 struct gdbarch_data *
3733 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3735 return gdbarch_data_register (pre_init, NULL);
3738 struct gdbarch_data *
3739 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3741 return gdbarch_data_register (NULL, post_init);
3744 /* Create/delete the gdbarch data vector. */
3747 alloc_gdbarch_data (struct gdbarch *gdbarch)
3749 gdb_assert (gdbarch->data == NULL);
3750 gdbarch->nr_data = gdbarch_data_registry.nr;
3751 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3754 /* Initialize the current value of the specified per-architecture
3758 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3759 struct gdbarch_data *data,
3762 gdb_assert (data->index < gdbarch->nr_data);
3763 gdb_assert (gdbarch->data[data->index] == NULL);
3764 gdb_assert (data->pre_init == NULL);
3765 gdbarch->data[data->index] = pointer;
3768 /* Return the current value of the specified per-architecture
3772 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3774 gdb_assert (data->index < gdbarch->nr_data);
3775 if (gdbarch->data[data->index] == NULL)
3777 /* The data-pointer isn't initialized, call init() to get a
3779 if (data->pre_init != NULL)
3780 /* Mid architecture creation: pass just the obstack, and not
3781 the entire architecture, as that way it isn't possible for
3782 pre-init code to refer to undefined architecture
3784 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3785 else if (gdbarch->initialized_p
3786 && data->post_init != NULL)
3787 /* Post architecture creation: pass the entire architecture
3788 (as all fields are valid), but be careful to also detect
3789 recursive references. */
3791 gdb_assert (data->init_p);
3793 gdbarch->data[data->index] = data->post_init (gdbarch);
3797 /* The architecture initialization hasn't completed - punt -
3798 hope that the caller knows what they are doing. Once
3799 deprecated_set_gdbarch_data has been initialized, this can be
3800 changed to an internal error. */
3802 gdb_assert (gdbarch->data[data->index] != NULL);
3804 return gdbarch->data[data->index];
3808 /* Keep a registry of the architectures known by GDB. */
3810 struct gdbarch_registration
3812 enum bfd_architecture bfd_architecture;
3813 gdbarch_init_ftype *init;
3814 gdbarch_dump_tdep_ftype *dump_tdep;
3815 struct gdbarch_list *arches;
3816 struct gdbarch_registration *next;
3819 static struct gdbarch_registration *gdbarch_registry = NULL;
3822 append_name (const char ***buf, int *nr, const char *name)
3824 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3830 gdbarch_printable_names (void)
3832 /* Accumulate a list of names based on the registed list of
3835 const char **arches = NULL;
3836 struct gdbarch_registration *rego;
3838 for (rego = gdbarch_registry;
3842 const struct bfd_arch_info *ap;
3843 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3845 internal_error (__FILE__, __LINE__,
3846 _("gdbarch_architecture_names: multi-arch unknown"));
3849 append_name (&arches, &nr_arches, ap->printable_name);
3854 append_name (&arches, &nr_arches, NULL);
3860 gdbarch_register (enum bfd_architecture bfd_architecture,
3861 gdbarch_init_ftype *init,
3862 gdbarch_dump_tdep_ftype *dump_tdep)
3864 struct gdbarch_registration **curr;
3865 const struct bfd_arch_info *bfd_arch_info;
3867 /* Check that BFD recognizes this architecture */
3868 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3869 if (bfd_arch_info == NULL)
3871 internal_error (__FILE__, __LINE__,
3872 _("gdbarch: Attempt to register unknown architecture (%d)"),
3875 /* Check that we haven't seen this architecture before */
3876 for (curr = &gdbarch_registry;
3878 curr = &(*curr)->next)
3880 if (bfd_architecture == (*curr)->bfd_architecture)
3881 internal_error (__FILE__, __LINE__,
3882 _("gdbarch: Duplicate registraration of architecture (%s)"),
3883 bfd_arch_info->printable_name);
3887 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
3888 bfd_arch_info->printable_name,
3889 host_address_to_string (init));
3891 (*curr) = XMALLOC (struct gdbarch_registration);
3892 (*curr)->bfd_architecture = bfd_architecture;
3893 (*curr)->init = init;
3894 (*curr)->dump_tdep = dump_tdep;
3895 (*curr)->arches = NULL;
3896 (*curr)->next = NULL;
3900 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3901 gdbarch_init_ftype *init)
3903 gdbarch_register (bfd_architecture, init, NULL);
3907 /* Look for an architecture using gdbarch_info. */
3909 struct gdbarch_list *
3910 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3911 const struct gdbarch_info *info)
3913 for (; arches != NULL; arches = arches->next)
3915 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3917 if (info->byte_order != arches->gdbarch->byte_order)
3919 if (info->osabi != arches->gdbarch->osabi)
3921 if (info->target_desc != arches->gdbarch->target_desc)
3929 /* Find an architecture that matches the specified INFO. Create a new
3930 architecture if needed. Return that new architecture. */
3933 gdbarch_find_by_info (struct gdbarch_info info)
3935 struct gdbarch *new_gdbarch;
3936 struct gdbarch_registration *rego;
3938 /* Fill in missing parts of the INFO struct using a number of
3939 sources: "set ..."; INFOabfd supplied; and the global
3941 gdbarch_info_fill (&info);
3943 /* Must have found some sort of architecture. */
3944 gdb_assert (info.bfd_arch_info != NULL);
3948 fprintf_unfiltered (gdb_stdlog,
3949 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
3950 (info.bfd_arch_info != NULL
3951 ? info.bfd_arch_info->printable_name
3953 fprintf_unfiltered (gdb_stdlog,
3954 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
3956 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3957 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3959 fprintf_unfiltered (gdb_stdlog,
3960 "gdbarch_find_by_info: info.osabi %d (%s)\n",
3961 info.osabi, gdbarch_osabi_name (info.osabi));
3962 fprintf_unfiltered (gdb_stdlog,
3963 "gdbarch_find_by_info: info.abfd %s\n",
3964 host_address_to_string (info.abfd));
3965 fprintf_unfiltered (gdb_stdlog,
3966 "gdbarch_find_by_info: info.tdep_info %s\n",
3967 host_address_to_string (info.tdep_info));
3970 /* Find the tdep code that knows about this architecture. */
3971 for (rego = gdbarch_registry;
3974 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3979 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
3980 "No matching architecture\n");
3984 /* Ask the tdep code for an architecture that matches "info". */
3985 new_gdbarch = rego->init (info, rego->arches);
3987 /* Did the tdep code like it? No. Reject the change and revert to
3988 the old architecture. */
3989 if (new_gdbarch == NULL)
3992 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
3993 "Target rejected architecture\n");
3997 /* Is this a pre-existing architecture (as determined by already
3998 being initialized)? Move it to the front of the architecture
3999 list (keeping the list sorted Most Recently Used). */
4000 if (new_gdbarch->initialized_p)
4002 struct gdbarch_list **list;
4003 struct gdbarch_list *this;
4005 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4006 "Previous architecture %s (%s) selected\n",
4007 host_address_to_string (new_gdbarch),
4008 new_gdbarch->bfd_arch_info->printable_name);
4009 /* Find the existing arch in the list. */
4010 for (list = ®o->arches;
4011 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4012 list = &(*list)->next);
4013 /* It had better be in the list of architectures. */
4014 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4017 (*list) = this->next;
4018 /* Insert THIS at the front. */
4019 this->next = rego->arches;
4020 rego->arches = this;
4025 /* It's a new architecture. */
4027 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4028 "New architecture %s (%s) selected\n",
4029 host_address_to_string (new_gdbarch),
4030 new_gdbarch->bfd_arch_info->printable_name);
4032 /* Insert the new architecture into the front of the architecture
4033 list (keep the list sorted Most Recently Used). */
4035 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4036 this->next = rego->arches;
4037 this->gdbarch = new_gdbarch;
4038 rego->arches = this;
4041 /* Check that the newly installed architecture is valid. Plug in
4042 any post init values. */
4043 new_gdbarch->dump_tdep = rego->dump_tdep;
4044 verify_gdbarch (new_gdbarch);
4045 new_gdbarch->initialized_p = 1;
4048 gdbarch_dump (new_gdbarch, gdb_stdlog);
4053 /* Make the specified architecture current. */
4056 deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4058 gdb_assert (new_gdbarch != NULL);
4059 gdb_assert (new_gdbarch->initialized_p);
4060 target_gdbarch = new_gdbarch;
4061 observer_notify_architecture_changed (new_gdbarch);
4062 registers_changed ();
4065 extern void _initialize_gdbarch (void);
4068 _initialize_gdbarch (void)
4070 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
4071 Set architecture debugging."), _("\
4072 Show architecture debugging."), _("\
4073 When non-zero, architecture debugging is enabled."),
4076 &setdebuglist, &showdebuglist);