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 /* Maintain the struct gdbarch object */
85 /* Has this architecture been fully initialized? */
88 /* An obstack bound to the lifetime of the architecture. */
89 struct obstack *obstack;
91 /* basic architectural information */
92 const struct bfd_arch_info * bfd_arch_info;
94 int byte_order_for_code;
96 const struct target_desc * target_desc;
98 /* target specific vector. */
99 struct gdbarch_tdep *tdep;
100 gdbarch_dump_tdep_ftype *dump_tdep;
102 /* per-architecture data-pointers */
106 /* per-architecture swap-regions */
107 struct gdbarch_swap *swap;
109 /* Multi-arch values.
111 When extending this structure you must:
115 Declare set/get functions and define the corresponding
118 gdbarch_alloc(): If zero/NULL is not a suitable default,
119 initialize the new field.
121 verify_gdbarch(): Confirm that the target updated the field
124 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
127 ``startup_gdbarch()'': Append an initial value to the static
128 variable (base values on the host's c-type system).
130 get_gdbarch(): Implement the set/get functions (probably using
131 the macro's as shortcuts).
141 const struct floatformat ** float_format;
143 const struct floatformat ** double_format;
145 const struct floatformat ** long_double_format;
149 gdbarch_read_pc_ftype *read_pc;
150 gdbarch_write_pc_ftype *write_pc;
151 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
152 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
153 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
160 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
161 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
162 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
163 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
164 gdbarch_register_name_ftype *register_name;
165 gdbarch_register_type_ftype *register_type;
166 gdbarch_dummy_id_ftype *dummy_id;
167 int deprecated_fp_regnum;
168 gdbarch_push_dummy_call_ftype *push_dummy_call;
169 int call_dummy_location;
170 gdbarch_push_dummy_code_ftype *push_dummy_code;
171 gdbarch_print_registers_info_ftype *print_registers_info;
172 gdbarch_print_float_info_ftype *print_float_info;
173 gdbarch_print_vector_info_ftype *print_vector_info;
174 gdbarch_register_sim_regno_ftype *register_sim_regno;
175 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
176 gdbarch_cannot_store_register_ftype *cannot_store_register;
177 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
178 int believe_pcc_promotion;
179 gdbarch_convert_register_p_ftype *convert_register_p;
180 gdbarch_register_to_value_ftype *register_to_value;
181 gdbarch_value_to_register_ftype *value_to_register;
182 gdbarch_value_from_register_ftype *value_from_register;
183 gdbarch_pointer_to_address_ftype *pointer_to_address;
184 gdbarch_address_to_pointer_ftype *address_to_pointer;
185 gdbarch_integer_to_address_ftype *integer_to_address;
186 gdbarch_return_value_ftype *return_value;
187 gdbarch_skip_prologue_ftype *skip_prologue;
188 gdbarch_skip_main_prologue_ftype *skip_main_prologue;
189 gdbarch_inner_than_ftype *inner_than;
190 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
191 gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
192 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
193 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
194 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
195 CORE_ADDR decr_pc_after_break;
196 CORE_ADDR deprecated_function_start_offset;
197 gdbarch_remote_register_number_ftype *remote_register_number;
198 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
199 CORE_ADDR frame_args_skip;
200 gdbarch_unwind_pc_ftype *unwind_pc;
201 gdbarch_unwind_sp_ftype *unwind_sp;
202 gdbarch_frame_num_args_ftype *frame_num_args;
203 gdbarch_frame_align_ftype *frame_align;
204 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
205 int frame_red_zone_size;
206 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
207 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
208 gdbarch_smash_text_address_ftype *smash_text_address;
209 gdbarch_software_single_step_ftype *software_single_step;
210 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
211 gdbarch_print_insn_ftype *print_insn;
212 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
213 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
214 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
215 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
216 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
217 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
218 int cannot_step_breakpoint;
219 int have_nonsteppable_watchpoint;
220 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
221 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
222 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
223 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
224 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
225 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
226 int core_reg_section_encodes_pid;
227 struct core_regset_section * core_regset_sections;
228 gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
229 gdbarch_core_pid_to_str_ftype *core_pid_to_str;
230 const char * gcore_bfd_target;
231 int vtable_function_descriptors;
233 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
234 ULONGEST max_insn_length;
235 gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
236 gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
237 gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
238 gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
239 gdbarch_displaced_step_location_ftype *displaced_step_location;
240 gdbarch_overlay_update_ftype *overlay_update;
241 gdbarch_core_read_description_ftype *core_read_description;
242 gdbarch_static_transform_name_ftype *static_transform_name;
243 int sofun_address_maybe_missing;
244 gdbarch_process_record_ftype *process_record;
245 gdbarch_process_record_signal_ftype *process_record_signal;
246 gdbarch_target_signal_from_host_ftype *target_signal_from_host;
247 gdbarch_target_signal_to_host_ftype *target_signal_to_host;
248 gdbarch_get_siginfo_type_ftype *get_siginfo_type;
249 gdbarch_record_special_symbol_ftype *record_special_symbol;
250 gdbarch_get_syscall_number_ftype *get_syscall_number;
251 int has_global_solist;
252 int has_global_breakpoints;
253 gdbarch_has_shared_address_space_ftype *has_shared_address_space;
254 gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
258 /* The default architecture uses host values (for want of a better
261 extern const struct bfd_arch_info bfd_default_arch_struct;
263 struct gdbarch startup_gdbarch =
265 1, /* Always initialized. */
266 NULL, /* The obstack. */
267 /* basic architecture information */
268 &bfd_default_arch_struct, /* bfd_arch_info */
269 BFD_ENDIAN_BIG, /* byte_order */
270 BFD_ENDIAN_BIG, /* byte_order_for_code */
271 GDB_OSABI_UNKNOWN, /* osabi */
273 /* target specific vector and its dump routine */
275 /*per-architecture data-pointers and swap regions */
277 /* Multi-arch values */
278 1, /* bits_big_endian */
279 8 * sizeof (short), /* short_bit */
280 8 * sizeof (int), /* int_bit */
281 8 * sizeof (long), /* long_bit */
282 8 * sizeof (LONGEST), /* long_long_bit */
283 8 * sizeof (float), /* float_bit */
284 0, /* float_format */
285 8 * sizeof (double), /* double_bit */
286 0, /* double_format */
287 8 * sizeof (long double), /* long_double_bit */
288 0, /* long_double_format */
289 8 * sizeof (void*), /* ptr_bit */
290 8 * sizeof (void*), /* addr_bit */
294 legacy_virtual_frame_pointer, /* virtual_frame_pointer */
295 0, /* pseudo_register_read */
296 0, /* pseudo_register_write */
298 0, /* num_pseudo_regs */
303 no_op_reg_to_regnum, /* stab_reg_to_regnum */
304 no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
305 no_op_reg_to_regnum, /* sdb_reg_to_regnum */
306 no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
307 0, /* register_name */
308 0, /* register_type */
310 -1, /* deprecated_fp_regnum */
311 0, /* push_dummy_call */
312 0, /* call_dummy_location */
313 0, /* push_dummy_code */
314 default_print_registers_info, /* print_registers_info */
315 0, /* print_float_info */
316 0, /* print_vector_info */
317 legacy_register_sim_regno, /* register_sim_regno */
318 cannot_register_not, /* cannot_fetch_register */
319 cannot_register_not, /* cannot_store_register */
320 0, /* get_longjmp_target */
321 0, /* believe_pcc_promotion */
322 generic_convert_register_p, /* convert_register_p */
323 0, /* register_to_value */
324 0, /* value_to_register */
325 0, /* value_from_register */
326 unsigned_pointer_to_address, /* pointer_to_address */
327 unsigned_address_to_pointer, /* address_to_pointer */
328 0, /* integer_to_address */
329 0, /* return_value */
330 0, /* skip_prologue */
331 0, /* skip_main_prologue */
333 0, /* breakpoint_from_pc */
334 default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */
335 0, /* adjust_breakpoint_address */
336 default_memory_insert_breakpoint, /* memory_insert_breakpoint */
337 default_memory_remove_breakpoint, /* memory_remove_breakpoint */
338 0, /* decr_pc_after_break */
339 0, /* deprecated_function_start_offset */
340 default_remote_register_number, /* remote_register_number */
341 0, /* fetch_tls_load_module_address */
342 0, /* frame_args_skip */
345 0, /* frame_num_args */
347 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
348 0, /* frame_red_zone_size */
349 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
350 core_addr_identity, /* addr_bits_remove */
351 core_addr_identity, /* smash_text_address */
352 0, /* software_single_step */
353 0, /* single_step_through_delay */
355 0, /* skip_trampoline_code */
356 generic_skip_solib_resolver, /* skip_solib_resolver */
357 generic_in_solib_return_trampoline, /* in_solib_return_trampoline */
358 generic_in_function_epilogue_p, /* in_function_epilogue_p */
359 0, /* elf_make_msymbol_special */
360 0, /* coff_make_msymbol_special */
361 0, /* cannot_step_breakpoint */
362 0, /* have_nonsteppable_watchpoint */
363 0, /* address_class_type_flags */
364 0, /* address_class_type_flags_to_name */
365 0, /* address_class_name_to_type_flags */
366 default_register_reggroup_p, /* register_reggroup_p */
367 0, /* fetch_pointer_argument */
368 0, /* regset_from_core_section */
369 0, /* core_reg_section_encodes_pid */
370 0, /* core_regset_sections */
371 0, /* core_xfer_shared_libraries */
372 0, /* core_pid_to_str */
373 0, /* gcore_bfd_target */
374 0, /* vtable_function_descriptors */
375 0, /* vbit_in_delta */
376 0, /* skip_permanent_breakpoint */
377 0, /* max_insn_length */
378 0, /* displaced_step_copy_insn */
379 default_displaced_step_hw_singlestep, /* displaced_step_hw_singlestep */
380 0, /* displaced_step_fixup */
381 NULL, /* displaced_step_free_closure */
382 NULL, /* displaced_step_location */
383 0, /* overlay_update */
384 0, /* core_read_description */
385 0, /* static_transform_name */
386 0, /* sofun_address_maybe_missing */
387 0, /* process_record */
388 0, /* process_record_signal */
389 default_target_signal_from_host, /* target_signal_from_host */
390 default_target_signal_to_host, /* target_signal_to_host */
391 0, /* get_siginfo_type */
392 0, /* record_special_symbol */
393 0, /* get_syscall_number */
394 0, /* has_global_solist */
395 0, /* has_global_breakpoints */
396 default_has_shared_address_space, /* has_shared_address_space */
397 default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
398 /* startup_gdbarch() */
401 struct gdbarch *target_gdbarch = &startup_gdbarch;
403 /* Create a new ``struct gdbarch'' based on information provided by
404 ``struct gdbarch_info''. */
407 gdbarch_alloc (const struct gdbarch_info *info,
408 struct gdbarch_tdep *tdep)
410 struct gdbarch *gdbarch;
412 /* Create an obstack for allocating all the per-architecture memory,
413 then use that to allocate the architecture vector. */
414 struct obstack *obstack = XMALLOC (struct obstack);
415 obstack_init (obstack);
416 gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
417 memset (gdbarch, 0, sizeof (*gdbarch));
418 gdbarch->obstack = obstack;
420 alloc_gdbarch_data (gdbarch);
422 gdbarch->tdep = tdep;
424 gdbarch->bfd_arch_info = info->bfd_arch_info;
425 gdbarch->byte_order = info->byte_order;
426 gdbarch->byte_order_for_code = info->byte_order_for_code;
427 gdbarch->osabi = info->osabi;
428 gdbarch->target_desc = info->target_desc;
430 /* Force the explicit initialization of these. */
431 gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
432 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
433 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
434 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
435 gdbarch->long_long_bit = 2*gdbarch->long_bit;
436 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
437 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
438 gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
439 gdbarch->ptr_bit = gdbarch->int_bit;
440 gdbarch->char_signed = -1;
441 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
442 gdbarch->num_regs = -1;
443 gdbarch->sp_regnum = -1;
444 gdbarch->pc_regnum = -1;
445 gdbarch->ps_regnum = -1;
446 gdbarch->fp0_regnum = -1;
447 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
448 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
449 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
450 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
451 gdbarch->deprecated_fp_regnum = -1;
452 gdbarch->call_dummy_location = AT_ENTRY_POINT;
453 gdbarch->print_registers_info = default_print_registers_info;
454 gdbarch->register_sim_regno = legacy_register_sim_regno;
455 gdbarch->cannot_fetch_register = cannot_register_not;
456 gdbarch->cannot_store_register = cannot_register_not;
457 gdbarch->convert_register_p = generic_convert_register_p;
458 gdbarch->value_from_register = default_value_from_register;
459 gdbarch->pointer_to_address = unsigned_pointer_to_address;
460 gdbarch->address_to_pointer = unsigned_address_to_pointer;
461 gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
462 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
463 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
464 gdbarch->remote_register_number = default_remote_register_number;
465 gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
466 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
467 gdbarch->addr_bits_remove = core_addr_identity;
468 gdbarch->smash_text_address = core_addr_identity;
469 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
470 gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
471 gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
472 gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
473 gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
474 gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
475 gdbarch->register_reggroup_p = default_register_reggroup_p;
476 gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
477 gdbarch->displaced_step_fixup = NULL;
478 gdbarch->displaced_step_free_closure = NULL;
479 gdbarch->displaced_step_location = NULL;
480 gdbarch->target_signal_from_host = default_target_signal_from_host;
481 gdbarch->target_signal_to_host = default_target_signal_to_host;
482 gdbarch->has_shared_address_space = default_has_shared_address_space;
483 gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
484 /* gdbarch_alloc() */
490 /* Allocate extra space using the per-architecture obstack. */
493 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
495 void *data = obstack_alloc (arch->obstack, size);
496 memset (data, 0, size);
501 /* Free a gdbarch struct. This should never happen in normal
502 operation --- once you've created a gdbarch, you keep it around.
503 However, if an architecture's init function encounters an error
504 building the structure, it may need to clean up a partially
505 constructed gdbarch. */
508 gdbarch_free (struct gdbarch *arch)
510 struct obstack *obstack;
511 gdb_assert (arch != NULL);
512 gdb_assert (!arch->initialized_p);
513 obstack = arch->obstack;
514 obstack_free (obstack, 0); /* Includes the ARCH. */
519 /* Ensure that all values in a GDBARCH are reasonable. */
522 verify_gdbarch (struct gdbarch *gdbarch)
525 struct cleanup *cleanups;
528 log = mem_fileopen ();
529 cleanups = make_cleanup_ui_file_delete (log);
531 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
532 fprintf_unfiltered (log, "\n\tbyte-order");
533 if (gdbarch->bfd_arch_info == NULL)
534 fprintf_unfiltered (log, "\n\tbfd_arch_info");
535 /* Check those that need to be defined for the given multi-arch level. */
536 /* Skip verify of bits_big_endian, invalid_p == 0 */
537 /* Skip verify of short_bit, invalid_p == 0 */
538 /* Skip verify of int_bit, invalid_p == 0 */
539 /* Skip verify of long_bit, invalid_p == 0 */
540 /* Skip verify of long_long_bit, invalid_p == 0 */
541 /* Skip verify of float_bit, invalid_p == 0 */
542 if (gdbarch->float_format == 0)
543 gdbarch->float_format = floatformats_ieee_single;
544 /* Skip verify of double_bit, invalid_p == 0 */
545 if (gdbarch->double_format == 0)
546 gdbarch->double_format = floatformats_ieee_double;
547 /* Skip verify of long_double_bit, invalid_p == 0 */
548 if (gdbarch->long_double_format == 0)
549 gdbarch->long_double_format = floatformats_ieee_double;
550 /* Skip verify of ptr_bit, invalid_p == 0 */
551 if (gdbarch->addr_bit == 0)
552 gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
553 if (gdbarch->char_signed == -1)
554 gdbarch->char_signed = 1;
555 /* Skip verify of read_pc, has predicate */
556 /* Skip verify of write_pc, has predicate */
557 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
558 /* Skip verify of pseudo_register_read, has predicate */
559 /* Skip verify of pseudo_register_write, has predicate */
560 if (gdbarch->num_regs == -1)
561 fprintf_unfiltered (log, "\n\tnum_regs");
562 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
563 /* Skip verify of sp_regnum, invalid_p == 0 */
564 /* Skip verify of pc_regnum, invalid_p == 0 */
565 /* Skip verify of ps_regnum, invalid_p == 0 */
566 /* Skip verify of fp0_regnum, invalid_p == 0 */
567 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
568 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
569 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
570 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
571 if (gdbarch->register_name == 0)
572 fprintf_unfiltered (log, "\n\tregister_name");
573 /* Skip verify of register_type, has predicate */
574 /* Skip verify of dummy_id, has predicate */
575 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
576 /* Skip verify of push_dummy_call, has predicate */
577 /* Skip verify of call_dummy_location, invalid_p == 0 */
578 /* Skip verify of push_dummy_code, has predicate */
579 /* Skip verify of print_registers_info, invalid_p == 0 */
580 /* Skip verify of print_float_info, has predicate */
581 /* Skip verify of print_vector_info, has predicate */
582 /* Skip verify of register_sim_regno, invalid_p == 0 */
583 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
584 /* Skip verify of cannot_store_register, invalid_p == 0 */
585 /* Skip verify of get_longjmp_target, has predicate */
586 /* Skip verify of convert_register_p, invalid_p == 0 */
587 /* Skip verify of value_from_register, invalid_p == 0 */
588 /* Skip verify of pointer_to_address, invalid_p == 0 */
589 /* Skip verify of address_to_pointer, invalid_p == 0 */
590 /* Skip verify of integer_to_address, has predicate */
591 /* Skip verify of return_value, has predicate */
592 if (gdbarch->skip_prologue == 0)
593 fprintf_unfiltered (log, "\n\tskip_prologue");
594 /* Skip verify of skip_main_prologue, has predicate */
595 if (gdbarch->inner_than == 0)
596 fprintf_unfiltered (log, "\n\tinner_than");
597 if (gdbarch->breakpoint_from_pc == 0)
598 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
599 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
600 /* Skip verify of adjust_breakpoint_address, has predicate */
601 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
602 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
603 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
604 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
605 /* Skip verify of remote_register_number, invalid_p == 0 */
606 /* Skip verify of fetch_tls_load_module_address, has predicate */
607 /* Skip verify of frame_args_skip, invalid_p == 0 */
608 /* Skip verify of unwind_pc, has predicate */
609 /* Skip verify of unwind_sp, has predicate */
610 /* Skip verify of frame_num_args, has predicate */
611 /* Skip verify of frame_align, has predicate */
612 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
613 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
614 /* Skip verify of addr_bits_remove, invalid_p == 0 */
615 /* Skip verify of smash_text_address, invalid_p == 0 */
616 /* Skip verify of software_single_step, has predicate */
617 /* Skip verify of single_step_through_delay, has predicate */
618 if (gdbarch->print_insn == 0)
619 fprintf_unfiltered (log, "\n\tprint_insn");
620 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
621 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
622 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
623 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
624 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
625 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
626 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
627 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
628 /* Skip verify of address_class_type_flags, has predicate */
629 /* Skip verify of address_class_type_flags_to_name, has predicate */
630 /* Skip verify of address_class_name_to_type_flags, has predicate */
631 /* Skip verify of register_reggroup_p, invalid_p == 0 */
632 /* Skip verify of fetch_pointer_argument, has predicate */
633 /* Skip verify of regset_from_core_section, has predicate */
634 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
635 /* Skip verify of core_xfer_shared_libraries, has predicate */
636 /* Skip verify of core_pid_to_str, has predicate */
637 /* Skip verify of gcore_bfd_target, has predicate */
638 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
639 /* Skip verify of vbit_in_delta, invalid_p == 0 */
640 /* Skip verify of skip_permanent_breakpoint, has predicate */
641 /* Skip verify of max_insn_length, has predicate */
642 /* Skip verify of displaced_step_copy_insn, has predicate */
643 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
644 /* Skip verify of displaced_step_fixup, has predicate */
645 if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
646 fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
647 if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
648 fprintf_unfiltered (log, "\n\tdisplaced_step_location");
649 /* Skip verify of overlay_update, has predicate */
650 /* Skip verify of core_read_description, has predicate */
651 /* Skip verify of static_transform_name, has predicate */
652 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
653 /* Skip verify of process_record, has predicate */
654 /* Skip verify of process_record_signal, has predicate */
655 /* Skip verify of target_signal_from_host, invalid_p == 0 */
656 /* Skip verify of target_signal_to_host, invalid_p == 0 */
657 /* Skip verify of get_siginfo_type, has predicate */
658 /* Skip verify of record_special_symbol, has predicate */
659 /* Skip verify of get_syscall_number, has predicate */
660 /* Skip verify of has_global_solist, invalid_p == 0 */
661 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
662 /* Skip verify of has_shared_address_space, invalid_p == 0 */
663 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
664 buf = ui_file_xstrdup (log, &length);
665 make_cleanup (xfree, buf);
667 internal_error (__FILE__, __LINE__,
668 _("verify_gdbarch: the following are invalid ...%s"),
670 do_cleanups (cleanups);
674 /* Print out the details of the current architecture. */
677 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
679 const char *gdb_nm_file = "<not-defined>";
680 #if defined (GDB_NM_FILE)
681 gdb_nm_file = GDB_NM_FILE;
683 fprintf_unfiltered (file,
684 "gdbarch_dump: GDB_NM_FILE = %s\n",
686 fprintf_unfiltered (file,
687 "gdbarch_dump: addr_bit = %s\n",
688 plongest (gdbarch->addr_bit));
689 fprintf_unfiltered (file,
690 "gdbarch_dump: addr_bits_remove = <%s>\n",
691 host_address_to_string (gdbarch->addr_bits_remove));
692 fprintf_unfiltered (file,
693 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
694 gdbarch_address_class_name_to_type_flags_p (gdbarch));
695 fprintf_unfiltered (file,
696 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
697 host_address_to_string (gdbarch->address_class_name_to_type_flags));
698 fprintf_unfiltered (file,
699 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
700 gdbarch_address_class_type_flags_p (gdbarch));
701 fprintf_unfiltered (file,
702 "gdbarch_dump: address_class_type_flags = <%s>\n",
703 host_address_to_string (gdbarch->address_class_type_flags));
704 fprintf_unfiltered (file,
705 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
706 gdbarch_address_class_type_flags_to_name_p (gdbarch));
707 fprintf_unfiltered (file,
708 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
709 host_address_to_string (gdbarch->address_class_type_flags_to_name));
710 fprintf_unfiltered (file,
711 "gdbarch_dump: address_to_pointer = <%s>\n",
712 host_address_to_string (gdbarch->address_to_pointer));
713 fprintf_unfiltered (file,
714 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
715 gdbarch_adjust_breakpoint_address_p (gdbarch));
716 fprintf_unfiltered (file,
717 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
718 host_address_to_string (gdbarch->adjust_breakpoint_address));
719 fprintf_unfiltered (file,
720 "gdbarch_dump: believe_pcc_promotion = %s\n",
721 plongest (gdbarch->believe_pcc_promotion));
722 fprintf_unfiltered (file,
723 "gdbarch_dump: bfd_arch_info = %s\n",
724 gdbarch_bfd_arch_info (gdbarch)->printable_name);
725 fprintf_unfiltered (file,
726 "gdbarch_dump: bits_big_endian = %s\n",
727 plongest (gdbarch->bits_big_endian));
728 fprintf_unfiltered (file,
729 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
730 host_address_to_string (gdbarch->breakpoint_from_pc));
731 fprintf_unfiltered (file,
732 "gdbarch_dump: byte_order = %s\n",
733 plongest (gdbarch->byte_order));
734 fprintf_unfiltered (file,
735 "gdbarch_dump: byte_order_for_code = %s\n",
736 plongest (gdbarch->byte_order_for_code));
737 fprintf_unfiltered (file,
738 "gdbarch_dump: call_dummy_location = %s\n",
739 plongest (gdbarch->call_dummy_location));
740 fprintf_unfiltered (file,
741 "gdbarch_dump: cannot_fetch_register = <%s>\n",
742 host_address_to_string (gdbarch->cannot_fetch_register));
743 fprintf_unfiltered (file,
744 "gdbarch_dump: cannot_step_breakpoint = %s\n",
745 plongest (gdbarch->cannot_step_breakpoint));
746 fprintf_unfiltered (file,
747 "gdbarch_dump: cannot_store_register = <%s>\n",
748 host_address_to_string (gdbarch->cannot_store_register));
749 fprintf_unfiltered (file,
750 "gdbarch_dump: char_signed = %s\n",
751 plongest (gdbarch->char_signed));
752 fprintf_unfiltered (file,
753 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
754 host_address_to_string (gdbarch->coff_make_msymbol_special));
755 fprintf_unfiltered (file,
756 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
757 host_address_to_string (gdbarch->convert_from_func_ptr_addr));
758 fprintf_unfiltered (file,
759 "gdbarch_dump: convert_register_p = <%s>\n",
760 host_address_to_string (gdbarch->convert_register_p));
761 fprintf_unfiltered (file,
762 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
763 gdbarch_core_pid_to_str_p (gdbarch));
764 fprintf_unfiltered (file,
765 "gdbarch_dump: core_pid_to_str = <%s>\n",
766 host_address_to_string (gdbarch->core_pid_to_str));
767 fprintf_unfiltered (file,
768 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
769 gdbarch_core_read_description_p (gdbarch));
770 fprintf_unfiltered (file,
771 "gdbarch_dump: core_read_description = <%s>\n",
772 host_address_to_string (gdbarch->core_read_description));
773 fprintf_unfiltered (file,
774 "gdbarch_dump: core_reg_section_encodes_pid = %s\n",
775 plongest (gdbarch->core_reg_section_encodes_pid));
776 fprintf_unfiltered (file,
777 "gdbarch_dump: core_regset_sections = %s\n",
778 host_address_to_string (gdbarch->core_regset_sections));
779 fprintf_unfiltered (file,
780 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
781 gdbarch_core_xfer_shared_libraries_p (gdbarch));
782 fprintf_unfiltered (file,
783 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
784 host_address_to_string (gdbarch->core_xfer_shared_libraries));
785 fprintf_unfiltered (file,
786 "gdbarch_dump: decr_pc_after_break = %s\n",
787 core_addr_to_string_nz (gdbarch->decr_pc_after_break));
788 fprintf_unfiltered (file,
789 "gdbarch_dump: deprecated_fp_regnum = %s\n",
790 plongest (gdbarch->deprecated_fp_regnum));
791 fprintf_unfiltered (file,
792 "gdbarch_dump: deprecated_function_start_offset = %s\n",
793 core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
794 fprintf_unfiltered (file,
795 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
796 gdbarch_displaced_step_copy_insn_p (gdbarch));
797 fprintf_unfiltered (file,
798 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
799 host_address_to_string (gdbarch->displaced_step_copy_insn));
800 fprintf_unfiltered (file,
801 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
802 gdbarch_displaced_step_fixup_p (gdbarch));
803 fprintf_unfiltered (file,
804 "gdbarch_dump: displaced_step_fixup = <%s>\n",
805 host_address_to_string (gdbarch->displaced_step_fixup));
806 fprintf_unfiltered (file,
807 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
808 host_address_to_string (gdbarch->displaced_step_free_closure));
809 fprintf_unfiltered (file,
810 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
811 host_address_to_string (gdbarch->displaced_step_hw_singlestep));
812 fprintf_unfiltered (file,
813 "gdbarch_dump: displaced_step_location = <%s>\n",
814 host_address_to_string (gdbarch->displaced_step_location));
815 fprintf_unfiltered (file,
816 "gdbarch_dump: double_bit = %s\n",
817 plongest (gdbarch->double_bit));
818 fprintf_unfiltered (file,
819 "gdbarch_dump: double_format = %s\n",
820 pformat (gdbarch->double_format));
821 fprintf_unfiltered (file,
822 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
823 gdbarch_dummy_id_p (gdbarch));
824 fprintf_unfiltered (file,
825 "gdbarch_dump: dummy_id = <%s>\n",
826 host_address_to_string (gdbarch->dummy_id));
827 fprintf_unfiltered (file,
828 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
829 host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
830 fprintf_unfiltered (file,
831 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
832 host_address_to_string (gdbarch->ecoff_reg_to_regnum));
833 fprintf_unfiltered (file,
834 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
835 host_address_to_string (gdbarch->elf_make_msymbol_special));
836 fprintf_unfiltered (file,
837 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
838 host_address_to_string (gdbarch->fast_tracepoint_valid_at));
839 fprintf_unfiltered (file,
840 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
841 gdbarch_fetch_pointer_argument_p (gdbarch));
842 fprintf_unfiltered (file,
843 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
844 host_address_to_string (gdbarch->fetch_pointer_argument));
845 fprintf_unfiltered (file,
846 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
847 gdbarch_fetch_tls_load_module_address_p (gdbarch));
848 fprintf_unfiltered (file,
849 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
850 host_address_to_string (gdbarch->fetch_tls_load_module_address));
851 fprintf_unfiltered (file,
852 "gdbarch_dump: float_bit = %s\n",
853 plongest (gdbarch->float_bit));
854 fprintf_unfiltered (file,
855 "gdbarch_dump: float_format = %s\n",
856 pformat (gdbarch->float_format));
857 fprintf_unfiltered (file,
858 "gdbarch_dump: fp0_regnum = %s\n",
859 plongest (gdbarch->fp0_regnum));
860 fprintf_unfiltered (file,
861 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
862 gdbarch_frame_align_p (gdbarch));
863 fprintf_unfiltered (file,
864 "gdbarch_dump: frame_align = <%s>\n",
865 host_address_to_string (gdbarch->frame_align));
866 fprintf_unfiltered (file,
867 "gdbarch_dump: frame_args_skip = %s\n",
868 core_addr_to_string_nz (gdbarch->frame_args_skip));
869 fprintf_unfiltered (file,
870 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
871 gdbarch_frame_num_args_p (gdbarch));
872 fprintf_unfiltered (file,
873 "gdbarch_dump: frame_num_args = <%s>\n",
874 host_address_to_string (gdbarch->frame_num_args));
875 fprintf_unfiltered (file,
876 "gdbarch_dump: frame_red_zone_size = %s\n",
877 plongest (gdbarch->frame_red_zone_size));
878 fprintf_unfiltered (file,
879 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
880 gdbarch_gcore_bfd_target_p (gdbarch));
881 fprintf_unfiltered (file,
882 "gdbarch_dump: gcore_bfd_target = %s\n",
883 gdbarch->gcore_bfd_target);
884 fprintf_unfiltered (file,
885 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
886 gdbarch_get_longjmp_target_p (gdbarch));
887 fprintf_unfiltered (file,
888 "gdbarch_dump: get_longjmp_target = <%s>\n",
889 host_address_to_string (gdbarch->get_longjmp_target));
890 fprintf_unfiltered (file,
891 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
892 gdbarch_get_siginfo_type_p (gdbarch));
893 fprintf_unfiltered (file,
894 "gdbarch_dump: get_siginfo_type = <%s>\n",
895 host_address_to_string (gdbarch->get_siginfo_type));
896 fprintf_unfiltered (file,
897 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
898 gdbarch_get_syscall_number_p (gdbarch));
899 fprintf_unfiltered (file,
900 "gdbarch_dump: get_syscall_number = <%s>\n",
901 host_address_to_string (gdbarch->get_syscall_number));
902 fprintf_unfiltered (file,
903 "gdbarch_dump: has_global_breakpoints = %s\n",
904 plongest (gdbarch->has_global_breakpoints));
905 fprintf_unfiltered (file,
906 "gdbarch_dump: has_global_solist = %s\n",
907 plongest (gdbarch->has_global_solist));
908 fprintf_unfiltered (file,
909 "gdbarch_dump: has_shared_address_space = <%s>\n",
910 host_address_to_string (gdbarch->has_shared_address_space));
911 fprintf_unfiltered (file,
912 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
913 plongest (gdbarch->have_nonsteppable_watchpoint));
914 fprintf_unfiltered (file,
915 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
916 host_address_to_string (gdbarch->in_function_epilogue_p));
917 fprintf_unfiltered (file,
918 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
919 host_address_to_string (gdbarch->in_solib_return_trampoline));
920 fprintf_unfiltered (file,
921 "gdbarch_dump: inner_than = <%s>\n",
922 host_address_to_string (gdbarch->inner_than));
923 fprintf_unfiltered (file,
924 "gdbarch_dump: int_bit = %s\n",
925 plongest (gdbarch->int_bit));
926 fprintf_unfiltered (file,
927 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
928 gdbarch_integer_to_address_p (gdbarch));
929 fprintf_unfiltered (file,
930 "gdbarch_dump: integer_to_address = <%s>\n",
931 host_address_to_string (gdbarch->integer_to_address));
932 fprintf_unfiltered (file,
933 "gdbarch_dump: long_bit = %s\n",
934 plongest (gdbarch->long_bit));
935 fprintf_unfiltered (file,
936 "gdbarch_dump: long_double_bit = %s\n",
937 plongest (gdbarch->long_double_bit));
938 fprintf_unfiltered (file,
939 "gdbarch_dump: long_double_format = %s\n",
940 pformat (gdbarch->long_double_format));
941 fprintf_unfiltered (file,
942 "gdbarch_dump: long_long_bit = %s\n",
943 plongest (gdbarch->long_long_bit));
944 fprintf_unfiltered (file,
945 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
946 gdbarch_max_insn_length_p (gdbarch));
947 fprintf_unfiltered (file,
948 "gdbarch_dump: max_insn_length = %s\n",
949 plongest (gdbarch->max_insn_length));
950 fprintf_unfiltered (file,
951 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
952 host_address_to_string (gdbarch->memory_insert_breakpoint));
953 fprintf_unfiltered (file,
954 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
955 host_address_to_string (gdbarch->memory_remove_breakpoint));
956 fprintf_unfiltered (file,
957 "gdbarch_dump: num_pseudo_regs = %s\n",
958 plongest (gdbarch->num_pseudo_regs));
959 fprintf_unfiltered (file,
960 "gdbarch_dump: num_regs = %s\n",
961 plongest (gdbarch->num_regs));
962 fprintf_unfiltered (file,
963 "gdbarch_dump: osabi = %s\n",
964 plongest (gdbarch->osabi));
965 fprintf_unfiltered (file,
966 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
967 gdbarch_overlay_update_p (gdbarch));
968 fprintf_unfiltered (file,
969 "gdbarch_dump: overlay_update = <%s>\n",
970 host_address_to_string (gdbarch->overlay_update));
971 fprintf_unfiltered (file,
972 "gdbarch_dump: pc_regnum = %s\n",
973 plongest (gdbarch->pc_regnum));
974 fprintf_unfiltered (file,
975 "gdbarch_dump: pointer_to_address = <%s>\n",
976 host_address_to_string (gdbarch->pointer_to_address));
977 fprintf_unfiltered (file,
978 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
979 gdbarch_print_float_info_p (gdbarch));
980 fprintf_unfiltered (file,
981 "gdbarch_dump: print_float_info = <%s>\n",
982 host_address_to_string (gdbarch->print_float_info));
983 fprintf_unfiltered (file,
984 "gdbarch_dump: print_insn = <%s>\n",
985 host_address_to_string (gdbarch->print_insn));
986 fprintf_unfiltered (file,
987 "gdbarch_dump: print_registers_info = <%s>\n",
988 host_address_to_string (gdbarch->print_registers_info));
989 fprintf_unfiltered (file,
990 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
991 gdbarch_print_vector_info_p (gdbarch));
992 fprintf_unfiltered (file,
993 "gdbarch_dump: print_vector_info = <%s>\n",
994 host_address_to_string (gdbarch->print_vector_info));
995 fprintf_unfiltered (file,
996 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
997 gdbarch_process_record_p (gdbarch));
998 fprintf_unfiltered (file,
999 "gdbarch_dump: process_record = <%s>\n",
1000 host_address_to_string (gdbarch->process_record));
1001 fprintf_unfiltered (file,
1002 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1003 gdbarch_process_record_signal_p (gdbarch));
1004 fprintf_unfiltered (file,
1005 "gdbarch_dump: process_record_signal = <%s>\n",
1006 host_address_to_string (gdbarch->process_record_signal));
1007 fprintf_unfiltered (file,
1008 "gdbarch_dump: ps_regnum = %s\n",
1009 plongest (gdbarch->ps_regnum));
1010 fprintf_unfiltered (file,
1011 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1012 gdbarch_pseudo_register_read_p (gdbarch));
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: pseudo_register_read = <%s>\n",
1015 host_address_to_string (gdbarch->pseudo_register_read));
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1018 gdbarch_pseudo_register_write_p (gdbarch));
1019 fprintf_unfiltered (file,
1020 "gdbarch_dump: pseudo_register_write = <%s>\n",
1021 host_address_to_string (gdbarch->pseudo_register_write));
1022 fprintf_unfiltered (file,
1023 "gdbarch_dump: ptr_bit = %s\n",
1024 plongest (gdbarch->ptr_bit));
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1027 gdbarch_push_dummy_call_p (gdbarch));
1028 fprintf_unfiltered (file,
1029 "gdbarch_dump: push_dummy_call = <%s>\n",
1030 host_address_to_string (gdbarch->push_dummy_call));
1031 fprintf_unfiltered (file,
1032 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1033 gdbarch_push_dummy_code_p (gdbarch));
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: push_dummy_code = <%s>\n",
1036 host_address_to_string (gdbarch->push_dummy_code));
1037 fprintf_unfiltered (file,
1038 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1039 gdbarch_read_pc_p (gdbarch));
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: read_pc = <%s>\n",
1042 host_address_to_string (gdbarch->read_pc));
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1045 gdbarch_record_special_symbol_p (gdbarch));
1046 fprintf_unfiltered (file,
1047 "gdbarch_dump: record_special_symbol = <%s>\n",
1048 host_address_to_string (gdbarch->record_special_symbol));
1049 fprintf_unfiltered (file,
1050 "gdbarch_dump: register_name = <%s>\n",
1051 host_address_to_string (gdbarch->register_name));
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: register_reggroup_p = <%s>\n",
1054 host_address_to_string (gdbarch->register_reggroup_p));
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: register_sim_regno = <%s>\n",
1057 host_address_to_string (gdbarch->register_sim_regno));
1058 fprintf_unfiltered (file,
1059 "gdbarch_dump: register_to_value = <%s>\n",
1060 host_address_to_string (gdbarch->register_to_value));
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1063 gdbarch_register_type_p (gdbarch));
1064 fprintf_unfiltered (file,
1065 "gdbarch_dump: register_type = <%s>\n",
1066 host_address_to_string (gdbarch->register_type));
1067 fprintf_unfiltered (file,
1068 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1069 gdbarch_regset_from_core_section_p (gdbarch));
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: regset_from_core_section = <%s>\n",
1072 host_address_to_string (gdbarch->regset_from_core_section));
1073 fprintf_unfiltered (file,
1074 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1075 host_address_to_string (gdbarch->remote_breakpoint_from_pc));
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: remote_register_number = <%s>\n",
1078 host_address_to_string (gdbarch->remote_register_number));
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1081 gdbarch_return_value_p (gdbarch));
1082 fprintf_unfiltered (file,
1083 "gdbarch_dump: return_value = <%s>\n",
1084 host_address_to_string (gdbarch->return_value));
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1087 host_address_to_string (gdbarch->sdb_reg_to_regnum));
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: short_bit = %s\n",
1090 plongest (gdbarch->short_bit));
1091 fprintf_unfiltered (file,
1092 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1093 gdbarch_single_step_through_delay_p (gdbarch));
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: single_step_through_delay = <%s>\n",
1096 host_address_to_string (gdbarch->single_step_through_delay));
1097 fprintf_unfiltered (file,
1098 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1099 gdbarch_skip_main_prologue_p (gdbarch));
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: skip_main_prologue = <%s>\n",
1102 host_address_to_string (gdbarch->skip_main_prologue));
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1105 gdbarch_skip_permanent_breakpoint_p (gdbarch));
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1108 host_address_to_string (gdbarch->skip_permanent_breakpoint));
1109 fprintf_unfiltered (file,
1110 "gdbarch_dump: skip_prologue = <%s>\n",
1111 host_address_to_string (gdbarch->skip_prologue));
1112 fprintf_unfiltered (file,
1113 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1114 host_address_to_string (gdbarch->skip_solib_resolver));
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1117 host_address_to_string (gdbarch->skip_trampoline_code));
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: smash_text_address = <%s>\n",
1120 host_address_to_string (gdbarch->smash_text_address));
1121 fprintf_unfiltered (file,
1122 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1123 gdbarch_software_single_step_p (gdbarch));
1124 fprintf_unfiltered (file,
1125 "gdbarch_dump: software_single_step = <%s>\n",
1126 host_address_to_string (gdbarch->software_single_step));
1127 fprintf_unfiltered (file,
1128 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1129 plongest (gdbarch->sofun_address_maybe_missing));
1130 fprintf_unfiltered (file,
1131 "gdbarch_dump: sp_regnum = %s\n",
1132 plongest (gdbarch->sp_regnum));
1133 fprintf_unfiltered (file,
1134 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1135 host_address_to_string (gdbarch->stab_reg_to_regnum));
1136 fprintf_unfiltered (file,
1137 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1138 host_address_to_string (gdbarch->stabs_argument_has_addr));
1139 fprintf_unfiltered (file,
1140 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1141 gdbarch_static_transform_name_p (gdbarch));
1142 fprintf_unfiltered (file,
1143 "gdbarch_dump: static_transform_name = <%s>\n",
1144 host_address_to_string (gdbarch->static_transform_name));
1145 fprintf_unfiltered (file,
1146 "gdbarch_dump: target_desc = %s\n",
1147 host_address_to_string (gdbarch->target_desc));
1148 fprintf_unfiltered (file,
1149 "gdbarch_dump: target_signal_from_host = <%s>\n",
1150 host_address_to_string (gdbarch->target_signal_from_host));
1151 fprintf_unfiltered (file,
1152 "gdbarch_dump: target_signal_to_host = <%s>\n",
1153 host_address_to_string (gdbarch->target_signal_to_host));
1154 fprintf_unfiltered (file,
1155 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1156 gdbarch_unwind_pc_p (gdbarch));
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: unwind_pc = <%s>\n",
1159 host_address_to_string (gdbarch->unwind_pc));
1160 fprintf_unfiltered (file,
1161 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1162 gdbarch_unwind_sp_p (gdbarch));
1163 fprintf_unfiltered (file,
1164 "gdbarch_dump: unwind_sp = <%s>\n",
1165 host_address_to_string (gdbarch->unwind_sp));
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: value_from_register = <%s>\n",
1168 host_address_to_string (gdbarch->value_from_register));
1169 fprintf_unfiltered (file,
1170 "gdbarch_dump: value_to_register = <%s>\n",
1171 host_address_to_string (gdbarch->value_to_register));
1172 fprintf_unfiltered (file,
1173 "gdbarch_dump: vbit_in_delta = %s\n",
1174 plongest (gdbarch->vbit_in_delta));
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1177 host_address_to_string (gdbarch->virtual_frame_pointer));
1178 fprintf_unfiltered (file,
1179 "gdbarch_dump: vtable_function_descriptors = %s\n",
1180 plongest (gdbarch->vtable_function_descriptors));
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1183 gdbarch_write_pc_p (gdbarch));
1184 fprintf_unfiltered (file,
1185 "gdbarch_dump: write_pc = <%s>\n",
1186 host_address_to_string (gdbarch->write_pc));
1187 if (gdbarch->dump_tdep != NULL)
1188 gdbarch->dump_tdep (gdbarch, file);
1191 struct gdbarch_tdep *
1192 gdbarch_tdep (struct gdbarch *gdbarch)
1194 if (gdbarch_debug >= 2)
1195 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1196 return gdbarch->tdep;
1200 const struct bfd_arch_info *
1201 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1203 gdb_assert (gdbarch != NULL);
1204 if (gdbarch_debug >= 2)
1205 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1206 return gdbarch->bfd_arch_info;
1210 gdbarch_byte_order (struct gdbarch *gdbarch)
1212 gdb_assert (gdbarch != NULL);
1213 if (gdbarch_debug >= 2)
1214 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1215 return gdbarch->byte_order;
1219 gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
1221 gdb_assert (gdbarch != NULL);
1222 if (gdbarch_debug >= 2)
1223 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
1224 return gdbarch->byte_order_for_code;
1228 gdbarch_osabi (struct gdbarch *gdbarch)
1230 gdb_assert (gdbarch != NULL);
1231 if (gdbarch_debug >= 2)
1232 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1233 return gdbarch->osabi;
1236 const struct target_desc *
1237 gdbarch_target_desc (struct gdbarch *gdbarch)
1239 gdb_assert (gdbarch != NULL);
1240 if (gdbarch_debug >= 2)
1241 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1242 return gdbarch->target_desc;
1246 gdbarch_bits_big_endian (struct gdbarch *gdbarch)
1248 gdb_assert (gdbarch != NULL);
1249 /* Skip verify of bits_big_endian, invalid_p == 0 */
1250 if (gdbarch_debug >= 2)
1251 fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
1252 return gdbarch->bits_big_endian;
1256 set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
1257 int bits_big_endian)
1259 gdbarch->bits_big_endian = bits_big_endian;
1263 gdbarch_short_bit (struct gdbarch *gdbarch)
1265 gdb_assert (gdbarch != NULL);
1266 /* Skip verify of short_bit, invalid_p == 0 */
1267 if (gdbarch_debug >= 2)
1268 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1269 return gdbarch->short_bit;
1273 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1276 gdbarch->short_bit = short_bit;
1280 gdbarch_int_bit (struct gdbarch *gdbarch)
1282 gdb_assert (gdbarch != NULL);
1283 /* Skip verify of int_bit, invalid_p == 0 */
1284 if (gdbarch_debug >= 2)
1285 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1286 return gdbarch->int_bit;
1290 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1293 gdbarch->int_bit = int_bit;
1297 gdbarch_long_bit (struct gdbarch *gdbarch)
1299 gdb_assert (gdbarch != NULL);
1300 /* Skip verify of long_bit, invalid_p == 0 */
1301 if (gdbarch_debug >= 2)
1302 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1303 return gdbarch->long_bit;
1307 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1310 gdbarch->long_bit = long_bit;
1314 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1316 gdb_assert (gdbarch != NULL);
1317 /* Skip verify of long_long_bit, invalid_p == 0 */
1318 if (gdbarch_debug >= 2)
1319 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1320 return gdbarch->long_long_bit;
1324 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1327 gdbarch->long_long_bit = long_long_bit;
1331 gdbarch_float_bit (struct gdbarch *gdbarch)
1333 gdb_assert (gdbarch != NULL);
1334 /* Skip verify of float_bit, invalid_p == 0 */
1335 if (gdbarch_debug >= 2)
1336 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1337 return gdbarch->float_bit;
1341 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1344 gdbarch->float_bit = float_bit;
1347 const struct floatformat **
1348 gdbarch_float_format (struct gdbarch *gdbarch)
1350 gdb_assert (gdbarch != NULL);
1351 if (gdbarch_debug >= 2)
1352 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1353 return gdbarch->float_format;
1357 set_gdbarch_float_format (struct gdbarch *gdbarch,
1358 const struct floatformat ** float_format)
1360 gdbarch->float_format = float_format;
1364 gdbarch_double_bit (struct gdbarch *gdbarch)
1366 gdb_assert (gdbarch != NULL);
1367 /* Skip verify of double_bit, invalid_p == 0 */
1368 if (gdbarch_debug >= 2)
1369 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1370 return gdbarch->double_bit;
1374 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1377 gdbarch->double_bit = double_bit;
1380 const struct floatformat **
1381 gdbarch_double_format (struct gdbarch *gdbarch)
1383 gdb_assert (gdbarch != NULL);
1384 if (gdbarch_debug >= 2)
1385 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1386 return gdbarch->double_format;
1390 set_gdbarch_double_format (struct gdbarch *gdbarch,
1391 const struct floatformat ** double_format)
1393 gdbarch->double_format = double_format;
1397 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1399 gdb_assert (gdbarch != NULL);
1400 /* Skip verify of long_double_bit, invalid_p == 0 */
1401 if (gdbarch_debug >= 2)
1402 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1403 return gdbarch->long_double_bit;
1407 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1408 int long_double_bit)
1410 gdbarch->long_double_bit = long_double_bit;
1413 const struct floatformat **
1414 gdbarch_long_double_format (struct gdbarch *gdbarch)
1416 gdb_assert (gdbarch != NULL);
1417 if (gdbarch_debug >= 2)
1418 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1419 return gdbarch->long_double_format;
1423 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1424 const struct floatformat ** long_double_format)
1426 gdbarch->long_double_format = long_double_format;
1430 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1432 gdb_assert (gdbarch != NULL);
1433 /* Skip verify of ptr_bit, invalid_p == 0 */
1434 if (gdbarch_debug >= 2)
1435 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1436 return gdbarch->ptr_bit;
1440 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1443 gdbarch->ptr_bit = ptr_bit;
1447 gdbarch_addr_bit (struct gdbarch *gdbarch)
1449 gdb_assert (gdbarch != NULL);
1450 /* Check variable changed from pre-default. */
1451 gdb_assert (gdbarch->addr_bit != 0);
1452 if (gdbarch_debug >= 2)
1453 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1454 return gdbarch->addr_bit;
1458 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1461 gdbarch->addr_bit = addr_bit;
1465 gdbarch_char_signed (struct gdbarch *gdbarch)
1467 gdb_assert (gdbarch != NULL);
1468 /* Check variable changed from pre-default. */
1469 gdb_assert (gdbarch->char_signed != -1);
1470 if (gdbarch_debug >= 2)
1471 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1472 return gdbarch->char_signed;
1476 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1479 gdbarch->char_signed = char_signed;
1483 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1485 gdb_assert (gdbarch != NULL);
1486 return gdbarch->read_pc != NULL;
1490 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1492 gdb_assert (gdbarch != NULL);
1493 gdb_assert (gdbarch->read_pc != NULL);
1494 if (gdbarch_debug >= 2)
1495 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1496 return gdbarch->read_pc (regcache);
1500 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1501 gdbarch_read_pc_ftype read_pc)
1503 gdbarch->read_pc = read_pc;
1507 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1509 gdb_assert (gdbarch != NULL);
1510 return gdbarch->write_pc != NULL;
1514 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1516 gdb_assert (gdbarch != NULL);
1517 gdb_assert (gdbarch->write_pc != NULL);
1518 if (gdbarch_debug >= 2)
1519 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1520 gdbarch->write_pc (regcache, val);
1524 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1525 gdbarch_write_pc_ftype write_pc)
1527 gdbarch->write_pc = write_pc;
1531 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1533 gdb_assert (gdbarch != NULL);
1534 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1535 if (gdbarch_debug >= 2)
1536 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1537 gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
1541 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1542 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1544 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1548 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1550 gdb_assert (gdbarch != NULL);
1551 return gdbarch->pseudo_register_read != NULL;
1555 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1557 gdb_assert (gdbarch != NULL);
1558 gdb_assert (gdbarch->pseudo_register_read != NULL);
1559 if (gdbarch_debug >= 2)
1560 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1561 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1565 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1566 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1568 gdbarch->pseudo_register_read = pseudo_register_read;
1572 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1574 gdb_assert (gdbarch != NULL);
1575 return gdbarch->pseudo_register_write != NULL;
1579 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1581 gdb_assert (gdbarch != NULL);
1582 gdb_assert (gdbarch->pseudo_register_write != NULL);
1583 if (gdbarch_debug >= 2)
1584 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1585 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1589 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1590 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1592 gdbarch->pseudo_register_write = pseudo_register_write;
1596 gdbarch_num_regs (struct gdbarch *gdbarch)
1598 gdb_assert (gdbarch != NULL);
1599 /* Check variable changed from pre-default. */
1600 gdb_assert (gdbarch->num_regs != -1);
1601 if (gdbarch_debug >= 2)
1602 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1603 return gdbarch->num_regs;
1607 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1610 gdbarch->num_regs = num_regs;
1614 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1616 gdb_assert (gdbarch != NULL);
1617 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1618 if (gdbarch_debug >= 2)
1619 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1620 return gdbarch->num_pseudo_regs;
1624 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1625 int num_pseudo_regs)
1627 gdbarch->num_pseudo_regs = num_pseudo_regs;
1631 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1633 gdb_assert (gdbarch != NULL);
1634 /* Skip verify of sp_regnum, invalid_p == 0 */
1635 if (gdbarch_debug >= 2)
1636 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1637 return gdbarch->sp_regnum;
1641 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1644 gdbarch->sp_regnum = sp_regnum;
1648 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1650 gdb_assert (gdbarch != NULL);
1651 /* Skip verify of pc_regnum, invalid_p == 0 */
1652 if (gdbarch_debug >= 2)
1653 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1654 return gdbarch->pc_regnum;
1658 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1661 gdbarch->pc_regnum = pc_regnum;
1665 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1667 gdb_assert (gdbarch != NULL);
1668 /* Skip verify of ps_regnum, invalid_p == 0 */
1669 if (gdbarch_debug >= 2)
1670 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1671 return gdbarch->ps_regnum;
1675 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1678 gdbarch->ps_regnum = ps_regnum;
1682 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1684 gdb_assert (gdbarch != NULL);
1685 /* Skip verify of fp0_regnum, invalid_p == 0 */
1686 if (gdbarch_debug >= 2)
1687 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1688 return gdbarch->fp0_regnum;
1692 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1695 gdbarch->fp0_regnum = fp0_regnum;
1699 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1701 gdb_assert (gdbarch != NULL);
1702 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1703 if (gdbarch_debug >= 2)
1704 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1705 return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
1709 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1710 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1712 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1716 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1718 gdb_assert (gdbarch != NULL);
1719 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1720 if (gdbarch_debug >= 2)
1721 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1722 return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
1726 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1727 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1729 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1733 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1735 gdb_assert (gdbarch != NULL);
1736 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1737 if (gdbarch_debug >= 2)
1738 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1739 return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
1743 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1744 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1746 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1750 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1752 gdb_assert (gdbarch != NULL);
1753 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1754 if (gdbarch_debug >= 2)
1755 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1756 return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
1760 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1761 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1763 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1767 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1769 gdb_assert (gdbarch != NULL);
1770 gdb_assert (gdbarch->register_name != NULL);
1771 if (gdbarch_debug >= 2)
1772 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1773 return gdbarch->register_name (gdbarch, regnr);
1777 set_gdbarch_register_name (struct gdbarch *gdbarch,
1778 gdbarch_register_name_ftype register_name)
1780 gdbarch->register_name = register_name;
1784 gdbarch_register_type_p (struct gdbarch *gdbarch)
1786 gdb_assert (gdbarch != NULL);
1787 return gdbarch->register_type != NULL;
1791 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1793 gdb_assert (gdbarch != NULL);
1794 gdb_assert (gdbarch->register_type != NULL);
1795 if (gdbarch_debug >= 2)
1796 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1797 return gdbarch->register_type (gdbarch, reg_nr);
1801 set_gdbarch_register_type (struct gdbarch *gdbarch,
1802 gdbarch_register_type_ftype register_type)
1804 gdbarch->register_type = register_type;
1808 gdbarch_dummy_id_p (struct gdbarch *gdbarch)
1810 gdb_assert (gdbarch != NULL);
1811 return gdbarch->dummy_id != NULL;
1815 gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
1817 gdb_assert (gdbarch != NULL);
1818 gdb_assert (gdbarch->dummy_id != NULL);
1819 if (gdbarch_debug >= 2)
1820 fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
1821 return gdbarch->dummy_id (gdbarch, this_frame);
1825 set_gdbarch_dummy_id (struct gdbarch *gdbarch,
1826 gdbarch_dummy_id_ftype dummy_id)
1828 gdbarch->dummy_id = dummy_id;
1832 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1834 gdb_assert (gdbarch != NULL);
1835 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1836 if (gdbarch_debug >= 2)
1837 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1838 return gdbarch->deprecated_fp_regnum;
1842 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1843 int deprecated_fp_regnum)
1845 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1849 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1851 gdb_assert (gdbarch != NULL);
1852 return gdbarch->push_dummy_call != NULL;
1856 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)
1858 gdb_assert (gdbarch != NULL);
1859 gdb_assert (gdbarch->push_dummy_call != NULL);
1860 if (gdbarch_debug >= 2)
1861 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1862 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1866 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1867 gdbarch_push_dummy_call_ftype push_dummy_call)
1869 gdbarch->push_dummy_call = push_dummy_call;
1873 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1875 gdb_assert (gdbarch != NULL);
1876 /* Skip verify of call_dummy_location, invalid_p == 0 */
1877 if (gdbarch_debug >= 2)
1878 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1879 return gdbarch->call_dummy_location;
1883 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1884 int call_dummy_location)
1886 gdbarch->call_dummy_location = call_dummy_location;
1890 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1892 gdb_assert (gdbarch != NULL);
1893 return gdbarch->push_dummy_code != NULL;
1897 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)
1899 gdb_assert (gdbarch != NULL);
1900 gdb_assert (gdbarch->push_dummy_code != NULL);
1901 if (gdbarch_debug >= 2)
1902 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1903 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
1907 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1908 gdbarch_push_dummy_code_ftype push_dummy_code)
1910 gdbarch->push_dummy_code = push_dummy_code;
1914 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1916 gdb_assert (gdbarch != NULL);
1917 gdb_assert (gdbarch->print_registers_info != NULL);
1918 if (gdbarch_debug >= 2)
1919 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1920 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1924 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1925 gdbarch_print_registers_info_ftype print_registers_info)
1927 gdbarch->print_registers_info = print_registers_info;
1931 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1933 gdb_assert (gdbarch != NULL);
1934 return gdbarch->print_float_info != NULL;
1938 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1940 gdb_assert (gdbarch != NULL);
1941 gdb_assert (gdbarch->print_float_info != NULL);
1942 if (gdbarch_debug >= 2)
1943 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1944 gdbarch->print_float_info (gdbarch, file, frame, args);
1948 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1949 gdbarch_print_float_info_ftype print_float_info)
1951 gdbarch->print_float_info = print_float_info;
1955 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1957 gdb_assert (gdbarch != NULL);
1958 return gdbarch->print_vector_info != NULL;
1962 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1964 gdb_assert (gdbarch != NULL);
1965 gdb_assert (gdbarch->print_vector_info != NULL);
1966 if (gdbarch_debug >= 2)
1967 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1968 gdbarch->print_vector_info (gdbarch, file, frame, args);
1972 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1973 gdbarch_print_vector_info_ftype print_vector_info)
1975 gdbarch->print_vector_info = print_vector_info;
1979 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1981 gdb_assert (gdbarch != NULL);
1982 gdb_assert (gdbarch->register_sim_regno != NULL);
1983 if (gdbarch_debug >= 2)
1984 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1985 return gdbarch->register_sim_regno (gdbarch, reg_nr);
1989 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1990 gdbarch_register_sim_regno_ftype register_sim_regno)
1992 gdbarch->register_sim_regno = register_sim_regno;
1996 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1998 gdb_assert (gdbarch != NULL);
1999 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2000 if (gdbarch_debug >= 2)
2001 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2002 return gdbarch->cannot_fetch_register (gdbarch, regnum);
2006 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2007 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2009 gdbarch->cannot_fetch_register = cannot_fetch_register;
2013 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2015 gdb_assert (gdbarch != NULL);
2016 gdb_assert (gdbarch->cannot_store_register != NULL);
2017 if (gdbarch_debug >= 2)
2018 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2019 return gdbarch->cannot_store_register (gdbarch, regnum);
2023 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2024 gdbarch_cannot_store_register_ftype cannot_store_register)
2026 gdbarch->cannot_store_register = cannot_store_register;
2030 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2032 gdb_assert (gdbarch != NULL);
2033 return gdbarch->get_longjmp_target != NULL;
2037 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
2039 gdb_assert (gdbarch != NULL);
2040 gdb_assert (gdbarch->get_longjmp_target != NULL);
2041 if (gdbarch_debug >= 2)
2042 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2043 return gdbarch->get_longjmp_target (frame, pc);
2047 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2048 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2050 gdbarch->get_longjmp_target = get_longjmp_target;
2054 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2056 gdb_assert (gdbarch != NULL);
2057 if (gdbarch_debug >= 2)
2058 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2059 return gdbarch->believe_pcc_promotion;
2063 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2064 int believe_pcc_promotion)
2066 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2070 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2072 gdb_assert (gdbarch != NULL);
2073 gdb_assert (gdbarch->convert_register_p != NULL);
2074 if (gdbarch_debug >= 2)
2075 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2076 return gdbarch->convert_register_p (gdbarch, regnum, type);
2080 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2081 gdbarch_convert_register_p_ftype convert_register_p)
2083 gdbarch->convert_register_p = convert_register_p;
2087 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2089 gdb_assert (gdbarch != NULL);
2090 gdb_assert (gdbarch->register_to_value != NULL);
2091 if (gdbarch_debug >= 2)
2092 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2093 gdbarch->register_to_value (frame, regnum, type, buf);
2097 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2098 gdbarch_register_to_value_ftype register_to_value)
2100 gdbarch->register_to_value = register_to_value;
2104 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2106 gdb_assert (gdbarch != NULL);
2107 gdb_assert (gdbarch->value_to_register != NULL);
2108 if (gdbarch_debug >= 2)
2109 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2110 gdbarch->value_to_register (frame, regnum, type, buf);
2114 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2115 gdbarch_value_to_register_ftype value_to_register)
2117 gdbarch->value_to_register = value_to_register;
2121 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2123 gdb_assert (gdbarch != NULL);
2124 gdb_assert (gdbarch->value_from_register != NULL);
2125 if (gdbarch_debug >= 2)
2126 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2127 return gdbarch->value_from_register (type, regnum, frame);
2131 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2132 gdbarch_value_from_register_ftype value_from_register)
2134 gdbarch->value_from_register = value_from_register;
2138 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2140 gdb_assert (gdbarch != NULL);
2141 gdb_assert (gdbarch->pointer_to_address != NULL);
2142 if (gdbarch_debug >= 2)
2143 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2144 return gdbarch->pointer_to_address (gdbarch, type, buf);
2148 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2149 gdbarch_pointer_to_address_ftype pointer_to_address)
2151 gdbarch->pointer_to_address = pointer_to_address;
2155 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2157 gdb_assert (gdbarch != NULL);
2158 gdb_assert (gdbarch->address_to_pointer != NULL);
2159 if (gdbarch_debug >= 2)
2160 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2161 gdbarch->address_to_pointer (gdbarch, type, buf, addr);
2165 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2166 gdbarch_address_to_pointer_ftype address_to_pointer)
2168 gdbarch->address_to_pointer = address_to_pointer;
2172 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2174 gdb_assert (gdbarch != NULL);
2175 return gdbarch->integer_to_address != NULL;
2179 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2181 gdb_assert (gdbarch != NULL);
2182 gdb_assert (gdbarch->integer_to_address != NULL);
2183 if (gdbarch_debug >= 2)
2184 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2185 return gdbarch->integer_to_address (gdbarch, type, buf);
2189 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2190 gdbarch_integer_to_address_ftype integer_to_address)
2192 gdbarch->integer_to_address = integer_to_address;
2196 gdbarch_return_value_p (struct gdbarch *gdbarch)
2198 gdb_assert (gdbarch != NULL);
2199 return gdbarch->return_value != NULL;
2202 enum return_value_convention
2203 gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2205 gdb_assert (gdbarch != NULL);
2206 gdb_assert (gdbarch->return_value != NULL);
2207 if (gdbarch_debug >= 2)
2208 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2209 return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
2213 set_gdbarch_return_value (struct gdbarch *gdbarch,
2214 gdbarch_return_value_ftype return_value)
2216 gdbarch->return_value = return_value;
2220 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2222 gdb_assert (gdbarch != NULL);
2223 gdb_assert (gdbarch->skip_prologue != NULL);
2224 if (gdbarch_debug >= 2)
2225 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2226 return gdbarch->skip_prologue (gdbarch, ip);
2230 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2231 gdbarch_skip_prologue_ftype skip_prologue)
2233 gdbarch->skip_prologue = skip_prologue;
2237 gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
2239 gdb_assert (gdbarch != NULL);
2240 return gdbarch->skip_main_prologue != NULL;
2244 gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2246 gdb_assert (gdbarch != NULL);
2247 gdb_assert (gdbarch->skip_main_prologue != NULL);
2248 if (gdbarch_debug >= 2)
2249 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
2250 return gdbarch->skip_main_prologue (gdbarch, ip);
2254 set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
2255 gdbarch_skip_main_prologue_ftype skip_main_prologue)
2257 gdbarch->skip_main_prologue = skip_main_prologue;
2261 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2263 gdb_assert (gdbarch != NULL);
2264 gdb_assert (gdbarch->inner_than != NULL);
2265 if (gdbarch_debug >= 2)
2266 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2267 return gdbarch->inner_than (lhs, rhs);
2271 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2272 gdbarch_inner_than_ftype inner_than)
2274 gdbarch->inner_than = inner_than;
2278 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2280 gdb_assert (gdbarch != NULL);
2281 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2282 if (gdbarch_debug >= 2)
2283 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2284 return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
2288 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2289 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2291 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2295 gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
2297 gdb_assert (gdbarch != NULL);
2298 gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
2299 if (gdbarch_debug >= 2)
2300 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
2301 gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
2305 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
2306 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
2308 gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
2312 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2314 gdb_assert (gdbarch != NULL);
2315 return gdbarch->adjust_breakpoint_address != NULL;
2319 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2321 gdb_assert (gdbarch != NULL);
2322 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2323 if (gdbarch_debug >= 2)
2324 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2325 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2329 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2330 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2332 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2336 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2338 gdb_assert (gdbarch != NULL);
2339 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2340 if (gdbarch_debug >= 2)
2341 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2342 return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
2346 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2347 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2349 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2353 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2355 gdb_assert (gdbarch != NULL);
2356 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2357 if (gdbarch_debug >= 2)
2358 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2359 return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
2363 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2364 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2366 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2370 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2372 gdb_assert (gdbarch != NULL);
2373 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2374 if (gdbarch_debug >= 2)
2375 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2376 return gdbarch->decr_pc_after_break;
2380 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2381 CORE_ADDR decr_pc_after_break)
2383 gdbarch->decr_pc_after_break = decr_pc_after_break;
2387 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2389 gdb_assert (gdbarch != NULL);
2390 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2391 if (gdbarch_debug >= 2)
2392 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2393 return gdbarch->deprecated_function_start_offset;
2397 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2398 CORE_ADDR deprecated_function_start_offset)
2400 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2404 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2406 gdb_assert (gdbarch != NULL);
2407 gdb_assert (gdbarch->remote_register_number != NULL);
2408 if (gdbarch_debug >= 2)
2409 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2410 return gdbarch->remote_register_number (gdbarch, regno);
2414 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2415 gdbarch_remote_register_number_ftype remote_register_number)
2417 gdbarch->remote_register_number = remote_register_number;
2421 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2423 gdb_assert (gdbarch != NULL);
2424 return gdbarch->fetch_tls_load_module_address != NULL;
2428 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2430 gdb_assert (gdbarch != NULL);
2431 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2432 if (gdbarch_debug >= 2)
2433 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2434 return gdbarch->fetch_tls_load_module_address (objfile);
2438 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2439 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2441 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2445 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2447 gdb_assert (gdbarch != NULL);
2448 /* Skip verify of frame_args_skip, invalid_p == 0 */
2449 if (gdbarch_debug >= 2)
2450 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2451 return gdbarch->frame_args_skip;
2455 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2456 CORE_ADDR frame_args_skip)
2458 gdbarch->frame_args_skip = frame_args_skip;
2462 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2464 gdb_assert (gdbarch != NULL);
2465 return gdbarch->unwind_pc != NULL;
2469 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2471 gdb_assert (gdbarch != NULL);
2472 gdb_assert (gdbarch->unwind_pc != NULL);
2473 if (gdbarch_debug >= 2)
2474 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2475 return gdbarch->unwind_pc (gdbarch, next_frame);
2479 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2480 gdbarch_unwind_pc_ftype unwind_pc)
2482 gdbarch->unwind_pc = unwind_pc;
2486 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2488 gdb_assert (gdbarch != NULL);
2489 return gdbarch->unwind_sp != NULL;
2493 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2495 gdb_assert (gdbarch != NULL);
2496 gdb_assert (gdbarch->unwind_sp != NULL);
2497 if (gdbarch_debug >= 2)
2498 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2499 return gdbarch->unwind_sp (gdbarch, next_frame);
2503 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2504 gdbarch_unwind_sp_ftype unwind_sp)
2506 gdbarch->unwind_sp = unwind_sp;
2510 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2512 gdb_assert (gdbarch != NULL);
2513 return gdbarch->frame_num_args != NULL;
2517 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2519 gdb_assert (gdbarch != NULL);
2520 gdb_assert (gdbarch->frame_num_args != NULL);
2521 if (gdbarch_debug >= 2)
2522 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2523 return gdbarch->frame_num_args (frame);
2527 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2528 gdbarch_frame_num_args_ftype frame_num_args)
2530 gdbarch->frame_num_args = frame_num_args;
2534 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2536 gdb_assert (gdbarch != NULL);
2537 return gdbarch->frame_align != NULL;
2541 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2543 gdb_assert (gdbarch != NULL);
2544 gdb_assert (gdbarch->frame_align != NULL);
2545 if (gdbarch_debug >= 2)
2546 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2547 return gdbarch->frame_align (gdbarch, address);
2551 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2552 gdbarch_frame_align_ftype frame_align)
2554 gdbarch->frame_align = frame_align;
2558 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2560 gdb_assert (gdbarch != NULL);
2561 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2562 if (gdbarch_debug >= 2)
2563 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2564 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2568 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2569 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2571 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2575 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2577 gdb_assert (gdbarch != NULL);
2578 if (gdbarch_debug >= 2)
2579 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2580 return gdbarch->frame_red_zone_size;
2584 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2585 int frame_red_zone_size)
2587 gdbarch->frame_red_zone_size = frame_red_zone_size;
2591 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2593 gdb_assert (gdbarch != NULL);
2594 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2595 if (gdbarch_debug >= 2)
2596 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2597 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2601 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2602 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2604 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2608 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2610 gdb_assert (gdbarch != NULL);
2611 gdb_assert (gdbarch->addr_bits_remove != NULL);
2612 if (gdbarch_debug >= 2)
2613 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2614 return gdbarch->addr_bits_remove (gdbarch, addr);
2618 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2619 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2621 gdbarch->addr_bits_remove = addr_bits_remove;
2625 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2627 gdb_assert (gdbarch != NULL);
2628 gdb_assert (gdbarch->smash_text_address != NULL);
2629 if (gdbarch_debug >= 2)
2630 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2631 return gdbarch->smash_text_address (gdbarch, addr);
2635 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2636 gdbarch_smash_text_address_ftype smash_text_address)
2638 gdbarch->smash_text_address = smash_text_address;
2642 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2644 gdb_assert (gdbarch != NULL);
2645 return gdbarch->software_single_step != NULL;
2649 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2651 gdb_assert (gdbarch != NULL);
2652 gdb_assert (gdbarch->software_single_step != NULL);
2653 if (gdbarch_debug >= 2)
2654 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2655 return gdbarch->software_single_step (frame);
2659 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2660 gdbarch_software_single_step_ftype software_single_step)
2662 gdbarch->software_single_step = software_single_step;
2666 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2668 gdb_assert (gdbarch != NULL);
2669 return gdbarch->single_step_through_delay != NULL;
2673 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2675 gdb_assert (gdbarch != NULL);
2676 gdb_assert (gdbarch->single_step_through_delay != NULL);
2677 if (gdbarch_debug >= 2)
2678 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2679 return gdbarch->single_step_through_delay (gdbarch, frame);
2683 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2684 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2686 gdbarch->single_step_through_delay = single_step_through_delay;
2690 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2692 gdb_assert (gdbarch != NULL);
2693 gdb_assert (gdbarch->print_insn != NULL);
2694 if (gdbarch_debug >= 2)
2695 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2696 return gdbarch->print_insn (vma, info);
2700 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2701 gdbarch_print_insn_ftype print_insn)
2703 gdbarch->print_insn = print_insn;
2707 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2709 gdb_assert (gdbarch != NULL);
2710 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2711 if (gdbarch_debug >= 2)
2712 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2713 return gdbarch->skip_trampoline_code (frame, pc);
2717 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2718 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2720 gdbarch->skip_trampoline_code = skip_trampoline_code;
2724 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2726 gdb_assert (gdbarch != NULL);
2727 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2728 if (gdbarch_debug >= 2)
2729 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2730 return gdbarch->skip_solib_resolver (gdbarch, pc);
2734 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2735 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2737 gdbarch->skip_solib_resolver = skip_solib_resolver;
2741 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2743 gdb_assert (gdbarch != NULL);
2744 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2745 if (gdbarch_debug >= 2)
2746 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2747 return gdbarch->in_solib_return_trampoline (gdbarch, pc, name);
2751 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2752 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2754 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2758 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2760 gdb_assert (gdbarch != NULL);
2761 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2762 if (gdbarch_debug >= 2)
2763 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2764 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2768 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2769 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2771 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2775 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2777 gdb_assert (gdbarch != NULL);
2778 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2779 if (gdbarch_debug >= 2)
2780 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2781 gdbarch->elf_make_msymbol_special (sym, msym);
2785 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2786 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2788 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2792 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2794 gdb_assert (gdbarch != NULL);
2795 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2796 if (gdbarch_debug >= 2)
2797 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2798 gdbarch->coff_make_msymbol_special (val, msym);
2802 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2803 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2805 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2809 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2811 gdb_assert (gdbarch != NULL);
2812 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2813 if (gdbarch_debug >= 2)
2814 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2815 return gdbarch->cannot_step_breakpoint;
2819 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2820 int cannot_step_breakpoint)
2822 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2826 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2828 gdb_assert (gdbarch != NULL);
2829 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2830 if (gdbarch_debug >= 2)
2831 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2832 return gdbarch->have_nonsteppable_watchpoint;
2836 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2837 int have_nonsteppable_watchpoint)
2839 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2843 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2845 gdb_assert (gdbarch != NULL);
2846 return gdbarch->address_class_type_flags != NULL;
2850 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2852 gdb_assert (gdbarch != NULL);
2853 gdb_assert (gdbarch->address_class_type_flags != NULL);
2854 if (gdbarch_debug >= 2)
2855 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2856 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2860 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2861 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2863 gdbarch->address_class_type_flags = address_class_type_flags;
2867 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2869 gdb_assert (gdbarch != NULL);
2870 return gdbarch->address_class_type_flags_to_name != NULL;
2874 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2876 gdb_assert (gdbarch != NULL);
2877 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2878 if (gdbarch_debug >= 2)
2879 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2880 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2884 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2885 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2887 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2891 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2893 gdb_assert (gdbarch != NULL);
2894 return gdbarch->address_class_name_to_type_flags != NULL;
2898 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2900 gdb_assert (gdbarch != NULL);
2901 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2902 if (gdbarch_debug >= 2)
2903 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2904 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2908 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2909 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2911 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2915 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2917 gdb_assert (gdbarch != NULL);
2918 gdb_assert (gdbarch->register_reggroup_p != NULL);
2919 if (gdbarch_debug >= 2)
2920 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2921 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2925 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2926 gdbarch_register_reggroup_p_ftype register_reggroup_p)
2928 gdbarch->register_reggroup_p = register_reggroup_p;
2932 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
2934 gdb_assert (gdbarch != NULL);
2935 return gdbarch->fetch_pointer_argument != NULL;
2939 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
2941 gdb_assert (gdbarch != NULL);
2942 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
2943 if (gdbarch_debug >= 2)
2944 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
2945 return gdbarch->fetch_pointer_argument (frame, argi, type);
2949 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
2950 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
2952 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
2956 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
2958 gdb_assert (gdbarch != NULL);
2959 return gdbarch->regset_from_core_section != NULL;
2962 const struct regset *
2963 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
2965 gdb_assert (gdbarch != NULL);
2966 gdb_assert (gdbarch->regset_from_core_section != NULL);
2967 if (gdbarch_debug >= 2)
2968 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
2969 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
2973 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
2974 gdbarch_regset_from_core_section_ftype regset_from_core_section)
2976 gdbarch->regset_from_core_section = regset_from_core_section;
2980 gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch)
2982 gdb_assert (gdbarch != NULL);
2983 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
2984 if (gdbarch_debug >= 2)
2985 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_reg_section_encodes_pid called\n");
2986 return gdbarch->core_reg_section_encodes_pid;
2990 set_gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch,
2991 int core_reg_section_encodes_pid)
2993 gdbarch->core_reg_section_encodes_pid = core_reg_section_encodes_pid;
2996 struct core_regset_section *
2997 gdbarch_core_regset_sections (struct gdbarch *gdbarch)
2999 gdb_assert (gdbarch != NULL);
3000 if (gdbarch_debug >= 2)
3001 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
3002 return gdbarch->core_regset_sections;
3006 set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
3007 struct core_regset_section * core_regset_sections)
3009 gdbarch->core_regset_sections = core_regset_sections;
3013 gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
3015 gdb_assert (gdbarch != NULL);
3016 return gdbarch->core_xfer_shared_libraries != NULL;
3020 gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
3022 gdb_assert (gdbarch != NULL);
3023 gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
3024 if (gdbarch_debug >= 2)
3025 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
3026 return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
3030 set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
3031 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
3033 gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
3037 gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch)
3039 gdb_assert (gdbarch != NULL);
3040 return gdbarch->core_pid_to_str != NULL;
3044 gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
3046 gdb_assert (gdbarch != NULL);
3047 gdb_assert (gdbarch->core_pid_to_str != NULL);
3048 if (gdbarch_debug >= 2)
3049 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_pid_to_str called\n");
3050 return gdbarch->core_pid_to_str (gdbarch, ptid);
3054 set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch,
3055 gdbarch_core_pid_to_str_ftype core_pid_to_str)
3057 gdbarch->core_pid_to_str = core_pid_to_str;
3061 gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
3063 gdb_assert (gdbarch != NULL);
3064 return gdbarch->gcore_bfd_target != 0;
3068 gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
3070 gdb_assert (gdbarch != NULL);
3071 /* Check variable changed from pre-default. */
3072 gdb_assert (gdbarch->gcore_bfd_target != 0);
3073 if (gdbarch_debug >= 2)
3074 fprintf_unfiltered (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
3075 return gdbarch->gcore_bfd_target;
3079 set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch,
3080 const char * gcore_bfd_target)
3082 gdbarch->gcore_bfd_target = gcore_bfd_target;
3086 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3088 gdb_assert (gdbarch != NULL);
3089 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3090 if (gdbarch_debug >= 2)
3091 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3092 return gdbarch->vtable_function_descriptors;
3096 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3097 int vtable_function_descriptors)
3099 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3103 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3105 gdb_assert (gdbarch != NULL);
3106 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3107 if (gdbarch_debug >= 2)
3108 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3109 return gdbarch->vbit_in_delta;
3113 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3116 gdbarch->vbit_in_delta = vbit_in_delta;
3120 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3122 gdb_assert (gdbarch != NULL);
3123 return gdbarch->skip_permanent_breakpoint != NULL;
3127 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3129 gdb_assert (gdbarch != NULL);
3130 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3131 if (gdbarch_debug >= 2)
3132 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3133 gdbarch->skip_permanent_breakpoint (regcache);
3137 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3138 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3140 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3144 gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
3146 gdb_assert (gdbarch != NULL);
3147 return gdbarch->max_insn_length != 0;
3151 gdbarch_max_insn_length (struct gdbarch *gdbarch)
3153 gdb_assert (gdbarch != NULL);
3154 /* Check variable changed from pre-default. */
3155 gdb_assert (gdbarch->max_insn_length != 0);
3156 if (gdbarch_debug >= 2)
3157 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
3158 return gdbarch->max_insn_length;
3162 set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
3163 ULONGEST max_insn_length)
3165 gdbarch->max_insn_length = max_insn_length;
3169 gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
3171 gdb_assert (gdbarch != NULL);
3172 return gdbarch->displaced_step_copy_insn != NULL;
3175 struct displaced_step_closure *
3176 gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3178 gdb_assert (gdbarch != NULL);
3179 gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
3180 if (gdbarch_debug >= 2)
3181 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
3182 return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
3186 set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
3187 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
3189 gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
3193 gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3195 gdb_assert (gdbarch != NULL);
3196 gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
3197 if (gdbarch_debug >= 2)
3198 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n");
3199 return gdbarch->displaced_step_hw_singlestep (gdbarch, closure);
3203 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
3204 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep)
3206 gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep;
3210 gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
3212 gdb_assert (gdbarch != NULL);
3213 return gdbarch->displaced_step_fixup != NULL;
3217 gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3219 gdb_assert (gdbarch != NULL);
3220 gdb_assert (gdbarch->displaced_step_fixup != NULL);
3221 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3222 if (gdbarch_debug >= 2)
3223 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
3224 gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
3228 set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
3229 gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
3231 gdbarch->displaced_step_fixup = displaced_step_fixup;
3235 gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3237 gdb_assert (gdbarch != NULL);
3238 gdb_assert (gdbarch->displaced_step_free_closure != NULL);
3239 if (gdbarch_debug >= 2)
3240 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
3241 gdbarch->displaced_step_free_closure (gdbarch, closure);
3245 set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
3246 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
3248 gdbarch->displaced_step_free_closure = displaced_step_free_closure;
3252 gdbarch_displaced_step_location (struct gdbarch *gdbarch)
3254 gdb_assert (gdbarch != NULL);
3255 gdb_assert (gdbarch->displaced_step_location != NULL);
3256 if (gdbarch_debug >= 2)
3257 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
3258 return gdbarch->displaced_step_location (gdbarch);
3262 set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
3263 gdbarch_displaced_step_location_ftype displaced_step_location)
3265 gdbarch->displaced_step_location = displaced_step_location;
3269 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3271 gdb_assert (gdbarch != NULL);
3272 return gdbarch->overlay_update != NULL;
3276 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3278 gdb_assert (gdbarch != NULL);
3279 gdb_assert (gdbarch->overlay_update != NULL);
3280 if (gdbarch_debug >= 2)
3281 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3282 gdbarch->overlay_update (osect);
3286 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3287 gdbarch_overlay_update_ftype overlay_update)
3289 gdbarch->overlay_update = overlay_update;
3293 gdbarch_core_read_description_p (struct gdbarch *gdbarch)
3295 gdb_assert (gdbarch != NULL);
3296 return gdbarch->core_read_description != NULL;
3299 const struct target_desc *
3300 gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
3302 gdb_assert (gdbarch != NULL);
3303 gdb_assert (gdbarch->core_read_description != NULL);
3304 if (gdbarch_debug >= 2)
3305 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
3306 return gdbarch->core_read_description (gdbarch, target, abfd);
3310 set_gdbarch_core_read_description (struct gdbarch *gdbarch,
3311 gdbarch_core_read_description_ftype core_read_description)
3313 gdbarch->core_read_description = core_read_description;
3317 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
3319 gdb_assert (gdbarch != NULL);
3320 return gdbarch->static_transform_name != NULL;
3324 gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name)
3326 gdb_assert (gdbarch != NULL);
3327 gdb_assert (gdbarch->static_transform_name != NULL);
3328 if (gdbarch_debug >= 2)
3329 fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
3330 return gdbarch->static_transform_name (name);
3334 set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
3335 gdbarch_static_transform_name_ftype static_transform_name)
3337 gdbarch->static_transform_name = static_transform_name;
3341 gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
3343 gdb_assert (gdbarch != NULL);
3344 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3345 if (gdbarch_debug >= 2)
3346 fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
3347 return gdbarch->sofun_address_maybe_missing;
3351 set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
3352 int sofun_address_maybe_missing)
3354 gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
3358 gdbarch_process_record_p (struct gdbarch *gdbarch)
3360 gdb_assert (gdbarch != NULL);
3361 return gdbarch->process_record != NULL;
3365 gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
3367 gdb_assert (gdbarch != NULL);
3368 gdb_assert (gdbarch->process_record != NULL);
3369 if (gdbarch_debug >= 2)
3370 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
3371 return gdbarch->process_record (gdbarch, regcache, addr);
3375 set_gdbarch_process_record (struct gdbarch *gdbarch,
3376 gdbarch_process_record_ftype process_record)
3378 gdbarch->process_record = process_record;
3382 gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
3384 gdb_assert (gdbarch != NULL);
3385 return gdbarch->process_record_signal != NULL;
3389 gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal)
3391 gdb_assert (gdbarch != NULL);
3392 gdb_assert (gdbarch->process_record_signal != NULL);
3393 if (gdbarch_debug >= 2)
3394 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n");
3395 return gdbarch->process_record_signal (gdbarch, regcache, signal);
3399 set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
3400 gdbarch_process_record_signal_ftype process_record_signal)
3402 gdbarch->process_record_signal = process_record_signal;
3406 gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
3408 gdb_assert (gdbarch != NULL);
3409 gdb_assert (gdbarch->target_signal_from_host != NULL);
3410 if (gdbarch_debug >= 2)
3411 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n");
3412 return gdbarch->target_signal_from_host (gdbarch, signo);
3416 set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
3417 gdbarch_target_signal_from_host_ftype target_signal_from_host)
3419 gdbarch->target_signal_from_host = target_signal_from_host;
3423 gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
3425 gdb_assert (gdbarch != NULL);
3426 gdb_assert (gdbarch->target_signal_to_host != NULL);
3427 if (gdbarch_debug >= 2)
3428 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n");
3429 return gdbarch->target_signal_to_host (gdbarch, ts);
3433 set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch,
3434 gdbarch_target_signal_to_host_ftype target_signal_to_host)
3436 gdbarch->target_signal_to_host = target_signal_to_host;
3440 gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
3442 gdb_assert (gdbarch != NULL);
3443 return gdbarch->get_siginfo_type != NULL;
3447 gdbarch_get_siginfo_type (struct gdbarch *gdbarch)
3449 gdb_assert (gdbarch != NULL);
3450 gdb_assert (gdbarch->get_siginfo_type != NULL);
3451 if (gdbarch_debug >= 2)
3452 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n");
3453 return gdbarch->get_siginfo_type (gdbarch);
3457 set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch,
3458 gdbarch_get_siginfo_type_ftype get_siginfo_type)
3460 gdbarch->get_siginfo_type = get_siginfo_type;
3464 gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
3466 gdb_assert (gdbarch != NULL);
3467 return gdbarch->record_special_symbol != NULL;
3471 gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
3473 gdb_assert (gdbarch != NULL);
3474 gdb_assert (gdbarch->record_special_symbol != NULL);
3475 if (gdbarch_debug >= 2)
3476 fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
3477 gdbarch->record_special_symbol (gdbarch, objfile, sym);
3481 set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
3482 gdbarch_record_special_symbol_ftype record_special_symbol)
3484 gdbarch->record_special_symbol = record_special_symbol;
3488 gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
3490 gdb_assert (gdbarch != NULL);
3491 return gdbarch->get_syscall_number != NULL;
3495 gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
3497 gdb_assert (gdbarch != NULL);
3498 gdb_assert (gdbarch->get_syscall_number != NULL);
3499 if (gdbarch_debug >= 2)
3500 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
3501 return gdbarch->get_syscall_number (gdbarch, ptid);
3505 set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
3506 gdbarch_get_syscall_number_ftype get_syscall_number)
3508 gdbarch->get_syscall_number = get_syscall_number;
3512 gdbarch_has_global_solist (struct gdbarch *gdbarch)
3514 gdb_assert (gdbarch != NULL);
3515 /* Skip verify of has_global_solist, invalid_p == 0 */
3516 if (gdbarch_debug >= 2)
3517 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
3518 return gdbarch->has_global_solist;
3522 set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
3523 int has_global_solist)
3525 gdbarch->has_global_solist = has_global_solist;
3529 gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
3531 gdb_assert (gdbarch != NULL);
3532 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3533 if (gdbarch_debug >= 2)
3534 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
3535 return gdbarch->has_global_breakpoints;
3539 set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
3540 int has_global_breakpoints)
3542 gdbarch->has_global_breakpoints = has_global_breakpoints;
3546 gdbarch_has_shared_address_space (struct gdbarch *gdbarch)
3548 gdb_assert (gdbarch != NULL);
3549 gdb_assert (gdbarch->has_shared_address_space != NULL);
3550 if (gdbarch_debug >= 2)
3551 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_shared_address_space called\n");
3552 return gdbarch->has_shared_address_space (gdbarch);
3556 set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
3557 gdbarch_has_shared_address_space_ftype has_shared_address_space)
3559 gdbarch->has_shared_address_space = has_shared_address_space;
3563 gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
3565 gdb_assert (gdbarch != NULL);
3566 gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
3567 if (gdbarch_debug >= 2)
3568 fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
3569 return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
3573 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
3574 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
3576 gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
3580 /* Keep a registry of per-architecture data-pointers required by GDB
3587 gdbarch_data_pre_init_ftype *pre_init;
3588 gdbarch_data_post_init_ftype *post_init;
3591 struct gdbarch_data_registration
3593 struct gdbarch_data *data;
3594 struct gdbarch_data_registration *next;
3597 struct gdbarch_data_registry
3600 struct gdbarch_data_registration *registrations;
3603 struct gdbarch_data_registry gdbarch_data_registry =
3608 static struct gdbarch_data *
3609 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3610 gdbarch_data_post_init_ftype *post_init)
3612 struct gdbarch_data_registration **curr;
3613 /* Append the new registraration. */
3614 for (curr = &gdbarch_data_registry.registrations;
3616 curr = &(*curr)->next);
3617 (*curr) = XMALLOC (struct gdbarch_data_registration);
3618 (*curr)->next = NULL;
3619 (*curr)->data = XMALLOC (struct gdbarch_data);
3620 (*curr)->data->index = gdbarch_data_registry.nr++;
3621 (*curr)->data->pre_init = pre_init;
3622 (*curr)->data->post_init = post_init;
3623 (*curr)->data->init_p = 1;
3624 return (*curr)->data;
3627 struct gdbarch_data *
3628 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3630 return gdbarch_data_register (pre_init, NULL);
3633 struct gdbarch_data *
3634 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3636 return gdbarch_data_register (NULL, post_init);
3639 /* Create/delete the gdbarch data vector. */
3642 alloc_gdbarch_data (struct gdbarch *gdbarch)
3644 gdb_assert (gdbarch->data == NULL);
3645 gdbarch->nr_data = gdbarch_data_registry.nr;
3646 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3649 /* Initialize the current value of the specified per-architecture
3653 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3654 struct gdbarch_data *data,
3657 gdb_assert (data->index < gdbarch->nr_data);
3658 gdb_assert (gdbarch->data[data->index] == NULL);
3659 gdb_assert (data->pre_init == NULL);
3660 gdbarch->data[data->index] = pointer;
3663 /* Return the current value of the specified per-architecture
3667 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3669 gdb_assert (data->index < gdbarch->nr_data);
3670 if (gdbarch->data[data->index] == NULL)
3672 /* The data-pointer isn't initialized, call init() to get a
3674 if (data->pre_init != NULL)
3675 /* Mid architecture creation: pass just the obstack, and not
3676 the entire architecture, as that way it isn't possible for
3677 pre-init code to refer to undefined architecture
3679 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3680 else if (gdbarch->initialized_p
3681 && data->post_init != NULL)
3682 /* Post architecture creation: pass the entire architecture
3683 (as all fields are valid), but be careful to also detect
3684 recursive references. */
3686 gdb_assert (data->init_p);
3688 gdbarch->data[data->index] = data->post_init (gdbarch);
3692 /* The architecture initialization hasn't completed - punt -
3693 hope that the caller knows what they are doing. Once
3694 deprecated_set_gdbarch_data has been initialized, this can be
3695 changed to an internal error. */
3697 gdb_assert (gdbarch->data[data->index] != NULL);
3699 return gdbarch->data[data->index];
3703 /* Keep a registry of the architectures known by GDB. */
3705 struct gdbarch_registration
3707 enum bfd_architecture bfd_architecture;
3708 gdbarch_init_ftype *init;
3709 gdbarch_dump_tdep_ftype *dump_tdep;
3710 struct gdbarch_list *arches;
3711 struct gdbarch_registration *next;
3714 static struct gdbarch_registration *gdbarch_registry = NULL;
3717 append_name (const char ***buf, int *nr, const char *name)
3719 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3725 gdbarch_printable_names (void)
3727 /* Accumulate a list of names based on the registed list of
3729 enum bfd_architecture a;
3731 const char **arches = NULL;
3732 struct gdbarch_registration *rego;
3733 for (rego = gdbarch_registry;
3737 const struct bfd_arch_info *ap;
3738 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3740 internal_error (__FILE__, __LINE__,
3741 _("gdbarch_architecture_names: multi-arch unknown"));
3744 append_name (&arches, &nr_arches, ap->printable_name);
3749 append_name (&arches, &nr_arches, NULL);
3755 gdbarch_register (enum bfd_architecture bfd_architecture,
3756 gdbarch_init_ftype *init,
3757 gdbarch_dump_tdep_ftype *dump_tdep)
3759 struct gdbarch_registration **curr;
3760 const struct bfd_arch_info *bfd_arch_info;
3761 /* Check that BFD recognizes this architecture */
3762 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3763 if (bfd_arch_info == NULL)
3765 internal_error (__FILE__, __LINE__,
3766 _("gdbarch: Attempt to register unknown architecture (%d)"),
3769 /* Check that we haven't seen this architecture before */
3770 for (curr = &gdbarch_registry;
3772 curr = &(*curr)->next)
3774 if (bfd_architecture == (*curr)->bfd_architecture)
3775 internal_error (__FILE__, __LINE__,
3776 _("gdbarch: Duplicate registraration of architecture (%s)"),
3777 bfd_arch_info->printable_name);
3781 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
3782 bfd_arch_info->printable_name,
3783 host_address_to_string (init));
3785 (*curr) = XMALLOC (struct gdbarch_registration);
3786 (*curr)->bfd_architecture = bfd_architecture;
3787 (*curr)->init = init;
3788 (*curr)->dump_tdep = dump_tdep;
3789 (*curr)->arches = NULL;
3790 (*curr)->next = NULL;
3794 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3795 gdbarch_init_ftype *init)
3797 gdbarch_register (bfd_architecture, init, NULL);
3801 /* Look for an architecture using gdbarch_info. */
3803 struct gdbarch_list *
3804 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3805 const struct gdbarch_info *info)
3807 for (; arches != NULL; arches = arches->next)
3809 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3811 if (info->byte_order != arches->gdbarch->byte_order)
3813 if (info->osabi != arches->gdbarch->osabi)
3815 if (info->target_desc != arches->gdbarch->target_desc)
3823 /* Find an architecture that matches the specified INFO. Create a new
3824 architecture if needed. Return that new architecture. */
3827 gdbarch_find_by_info (struct gdbarch_info info)
3829 struct gdbarch *new_gdbarch;
3830 struct gdbarch_registration *rego;
3832 /* Fill in missing parts of the INFO struct using a number of
3833 sources: "set ..."; INFOabfd supplied; and the global
3835 gdbarch_info_fill (&info);
3837 /* Must have found some sort of architecture. */
3838 gdb_assert (info.bfd_arch_info != NULL);
3842 fprintf_unfiltered (gdb_stdlog,
3843 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
3844 (info.bfd_arch_info != NULL
3845 ? info.bfd_arch_info->printable_name
3847 fprintf_unfiltered (gdb_stdlog,
3848 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
3850 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3851 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3853 fprintf_unfiltered (gdb_stdlog,
3854 "gdbarch_find_by_info: info.osabi %d (%s)\n",
3855 info.osabi, gdbarch_osabi_name (info.osabi));
3856 fprintf_unfiltered (gdb_stdlog,
3857 "gdbarch_find_by_info: info.abfd %s\n",
3858 host_address_to_string (info.abfd));
3859 fprintf_unfiltered (gdb_stdlog,
3860 "gdbarch_find_by_info: info.tdep_info %s\n",
3861 host_address_to_string (info.tdep_info));
3864 /* Find the tdep code that knows about this architecture. */
3865 for (rego = gdbarch_registry;
3868 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3873 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
3874 "No matching architecture\n");
3878 /* Ask the tdep code for an architecture that matches "info". */
3879 new_gdbarch = rego->init (info, rego->arches);
3881 /* Did the tdep code like it? No. Reject the change and revert to
3882 the old architecture. */
3883 if (new_gdbarch == NULL)
3886 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
3887 "Target rejected architecture\n");
3891 /* Is this a pre-existing architecture (as determined by already
3892 being initialized)? Move it to the front of the architecture
3893 list (keeping the list sorted Most Recently Used). */
3894 if (new_gdbarch->initialized_p)
3896 struct gdbarch_list **list;
3897 struct gdbarch_list *this;
3899 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
3900 "Previous architecture %s (%s) selected\n",
3901 host_address_to_string (new_gdbarch),
3902 new_gdbarch->bfd_arch_info->printable_name);
3903 /* Find the existing arch in the list. */
3904 for (list = ®o->arches;
3905 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3906 list = &(*list)->next);
3907 /* It had better be in the list of architectures. */
3908 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3911 (*list) = this->next;
3912 /* Insert THIS at the front. */
3913 this->next = rego->arches;
3914 rego->arches = this;
3919 /* It's a new architecture. */
3921 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
3922 "New architecture %s (%s) selected\n",
3923 host_address_to_string (new_gdbarch),
3924 new_gdbarch->bfd_arch_info->printable_name);
3926 /* Insert the new architecture into the front of the architecture
3927 list (keep the list sorted Most Recently Used). */
3929 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3930 this->next = rego->arches;
3931 this->gdbarch = new_gdbarch;
3932 rego->arches = this;
3935 /* Check that the newly installed architecture is valid. Plug in
3936 any post init values. */
3937 new_gdbarch->dump_tdep = rego->dump_tdep;
3938 verify_gdbarch (new_gdbarch);
3939 new_gdbarch->initialized_p = 1;
3942 gdbarch_dump (new_gdbarch, gdb_stdlog);
3947 /* Make the specified architecture current. */
3950 deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3952 gdb_assert (new_gdbarch != NULL);
3953 gdb_assert (new_gdbarch->initialized_p);
3954 target_gdbarch = new_gdbarch;
3955 observer_notify_architecture_changed (new_gdbarch);
3956 registers_changed ();
3959 extern void _initialize_gdbarch (void);
3962 _initialize_gdbarch (void)
3964 struct cmd_list_element *c;
3966 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3967 Set architecture debugging."), _("\
3968 Show architecture debugging."), _("\
3969 When non-zero, architecture debugging is enabled."),
3972 &setdebuglist, &showdebuglist);