gdb
[binutils-gdb.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
2 /* vi:set ro: */
3
4 /* Dynamic architecture support for GDB, the GNU debugger.
5
6 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 2007, 2008, 2009 Free Software Foundation, Inc.
8
9 This file is part of GDB.
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23
24 /* This file was created with the aid of ``gdbarch.sh''.
25
26 The Bourne shell script ``gdbarch.sh'' creates the files
27 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
28 against the existing ``gdbarch.[hc]''. Any differences found
29 being reported.
30
31 If editing this file, please also run gdbarch.sh and merge any
32 changes into that script. Conversely, when making sweeping changes
33 to this file, modifying gdbarch.sh and using its output may prove
34 easier. */
35
36
37 #include "defs.h"
38 #include "arch-utils.h"
39
40 #include "gdbcmd.h"
41 #include "inferior.h"
42 #include "symcat.h"
43
44 #include "floatformat.h"
45
46 #include "gdb_assert.h"
47 #include "gdb_string.h"
48 #include "reggroups.h"
49 #include "osabi.h"
50 #include "gdb_obstack.h"
51 #include "observer.h"
52 #include "regcache.h"
53 #include "objfiles.h"
54
55 /* Static function declarations */
56
57 static void alloc_gdbarch_data (struct gdbarch *);
58
59 /* Non-zero if we want to trace architecture code. */
60
61 #ifndef GDBARCH_DEBUG
62 #define GDBARCH_DEBUG 0
63 #endif
64 unsigned int gdbarch_debug = GDBARCH_DEBUG;
65 static void
66 show_gdbarch_debug (struct ui_file *file, int from_tty,
67 struct cmd_list_element *c, const char *value)
68 {
69 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
70 }
71
72 static const char *
73 pformat (const struct floatformat **format)
74 {
75 if (format == NULL)
76 return "(null)";
77 else
78 /* Just print out one of them - this is only for diagnostics. */
79 return format[0]->name;
80 }
81
82 static const char *
83 pstring (const char *string)
84 {
85 if (string == NULL)
86 return "(null)";
87 return string;
88 }
89
90
91 /* Maintain the struct gdbarch object. */
92
93 struct gdbarch
94 {
95 /* Has this architecture been fully initialized? */
96 int initialized_p;
97
98 /* An obstack bound to the lifetime of the architecture. */
99 struct obstack *obstack;
100
101 /* basic architectural information. */
102 const struct bfd_arch_info * bfd_arch_info;
103 int byte_order;
104 int byte_order_for_code;
105 enum gdb_osabi osabi;
106 const struct target_desc * target_desc;
107
108 /* target specific vector. */
109 struct gdbarch_tdep *tdep;
110 gdbarch_dump_tdep_ftype *dump_tdep;
111
112 /* per-architecture data-pointers. */
113 unsigned nr_data;
114 void **data;
115
116 /* Multi-arch values.
117
118 When extending this structure you must:
119
120 Add the field below.
121
122 Declare set/get functions and define the corresponding
123 macro in gdbarch.h.
124
125 gdbarch_alloc(): If zero/NULL is not a suitable default,
126 initialize the new field.
127
128 verify_gdbarch(): Confirm that the target updated the field
129 correctly.
130
131 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
132 field is dumped out
133
134 ``startup_gdbarch()'': Append an initial value to the static
135 variable (base values on the host's c-type system).
136
137 get_gdbarch(): Implement the set/get functions (probably using
138 the macro's as shortcuts).
139
140 */
141
142 int bits_big_endian;
143 int short_bit;
144 int int_bit;
145 int long_bit;
146 int long_long_bit;
147 int long_long_align_bit;
148 int half_bit;
149 const struct floatformat ** half_format;
150 int float_bit;
151 const struct floatformat ** float_format;
152 int double_bit;
153 const struct floatformat ** double_format;
154 int long_double_bit;
155 const struct floatformat ** long_double_format;
156 int ptr_bit;
157 int addr_bit;
158 int dwarf2_addr_size;
159 int char_signed;
160 gdbarch_read_pc_ftype *read_pc;
161 gdbarch_write_pc_ftype *write_pc;
162 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
163 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
164 gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value;
165 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
166 int num_regs;
167 int num_pseudo_regs;
168 gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect;
169 gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack;
170 int sp_regnum;
171 int pc_regnum;
172 int ps_regnum;
173 int fp0_regnum;
174 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
175 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
176 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
177 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
178 gdbarch_register_name_ftype *register_name;
179 gdbarch_register_type_ftype *register_type;
180 gdbarch_dummy_id_ftype *dummy_id;
181 int deprecated_fp_regnum;
182 gdbarch_push_dummy_call_ftype *push_dummy_call;
183 int call_dummy_location;
184 gdbarch_push_dummy_code_ftype *push_dummy_code;
185 gdbarch_print_registers_info_ftype *print_registers_info;
186 gdbarch_print_float_info_ftype *print_float_info;
187 gdbarch_print_vector_info_ftype *print_vector_info;
188 gdbarch_register_sim_regno_ftype *register_sim_regno;
189 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
190 gdbarch_cannot_store_register_ftype *cannot_store_register;
191 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
192 int believe_pcc_promotion;
193 gdbarch_convert_register_p_ftype *convert_register_p;
194 gdbarch_register_to_value_ftype *register_to_value;
195 gdbarch_value_to_register_ftype *value_to_register;
196 gdbarch_value_from_register_ftype *value_from_register;
197 gdbarch_pointer_to_address_ftype *pointer_to_address;
198 gdbarch_address_to_pointer_ftype *address_to_pointer;
199 gdbarch_integer_to_address_ftype *integer_to_address;
200 gdbarch_return_value_ftype *return_value;
201 gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p;
202 gdbarch_skip_prologue_ftype *skip_prologue;
203 gdbarch_skip_main_prologue_ftype *skip_main_prologue;
204 gdbarch_inner_than_ftype *inner_than;
205 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
206 gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
207 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
208 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
209 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
210 CORE_ADDR decr_pc_after_break;
211 CORE_ADDR deprecated_function_start_offset;
212 gdbarch_remote_register_number_ftype *remote_register_number;
213 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
214 CORE_ADDR frame_args_skip;
215 gdbarch_unwind_pc_ftype *unwind_pc;
216 gdbarch_unwind_sp_ftype *unwind_sp;
217 gdbarch_frame_num_args_ftype *frame_num_args;
218 gdbarch_frame_align_ftype *frame_align;
219 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
220 int frame_red_zone_size;
221 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
222 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
223 gdbarch_software_single_step_ftype *software_single_step;
224 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
225 gdbarch_print_insn_ftype *print_insn;
226 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
227 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
228 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
229 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
230 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
231 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
232 int cannot_step_breakpoint;
233 int have_nonsteppable_watchpoint;
234 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
235 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
236 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
237 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
238 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
239 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
240 struct core_regset_section * core_regset_sections;
241 gdbarch_make_corefile_notes_ftype *make_corefile_notes;
242 gdbarch_find_memory_regions_ftype *find_memory_regions;
243 gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
244 gdbarch_core_pid_to_str_ftype *core_pid_to_str;
245 const char * gcore_bfd_target;
246 int vtable_function_descriptors;
247 int vbit_in_delta;
248 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
249 ULONGEST max_insn_length;
250 gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
251 gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
252 gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
253 gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
254 gdbarch_displaced_step_location_ftype *displaced_step_location;
255 gdbarch_relocate_instruction_ftype *relocate_instruction;
256 gdbarch_overlay_update_ftype *overlay_update;
257 gdbarch_core_read_description_ftype *core_read_description;
258 gdbarch_static_transform_name_ftype *static_transform_name;
259 int sofun_address_maybe_missing;
260 gdbarch_process_record_ftype *process_record;
261 gdbarch_process_record_signal_ftype *process_record_signal;
262 gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target;
263 gdbarch_get_siginfo_type_ftype *get_siginfo_type;
264 gdbarch_record_special_symbol_ftype *record_special_symbol;
265 gdbarch_get_syscall_number_ftype *get_syscall_number;
266 const char * stap_integer_prefix;
267 const char * stap_integer_suffix;
268 const char * stap_register_prefix;
269 const char * stap_register_suffix;
270 const char * stap_register_indirection_prefix;
271 const char * stap_register_indirection_suffix;
272 const char * stap_gdb_register_prefix;
273 const char * stap_gdb_register_suffix;
274 gdbarch_stap_is_single_operand_ftype *stap_is_single_operand;
275 gdbarch_stap_parse_special_token_ftype *stap_parse_special_token;
276 int has_global_solist;
277 int has_global_breakpoints;
278 gdbarch_has_shared_address_space_ftype *has_shared_address_space;
279 gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
280 gdbarch_auto_charset_ftype *auto_charset;
281 gdbarch_auto_wide_charset_ftype *auto_wide_charset;
282 const char * solib_symbols_extension;
283 int has_dos_based_file_system;
284 gdbarch_gen_return_address_ftype *gen_return_address;
285 gdbarch_info_proc_ftype *info_proc;
286 gdbarch_core_info_proc_ftype *core_info_proc;
287 gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order;
288 };
289
290
291 /* The default architecture uses host values (for want of a better
292 choice). */
293
294 extern const struct bfd_arch_info bfd_default_arch_struct;
295
296 struct gdbarch startup_gdbarch =
297 {
298 1, /* Always initialized. */
299 NULL, /* The obstack. */
300 /* basic architecture information. */
301 &bfd_default_arch_struct, /* bfd_arch_info */
302 BFD_ENDIAN_BIG, /* byte_order */
303 BFD_ENDIAN_BIG, /* byte_order_for_code */
304 GDB_OSABI_UNKNOWN, /* osabi */
305 0, /* target_desc */
306 /* target specific vector and its dump routine. */
307 NULL, NULL,
308 /*per-architecture data-pointers. */
309 0, NULL,
310 /* Multi-arch values */
311 1, /* bits_big_endian */
312 8 * sizeof (short), /* short_bit */
313 8 * sizeof (int), /* int_bit */
314 8 * sizeof (long), /* long_bit */
315 8 * sizeof (LONGEST), /* long_long_bit */
316 8 * sizeof (LONGEST), /* long_long_align_bit */
317 16, /* half_bit */
318 0, /* half_format */
319 8 * sizeof (float), /* float_bit */
320 0, /* float_format */
321 8 * sizeof (double), /* double_bit */
322 0, /* double_format */
323 8 * sizeof (long double), /* long_double_bit */
324 0, /* long_double_format */
325 8 * sizeof (void*), /* ptr_bit */
326 8 * sizeof (void*), /* addr_bit */
327 sizeof (void*), /* dwarf2_addr_size */
328 1, /* char_signed */
329 0, /* read_pc */
330 0, /* write_pc */
331 legacy_virtual_frame_pointer, /* virtual_frame_pointer */
332 0, /* pseudo_register_read */
333 0, /* pseudo_register_read_value */
334 0, /* pseudo_register_write */
335 0, /* num_regs */
336 0, /* num_pseudo_regs */
337 0, /* ax_pseudo_register_collect */
338 0, /* ax_pseudo_register_push_stack */
339 -1, /* sp_regnum */
340 -1, /* pc_regnum */
341 -1, /* ps_regnum */
342 0, /* fp0_regnum */
343 no_op_reg_to_regnum, /* stab_reg_to_regnum */
344 no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
345 no_op_reg_to_regnum, /* sdb_reg_to_regnum */
346 no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
347 0, /* register_name */
348 0, /* register_type */
349 0, /* dummy_id */
350 -1, /* deprecated_fp_regnum */
351 0, /* push_dummy_call */
352 0, /* call_dummy_location */
353 0, /* push_dummy_code */
354 default_print_registers_info, /* print_registers_info */
355 0, /* print_float_info */
356 0, /* print_vector_info */
357 legacy_register_sim_regno, /* register_sim_regno */
358 cannot_register_not, /* cannot_fetch_register */
359 cannot_register_not, /* cannot_store_register */
360 0, /* get_longjmp_target */
361 0, /* believe_pcc_promotion */
362 generic_convert_register_p, /* convert_register_p */
363 0, /* register_to_value */
364 0, /* value_to_register */
365 0, /* value_from_register */
366 unsigned_pointer_to_address, /* pointer_to_address */
367 unsigned_address_to_pointer, /* address_to_pointer */
368 0, /* integer_to_address */
369 0, /* return_value */
370 default_return_in_first_hidden_param_p, /* return_in_first_hidden_param_p */
371 0, /* skip_prologue */
372 0, /* skip_main_prologue */
373 0, /* inner_than */
374 0, /* breakpoint_from_pc */
375 default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */
376 0, /* adjust_breakpoint_address */
377 default_memory_insert_breakpoint, /* memory_insert_breakpoint */
378 default_memory_remove_breakpoint, /* memory_remove_breakpoint */
379 0, /* decr_pc_after_break */
380 0, /* deprecated_function_start_offset */
381 default_remote_register_number, /* remote_register_number */
382 0, /* fetch_tls_load_module_address */
383 0, /* frame_args_skip */
384 0, /* unwind_pc */
385 0, /* unwind_sp */
386 0, /* frame_num_args */
387 0, /* frame_align */
388 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
389 0, /* frame_red_zone_size */
390 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
391 core_addr_identity, /* addr_bits_remove */
392 0, /* software_single_step */
393 0, /* single_step_through_delay */
394 0, /* print_insn */
395 0, /* skip_trampoline_code */
396 generic_skip_solib_resolver, /* skip_solib_resolver */
397 generic_in_solib_return_trampoline, /* in_solib_return_trampoline */
398 generic_in_function_epilogue_p, /* in_function_epilogue_p */
399 0, /* elf_make_msymbol_special */
400 0, /* coff_make_msymbol_special */
401 0, /* cannot_step_breakpoint */
402 0, /* have_nonsteppable_watchpoint */
403 0, /* address_class_type_flags */
404 0, /* address_class_type_flags_to_name */
405 0, /* address_class_name_to_type_flags */
406 default_register_reggroup_p, /* register_reggroup_p */
407 0, /* fetch_pointer_argument */
408 0, /* regset_from_core_section */
409 0, /* core_regset_sections */
410 0, /* make_corefile_notes */
411 0, /* find_memory_regions */
412 0, /* core_xfer_shared_libraries */
413 0, /* core_pid_to_str */
414 0, /* gcore_bfd_target */
415 0, /* vtable_function_descriptors */
416 0, /* vbit_in_delta */
417 0, /* skip_permanent_breakpoint */
418 0, /* max_insn_length */
419 0, /* displaced_step_copy_insn */
420 default_displaced_step_hw_singlestep, /* displaced_step_hw_singlestep */
421 0, /* displaced_step_fixup */
422 NULL, /* displaced_step_free_closure */
423 NULL, /* displaced_step_location */
424 0, /* relocate_instruction */
425 0, /* overlay_update */
426 0, /* core_read_description */
427 0, /* static_transform_name */
428 0, /* sofun_address_maybe_missing */
429 0, /* process_record */
430 0, /* process_record_signal */
431 0, /* gdb_signal_from_target */
432 0, /* get_siginfo_type */
433 0, /* record_special_symbol */
434 0, /* get_syscall_number */
435 0, /* stap_integer_prefix */
436 0, /* stap_integer_suffix */
437 0, /* stap_register_prefix */
438 0, /* stap_register_suffix */
439 0, /* stap_register_indirection_prefix */
440 0, /* stap_register_indirection_suffix */
441 0, /* stap_gdb_register_prefix */
442 0, /* stap_gdb_register_suffix */
443 0, /* stap_is_single_operand */
444 0, /* stap_parse_special_token */
445 0, /* has_global_solist */
446 0, /* has_global_breakpoints */
447 default_has_shared_address_space, /* has_shared_address_space */
448 default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
449 default_auto_charset, /* auto_charset */
450 default_auto_wide_charset, /* auto_wide_charset */
451 0, /* solib_symbols_extension */
452 0, /* has_dos_based_file_system */
453 default_gen_return_address, /* gen_return_address */
454 0, /* info_proc */
455 0, /* core_info_proc */
456 default_iterate_over_objfiles_in_search_order, /* iterate_over_objfiles_in_search_order */
457 /* startup_gdbarch() */
458 };
459
460
461 /* Create a new ``struct gdbarch'' based on information provided by
462 ``struct gdbarch_info''. */
463
464 struct gdbarch *
465 gdbarch_alloc (const struct gdbarch_info *info,
466 struct gdbarch_tdep *tdep)
467 {
468 struct gdbarch *gdbarch;
469
470 /* Create an obstack for allocating all the per-architecture memory,
471 then use that to allocate the architecture vector. */
472 struct obstack *obstack = XMALLOC (struct obstack);
473 obstack_init (obstack);
474 gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
475 memset (gdbarch, 0, sizeof (*gdbarch));
476 gdbarch->obstack = obstack;
477
478 alloc_gdbarch_data (gdbarch);
479
480 gdbarch->tdep = tdep;
481
482 gdbarch->bfd_arch_info = info->bfd_arch_info;
483 gdbarch->byte_order = info->byte_order;
484 gdbarch->byte_order_for_code = info->byte_order_for_code;
485 gdbarch->osabi = info->osabi;
486 gdbarch->target_desc = info->target_desc;
487
488 /* Force the explicit initialization of these. */
489 gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
490 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
491 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
492 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
493 gdbarch->long_long_bit = 2*gdbarch->long_bit;
494 gdbarch->long_long_align_bit = 2*gdbarch->long_bit;
495 gdbarch->half_bit = 2*TARGET_CHAR_BIT;
496 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
497 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
498 gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
499 gdbarch->ptr_bit = gdbarch->int_bit;
500 gdbarch->char_signed = -1;
501 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
502 gdbarch->num_regs = -1;
503 gdbarch->sp_regnum = -1;
504 gdbarch->pc_regnum = -1;
505 gdbarch->ps_regnum = -1;
506 gdbarch->fp0_regnum = -1;
507 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
508 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
509 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
510 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
511 gdbarch->deprecated_fp_regnum = -1;
512 gdbarch->call_dummy_location = AT_ENTRY_POINT;
513 gdbarch->print_registers_info = default_print_registers_info;
514 gdbarch->register_sim_regno = legacy_register_sim_regno;
515 gdbarch->cannot_fetch_register = cannot_register_not;
516 gdbarch->cannot_store_register = cannot_register_not;
517 gdbarch->convert_register_p = generic_convert_register_p;
518 gdbarch->value_from_register = default_value_from_register;
519 gdbarch->pointer_to_address = unsigned_pointer_to_address;
520 gdbarch->address_to_pointer = unsigned_address_to_pointer;
521 gdbarch->return_in_first_hidden_param_p = default_return_in_first_hidden_param_p;
522 gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
523 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
524 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
525 gdbarch->remote_register_number = default_remote_register_number;
526 gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
527 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
528 gdbarch->addr_bits_remove = core_addr_identity;
529 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
530 gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
531 gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
532 gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
533 gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
534 gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
535 gdbarch->register_reggroup_p = default_register_reggroup_p;
536 gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
537 gdbarch->displaced_step_fixup = NULL;
538 gdbarch->displaced_step_free_closure = NULL;
539 gdbarch->displaced_step_location = NULL;
540 gdbarch->relocate_instruction = NULL;
541 gdbarch->has_shared_address_space = default_has_shared_address_space;
542 gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
543 gdbarch->auto_charset = default_auto_charset;
544 gdbarch->auto_wide_charset = default_auto_wide_charset;
545 gdbarch->gen_return_address = default_gen_return_address;
546 gdbarch->iterate_over_objfiles_in_search_order = default_iterate_over_objfiles_in_search_order;
547 /* gdbarch_alloc() */
548
549 return gdbarch;
550 }
551
552
553 /* Allocate extra space using the per-architecture obstack. */
554
555 void *
556 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
557 {
558 void *data = obstack_alloc (arch->obstack, size);
559
560 memset (data, 0, size);
561 return data;
562 }
563
564
565 /* Free a gdbarch struct. This should never happen in normal
566 operation --- once you've created a gdbarch, you keep it around.
567 However, if an architecture's init function encounters an error
568 building the structure, it may need to clean up a partially
569 constructed gdbarch. */
570
571 void
572 gdbarch_free (struct gdbarch *arch)
573 {
574 struct obstack *obstack;
575
576 gdb_assert (arch != NULL);
577 gdb_assert (!arch->initialized_p);
578 obstack = arch->obstack;
579 obstack_free (obstack, 0); /* Includes the ARCH. */
580 xfree (obstack);
581 }
582
583
584 /* Ensure that all values in a GDBARCH are reasonable. */
585
586 static void
587 verify_gdbarch (struct gdbarch *gdbarch)
588 {
589 struct ui_file *log;
590 struct cleanup *cleanups;
591 long length;
592 char *buf;
593
594 log = mem_fileopen ();
595 cleanups = make_cleanup_ui_file_delete (log);
596 /* fundamental */
597 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
598 fprintf_unfiltered (log, "\n\tbyte-order");
599 if (gdbarch->bfd_arch_info == NULL)
600 fprintf_unfiltered (log, "\n\tbfd_arch_info");
601 /* Check those that need to be defined for the given multi-arch level. */
602 /* Skip verify of bits_big_endian, invalid_p == 0 */
603 /* Skip verify of short_bit, invalid_p == 0 */
604 /* Skip verify of int_bit, invalid_p == 0 */
605 /* Skip verify of long_bit, invalid_p == 0 */
606 /* Skip verify of long_long_bit, invalid_p == 0 */
607 /* Skip verify of long_long_align_bit, invalid_p == 0 */
608 /* Skip verify of half_bit, invalid_p == 0 */
609 if (gdbarch->half_format == 0)
610 gdbarch->half_format = floatformats_ieee_half;
611 /* Skip verify of float_bit, invalid_p == 0 */
612 if (gdbarch->float_format == 0)
613 gdbarch->float_format = floatformats_ieee_single;
614 /* Skip verify of double_bit, invalid_p == 0 */
615 if (gdbarch->double_format == 0)
616 gdbarch->double_format = floatformats_ieee_double;
617 /* Skip verify of long_double_bit, invalid_p == 0 */
618 if (gdbarch->long_double_format == 0)
619 gdbarch->long_double_format = floatformats_ieee_double;
620 /* Skip verify of ptr_bit, invalid_p == 0 */
621 if (gdbarch->addr_bit == 0)
622 gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
623 if (gdbarch->dwarf2_addr_size == 0)
624 gdbarch->dwarf2_addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
625 if (gdbarch->char_signed == -1)
626 gdbarch->char_signed = 1;
627 /* Skip verify of read_pc, has predicate. */
628 /* Skip verify of write_pc, has predicate. */
629 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
630 /* Skip verify of pseudo_register_read, has predicate. */
631 /* Skip verify of pseudo_register_read_value, has predicate. */
632 /* Skip verify of pseudo_register_write, has predicate. */
633 if (gdbarch->num_regs == -1)
634 fprintf_unfiltered (log, "\n\tnum_regs");
635 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
636 /* Skip verify of ax_pseudo_register_collect, has predicate. */
637 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
638 /* Skip verify of sp_regnum, invalid_p == 0 */
639 /* Skip verify of pc_regnum, invalid_p == 0 */
640 /* Skip verify of ps_regnum, invalid_p == 0 */
641 /* Skip verify of fp0_regnum, invalid_p == 0 */
642 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
643 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
644 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
645 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
646 if (gdbarch->register_name == 0)
647 fprintf_unfiltered (log, "\n\tregister_name");
648 /* Skip verify of register_type, has predicate. */
649 /* Skip verify of dummy_id, has predicate. */
650 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
651 /* Skip verify of push_dummy_call, has predicate. */
652 /* Skip verify of call_dummy_location, invalid_p == 0 */
653 /* Skip verify of push_dummy_code, has predicate. */
654 /* Skip verify of print_registers_info, invalid_p == 0 */
655 /* Skip verify of print_float_info, has predicate. */
656 /* Skip verify of print_vector_info, has predicate. */
657 /* Skip verify of register_sim_regno, invalid_p == 0 */
658 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
659 /* Skip verify of cannot_store_register, invalid_p == 0 */
660 /* Skip verify of get_longjmp_target, has predicate. */
661 /* Skip verify of convert_register_p, invalid_p == 0 */
662 /* Skip verify of value_from_register, invalid_p == 0 */
663 /* Skip verify of pointer_to_address, invalid_p == 0 */
664 /* Skip verify of address_to_pointer, invalid_p == 0 */
665 /* Skip verify of integer_to_address, has predicate. */
666 /* Skip verify of return_value, has predicate. */
667 /* Skip verify of return_in_first_hidden_param_p, invalid_p == 0 */
668 if (gdbarch->skip_prologue == 0)
669 fprintf_unfiltered (log, "\n\tskip_prologue");
670 /* Skip verify of skip_main_prologue, has predicate. */
671 if (gdbarch->inner_than == 0)
672 fprintf_unfiltered (log, "\n\tinner_than");
673 if (gdbarch->breakpoint_from_pc == 0)
674 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
675 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
676 /* Skip verify of adjust_breakpoint_address, has predicate. */
677 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
678 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
679 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
680 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
681 /* Skip verify of remote_register_number, invalid_p == 0 */
682 /* Skip verify of fetch_tls_load_module_address, has predicate. */
683 /* Skip verify of frame_args_skip, invalid_p == 0 */
684 /* Skip verify of unwind_pc, has predicate. */
685 /* Skip verify of unwind_sp, has predicate. */
686 /* Skip verify of frame_num_args, has predicate. */
687 /* Skip verify of frame_align, has predicate. */
688 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
689 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
690 /* Skip verify of addr_bits_remove, invalid_p == 0 */
691 /* Skip verify of software_single_step, has predicate. */
692 /* Skip verify of single_step_through_delay, has predicate. */
693 if (gdbarch->print_insn == 0)
694 fprintf_unfiltered (log, "\n\tprint_insn");
695 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
696 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
697 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
698 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
699 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
700 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
701 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
702 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
703 /* Skip verify of address_class_type_flags, has predicate. */
704 /* Skip verify of address_class_type_flags_to_name, has predicate. */
705 /* Skip verify of address_class_name_to_type_flags, has predicate. */
706 /* Skip verify of register_reggroup_p, invalid_p == 0 */
707 /* Skip verify of fetch_pointer_argument, has predicate. */
708 /* Skip verify of regset_from_core_section, has predicate. */
709 /* Skip verify of make_corefile_notes, has predicate. */
710 /* Skip verify of find_memory_regions, has predicate. */
711 /* Skip verify of core_xfer_shared_libraries, has predicate. */
712 /* Skip verify of core_pid_to_str, has predicate. */
713 /* Skip verify of gcore_bfd_target, has predicate. */
714 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
715 /* Skip verify of vbit_in_delta, invalid_p == 0 */
716 /* Skip verify of skip_permanent_breakpoint, has predicate. */
717 /* Skip verify of max_insn_length, has predicate. */
718 /* Skip verify of displaced_step_copy_insn, has predicate. */
719 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
720 /* Skip verify of displaced_step_fixup, has predicate. */
721 if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
722 fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
723 if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
724 fprintf_unfiltered (log, "\n\tdisplaced_step_location");
725 /* Skip verify of relocate_instruction, has predicate. */
726 /* Skip verify of overlay_update, has predicate. */
727 /* Skip verify of core_read_description, has predicate. */
728 /* Skip verify of static_transform_name, has predicate. */
729 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
730 /* Skip verify of process_record, has predicate. */
731 /* Skip verify of process_record_signal, has predicate. */
732 /* Skip verify of gdb_signal_from_target, has predicate. */
733 /* Skip verify of get_siginfo_type, has predicate. */
734 /* Skip verify of record_special_symbol, has predicate. */
735 /* Skip verify of get_syscall_number, has predicate. */
736 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
737 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
738 /* Skip verify of stap_register_prefix, invalid_p == 0 */
739 /* Skip verify of stap_register_suffix, invalid_p == 0 */
740 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
741 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
742 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
743 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
744 /* Skip verify of stap_is_single_operand, has predicate. */
745 /* Skip verify of stap_parse_special_token, has predicate. */
746 /* Skip verify of has_global_solist, invalid_p == 0 */
747 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
748 /* Skip verify of has_shared_address_space, invalid_p == 0 */
749 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
750 /* Skip verify of auto_charset, invalid_p == 0 */
751 /* Skip verify of auto_wide_charset, invalid_p == 0 */
752 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
753 /* Skip verify of gen_return_address, invalid_p == 0 */
754 /* Skip verify of info_proc, has predicate. */
755 /* Skip verify of core_info_proc, has predicate. */
756 /* Skip verify of iterate_over_objfiles_in_search_order, invalid_p == 0 */
757 buf = ui_file_xstrdup (log, &length);
758 make_cleanup (xfree, buf);
759 if (length > 0)
760 internal_error (__FILE__, __LINE__,
761 _("verify_gdbarch: the following are invalid ...%s"),
762 buf);
763 do_cleanups (cleanups);
764 }
765
766
767 /* Print out the details of the current architecture. */
768
769 void
770 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
771 {
772 const char *gdb_nm_file = "<not-defined>";
773
774 #if defined (GDB_NM_FILE)
775 gdb_nm_file = GDB_NM_FILE;
776 #endif
777 fprintf_unfiltered (file,
778 "gdbarch_dump: GDB_NM_FILE = %s\n",
779 gdb_nm_file);
780 fprintf_unfiltered (file,
781 "gdbarch_dump: addr_bit = %s\n",
782 plongest (gdbarch->addr_bit));
783 fprintf_unfiltered (file,
784 "gdbarch_dump: addr_bits_remove = <%s>\n",
785 host_address_to_string (gdbarch->addr_bits_remove));
786 fprintf_unfiltered (file,
787 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
788 gdbarch_address_class_name_to_type_flags_p (gdbarch));
789 fprintf_unfiltered (file,
790 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
791 host_address_to_string (gdbarch->address_class_name_to_type_flags));
792 fprintf_unfiltered (file,
793 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
794 gdbarch_address_class_type_flags_p (gdbarch));
795 fprintf_unfiltered (file,
796 "gdbarch_dump: address_class_type_flags = <%s>\n",
797 host_address_to_string (gdbarch->address_class_type_flags));
798 fprintf_unfiltered (file,
799 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
800 gdbarch_address_class_type_flags_to_name_p (gdbarch));
801 fprintf_unfiltered (file,
802 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
803 host_address_to_string (gdbarch->address_class_type_flags_to_name));
804 fprintf_unfiltered (file,
805 "gdbarch_dump: address_to_pointer = <%s>\n",
806 host_address_to_string (gdbarch->address_to_pointer));
807 fprintf_unfiltered (file,
808 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
809 gdbarch_adjust_breakpoint_address_p (gdbarch));
810 fprintf_unfiltered (file,
811 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
812 host_address_to_string (gdbarch->adjust_breakpoint_address));
813 fprintf_unfiltered (file,
814 "gdbarch_dump: auto_charset = <%s>\n",
815 host_address_to_string (gdbarch->auto_charset));
816 fprintf_unfiltered (file,
817 "gdbarch_dump: auto_wide_charset = <%s>\n",
818 host_address_to_string (gdbarch->auto_wide_charset));
819 fprintf_unfiltered (file,
820 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
821 gdbarch_ax_pseudo_register_collect_p (gdbarch));
822 fprintf_unfiltered (file,
823 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
824 host_address_to_string (gdbarch->ax_pseudo_register_collect));
825 fprintf_unfiltered (file,
826 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
827 gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
830 host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
831 fprintf_unfiltered (file,
832 "gdbarch_dump: believe_pcc_promotion = %s\n",
833 plongest (gdbarch->believe_pcc_promotion));
834 fprintf_unfiltered (file,
835 "gdbarch_dump: bfd_arch_info = %s\n",
836 gdbarch_bfd_arch_info (gdbarch)->printable_name);
837 fprintf_unfiltered (file,
838 "gdbarch_dump: bits_big_endian = %s\n",
839 plongest (gdbarch->bits_big_endian));
840 fprintf_unfiltered (file,
841 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
842 host_address_to_string (gdbarch->breakpoint_from_pc));
843 fprintf_unfiltered (file,
844 "gdbarch_dump: byte_order = %s\n",
845 plongest (gdbarch->byte_order));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: byte_order_for_code = %s\n",
848 plongest (gdbarch->byte_order_for_code));
849 fprintf_unfiltered (file,
850 "gdbarch_dump: call_dummy_location = %s\n",
851 plongest (gdbarch->call_dummy_location));
852 fprintf_unfiltered (file,
853 "gdbarch_dump: cannot_fetch_register = <%s>\n",
854 host_address_to_string (gdbarch->cannot_fetch_register));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: cannot_step_breakpoint = %s\n",
857 plongest (gdbarch->cannot_step_breakpoint));
858 fprintf_unfiltered (file,
859 "gdbarch_dump: cannot_store_register = <%s>\n",
860 host_address_to_string (gdbarch->cannot_store_register));
861 fprintf_unfiltered (file,
862 "gdbarch_dump: char_signed = %s\n",
863 plongest (gdbarch->char_signed));
864 fprintf_unfiltered (file,
865 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
866 host_address_to_string (gdbarch->coff_make_msymbol_special));
867 fprintf_unfiltered (file,
868 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
869 host_address_to_string (gdbarch->convert_from_func_ptr_addr));
870 fprintf_unfiltered (file,
871 "gdbarch_dump: convert_register_p = <%s>\n",
872 host_address_to_string (gdbarch->convert_register_p));
873 fprintf_unfiltered (file,
874 "gdbarch_dump: gdbarch_core_info_proc_p() = %d\n",
875 gdbarch_core_info_proc_p (gdbarch));
876 fprintf_unfiltered (file,
877 "gdbarch_dump: core_info_proc = <%s>\n",
878 host_address_to_string (gdbarch->core_info_proc));
879 fprintf_unfiltered (file,
880 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
881 gdbarch_core_pid_to_str_p (gdbarch));
882 fprintf_unfiltered (file,
883 "gdbarch_dump: core_pid_to_str = <%s>\n",
884 host_address_to_string (gdbarch->core_pid_to_str));
885 fprintf_unfiltered (file,
886 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
887 gdbarch_core_read_description_p (gdbarch));
888 fprintf_unfiltered (file,
889 "gdbarch_dump: core_read_description = <%s>\n",
890 host_address_to_string (gdbarch->core_read_description));
891 fprintf_unfiltered (file,
892 "gdbarch_dump: core_regset_sections = %s\n",
893 host_address_to_string (gdbarch->core_regset_sections));
894 fprintf_unfiltered (file,
895 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
896 gdbarch_core_xfer_shared_libraries_p (gdbarch));
897 fprintf_unfiltered (file,
898 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
899 host_address_to_string (gdbarch->core_xfer_shared_libraries));
900 fprintf_unfiltered (file,
901 "gdbarch_dump: decr_pc_after_break = %s\n",
902 core_addr_to_string_nz (gdbarch->decr_pc_after_break));
903 fprintf_unfiltered (file,
904 "gdbarch_dump: deprecated_fp_regnum = %s\n",
905 plongest (gdbarch->deprecated_fp_regnum));
906 fprintf_unfiltered (file,
907 "gdbarch_dump: deprecated_function_start_offset = %s\n",
908 core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
909 fprintf_unfiltered (file,
910 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
911 gdbarch_displaced_step_copy_insn_p (gdbarch));
912 fprintf_unfiltered (file,
913 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
914 host_address_to_string (gdbarch->displaced_step_copy_insn));
915 fprintf_unfiltered (file,
916 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
917 gdbarch_displaced_step_fixup_p (gdbarch));
918 fprintf_unfiltered (file,
919 "gdbarch_dump: displaced_step_fixup = <%s>\n",
920 host_address_to_string (gdbarch->displaced_step_fixup));
921 fprintf_unfiltered (file,
922 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
923 host_address_to_string (gdbarch->displaced_step_free_closure));
924 fprintf_unfiltered (file,
925 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
926 host_address_to_string (gdbarch->displaced_step_hw_singlestep));
927 fprintf_unfiltered (file,
928 "gdbarch_dump: displaced_step_location = <%s>\n",
929 host_address_to_string (gdbarch->displaced_step_location));
930 fprintf_unfiltered (file,
931 "gdbarch_dump: double_bit = %s\n",
932 plongest (gdbarch->double_bit));
933 fprintf_unfiltered (file,
934 "gdbarch_dump: double_format = %s\n",
935 pformat (gdbarch->double_format));
936 fprintf_unfiltered (file,
937 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
938 gdbarch_dummy_id_p (gdbarch));
939 fprintf_unfiltered (file,
940 "gdbarch_dump: dummy_id = <%s>\n",
941 host_address_to_string (gdbarch->dummy_id));
942 fprintf_unfiltered (file,
943 "gdbarch_dump: dwarf2_addr_size = %s\n",
944 plongest (gdbarch->dwarf2_addr_size));
945 fprintf_unfiltered (file,
946 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
947 host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
948 fprintf_unfiltered (file,
949 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
950 host_address_to_string (gdbarch->ecoff_reg_to_regnum));
951 fprintf_unfiltered (file,
952 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
953 host_address_to_string (gdbarch->elf_make_msymbol_special));
954 fprintf_unfiltered (file,
955 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
956 host_address_to_string (gdbarch->fast_tracepoint_valid_at));
957 fprintf_unfiltered (file,
958 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
959 gdbarch_fetch_pointer_argument_p (gdbarch));
960 fprintf_unfiltered (file,
961 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
962 host_address_to_string (gdbarch->fetch_pointer_argument));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
965 gdbarch_fetch_tls_load_module_address_p (gdbarch));
966 fprintf_unfiltered (file,
967 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
968 host_address_to_string (gdbarch->fetch_tls_load_module_address));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
971 gdbarch_find_memory_regions_p (gdbarch));
972 fprintf_unfiltered (file,
973 "gdbarch_dump: find_memory_regions = <%s>\n",
974 host_address_to_string (gdbarch->find_memory_regions));
975 fprintf_unfiltered (file,
976 "gdbarch_dump: float_bit = %s\n",
977 plongest (gdbarch->float_bit));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: float_format = %s\n",
980 pformat (gdbarch->float_format));
981 fprintf_unfiltered (file,
982 "gdbarch_dump: fp0_regnum = %s\n",
983 plongest (gdbarch->fp0_regnum));
984 fprintf_unfiltered (file,
985 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
986 gdbarch_frame_align_p (gdbarch));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: frame_align = <%s>\n",
989 host_address_to_string (gdbarch->frame_align));
990 fprintf_unfiltered (file,
991 "gdbarch_dump: frame_args_skip = %s\n",
992 core_addr_to_string_nz (gdbarch->frame_args_skip));
993 fprintf_unfiltered (file,
994 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
995 gdbarch_frame_num_args_p (gdbarch));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: frame_num_args = <%s>\n",
998 host_address_to_string (gdbarch->frame_num_args));
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: frame_red_zone_size = %s\n",
1001 plongest (gdbarch->frame_red_zone_size));
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
1004 gdbarch_gcore_bfd_target_p (gdbarch));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: gcore_bfd_target = %s\n",
1007 pstring (gdbarch->gcore_bfd_target));
1008 fprintf_unfiltered (file,
1009 "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
1010 gdbarch_gdb_signal_from_target_p (gdbarch));
1011 fprintf_unfiltered (file,
1012 "gdbarch_dump: gdb_signal_from_target = <%s>\n",
1013 host_address_to_string (gdbarch->gdb_signal_from_target));
1014 fprintf_unfiltered (file,
1015 "gdbarch_dump: gen_return_address = <%s>\n",
1016 host_address_to_string (gdbarch->gen_return_address));
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1019 gdbarch_get_longjmp_target_p (gdbarch));
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: get_longjmp_target = <%s>\n",
1022 host_address_to_string (gdbarch->get_longjmp_target));
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
1025 gdbarch_get_siginfo_type_p (gdbarch));
1026 fprintf_unfiltered (file,
1027 "gdbarch_dump: get_siginfo_type = <%s>\n",
1028 host_address_to_string (gdbarch->get_siginfo_type));
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
1031 gdbarch_get_syscall_number_p (gdbarch));
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: get_syscall_number = <%s>\n",
1034 host_address_to_string (gdbarch->get_syscall_number));
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: half_bit = %s\n",
1037 plongest (gdbarch->half_bit));
1038 fprintf_unfiltered (file,
1039 "gdbarch_dump: half_format = %s\n",
1040 pformat (gdbarch->half_format));
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: has_dos_based_file_system = %s\n",
1043 plongest (gdbarch->has_dos_based_file_system));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: has_global_breakpoints = %s\n",
1046 plongest (gdbarch->has_global_breakpoints));
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: has_global_solist = %s\n",
1049 plongest (gdbarch->has_global_solist));
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: has_shared_address_space = <%s>\n",
1052 host_address_to_string (gdbarch->has_shared_address_space));
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1055 plongest (gdbarch->have_nonsteppable_watchpoint));
1056 fprintf_unfiltered (file,
1057 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
1058 host_address_to_string (gdbarch->in_function_epilogue_p));
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
1061 host_address_to_string (gdbarch->in_solib_return_trampoline));
1062 fprintf_unfiltered (file,
1063 "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
1064 gdbarch_info_proc_p (gdbarch));
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: info_proc = <%s>\n",
1067 host_address_to_string (gdbarch->info_proc));
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: inner_than = <%s>\n",
1070 host_address_to_string (gdbarch->inner_than));
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: int_bit = %s\n",
1073 plongest (gdbarch->int_bit));
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1076 gdbarch_integer_to_address_p (gdbarch));
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: integer_to_address = <%s>\n",
1079 host_address_to_string (gdbarch->integer_to_address));
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
1082 host_address_to_string (gdbarch->iterate_over_objfiles_in_search_order));
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: long_bit = %s\n",
1085 plongest (gdbarch->long_bit));
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: long_double_bit = %s\n",
1088 plongest (gdbarch->long_double_bit));
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: long_double_format = %s\n",
1091 pformat (gdbarch->long_double_format));
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: long_long_align_bit = %s\n",
1094 plongest (gdbarch->long_long_align_bit));
1095 fprintf_unfiltered (file,
1096 "gdbarch_dump: long_long_bit = %s\n",
1097 plongest (gdbarch->long_long_bit));
1098 fprintf_unfiltered (file,
1099 "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
1100 gdbarch_make_corefile_notes_p (gdbarch));
1101 fprintf_unfiltered (file,
1102 "gdbarch_dump: make_corefile_notes = <%s>\n",
1103 host_address_to_string (gdbarch->make_corefile_notes));
1104 fprintf_unfiltered (file,
1105 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1106 gdbarch_max_insn_length_p (gdbarch));
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: max_insn_length = %s\n",
1109 plongest (gdbarch->max_insn_length));
1110 fprintf_unfiltered (file,
1111 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1112 host_address_to_string (gdbarch->memory_insert_breakpoint));
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1115 host_address_to_string (gdbarch->memory_remove_breakpoint));
1116 fprintf_unfiltered (file,
1117 "gdbarch_dump: num_pseudo_regs = %s\n",
1118 plongest (gdbarch->num_pseudo_regs));
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: num_regs = %s\n",
1121 plongest (gdbarch->num_regs));
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: osabi = %s\n",
1124 plongest (gdbarch->osabi));
1125 fprintf_unfiltered (file,
1126 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1127 gdbarch_overlay_update_p (gdbarch));
1128 fprintf_unfiltered (file,
1129 "gdbarch_dump: overlay_update = <%s>\n",
1130 host_address_to_string (gdbarch->overlay_update));
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: pc_regnum = %s\n",
1133 plongest (gdbarch->pc_regnum));
1134 fprintf_unfiltered (file,
1135 "gdbarch_dump: pointer_to_address = <%s>\n",
1136 host_address_to_string (gdbarch->pointer_to_address));
1137 fprintf_unfiltered (file,
1138 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1139 gdbarch_print_float_info_p (gdbarch));
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: print_float_info = <%s>\n",
1142 host_address_to_string (gdbarch->print_float_info));
1143 fprintf_unfiltered (file,
1144 "gdbarch_dump: print_insn = <%s>\n",
1145 host_address_to_string (gdbarch->print_insn));
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: print_registers_info = <%s>\n",
1148 host_address_to_string (gdbarch->print_registers_info));
1149 fprintf_unfiltered (file,
1150 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1151 gdbarch_print_vector_info_p (gdbarch));
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: print_vector_info = <%s>\n",
1154 host_address_to_string (gdbarch->print_vector_info));
1155 fprintf_unfiltered (file,
1156 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1157 gdbarch_process_record_p (gdbarch));
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: process_record = <%s>\n",
1160 host_address_to_string (gdbarch->process_record));
1161 fprintf_unfiltered (file,
1162 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1163 gdbarch_process_record_signal_p (gdbarch));
1164 fprintf_unfiltered (file,
1165 "gdbarch_dump: process_record_signal = <%s>\n",
1166 host_address_to_string (gdbarch->process_record_signal));
1167 fprintf_unfiltered (file,
1168 "gdbarch_dump: ps_regnum = %s\n",
1169 plongest (gdbarch->ps_regnum));
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1172 gdbarch_pseudo_register_read_p (gdbarch));
1173 fprintf_unfiltered (file,
1174 "gdbarch_dump: pseudo_register_read = <%s>\n",
1175 host_address_to_string (gdbarch->pseudo_register_read));
1176 fprintf_unfiltered (file,
1177 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1178 gdbarch_pseudo_register_read_value_p (gdbarch));
1179 fprintf_unfiltered (file,
1180 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1181 host_address_to_string (gdbarch->pseudo_register_read_value));
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1184 gdbarch_pseudo_register_write_p (gdbarch));
1185 fprintf_unfiltered (file,
1186 "gdbarch_dump: pseudo_register_write = <%s>\n",
1187 host_address_to_string (gdbarch->pseudo_register_write));
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: ptr_bit = %s\n",
1190 plongest (gdbarch->ptr_bit));
1191 fprintf_unfiltered (file,
1192 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1193 gdbarch_push_dummy_call_p (gdbarch));
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: push_dummy_call = <%s>\n",
1196 host_address_to_string (gdbarch->push_dummy_call));
1197 fprintf_unfiltered (file,
1198 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1199 gdbarch_push_dummy_code_p (gdbarch));
1200 fprintf_unfiltered (file,
1201 "gdbarch_dump: push_dummy_code = <%s>\n",
1202 host_address_to_string (gdbarch->push_dummy_code));
1203 fprintf_unfiltered (file,
1204 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1205 gdbarch_read_pc_p (gdbarch));
1206 fprintf_unfiltered (file,
1207 "gdbarch_dump: read_pc = <%s>\n",
1208 host_address_to_string (gdbarch->read_pc));
1209 fprintf_unfiltered (file,
1210 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1211 gdbarch_record_special_symbol_p (gdbarch));
1212 fprintf_unfiltered (file,
1213 "gdbarch_dump: record_special_symbol = <%s>\n",
1214 host_address_to_string (gdbarch->record_special_symbol));
1215 fprintf_unfiltered (file,
1216 "gdbarch_dump: register_name = <%s>\n",
1217 host_address_to_string (gdbarch->register_name));
1218 fprintf_unfiltered (file,
1219 "gdbarch_dump: register_reggroup_p = <%s>\n",
1220 host_address_to_string (gdbarch->register_reggroup_p));
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: register_sim_regno = <%s>\n",
1223 host_address_to_string (gdbarch->register_sim_regno));
1224 fprintf_unfiltered (file,
1225 "gdbarch_dump: register_to_value = <%s>\n",
1226 host_address_to_string (gdbarch->register_to_value));
1227 fprintf_unfiltered (file,
1228 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1229 gdbarch_register_type_p (gdbarch));
1230 fprintf_unfiltered (file,
1231 "gdbarch_dump: register_type = <%s>\n",
1232 host_address_to_string (gdbarch->register_type));
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1235 gdbarch_regset_from_core_section_p (gdbarch));
1236 fprintf_unfiltered (file,
1237 "gdbarch_dump: regset_from_core_section = <%s>\n",
1238 host_address_to_string (gdbarch->regset_from_core_section));
1239 fprintf_unfiltered (file,
1240 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1241 gdbarch_relocate_instruction_p (gdbarch));
1242 fprintf_unfiltered (file,
1243 "gdbarch_dump: relocate_instruction = <%s>\n",
1244 host_address_to_string (gdbarch->relocate_instruction));
1245 fprintf_unfiltered (file,
1246 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1247 host_address_to_string (gdbarch->remote_breakpoint_from_pc));
1248 fprintf_unfiltered (file,
1249 "gdbarch_dump: remote_register_number = <%s>\n",
1250 host_address_to_string (gdbarch->remote_register_number));
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
1253 host_address_to_string (gdbarch->return_in_first_hidden_param_p));
1254 fprintf_unfiltered (file,
1255 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1256 gdbarch_return_value_p (gdbarch));
1257 fprintf_unfiltered (file,
1258 "gdbarch_dump: return_value = <%s>\n",
1259 host_address_to_string (gdbarch->return_value));
1260 fprintf_unfiltered (file,
1261 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1262 host_address_to_string (gdbarch->sdb_reg_to_regnum));
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: short_bit = %s\n",
1265 plongest (gdbarch->short_bit));
1266 fprintf_unfiltered (file,
1267 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1268 gdbarch_single_step_through_delay_p (gdbarch));
1269 fprintf_unfiltered (file,
1270 "gdbarch_dump: single_step_through_delay = <%s>\n",
1271 host_address_to_string (gdbarch->single_step_through_delay));
1272 fprintf_unfiltered (file,
1273 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1274 gdbarch_skip_main_prologue_p (gdbarch));
1275 fprintf_unfiltered (file,
1276 "gdbarch_dump: skip_main_prologue = <%s>\n",
1277 host_address_to_string (gdbarch->skip_main_prologue));
1278 fprintf_unfiltered (file,
1279 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1280 gdbarch_skip_permanent_breakpoint_p (gdbarch));
1281 fprintf_unfiltered (file,
1282 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1283 host_address_to_string (gdbarch->skip_permanent_breakpoint));
1284 fprintf_unfiltered (file,
1285 "gdbarch_dump: skip_prologue = <%s>\n",
1286 host_address_to_string (gdbarch->skip_prologue));
1287 fprintf_unfiltered (file,
1288 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1289 host_address_to_string (gdbarch->skip_solib_resolver));
1290 fprintf_unfiltered (file,
1291 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1292 host_address_to_string (gdbarch->skip_trampoline_code));
1293 fprintf_unfiltered (file,
1294 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1295 gdbarch_software_single_step_p (gdbarch));
1296 fprintf_unfiltered (file,
1297 "gdbarch_dump: software_single_step = <%s>\n",
1298 host_address_to_string (gdbarch->software_single_step));
1299 fprintf_unfiltered (file,
1300 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1301 plongest (gdbarch->sofun_address_maybe_missing));
1302 fprintf_unfiltered (file,
1303 "gdbarch_dump: solib_symbols_extension = %s\n",
1304 pstring (gdbarch->solib_symbols_extension));
1305 fprintf_unfiltered (file,
1306 "gdbarch_dump: sp_regnum = %s\n",
1307 plongest (gdbarch->sp_regnum));
1308 fprintf_unfiltered (file,
1309 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1310 host_address_to_string (gdbarch->stab_reg_to_regnum));
1311 fprintf_unfiltered (file,
1312 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1313 host_address_to_string (gdbarch->stabs_argument_has_addr));
1314 fprintf_unfiltered (file,
1315 "gdbarch_dump: stap_gdb_register_prefix = %s\n",
1316 pstring (gdbarch->stap_gdb_register_prefix));
1317 fprintf_unfiltered (file,
1318 "gdbarch_dump: stap_gdb_register_suffix = %s\n",
1319 pstring (gdbarch->stap_gdb_register_suffix));
1320 fprintf_unfiltered (file,
1321 "gdbarch_dump: stap_integer_prefix = %s\n",
1322 pstring (gdbarch->stap_integer_prefix));
1323 fprintf_unfiltered (file,
1324 "gdbarch_dump: stap_integer_suffix = %s\n",
1325 pstring (gdbarch->stap_integer_suffix));
1326 fprintf_unfiltered (file,
1327 "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n",
1328 gdbarch_stap_is_single_operand_p (gdbarch));
1329 fprintf_unfiltered (file,
1330 "gdbarch_dump: stap_is_single_operand = <%s>\n",
1331 host_address_to_string (gdbarch->stap_is_single_operand));
1332 fprintf_unfiltered (file,
1333 "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n",
1334 gdbarch_stap_parse_special_token_p (gdbarch));
1335 fprintf_unfiltered (file,
1336 "gdbarch_dump: stap_parse_special_token = <%s>\n",
1337 host_address_to_string (gdbarch->stap_parse_special_token));
1338 fprintf_unfiltered (file,
1339 "gdbarch_dump: stap_register_indirection_prefix = %s\n",
1340 pstring (gdbarch->stap_register_indirection_prefix));
1341 fprintf_unfiltered (file,
1342 "gdbarch_dump: stap_register_indirection_suffix = %s\n",
1343 pstring (gdbarch->stap_register_indirection_suffix));
1344 fprintf_unfiltered (file,
1345 "gdbarch_dump: stap_register_prefix = %s\n",
1346 pstring (gdbarch->stap_register_prefix));
1347 fprintf_unfiltered (file,
1348 "gdbarch_dump: stap_register_suffix = %s\n",
1349 pstring (gdbarch->stap_register_suffix));
1350 fprintf_unfiltered (file,
1351 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1352 gdbarch_static_transform_name_p (gdbarch));
1353 fprintf_unfiltered (file,
1354 "gdbarch_dump: static_transform_name = <%s>\n",
1355 host_address_to_string (gdbarch->static_transform_name));
1356 fprintf_unfiltered (file,
1357 "gdbarch_dump: target_desc = %s\n",
1358 host_address_to_string (gdbarch->target_desc));
1359 fprintf_unfiltered (file,
1360 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1361 gdbarch_unwind_pc_p (gdbarch));
1362 fprintf_unfiltered (file,
1363 "gdbarch_dump: unwind_pc = <%s>\n",
1364 host_address_to_string (gdbarch->unwind_pc));
1365 fprintf_unfiltered (file,
1366 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1367 gdbarch_unwind_sp_p (gdbarch));
1368 fprintf_unfiltered (file,
1369 "gdbarch_dump: unwind_sp = <%s>\n",
1370 host_address_to_string (gdbarch->unwind_sp));
1371 fprintf_unfiltered (file,
1372 "gdbarch_dump: value_from_register = <%s>\n",
1373 host_address_to_string (gdbarch->value_from_register));
1374 fprintf_unfiltered (file,
1375 "gdbarch_dump: value_to_register = <%s>\n",
1376 host_address_to_string (gdbarch->value_to_register));
1377 fprintf_unfiltered (file,
1378 "gdbarch_dump: vbit_in_delta = %s\n",
1379 plongest (gdbarch->vbit_in_delta));
1380 fprintf_unfiltered (file,
1381 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1382 host_address_to_string (gdbarch->virtual_frame_pointer));
1383 fprintf_unfiltered (file,
1384 "gdbarch_dump: vtable_function_descriptors = %s\n",
1385 plongest (gdbarch->vtable_function_descriptors));
1386 fprintf_unfiltered (file,
1387 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1388 gdbarch_write_pc_p (gdbarch));
1389 fprintf_unfiltered (file,
1390 "gdbarch_dump: write_pc = <%s>\n",
1391 host_address_to_string (gdbarch->write_pc));
1392 if (gdbarch->dump_tdep != NULL)
1393 gdbarch->dump_tdep (gdbarch, file);
1394 }
1395
1396 struct gdbarch_tdep *
1397 gdbarch_tdep (struct gdbarch *gdbarch)
1398 {
1399 if (gdbarch_debug >= 2)
1400 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1401 return gdbarch->tdep;
1402 }
1403
1404
1405 const struct bfd_arch_info *
1406 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1407 {
1408 gdb_assert (gdbarch != NULL);
1409 if (gdbarch_debug >= 2)
1410 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1411 return gdbarch->bfd_arch_info;
1412 }
1413
1414 int
1415 gdbarch_byte_order (struct gdbarch *gdbarch)
1416 {
1417 gdb_assert (gdbarch != NULL);
1418 if (gdbarch_debug >= 2)
1419 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1420 return gdbarch->byte_order;
1421 }
1422
1423 int
1424 gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
1425 {
1426 gdb_assert (gdbarch != NULL);
1427 if (gdbarch_debug >= 2)
1428 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
1429 return gdbarch->byte_order_for_code;
1430 }
1431
1432 enum gdb_osabi
1433 gdbarch_osabi (struct gdbarch *gdbarch)
1434 {
1435 gdb_assert (gdbarch != NULL);
1436 if (gdbarch_debug >= 2)
1437 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1438 return gdbarch->osabi;
1439 }
1440
1441 const struct target_desc *
1442 gdbarch_target_desc (struct gdbarch *gdbarch)
1443 {
1444 gdb_assert (gdbarch != NULL);
1445 if (gdbarch_debug >= 2)
1446 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1447 return gdbarch->target_desc;
1448 }
1449
1450 int
1451 gdbarch_bits_big_endian (struct gdbarch *gdbarch)
1452 {
1453 gdb_assert (gdbarch != NULL);
1454 /* Skip verify of bits_big_endian, invalid_p == 0 */
1455 if (gdbarch_debug >= 2)
1456 fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
1457 return gdbarch->bits_big_endian;
1458 }
1459
1460 void
1461 set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
1462 int bits_big_endian)
1463 {
1464 gdbarch->bits_big_endian = bits_big_endian;
1465 }
1466
1467 int
1468 gdbarch_short_bit (struct gdbarch *gdbarch)
1469 {
1470 gdb_assert (gdbarch != NULL);
1471 /* Skip verify of short_bit, invalid_p == 0 */
1472 if (gdbarch_debug >= 2)
1473 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1474 return gdbarch->short_bit;
1475 }
1476
1477 void
1478 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1479 int short_bit)
1480 {
1481 gdbarch->short_bit = short_bit;
1482 }
1483
1484 int
1485 gdbarch_int_bit (struct gdbarch *gdbarch)
1486 {
1487 gdb_assert (gdbarch != NULL);
1488 /* Skip verify of int_bit, invalid_p == 0 */
1489 if (gdbarch_debug >= 2)
1490 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1491 return gdbarch->int_bit;
1492 }
1493
1494 void
1495 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1496 int int_bit)
1497 {
1498 gdbarch->int_bit = int_bit;
1499 }
1500
1501 int
1502 gdbarch_long_bit (struct gdbarch *gdbarch)
1503 {
1504 gdb_assert (gdbarch != NULL);
1505 /* Skip verify of long_bit, invalid_p == 0 */
1506 if (gdbarch_debug >= 2)
1507 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1508 return gdbarch->long_bit;
1509 }
1510
1511 void
1512 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1513 int long_bit)
1514 {
1515 gdbarch->long_bit = long_bit;
1516 }
1517
1518 int
1519 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1520 {
1521 gdb_assert (gdbarch != NULL);
1522 /* Skip verify of long_long_bit, invalid_p == 0 */
1523 if (gdbarch_debug >= 2)
1524 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1525 return gdbarch->long_long_bit;
1526 }
1527
1528 void
1529 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1530 int long_long_bit)
1531 {
1532 gdbarch->long_long_bit = long_long_bit;
1533 }
1534
1535 int
1536 gdbarch_long_long_align_bit (struct gdbarch *gdbarch)
1537 {
1538 gdb_assert (gdbarch != NULL);
1539 /* Skip verify of long_long_align_bit, invalid_p == 0 */
1540 if (gdbarch_debug >= 2)
1541 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_align_bit called\n");
1542 return gdbarch->long_long_align_bit;
1543 }
1544
1545 void
1546 set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch,
1547 int long_long_align_bit)
1548 {
1549 gdbarch->long_long_align_bit = long_long_align_bit;
1550 }
1551
1552 int
1553 gdbarch_half_bit (struct gdbarch *gdbarch)
1554 {
1555 gdb_assert (gdbarch != NULL);
1556 /* Skip verify of half_bit, invalid_p == 0 */
1557 if (gdbarch_debug >= 2)
1558 fprintf_unfiltered (gdb_stdlog, "gdbarch_half_bit called\n");
1559 return gdbarch->half_bit;
1560 }
1561
1562 void
1563 set_gdbarch_half_bit (struct gdbarch *gdbarch,
1564 int half_bit)
1565 {
1566 gdbarch->half_bit = half_bit;
1567 }
1568
1569 const struct floatformat **
1570 gdbarch_half_format (struct gdbarch *gdbarch)
1571 {
1572 gdb_assert (gdbarch != NULL);
1573 if (gdbarch_debug >= 2)
1574 fprintf_unfiltered (gdb_stdlog, "gdbarch_half_format called\n");
1575 return gdbarch->half_format;
1576 }
1577
1578 void
1579 set_gdbarch_half_format (struct gdbarch *gdbarch,
1580 const struct floatformat ** half_format)
1581 {
1582 gdbarch->half_format = half_format;
1583 }
1584
1585 int
1586 gdbarch_float_bit (struct gdbarch *gdbarch)
1587 {
1588 gdb_assert (gdbarch != NULL);
1589 /* Skip verify of float_bit, invalid_p == 0 */
1590 if (gdbarch_debug >= 2)
1591 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1592 return gdbarch->float_bit;
1593 }
1594
1595 void
1596 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1597 int float_bit)
1598 {
1599 gdbarch->float_bit = float_bit;
1600 }
1601
1602 const struct floatformat **
1603 gdbarch_float_format (struct gdbarch *gdbarch)
1604 {
1605 gdb_assert (gdbarch != NULL);
1606 if (gdbarch_debug >= 2)
1607 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1608 return gdbarch->float_format;
1609 }
1610
1611 void
1612 set_gdbarch_float_format (struct gdbarch *gdbarch,
1613 const struct floatformat ** float_format)
1614 {
1615 gdbarch->float_format = float_format;
1616 }
1617
1618 int
1619 gdbarch_double_bit (struct gdbarch *gdbarch)
1620 {
1621 gdb_assert (gdbarch != NULL);
1622 /* Skip verify of double_bit, invalid_p == 0 */
1623 if (gdbarch_debug >= 2)
1624 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1625 return gdbarch->double_bit;
1626 }
1627
1628 void
1629 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1630 int double_bit)
1631 {
1632 gdbarch->double_bit = double_bit;
1633 }
1634
1635 const struct floatformat **
1636 gdbarch_double_format (struct gdbarch *gdbarch)
1637 {
1638 gdb_assert (gdbarch != NULL);
1639 if (gdbarch_debug >= 2)
1640 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1641 return gdbarch->double_format;
1642 }
1643
1644 void
1645 set_gdbarch_double_format (struct gdbarch *gdbarch,
1646 const struct floatformat ** double_format)
1647 {
1648 gdbarch->double_format = double_format;
1649 }
1650
1651 int
1652 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1653 {
1654 gdb_assert (gdbarch != NULL);
1655 /* Skip verify of long_double_bit, invalid_p == 0 */
1656 if (gdbarch_debug >= 2)
1657 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1658 return gdbarch->long_double_bit;
1659 }
1660
1661 void
1662 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1663 int long_double_bit)
1664 {
1665 gdbarch->long_double_bit = long_double_bit;
1666 }
1667
1668 const struct floatformat **
1669 gdbarch_long_double_format (struct gdbarch *gdbarch)
1670 {
1671 gdb_assert (gdbarch != NULL);
1672 if (gdbarch_debug >= 2)
1673 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1674 return gdbarch->long_double_format;
1675 }
1676
1677 void
1678 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1679 const struct floatformat ** long_double_format)
1680 {
1681 gdbarch->long_double_format = long_double_format;
1682 }
1683
1684 int
1685 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1686 {
1687 gdb_assert (gdbarch != NULL);
1688 /* Skip verify of ptr_bit, invalid_p == 0 */
1689 if (gdbarch_debug >= 2)
1690 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1691 return gdbarch->ptr_bit;
1692 }
1693
1694 void
1695 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1696 int ptr_bit)
1697 {
1698 gdbarch->ptr_bit = ptr_bit;
1699 }
1700
1701 int
1702 gdbarch_addr_bit (struct gdbarch *gdbarch)
1703 {
1704 gdb_assert (gdbarch != NULL);
1705 /* Check variable changed from pre-default. */
1706 gdb_assert (gdbarch->addr_bit != 0);
1707 if (gdbarch_debug >= 2)
1708 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1709 return gdbarch->addr_bit;
1710 }
1711
1712 void
1713 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1714 int addr_bit)
1715 {
1716 gdbarch->addr_bit = addr_bit;
1717 }
1718
1719 int
1720 gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch)
1721 {
1722 gdb_assert (gdbarch != NULL);
1723 /* Check variable changed from pre-default. */
1724 gdb_assert (gdbarch->dwarf2_addr_size != 0);
1725 if (gdbarch_debug >= 2)
1726 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_addr_size called\n");
1727 return gdbarch->dwarf2_addr_size;
1728 }
1729
1730 void
1731 set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch,
1732 int dwarf2_addr_size)
1733 {
1734 gdbarch->dwarf2_addr_size = dwarf2_addr_size;
1735 }
1736
1737 int
1738 gdbarch_char_signed (struct gdbarch *gdbarch)
1739 {
1740 gdb_assert (gdbarch != NULL);
1741 /* Check variable changed from pre-default. */
1742 gdb_assert (gdbarch->char_signed != -1);
1743 if (gdbarch_debug >= 2)
1744 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1745 return gdbarch->char_signed;
1746 }
1747
1748 void
1749 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1750 int char_signed)
1751 {
1752 gdbarch->char_signed = char_signed;
1753 }
1754
1755 int
1756 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1757 {
1758 gdb_assert (gdbarch != NULL);
1759 return gdbarch->read_pc != NULL;
1760 }
1761
1762 CORE_ADDR
1763 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1764 {
1765 gdb_assert (gdbarch != NULL);
1766 gdb_assert (gdbarch->read_pc != NULL);
1767 if (gdbarch_debug >= 2)
1768 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1769 return gdbarch->read_pc (regcache);
1770 }
1771
1772 void
1773 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1774 gdbarch_read_pc_ftype read_pc)
1775 {
1776 gdbarch->read_pc = read_pc;
1777 }
1778
1779 int
1780 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1781 {
1782 gdb_assert (gdbarch != NULL);
1783 return gdbarch->write_pc != NULL;
1784 }
1785
1786 void
1787 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1788 {
1789 gdb_assert (gdbarch != NULL);
1790 gdb_assert (gdbarch->write_pc != NULL);
1791 if (gdbarch_debug >= 2)
1792 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1793 gdbarch->write_pc (regcache, val);
1794 }
1795
1796 void
1797 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1798 gdbarch_write_pc_ftype write_pc)
1799 {
1800 gdbarch->write_pc = write_pc;
1801 }
1802
1803 void
1804 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1805 {
1806 gdb_assert (gdbarch != NULL);
1807 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1808 if (gdbarch_debug >= 2)
1809 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1810 gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
1811 }
1812
1813 void
1814 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1815 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1816 {
1817 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1818 }
1819
1820 int
1821 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1822 {
1823 gdb_assert (gdbarch != NULL);
1824 return gdbarch->pseudo_register_read != NULL;
1825 }
1826
1827 enum register_status
1828 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1829 {
1830 gdb_assert (gdbarch != NULL);
1831 gdb_assert (gdbarch->pseudo_register_read != NULL);
1832 if (gdbarch_debug >= 2)
1833 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1834 return gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1835 }
1836
1837 void
1838 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1839 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1840 {
1841 gdbarch->pseudo_register_read = pseudo_register_read;
1842 }
1843
1844 int
1845 gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch)
1846 {
1847 gdb_assert (gdbarch != NULL);
1848 return gdbarch->pseudo_register_read_value != NULL;
1849 }
1850
1851 struct value *
1852 gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum)
1853 {
1854 gdb_assert (gdbarch != NULL);
1855 gdb_assert (gdbarch->pseudo_register_read_value != NULL);
1856 if (gdbarch_debug >= 2)
1857 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read_value called\n");
1858 return gdbarch->pseudo_register_read_value (gdbarch, regcache, cookednum);
1859 }
1860
1861 void
1862 set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch,
1863 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value)
1864 {
1865 gdbarch->pseudo_register_read_value = pseudo_register_read_value;
1866 }
1867
1868 int
1869 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1870 {
1871 gdb_assert (gdbarch != NULL);
1872 return gdbarch->pseudo_register_write != NULL;
1873 }
1874
1875 void
1876 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1877 {
1878 gdb_assert (gdbarch != NULL);
1879 gdb_assert (gdbarch->pseudo_register_write != NULL);
1880 if (gdbarch_debug >= 2)
1881 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1882 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1883 }
1884
1885 void
1886 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1887 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1888 {
1889 gdbarch->pseudo_register_write = pseudo_register_write;
1890 }
1891
1892 int
1893 gdbarch_num_regs (struct gdbarch *gdbarch)
1894 {
1895 gdb_assert (gdbarch != NULL);
1896 /* Check variable changed from pre-default. */
1897 gdb_assert (gdbarch->num_regs != -1);
1898 if (gdbarch_debug >= 2)
1899 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1900 return gdbarch->num_regs;
1901 }
1902
1903 void
1904 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1905 int num_regs)
1906 {
1907 gdbarch->num_regs = num_regs;
1908 }
1909
1910 int
1911 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1912 {
1913 gdb_assert (gdbarch != NULL);
1914 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1915 if (gdbarch_debug >= 2)
1916 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1917 return gdbarch->num_pseudo_regs;
1918 }
1919
1920 void
1921 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1922 int num_pseudo_regs)
1923 {
1924 gdbarch->num_pseudo_regs = num_pseudo_regs;
1925 }
1926
1927 int
1928 gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch)
1929 {
1930 gdb_assert (gdbarch != NULL);
1931 return gdbarch->ax_pseudo_register_collect != NULL;
1932 }
1933
1934 int
1935 gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
1936 {
1937 gdb_assert (gdbarch != NULL);
1938 gdb_assert (gdbarch->ax_pseudo_register_collect != NULL);
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_collect called\n");
1941 return gdbarch->ax_pseudo_register_collect (gdbarch, ax, reg);
1942 }
1943
1944 void
1945 set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch,
1946 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
1947 {
1948 gdbarch->ax_pseudo_register_collect = ax_pseudo_register_collect;
1949 }
1950
1951 int
1952 gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch)
1953 {
1954 gdb_assert (gdbarch != NULL);
1955 return gdbarch->ax_pseudo_register_push_stack != NULL;
1956 }
1957
1958 int
1959 gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
1960 {
1961 gdb_assert (gdbarch != NULL);
1962 gdb_assert (gdbarch->ax_pseudo_register_push_stack != NULL);
1963 if (gdbarch_debug >= 2)
1964 fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_push_stack called\n");
1965 return gdbarch->ax_pseudo_register_push_stack (gdbarch, ax, reg);
1966 }
1967
1968 void
1969 set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
1970 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack)
1971 {
1972 gdbarch->ax_pseudo_register_push_stack = ax_pseudo_register_push_stack;
1973 }
1974
1975 int
1976 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1977 {
1978 gdb_assert (gdbarch != NULL);
1979 /* Skip verify of sp_regnum, invalid_p == 0 */
1980 if (gdbarch_debug >= 2)
1981 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1982 return gdbarch->sp_regnum;
1983 }
1984
1985 void
1986 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1987 int sp_regnum)
1988 {
1989 gdbarch->sp_regnum = sp_regnum;
1990 }
1991
1992 int
1993 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1994 {
1995 gdb_assert (gdbarch != NULL);
1996 /* Skip verify of pc_regnum, invalid_p == 0 */
1997 if (gdbarch_debug >= 2)
1998 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1999 return gdbarch->pc_regnum;
2000 }
2001
2002 void
2003 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2004 int pc_regnum)
2005 {
2006 gdbarch->pc_regnum = pc_regnum;
2007 }
2008
2009 int
2010 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2011 {
2012 gdb_assert (gdbarch != NULL);
2013 /* Skip verify of ps_regnum, invalid_p == 0 */
2014 if (gdbarch_debug >= 2)
2015 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2016 return gdbarch->ps_regnum;
2017 }
2018
2019 void
2020 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2021 int ps_regnum)
2022 {
2023 gdbarch->ps_regnum = ps_regnum;
2024 }
2025
2026 int
2027 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2028 {
2029 gdb_assert (gdbarch != NULL);
2030 /* Skip verify of fp0_regnum, invalid_p == 0 */
2031 if (gdbarch_debug >= 2)
2032 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2033 return gdbarch->fp0_regnum;
2034 }
2035
2036 void
2037 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2038 int fp0_regnum)
2039 {
2040 gdbarch->fp0_regnum = fp0_regnum;
2041 }
2042
2043 int
2044 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2045 {
2046 gdb_assert (gdbarch != NULL);
2047 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2048 if (gdbarch_debug >= 2)
2049 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2050 return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
2051 }
2052
2053 void
2054 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2055 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2056 {
2057 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2058 }
2059
2060 int
2061 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2062 {
2063 gdb_assert (gdbarch != NULL);
2064 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2065 if (gdbarch_debug >= 2)
2066 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2067 return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
2068 }
2069
2070 void
2071 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2072 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2073 {
2074 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2075 }
2076
2077 int
2078 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2079 {
2080 gdb_assert (gdbarch != NULL);
2081 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2082 if (gdbarch_debug >= 2)
2083 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2084 return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
2085 }
2086
2087 void
2088 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2089 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2090 {
2091 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2092 }
2093
2094 int
2095 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2096 {
2097 gdb_assert (gdbarch != NULL);
2098 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2099 if (gdbarch_debug >= 2)
2100 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2101 return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
2102 }
2103
2104 void
2105 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2106 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2107 {
2108 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2109 }
2110
2111 const char *
2112 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2113 {
2114 gdb_assert (gdbarch != NULL);
2115 gdb_assert (gdbarch->register_name != NULL);
2116 if (gdbarch_debug >= 2)
2117 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2118 return gdbarch->register_name (gdbarch, regnr);
2119 }
2120
2121 void
2122 set_gdbarch_register_name (struct gdbarch *gdbarch,
2123 gdbarch_register_name_ftype register_name)
2124 {
2125 gdbarch->register_name = register_name;
2126 }
2127
2128 int
2129 gdbarch_register_type_p (struct gdbarch *gdbarch)
2130 {
2131 gdb_assert (gdbarch != NULL);
2132 return gdbarch->register_type != NULL;
2133 }
2134
2135 struct type *
2136 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2137 {
2138 gdb_assert (gdbarch != NULL);
2139 gdb_assert (gdbarch->register_type != NULL);
2140 if (gdbarch_debug >= 2)
2141 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2142 return gdbarch->register_type (gdbarch, reg_nr);
2143 }
2144
2145 void
2146 set_gdbarch_register_type (struct gdbarch *gdbarch,
2147 gdbarch_register_type_ftype register_type)
2148 {
2149 gdbarch->register_type = register_type;
2150 }
2151
2152 int
2153 gdbarch_dummy_id_p (struct gdbarch *gdbarch)
2154 {
2155 gdb_assert (gdbarch != NULL);
2156 return gdbarch->dummy_id != NULL;
2157 }
2158
2159 struct frame_id
2160 gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
2161 {
2162 gdb_assert (gdbarch != NULL);
2163 gdb_assert (gdbarch->dummy_id != NULL);
2164 if (gdbarch_debug >= 2)
2165 fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
2166 return gdbarch->dummy_id (gdbarch, this_frame);
2167 }
2168
2169 void
2170 set_gdbarch_dummy_id (struct gdbarch *gdbarch,
2171 gdbarch_dummy_id_ftype dummy_id)
2172 {
2173 gdbarch->dummy_id = dummy_id;
2174 }
2175
2176 int
2177 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2178 {
2179 gdb_assert (gdbarch != NULL);
2180 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2181 if (gdbarch_debug >= 2)
2182 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2183 return gdbarch->deprecated_fp_regnum;
2184 }
2185
2186 void
2187 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2188 int deprecated_fp_regnum)
2189 {
2190 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2191 }
2192
2193 int
2194 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2195 {
2196 gdb_assert (gdbarch != NULL);
2197 return gdbarch->push_dummy_call != NULL;
2198 }
2199
2200 CORE_ADDR
2201 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)
2202 {
2203 gdb_assert (gdbarch != NULL);
2204 gdb_assert (gdbarch->push_dummy_call != NULL);
2205 if (gdbarch_debug >= 2)
2206 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2207 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2208 }
2209
2210 void
2211 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2212 gdbarch_push_dummy_call_ftype push_dummy_call)
2213 {
2214 gdbarch->push_dummy_call = push_dummy_call;
2215 }
2216
2217 int
2218 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2219 {
2220 gdb_assert (gdbarch != NULL);
2221 /* Skip verify of call_dummy_location, invalid_p == 0 */
2222 if (gdbarch_debug >= 2)
2223 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2224 return gdbarch->call_dummy_location;
2225 }
2226
2227 void
2228 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2229 int call_dummy_location)
2230 {
2231 gdbarch->call_dummy_location = call_dummy_location;
2232 }
2233
2234 int
2235 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2236 {
2237 gdb_assert (gdbarch != NULL);
2238 return gdbarch->push_dummy_code != NULL;
2239 }
2240
2241 CORE_ADDR
2242 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)
2243 {
2244 gdb_assert (gdbarch != NULL);
2245 gdb_assert (gdbarch->push_dummy_code != NULL);
2246 if (gdbarch_debug >= 2)
2247 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2248 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
2249 }
2250
2251 void
2252 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2253 gdbarch_push_dummy_code_ftype push_dummy_code)
2254 {
2255 gdbarch->push_dummy_code = push_dummy_code;
2256 }
2257
2258 void
2259 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2260 {
2261 gdb_assert (gdbarch != NULL);
2262 gdb_assert (gdbarch->print_registers_info != NULL);
2263 if (gdbarch_debug >= 2)
2264 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2265 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2266 }
2267
2268 void
2269 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2270 gdbarch_print_registers_info_ftype print_registers_info)
2271 {
2272 gdbarch->print_registers_info = print_registers_info;
2273 }
2274
2275 int
2276 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2277 {
2278 gdb_assert (gdbarch != NULL);
2279 return gdbarch->print_float_info != NULL;
2280 }
2281
2282 void
2283 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2284 {
2285 gdb_assert (gdbarch != NULL);
2286 gdb_assert (gdbarch->print_float_info != NULL);
2287 if (gdbarch_debug >= 2)
2288 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2289 gdbarch->print_float_info (gdbarch, file, frame, args);
2290 }
2291
2292 void
2293 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2294 gdbarch_print_float_info_ftype print_float_info)
2295 {
2296 gdbarch->print_float_info = print_float_info;
2297 }
2298
2299 int
2300 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2301 {
2302 gdb_assert (gdbarch != NULL);
2303 return gdbarch->print_vector_info != NULL;
2304 }
2305
2306 void
2307 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2308 {
2309 gdb_assert (gdbarch != NULL);
2310 gdb_assert (gdbarch->print_vector_info != NULL);
2311 if (gdbarch_debug >= 2)
2312 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2313 gdbarch->print_vector_info (gdbarch, file, frame, args);
2314 }
2315
2316 void
2317 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2318 gdbarch_print_vector_info_ftype print_vector_info)
2319 {
2320 gdbarch->print_vector_info = print_vector_info;
2321 }
2322
2323 int
2324 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2325 {
2326 gdb_assert (gdbarch != NULL);
2327 gdb_assert (gdbarch->register_sim_regno != NULL);
2328 if (gdbarch_debug >= 2)
2329 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2330 return gdbarch->register_sim_regno (gdbarch, reg_nr);
2331 }
2332
2333 void
2334 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2335 gdbarch_register_sim_regno_ftype register_sim_regno)
2336 {
2337 gdbarch->register_sim_regno = register_sim_regno;
2338 }
2339
2340 int
2341 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2342 {
2343 gdb_assert (gdbarch != NULL);
2344 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2345 if (gdbarch_debug >= 2)
2346 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2347 return gdbarch->cannot_fetch_register (gdbarch, regnum);
2348 }
2349
2350 void
2351 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2352 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2353 {
2354 gdbarch->cannot_fetch_register = cannot_fetch_register;
2355 }
2356
2357 int
2358 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2359 {
2360 gdb_assert (gdbarch != NULL);
2361 gdb_assert (gdbarch->cannot_store_register != NULL);
2362 if (gdbarch_debug >= 2)
2363 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2364 return gdbarch->cannot_store_register (gdbarch, regnum);
2365 }
2366
2367 void
2368 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2369 gdbarch_cannot_store_register_ftype cannot_store_register)
2370 {
2371 gdbarch->cannot_store_register = cannot_store_register;
2372 }
2373
2374 int
2375 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2376 {
2377 gdb_assert (gdbarch != NULL);
2378 return gdbarch->get_longjmp_target != NULL;
2379 }
2380
2381 int
2382 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
2383 {
2384 gdb_assert (gdbarch != NULL);
2385 gdb_assert (gdbarch->get_longjmp_target != NULL);
2386 if (gdbarch_debug >= 2)
2387 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2388 return gdbarch->get_longjmp_target (frame, pc);
2389 }
2390
2391 void
2392 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2393 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2394 {
2395 gdbarch->get_longjmp_target = get_longjmp_target;
2396 }
2397
2398 int
2399 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2400 {
2401 gdb_assert (gdbarch != NULL);
2402 if (gdbarch_debug >= 2)
2403 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2404 return gdbarch->believe_pcc_promotion;
2405 }
2406
2407 void
2408 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2409 int believe_pcc_promotion)
2410 {
2411 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2412 }
2413
2414 int
2415 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2416 {
2417 gdb_assert (gdbarch != NULL);
2418 gdb_assert (gdbarch->convert_register_p != NULL);
2419 if (gdbarch_debug >= 2)
2420 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2421 return gdbarch->convert_register_p (gdbarch, regnum, type);
2422 }
2423
2424 void
2425 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2426 gdbarch_convert_register_p_ftype convert_register_p)
2427 {
2428 gdbarch->convert_register_p = convert_register_p;
2429 }
2430
2431 int
2432 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep)
2433 {
2434 gdb_assert (gdbarch != NULL);
2435 gdb_assert (gdbarch->register_to_value != NULL);
2436 if (gdbarch_debug >= 2)
2437 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2438 return gdbarch->register_to_value (frame, regnum, type, buf, optimizedp, unavailablep);
2439 }
2440
2441 void
2442 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2443 gdbarch_register_to_value_ftype register_to_value)
2444 {
2445 gdbarch->register_to_value = register_to_value;
2446 }
2447
2448 void
2449 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2450 {
2451 gdb_assert (gdbarch != NULL);
2452 gdb_assert (gdbarch->value_to_register != NULL);
2453 if (gdbarch_debug >= 2)
2454 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2455 gdbarch->value_to_register (frame, regnum, type, buf);
2456 }
2457
2458 void
2459 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2460 gdbarch_value_to_register_ftype value_to_register)
2461 {
2462 gdbarch->value_to_register = value_to_register;
2463 }
2464
2465 struct value *
2466 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2467 {
2468 gdb_assert (gdbarch != NULL);
2469 gdb_assert (gdbarch->value_from_register != NULL);
2470 if (gdbarch_debug >= 2)
2471 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2472 return gdbarch->value_from_register (type, regnum, frame);
2473 }
2474
2475 void
2476 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2477 gdbarch_value_from_register_ftype value_from_register)
2478 {
2479 gdbarch->value_from_register = value_from_register;
2480 }
2481
2482 CORE_ADDR
2483 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2484 {
2485 gdb_assert (gdbarch != NULL);
2486 gdb_assert (gdbarch->pointer_to_address != NULL);
2487 if (gdbarch_debug >= 2)
2488 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2489 return gdbarch->pointer_to_address (gdbarch, type, buf);
2490 }
2491
2492 void
2493 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2494 gdbarch_pointer_to_address_ftype pointer_to_address)
2495 {
2496 gdbarch->pointer_to_address = pointer_to_address;
2497 }
2498
2499 void
2500 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2501 {
2502 gdb_assert (gdbarch != NULL);
2503 gdb_assert (gdbarch->address_to_pointer != NULL);
2504 if (gdbarch_debug >= 2)
2505 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2506 gdbarch->address_to_pointer (gdbarch, type, buf, addr);
2507 }
2508
2509 void
2510 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2511 gdbarch_address_to_pointer_ftype address_to_pointer)
2512 {
2513 gdbarch->address_to_pointer = address_to_pointer;
2514 }
2515
2516 int
2517 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2518 {
2519 gdb_assert (gdbarch != NULL);
2520 return gdbarch->integer_to_address != NULL;
2521 }
2522
2523 CORE_ADDR
2524 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2525 {
2526 gdb_assert (gdbarch != NULL);
2527 gdb_assert (gdbarch->integer_to_address != NULL);
2528 if (gdbarch_debug >= 2)
2529 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2530 return gdbarch->integer_to_address (gdbarch, type, buf);
2531 }
2532
2533 void
2534 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2535 gdbarch_integer_to_address_ftype integer_to_address)
2536 {
2537 gdbarch->integer_to_address = integer_to_address;
2538 }
2539
2540 int
2541 gdbarch_return_value_p (struct gdbarch *gdbarch)
2542 {
2543 gdb_assert (gdbarch != NULL);
2544 return gdbarch->return_value != NULL;
2545 }
2546
2547 enum return_value_convention
2548 gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2549 {
2550 gdb_assert (gdbarch != NULL);
2551 gdb_assert (gdbarch->return_value != NULL);
2552 if (gdbarch_debug >= 2)
2553 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2554 return gdbarch->return_value (gdbarch, function, valtype, regcache, readbuf, writebuf);
2555 }
2556
2557 void
2558 set_gdbarch_return_value (struct gdbarch *gdbarch,
2559 gdbarch_return_value_ftype return_value)
2560 {
2561 gdbarch->return_value = return_value;
2562 }
2563
2564 int
2565 gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type)
2566 {
2567 gdb_assert (gdbarch != NULL);
2568 gdb_assert (gdbarch->return_in_first_hidden_param_p != NULL);
2569 if (gdbarch_debug >= 2)
2570 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_in_first_hidden_param_p called\n");
2571 return gdbarch->return_in_first_hidden_param_p (gdbarch, type);
2572 }
2573
2574 void
2575 set_gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
2576 gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p)
2577 {
2578 gdbarch->return_in_first_hidden_param_p = return_in_first_hidden_param_p;
2579 }
2580
2581 CORE_ADDR
2582 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2583 {
2584 gdb_assert (gdbarch != NULL);
2585 gdb_assert (gdbarch->skip_prologue != NULL);
2586 if (gdbarch_debug >= 2)
2587 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2588 return gdbarch->skip_prologue (gdbarch, ip);
2589 }
2590
2591 void
2592 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2593 gdbarch_skip_prologue_ftype skip_prologue)
2594 {
2595 gdbarch->skip_prologue = skip_prologue;
2596 }
2597
2598 int
2599 gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
2600 {
2601 gdb_assert (gdbarch != NULL);
2602 return gdbarch->skip_main_prologue != NULL;
2603 }
2604
2605 CORE_ADDR
2606 gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2607 {
2608 gdb_assert (gdbarch != NULL);
2609 gdb_assert (gdbarch->skip_main_prologue != NULL);
2610 if (gdbarch_debug >= 2)
2611 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
2612 return gdbarch->skip_main_prologue (gdbarch, ip);
2613 }
2614
2615 void
2616 set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
2617 gdbarch_skip_main_prologue_ftype skip_main_prologue)
2618 {
2619 gdbarch->skip_main_prologue = skip_main_prologue;
2620 }
2621
2622 int
2623 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2624 {
2625 gdb_assert (gdbarch != NULL);
2626 gdb_assert (gdbarch->inner_than != NULL);
2627 if (gdbarch_debug >= 2)
2628 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2629 return gdbarch->inner_than (lhs, rhs);
2630 }
2631
2632 void
2633 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2634 gdbarch_inner_than_ftype inner_than)
2635 {
2636 gdbarch->inner_than = inner_than;
2637 }
2638
2639 const gdb_byte *
2640 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2641 {
2642 gdb_assert (gdbarch != NULL);
2643 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2644 if (gdbarch_debug >= 2)
2645 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2646 return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
2647 }
2648
2649 void
2650 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2651 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2652 {
2653 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2654 }
2655
2656 void
2657 gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
2658 {
2659 gdb_assert (gdbarch != NULL);
2660 gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
2661 if (gdbarch_debug >= 2)
2662 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
2663 gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
2664 }
2665
2666 void
2667 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
2668 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
2669 {
2670 gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
2671 }
2672
2673 int
2674 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2675 {
2676 gdb_assert (gdbarch != NULL);
2677 return gdbarch->adjust_breakpoint_address != NULL;
2678 }
2679
2680 CORE_ADDR
2681 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2682 {
2683 gdb_assert (gdbarch != NULL);
2684 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2687 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2688 }
2689
2690 void
2691 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2692 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2693 {
2694 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2695 }
2696
2697 int
2698 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2699 {
2700 gdb_assert (gdbarch != NULL);
2701 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2702 if (gdbarch_debug >= 2)
2703 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2704 return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
2705 }
2706
2707 void
2708 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2709 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2710 {
2711 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2712 }
2713
2714 int
2715 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2716 {
2717 gdb_assert (gdbarch != NULL);
2718 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2719 if (gdbarch_debug >= 2)
2720 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2721 return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
2722 }
2723
2724 void
2725 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2726 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2727 {
2728 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2729 }
2730
2731 CORE_ADDR
2732 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2733 {
2734 gdb_assert (gdbarch != NULL);
2735 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2736 if (gdbarch_debug >= 2)
2737 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2738 return gdbarch->decr_pc_after_break;
2739 }
2740
2741 void
2742 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2743 CORE_ADDR decr_pc_after_break)
2744 {
2745 gdbarch->decr_pc_after_break = decr_pc_after_break;
2746 }
2747
2748 CORE_ADDR
2749 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2750 {
2751 gdb_assert (gdbarch != NULL);
2752 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2753 if (gdbarch_debug >= 2)
2754 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2755 return gdbarch->deprecated_function_start_offset;
2756 }
2757
2758 void
2759 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2760 CORE_ADDR deprecated_function_start_offset)
2761 {
2762 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2763 }
2764
2765 int
2766 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2767 {
2768 gdb_assert (gdbarch != NULL);
2769 gdb_assert (gdbarch->remote_register_number != NULL);
2770 if (gdbarch_debug >= 2)
2771 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2772 return gdbarch->remote_register_number (gdbarch, regno);
2773 }
2774
2775 void
2776 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2777 gdbarch_remote_register_number_ftype remote_register_number)
2778 {
2779 gdbarch->remote_register_number = remote_register_number;
2780 }
2781
2782 int
2783 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2784 {
2785 gdb_assert (gdbarch != NULL);
2786 return gdbarch->fetch_tls_load_module_address != NULL;
2787 }
2788
2789 CORE_ADDR
2790 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2791 {
2792 gdb_assert (gdbarch != NULL);
2793 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2794 if (gdbarch_debug >= 2)
2795 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2796 return gdbarch->fetch_tls_load_module_address (objfile);
2797 }
2798
2799 void
2800 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2801 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2802 {
2803 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2804 }
2805
2806 CORE_ADDR
2807 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2808 {
2809 gdb_assert (gdbarch != NULL);
2810 /* Skip verify of frame_args_skip, invalid_p == 0 */
2811 if (gdbarch_debug >= 2)
2812 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2813 return gdbarch->frame_args_skip;
2814 }
2815
2816 void
2817 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2818 CORE_ADDR frame_args_skip)
2819 {
2820 gdbarch->frame_args_skip = frame_args_skip;
2821 }
2822
2823 int
2824 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2825 {
2826 gdb_assert (gdbarch != NULL);
2827 return gdbarch->unwind_pc != NULL;
2828 }
2829
2830 CORE_ADDR
2831 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2832 {
2833 gdb_assert (gdbarch != NULL);
2834 gdb_assert (gdbarch->unwind_pc != NULL);
2835 if (gdbarch_debug >= 2)
2836 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2837 return gdbarch->unwind_pc (gdbarch, next_frame);
2838 }
2839
2840 void
2841 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2842 gdbarch_unwind_pc_ftype unwind_pc)
2843 {
2844 gdbarch->unwind_pc = unwind_pc;
2845 }
2846
2847 int
2848 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2849 {
2850 gdb_assert (gdbarch != NULL);
2851 return gdbarch->unwind_sp != NULL;
2852 }
2853
2854 CORE_ADDR
2855 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2856 {
2857 gdb_assert (gdbarch != NULL);
2858 gdb_assert (gdbarch->unwind_sp != NULL);
2859 if (gdbarch_debug >= 2)
2860 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2861 return gdbarch->unwind_sp (gdbarch, next_frame);
2862 }
2863
2864 void
2865 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2866 gdbarch_unwind_sp_ftype unwind_sp)
2867 {
2868 gdbarch->unwind_sp = unwind_sp;
2869 }
2870
2871 int
2872 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2873 {
2874 gdb_assert (gdbarch != NULL);
2875 return gdbarch->frame_num_args != NULL;
2876 }
2877
2878 int
2879 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2880 {
2881 gdb_assert (gdbarch != NULL);
2882 gdb_assert (gdbarch->frame_num_args != NULL);
2883 if (gdbarch_debug >= 2)
2884 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2885 return gdbarch->frame_num_args (frame);
2886 }
2887
2888 void
2889 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2890 gdbarch_frame_num_args_ftype frame_num_args)
2891 {
2892 gdbarch->frame_num_args = frame_num_args;
2893 }
2894
2895 int
2896 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2897 {
2898 gdb_assert (gdbarch != NULL);
2899 return gdbarch->frame_align != NULL;
2900 }
2901
2902 CORE_ADDR
2903 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2904 {
2905 gdb_assert (gdbarch != NULL);
2906 gdb_assert (gdbarch->frame_align != NULL);
2907 if (gdbarch_debug >= 2)
2908 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2909 return gdbarch->frame_align (gdbarch, address);
2910 }
2911
2912 void
2913 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2914 gdbarch_frame_align_ftype frame_align)
2915 {
2916 gdbarch->frame_align = frame_align;
2917 }
2918
2919 int
2920 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2921 {
2922 gdb_assert (gdbarch != NULL);
2923 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2924 if (gdbarch_debug >= 2)
2925 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2926 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2927 }
2928
2929 void
2930 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2931 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2932 {
2933 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2934 }
2935
2936 int
2937 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2938 {
2939 gdb_assert (gdbarch != NULL);
2940 if (gdbarch_debug >= 2)
2941 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2942 return gdbarch->frame_red_zone_size;
2943 }
2944
2945 void
2946 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2947 int frame_red_zone_size)
2948 {
2949 gdbarch->frame_red_zone_size = frame_red_zone_size;
2950 }
2951
2952 CORE_ADDR
2953 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2954 {
2955 gdb_assert (gdbarch != NULL);
2956 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2957 if (gdbarch_debug >= 2)
2958 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2959 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2960 }
2961
2962 void
2963 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2964 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2965 {
2966 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2967 }
2968
2969 CORE_ADDR
2970 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2971 {
2972 gdb_assert (gdbarch != NULL);
2973 gdb_assert (gdbarch->addr_bits_remove != NULL);
2974 if (gdbarch_debug >= 2)
2975 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2976 return gdbarch->addr_bits_remove (gdbarch, addr);
2977 }
2978
2979 void
2980 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2981 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2982 {
2983 gdbarch->addr_bits_remove = addr_bits_remove;
2984 }
2985
2986 int
2987 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2988 {
2989 gdb_assert (gdbarch != NULL);
2990 return gdbarch->software_single_step != NULL;
2991 }
2992
2993 int
2994 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2995 {
2996 gdb_assert (gdbarch != NULL);
2997 gdb_assert (gdbarch->software_single_step != NULL);
2998 if (gdbarch_debug >= 2)
2999 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3000 return gdbarch->software_single_step (frame);
3001 }
3002
3003 void
3004 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3005 gdbarch_software_single_step_ftype software_single_step)
3006 {
3007 gdbarch->software_single_step = software_single_step;
3008 }
3009
3010 int
3011 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
3012 {
3013 gdb_assert (gdbarch != NULL);
3014 return gdbarch->single_step_through_delay != NULL;
3015 }
3016
3017 int
3018 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
3019 {
3020 gdb_assert (gdbarch != NULL);
3021 gdb_assert (gdbarch->single_step_through_delay != NULL);
3022 if (gdbarch_debug >= 2)
3023 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
3024 return gdbarch->single_step_through_delay (gdbarch, frame);
3025 }
3026
3027 void
3028 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
3029 gdbarch_single_step_through_delay_ftype single_step_through_delay)
3030 {
3031 gdbarch->single_step_through_delay = single_step_through_delay;
3032 }
3033
3034 int
3035 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3036 {
3037 gdb_assert (gdbarch != NULL);
3038 gdb_assert (gdbarch->print_insn != NULL);
3039 if (gdbarch_debug >= 2)
3040 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3041 return gdbarch->print_insn (vma, info);
3042 }
3043
3044 void
3045 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3046 gdbarch_print_insn_ftype print_insn)
3047 {
3048 gdbarch->print_insn = print_insn;
3049 }
3050
3051 CORE_ADDR
3052 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
3053 {
3054 gdb_assert (gdbarch != NULL);
3055 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3056 if (gdbarch_debug >= 2)
3057 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3058 return gdbarch->skip_trampoline_code (frame, pc);
3059 }
3060
3061 void
3062 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3063 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3064 {
3065 gdbarch->skip_trampoline_code = skip_trampoline_code;
3066 }
3067
3068 CORE_ADDR
3069 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3070 {
3071 gdb_assert (gdbarch != NULL);
3072 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3073 if (gdbarch_debug >= 2)
3074 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3075 return gdbarch->skip_solib_resolver (gdbarch, pc);
3076 }
3077
3078 void
3079 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3080 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3081 {
3082 gdbarch->skip_solib_resolver = skip_solib_resolver;
3083 }
3084
3085 int
3086 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name)
3087 {
3088 gdb_assert (gdbarch != NULL);
3089 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3090 if (gdbarch_debug >= 2)
3091 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3092 return gdbarch->in_solib_return_trampoline (gdbarch, pc, name);
3093 }
3094
3095 void
3096 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3097 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3098 {
3099 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3100 }
3101
3102 int
3103 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3104 {
3105 gdb_assert (gdbarch != NULL);
3106 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3107 if (gdbarch_debug >= 2)
3108 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3109 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3110 }
3111
3112 void
3113 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3114 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3115 {
3116 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3117 }
3118
3119 void
3120 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3121 {
3122 gdb_assert (gdbarch != NULL);
3123 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3124 if (gdbarch_debug >= 2)
3125 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3126 gdbarch->elf_make_msymbol_special (sym, msym);
3127 }
3128
3129 void
3130 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3131 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3132 {
3133 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3134 }
3135
3136 void
3137 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3138 {
3139 gdb_assert (gdbarch != NULL);
3140 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3141 if (gdbarch_debug >= 2)
3142 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3143 gdbarch->coff_make_msymbol_special (val, msym);
3144 }
3145
3146 void
3147 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3148 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3149 {
3150 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3151 }
3152
3153 int
3154 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3155 {
3156 gdb_assert (gdbarch != NULL);
3157 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3158 if (gdbarch_debug >= 2)
3159 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3160 return gdbarch->cannot_step_breakpoint;
3161 }
3162
3163 void
3164 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3165 int cannot_step_breakpoint)
3166 {
3167 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3168 }
3169
3170 int
3171 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3172 {
3173 gdb_assert (gdbarch != NULL);
3174 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3175 if (gdbarch_debug >= 2)
3176 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3177 return gdbarch->have_nonsteppable_watchpoint;
3178 }
3179
3180 void
3181 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3182 int have_nonsteppable_watchpoint)
3183 {
3184 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3185 }
3186
3187 int
3188 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3189 {
3190 gdb_assert (gdbarch != NULL);
3191 return gdbarch->address_class_type_flags != NULL;
3192 }
3193
3194 int
3195 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3196 {
3197 gdb_assert (gdbarch != NULL);
3198 gdb_assert (gdbarch->address_class_type_flags != NULL);
3199 if (gdbarch_debug >= 2)
3200 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3201 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3202 }
3203
3204 void
3205 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3206 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3207 {
3208 gdbarch->address_class_type_flags = address_class_type_flags;
3209 }
3210
3211 int
3212 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3213 {
3214 gdb_assert (gdbarch != NULL);
3215 return gdbarch->address_class_type_flags_to_name != NULL;
3216 }
3217
3218 const char *
3219 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3220 {
3221 gdb_assert (gdbarch != NULL);
3222 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3223 if (gdbarch_debug >= 2)
3224 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3225 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3226 }
3227
3228 void
3229 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3230 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3231 {
3232 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3233 }
3234
3235 int
3236 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3237 {
3238 gdb_assert (gdbarch != NULL);
3239 return gdbarch->address_class_name_to_type_flags != NULL;
3240 }
3241
3242 int
3243 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3244 {
3245 gdb_assert (gdbarch != NULL);
3246 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3247 if (gdbarch_debug >= 2)
3248 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3249 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3250 }
3251
3252 void
3253 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3254 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3255 {
3256 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3257 }
3258
3259 int
3260 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3261 {
3262 gdb_assert (gdbarch != NULL);
3263 gdb_assert (gdbarch->register_reggroup_p != NULL);
3264 if (gdbarch_debug >= 2)
3265 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3266 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3267 }
3268
3269 void
3270 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3271 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3272 {
3273 gdbarch->register_reggroup_p = register_reggroup_p;
3274 }
3275
3276 int
3277 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3278 {
3279 gdb_assert (gdbarch != NULL);
3280 return gdbarch->fetch_pointer_argument != NULL;
3281 }
3282
3283 CORE_ADDR
3284 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3285 {
3286 gdb_assert (gdbarch != NULL);
3287 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3288 if (gdbarch_debug >= 2)
3289 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3290 return gdbarch->fetch_pointer_argument (frame, argi, type);
3291 }
3292
3293 void
3294 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3295 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3296 {
3297 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3298 }
3299
3300 int
3301 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3302 {
3303 gdb_assert (gdbarch != NULL);
3304 return gdbarch->regset_from_core_section != NULL;
3305 }
3306
3307 const struct regset *
3308 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3309 {
3310 gdb_assert (gdbarch != NULL);
3311 gdb_assert (gdbarch->regset_from_core_section != NULL);
3312 if (gdbarch_debug >= 2)
3313 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3314 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3315 }
3316
3317 void
3318 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3319 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3320 {
3321 gdbarch->regset_from_core_section = regset_from_core_section;
3322 }
3323
3324 struct core_regset_section *
3325 gdbarch_core_regset_sections (struct gdbarch *gdbarch)
3326 {
3327 gdb_assert (gdbarch != NULL);
3328 if (gdbarch_debug >= 2)
3329 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
3330 return gdbarch->core_regset_sections;
3331 }
3332
3333 void
3334 set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
3335 struct core_regset_section * core_regset_sections)
3336 {
3337 gdbarch->core_regset_sections = core_regset_sections;
3338 }
3339
3340 int
3341 gdbarch_make_corefile_notes_p (struct gdbarch *gdbarch)
3342 {
3343 gdb_assert (gdbarch != NULL);
3344 return gdbarch->make_corefile_notes != NULL;
3345 }
3346
3347 char *
3348 gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
3349 {
3350 gdb_assert (gdbarch != NULL);
3351 gdb_assert (gdbarch->make_corefile_notes != NULL);
3352 if (gdbarch_debug >= 2)
3353 fprintf_unfiltered (gdb_stdlog, "gdbarch_make_corefile_notes called\n");
3354 return gdbarch->make_corefile_notes (gdbarch, obfd, note_size);
3355 }
3356
3357 void
3358 set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch,
3359 gdbarch_make_corefile_notes_ftype make_corefile_notes)
3360 {
3361 gdbarch->make_corefile_notes = make_corefile_notes;
3362 }
3363
3364 int
3365 gdbarch_find_memory_regions_p (struct gdbarch *gdbarch)
3366 {
3367 gdb_assert (gdbarch != NULL);
3368 return gdbarch->find_memory_regions != NULL;
3369 }
3370
3371 int
3372 gdbarch_find_memory_regions (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data)
3373 {
3374 gdb_assert (gdbarch != NULL);
3375 gdb_assert (gdbarch->find_memory_regions != NULL);
3376 if (gdbarch_debug >= 2)
3377 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_memory_regions called\n");
3378 return gdbarch->find_memory_regions (gdbarch, func, data);
3379 }
3380
3381 void
3382 set_gdbarch_find_memory_regions (struct gdbarch *gdbarch,
3383 gdbarch_find_memory_regions_ftype find_memory_regions)
3384 {
3385 gdbarch->find_memory_regions = find_memory_regions;
3386 }
3387
3388 int
3389 gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
3390 {
3391 gdb_assert (gdbarch != NULL);
3392 return gdbarch->core_xfer_shared_libraries != NULL;
3393 }
3394
3395 LONGEST
3396 gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
3397 {
3398 gdb_assert (gdbarch != NULL);
3399 gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
3400 if (gdbarch_debug >= 2)
3401 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
3402 return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
3403 }
3404
3405 void
3406 set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
3407 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
3408 {
3409 gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
3410 }
3411
3412 int
3413 gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch)
3414 {
3415 gdb_assert (gdbarch != NULL);
3416 return gdbarch->core_pid_to_str != NULL;
3417 }
3418
3419 char *
3420 gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
3421 {
3422 gdb_assert (gdbarch != NULL);
3423 gdb_assert (gdbarch->core_pid_to_str != NULL);
3424 if (gdbarch_debug >= 2)
3425 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_pid_to_str called\n");
3426 return gdbarch->core_pid_to_str (gdbarch, ptid);
3427 }
3428
3429 void
3430 set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch,
3431 gdbarch_core_pid_to_str_ftype core_pid_to_str)
3432 {
3433 gdbarch->core_pid_to_str = core_pid_to_str;
3434 }
3435
3436 int
3437 gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
3438 {
3439 gdb_assert (gdbarch != NULL);
3440 return gdbarch->gcore_bfd_target != 0;
3441 }
3442
3443 const char *
3444 gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
3445 {
3446 gdb_assert (gdbarch != NULL);
3447 /* Check variable changed from pre-default. */
3448 gdb_assert (gdbarch->gcore_bfd_target != 0);
3449 if (gdbarch_debug >= 2)
3450 fprintf_unfiltered (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
3451 return gdbarch->gcore_bfd_target;
3452 }
3453
3454 void
3455 set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch,
3456 const char * gcore_bfd_target)
3457 {
3458 gdbarch->gcore_bfd_target = gcore_bfd_target;
3459 }
3460
3461 int
3462 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3463 {
3464 gdb_assert (gdbarch != NULL);
3465 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3466 if (gdbarch_debug >= 2)
3467 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3468 return gdbarch->vtable_function_descriptors;
3469 }
3470
3471 void
3472 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3473 int vtable_function_descriptors)
3474 {
3475 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3476 }
3477
3478 int
3479 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3480 {
3481 gdb_assert (gdbarch != NULL);
3482 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3483 if (gdbarch_debug >= 2)
3484 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3485 return gdbarch->vbit_in_delta;
3486 }
3487
3488 void
3489 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3490 int vbit_in_delta)
3491 {
3492 gdbarch->vbit_in_delta = vbit_in_delta;
3493 }
3494
3495 int
3496 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3497 {
3498 gdb_assert (gdbarch != NULL);
3499 return gdbarch->skip_permanent_breakpoint != NULL;
3500 }
3501
3502 void
3503 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3504 {
3505 gdb_assert (gdbarch != NULL);
3506 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3507 if (gdbarch_debug >= 2)
3508 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3509 gdbarch->skip_permanent_breakpoint (regcache);
3510 }
3511
3512 void
3513 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3514 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3515 {
3516 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3517 }
3518
3519 int
3520 gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
3521 {
3522 gdb_assert (gdbarch != NULL);
3523 return gdbarch->max_insn_length != 0;
3524 }
3525
3526 ULONGEST
3527 gdbarch_max_insn_length (struct gdbarch *gdbarch)
3528 {
3529 gdb_assert (gdbarch != NULL);
3530 /* Check variable changed from pre-default. */
3531 gdb_assert (gdbarch->max_insn_length != 0);
3532 if (gdbarch_debug >= 2)
3533 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
3534 return gdbarch->max_insn_length;
3535 }
3536
3537 void
3538 set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
3539 ULONGEST max_insn_length)
3540 {
3541 gdbarch->max_insn_length = max_insn_length;
3542 }
3543
3544 int
3545 gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
3546 {
3547 gdb_assert (gdbarch != NULL);
3548 return gdbarch->displaced_step_copy_insn != NULL;
3549 }
3550
3551 struct displaced_step_closure *
3552 gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3553 {
3554 gdb_assert (gdbarch != NULL);
3555 gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
3556 if (gdbarch_debug >= 2)
3557 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
3558 return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
3559 }
3560
3561 void
3562 set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
3563 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
3564 {
3565 gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
3566 }
3567
3568 int
3569 gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3570 {
3571 gdb_assert (gdbarch != NULL);
3572 gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
3573 if (gdbarch_debug >= 2)
3574 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n");
3575 return gdbarch->displaced_step_hw_singlestep (gdbarch, closure);
3576 }
3577
3578 void
3579 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
3580 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep)
3581 {
3582 gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep;
3583 }
3584
3585 int
3586 gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
3587 {
3588 gdb_assert (gdbarch != NULL);
3589 return gdbarch->displaced_step_fixup != NULL;
3590 }
3591
3592 void
3593 gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3594 {
3595 gdb_assert (gdbarch != NULL);
3596 gdb_assert (gdbarch->displaced_step_fixup != NULL);
3597 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3598 if (gdbarch_debug >= 2)
3599 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
3600 gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
3601 }
3602
3603 void
3604 set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
3605 gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
3606 {
3607 gdbarch->displaced_step_fixup = displaced_step_fixup;
3608 }
3609
3610 void
3611 gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3612 {
3613 gdb_assert (gdbarch != NULL);
3614 gdb_assert (gdbarch->displaced_step_free_closure != NULL);
3615 if (gdbarch_debug >= 2)
3616 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
3617 gdbarch->displaced_step_free_closure (gdbarch, closure);
3618 }
3619
3620 void
3621 set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
3622 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
3623 {
3624 gdbarch->displaced_step_free_closure = displaced_step_free_closure;
3625 }
3626
3627 CORE_ADDR
3628 gdbarch_displaced_step_location (struct gdbarch *gdbarch)
3629 {
3630 gdb_assert (gdbarch != NULL);
3631 gdb_assert (gdbarch->displaced_step_location != NULL);
3632 if (gdbarch_debug >= 2)
3633 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
3634 return gdbarch->displaced_step_location (gdbarch);
3635 }
3636
3637 void
3638 set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
3639 gdbarch_displaced_step_location_ftype displaced_step_location)
3640 {
3641 gdbarch->displaced_step_location = displaced_step_location;
3642 }
3643
3644 int
3645 gdbarch_relocate_instruction_p (struct gdbarch *gdbarch)
3646 {
3647 gdb_assert (gdbarch != NULL);
3648 return gdbarch->relocate_instruction != NULL;
3649 }
3650
3651 void
3652 gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from)
3653 {
3654 gdb_assert (gdbarch != NULL);
3655 gdb_assert (gdbarch->relocate_instruction != NULL);
3656 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3657 if (gdbarch_debug >= 2)
3658 fprintf_unfiltered (gdb_stdlog, "gdbarch_relocate_instruction called\n");
3659 gdbarch->relocate_instruction (gdbarch, to, from);
3660 }
3661
3662 void
3663 set_gdbarch_relocate_instruction (struct gdbarch *gdbarch,
3664 gdbarch_relocate_instruction_ftype relocate_instruction)
3665 {
3666 gdbarch->relocate_instruction = relocate_instruction;
3667 }
3668
3669 int
3670 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3671 {
3672 gdb_assert (gdbarch != NULL);
3673 return gdbarch->overlay_update != NULL;
3674 }
3675
3676 void
3677 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3678 {
3679 gdb_assert (gdbarch != NULL);
3680 gdb_assert (gdbarch->overlay_update != NULL);
3681 if (gdbarch_debug >= 2)
3682 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3683 gdbarch->overlay_update (osect);
3684 }
3685
3686 void
3687 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3688 gdbarch_overlay_update_ftype overlay_update)
3689 {
3690 gdbarch->overlay_update = overlay_update;
3691 }
3692
3693 int
3694 gdbarch_core_read_description_p (struct gdbarch *gdbarch)
3695 {
3696 gdb_assert (gdbarch != NULL);
3697 return gdbarch->core_read_description != NULL;
3698 }
3699
3700 const struct target_desc *
3701 gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
3702 {
3703 gdb_assert (gdbarch != NULL);
3704 gdb_assert (gdbarch->core_read_description != NULL);
3705 if (gdbarch_debug >= 2)
3706 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
3707 return gdbarch->core_read_description (gdbarch, target, abfd);
3708 }
3709
3710 void
3711 set_gdbarch_core_read_description (struct gdbarch *gdbarch,
3712 gdbarch_core_read_description_ftype core_read_description)
3713 {
3714 gdbarch->core_read_description = core_read_description;
3715 }
3716
3717 int
3718 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
3719 {
3720 gdb_assert (gdbarch != NULL);
3721 return gdbarch->static_transform_name != NULL;
3722 }
3723
3724 const char *
3725 gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name)
3726 {
3727 gdb_assert (gdbarch != NULL);
3728 gdb_assert (gdbarch->static_transform_name != NULL);
3729 if (gdbarch_debug >= 2)
3730 fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
3731 return gdbarch->static_transform_name (name);
3732 }
3733
3734 void
3735 set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
3736 gdbarch_static_transform_name_ftype static_transform_name)
3737 {
3738 gdbarch->static_transform_name = static_transform_name;
3739 }
3740
3741 int
3742 gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
3743 {
3744 gdb_assert (gdbarch != NULL);
3745 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3746 if (gdbarch_debug >= 2)
3747 fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
3748 return gdbarch->sofun_address_maybe_missing;
3749 }
3750
3751 void
3752 set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
3753 int sofun_address_maybe_missing)
3754 {
3755 gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
3756 }
3757
3758 int
3759 gdbarch_process_record_p (struct gdbarch *gdbarch)
3760 {
3761 gdb_assert (gdbarch != NULL);
3762 return gdbarch->process_record != NULL;
3763 }
3764
3765 int
3766 gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
3767 {
3768 gdb_assert (gdbarch != NULL);
3769 gdb_assert (gdbarch->process_record != NULL);
3770 if (gdbarch_debug >= 2)
3771 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
3772 return gdbarch->process_record (gdbarch, regcache, addr);
3773 }
3774
3775 void
3776 set_gdbarch_process_record (struct gdbarch *gdbarch,
3777 gdbarch_process_record_ftype process_record)
3778 {
3779 gdbarch->process_record = process_record;
3780 }
3781
3782 int
3783 gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
3784 {
3785 gdb_assert (gdbarch != NULL);
3786 return gdbarch->process_record_signal != NULL;
3787 }
3788
3789 int
3790 gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal)
3791 {
3792 gdb_assert (gdbarch != NULL);
3793 gdb_assert (gdbarch->process_record_signal != NULL);
3794 if (gdbarch_debug >= 2)
3795 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n");
3796 return gdbarch->process_record_signal (gdbarch, regcache, signal);
3797 }
3798
3799 void
3800 set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
3801 gdbarch_process_record_signal_ftype process_record_signal)
3802 {
3803 gdbarch->process_record_signal = process_record_signal;
3804 }
3805
3806 int
3807 gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch)
3808 {
3809 gdb_assert (gdbarch != NULL);
3810 return gdbarch->gdb_signal_from_target != NULL;
3811 }
3812
3813 enum gdb_signal
3814 gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo)
3815 {
3816 gdb_assert (gdbarch != NULL);
3817 gdb_assert (gdbarch->gdb_signal_from_target != NULL);
3818 if (gdbarch_debug >= 2)
3819 fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_from_target called\n");
3820 return gdbarch->gdb_signal_from_target (gdbarch, signo);
3821 }
3822
3823 void
3824 set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch,
3825 gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target)
3826 {
3827 gdbarch->gdb_signal_from_target = gdb_signal_from_target;
3828 }
3829
3830 int
3831 gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
3832 {
3833 gdb_assert (gdbarch != NULL);
3834 return gdbarch->get_siginfo_type != NULL;
3835 }
3836
3837 struct type *
3838 gdbarch_get_siginfo_type (struct gdbarch *gdbarch)
3839 {
3840 gdb_assert (gdbarch != NULL);
3841 gdb_assert (gdbarch->get_siginfo_type != NULL);
3842 if (gdbarch_debug >= 2)
3843 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n");
3844 return gdbarch->get_siginfo_type (gdbarch);
3845 }
3846
3847 void
3848 set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch,
3849 gdbarch_get_siginfo_type_ftype get_siginfo_type)
3850 {
3851 gdbarch->get_siginfo_type = get_siginfo_type;
3852 }
3853
3854 int
3855 gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
3856 {
3857 gdb_assert (gdbarch != NULL);
3858 return gdbarch->record_special_symbol != NULL;
3859 }
3860
3861 void
3862 gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
3863 {
3864 gdb_assert (gdbarch != NULL);
3865 gdb_assert (gdbarch->record_special_symbol != NULL);
3866 if (gdbarch_debug >= 2)
3867 fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
3868 gdbarch->record_special_symbol (gdbarch, objfile, sym);
3869 }
3870
3871 void
3872 set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
3873 gdbarch_record_special_symbol_ftype record_special_symbol)
3874 {
3875 gdbarch->record_special_symbol = record_special_symbol;
3876 }
3877
3878 int
3879 gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
3880 {
3881 gdb_assert (gdbarch != NULL);
3882 return gdbarch->get_syscall_number != NULL;
3883 }
3884
3885 LONGEST
3886 gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
3887 {
3888 gdb_assert (gdbarch != NULL);
3889 gdb_assert (gdbarch->get_syscall_number != NULL);
3890 if (gdbarch_debug >= 2)
3891 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
3892 return gdbarch->get_syscall_number (gdbarch, ptid);
3893 }
3894
3895 void
3896 set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
3897 gdbarch_get_syscall_number_ftype get_syscall_number)
3898 {
3899 gdbarch->get_syscall_number = get_syscall_number;
3900 }
3901
3902 const char *
3903 gdbarch_stap_integer_prefix (struct gdbarch *gdbarch)
3904 {
3905 gdb_assert (gdbarch != NULL);
3906 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
3907 if (gdbarch_debug >= 2)
3908 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_integer_prefix called\n");
3909 return gdbarch->stap_integer_prefix;
3910 }
3911
3912 void
3913 set_gdbarch_stap_integer_prefix (struct gdbarch *gdbarch,
3914 const char * stap_integer_prefix)
3915 {
3916 gdbarch->stap_integer_prefix = stap_integer_prefix;
3917 }
3918
3919 const char *
3920 gdbarch_stap_integer_suffix (struct gdbarch *gdbarch)
3921 {
3922 gdb_assert (gdbarch != NULL);
3923 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
3924 if (gdbarch_debug >= 2)
3925 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_integer_suffix called\n");
3926 return gdbarch->stap_integer_suffix;
3927 }
3928
3929 void
3930 set_gdbarch_stap_integer_suffix (struct gdbarch *gdbarch,
3931 const char * stap_integer_suffix)
3932 {
3933 gdbarch->stap_integer_suffix = stap_integer_suffix;
3934 }
3935
3936 const char *
3937 gdbarch_stap_register_prefix (struct gdbarch *gdbarch)
3938 {
3939 gdb_assert (gdbarch != NULL);
3940 /* Skip verify of stap_register_prefix, invalid_p == 0 */
3941 if (gdbarch_debug >= 2)
3942 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_prefix called\n");
3943 return gdbarch->stap_register_prefix;
3944 }
3945
3946 void
3947 set_gdbarch_stap_register_prefix (struct gdbarch *gdbarch,
3948 const char * stap_register_prefix)
3949 {
3950 gdbarch->stap_register_prefix = stap_register_prefix;
3951 }
3952
3953 const char *
3954 gdbarch_stap_register_suffix (struct gdbarch *gdbarch)
3955 {
3956 gdb_assert (gdbarch != NULL);
3957 /* Skip verify of stap_register_suffix, invalid_p == 0 */
3958 if (gdbarch_debug >= 2)
3959 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_suffix called\n");
3960 return gdbarch->stap_register_suffix;
3961 }
3962
3963 void
3964 set_gdbarch_stap_register_suffix (struct gdbarch *gdbarch,
3965 const char * stap_register_suffix)
3966 {
3967 gdbarch->stap_register_suffix = stap_register_suffix;
3968 }
3969
3970 const char *
3971 gdbarch_stap_register_indirection_prefix (struct gdbarch *gdbarch)
3972 {
3973 gdb_assert (gdbarch != NULL);
3974 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
3975 if (gdbarch_debug >= 2)
3976 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_indirection_prefix called\n");
3977 return gdbarch->stap_register_indirection_prefix;
3978 }
3979
3980 void
3981 set_gdbarch_stap_register_indirection_prefix (struct gdbarch *gdbarch,
3982 const char * stap_register_indirection_prefix)
3983 {
3984 gdbarch->stap_register_indirection_prefix = stap_register_indirection_prefix;
3985 }
3986
3987 const char *
3988 gdbarch_stap_register_indirection_suffix (struct gdbarch *gdbarch)
3989 {
3990 gdb_assert (gdbarch != NULL);
3991 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
3992 if (gdbarch_debug >= 2)
3993 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_indirection_suffix called\n");
3994 return gdbarch->stap_register_indirection_suffix;
3995 }
3996
3997 void
3998 set_gdbarch_stap_register_indirection_suffix (struct gdbarch *gdbarch,
3999 const char * stap_register_indirection_suffix)
4000 {
4001 gdbarch->stap_register_indirection_suffix = stap_register_indirection_suffix;
4002 }
4003
4004 const char *
4005 gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch)
4006 {
4007 gdb_assert (gdbarch != NULL);
4008 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
4009 if (gdbarch_debug >= 2)
4010 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_gdb_register_prefix called\n");
4011 return gdbarch->stap_gdb_register_prefix;
4012 }
4013
4014 void
4015 set_gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch,
4016 const char * stap_gdb_register_prefix)
4017 {
4018 gdbarch->stap_gdb_register_prefix = stap_gdb_register_prefix;
4019 }
4020
4021 const char *
4022 gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch)
4023 {
4024 gdb_assert (gdbarch != NULL);
4025 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
4026 if (gdbarch_debug >= 2)
4027 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_gdb_register_suffix called\n");
4028 return gdbarch->stap_gdb_register_suffix;
4029 }
4030
4031 void
4032 set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch,
4033 const char * stap_gdb_register_suffix)
4034 {
4035 gdbarch->stap_gdb_register_suffix = stap_gdb_register_suffix;
4036 }
4037
4038 int
4039 gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch)
4040 {
4041 gdb_assert (gdbarch != NULL);
4042 return gdbarch->stap_is_single_operand != NULL;
4043 }
4044
4045 int
4046 gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
4047 {
4048 gdb_assert (gdbarch != NULL);
4049 gdb_assert (gdbarch->stap_is_single_operand != NULL);
4050 if (gdbarch_debug >= 2)
4051 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_is_single_operand called\n");
4052 return gdbarch->stap_is_single_operand (gdbarch, s);
4053 }
4054
4055 void
4056 set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch,
4057 gdbarch_stap_is_single_operand_ftype stap_is_single_operand)
4058 {
4059 gdbarch->stap_is_single_operand = stap_is_single_operand;
4060 }
4061
4062 int
4063 gdbarch_stap_parse_special_token_p (struct gdbarch *gdbarch)
4064 {
4065 gdb_assert (gdbarch != NULL);
4066 return gdbarch->stap_parse_special_token != NULL;
4067 }
4068
4069 int
4070 gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, struct stap_parse_info *p)
4071 {
4072 gdb_assert (gdbarch != NULL);
4073 gdb_assert (gdbarch->stap_parse_special_token != NULL);
4074 if (gdbarch_debug >= 2)
4075 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_parse_special_token called\n");
4076 return gdbarch->stap_parse_special_token (gdbarch, p);
4077 }
4078
4079 void
4080 set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch,
4081 gdbarch_stap_parse_special_token_ftype stap_parse_special_token)
4082 {
4083 gdbarch->stap_parse_special_token = stap_parse_special_token;
4084 }
4085
4086 int
4087 gdbarch_has_global_solist (struct gdbarch *gdbarch)
4088 {
4089 gdb_assert (gdbarch != NULL);
4090 /* Skip verify of has_global_solist, invalid_p == 0 */
4091 if (gdbarch_debug >= 2)
4092 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
4093 return gdbarch->has_global_solist;
4094 }
4095
4096 void
4097 set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
4098 int has_global_solist)
4099 {
4100 gdbarch->has_global_solist = has_global_solist;
4101 }
4102
4103 int
4104 gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
4105 {
4106 gdb_assert (gdbarch != NULL);
4107 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
4108 if (gdbarch_debug >= 2)
4109 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
4110 return gdbarch->has_global_breakpoints;
4111 }
4112
4113 void
4114 set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
4115 int has_global_breakpoints)
4116 {
4117 gdbarch->has_global_breakpoints = has_global_breakpoints;
4118 }
4119
4120 int
4121 gdbarch_has_shared_address_space (struct gdbarch *gdbarch)
4122 {
4123 gdb_assert (gdbarch != NULL);
4124 gdb_assert (gdbarch->has_shared_address_space != NULL);
4125 if (gdbarch_debug >= 2)
4126 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_shared_address_space called\n");
4127 return gdbarch->has_shared_address_space (gdbarch);
4128 }
4129
4130 void
4131 set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
4132 gdbarch_has_shared_address_space_ftype has_shared_address_space)
4133 {
4134 gdbarch->has_shared_address_space = has_shared_address_space;
4135 }
4136
4137 int
4138 gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
4139 {
4140 gdb_assert (gdbarch != NULL);
4141 gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
4142 if (gdbarch_debug >= 2)
4143 fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
4144 return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
4145 }
4146
4147 void
4148 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
4149 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
4150 {
4151 gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
4152 }
4153
4154 const char *
4155 gdbarch_auto_charset (struct gdbarch *gdbarch)
4156 {
4157 gdb_assert (gdbarch != NULL);
4158 gdb_assert (gdbarch->auto_charset != NULL);
4159 if (gdbarch_debug >= 2)
4160 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_charset called\n");
4161 return gdbarch->auto_charset ();
4162 }
4163
4164 void
4165 set_gdbarch_auto_charset (struct gdbarch *gdbarch,
4166 gdbarch_auto_charset_ftype auto_charset)
4167 {
4168 gdbarch->auto_charset = auto_charset;
4169 }
4170
4171 const char *
4172 gdbarch_auto_wide_charset (struct gdbarch *gdbarch)
4173 {
4174 gdb_assert (gdbarch != NULL);
4175 gdb_assert (gdbarch->auto_wide_charset != NULL);
4176 if (gdbarch_debug >= 2)
4177 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
4178 return gdbarch->auto_wide_charset ();
4179 }
4180
4181 void
4182 set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
4183 gdbarch_auto_wide_charset_ftype auto_wide_charset)
4184 {
4185 gdbarch->auto_wide_charset = auto_wide_charset;
4186 }
4187
4188 const char *
4189 gdbarch_solib_symbols_extension (struct gdbarch *gdbarch)
4190 {
4191 gdb_assert (gdbarch != NULL);
4192 if (gdbarch_debug >= 2)
4193 fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n");
4194 return gdbarch->solib_symbols_extension;
4195 }
4196
4197 void
4198 set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch,
4199 const char * solib_symbols_extension)
4200 {
4201 gdbarch->solib_symbols_extension = solib_symbols_extension;
4202 }
4203
4204 int
4205 gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
4206 {
4207 gdb_assert (gdbarch != NULL);
4208 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
4209 if (gdbarch_debug >= 2)
4210 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_dos_based_file_system called\n");
4211 return gdbarch->has_dos_based_file_system;
4212 }
4213
4214 void
4215 set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
4216 int has_dos_based_file_system)
4217 {
4218 gdbarch->has_dos_based_file_system = has_dos_based_file_system;
4219 }
4220
4221 void
4222 gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope)
4223 {
4224 gdb_assert (gdbarch != NULL);
4225 gdb_assert (gdbarch->gen_return_address != NULL);
4226 if (gdbarch_debug >= 2)
4227 fprintf_unfiltered (gdb_stdlog, "gdbarch_gen_return_address called\n");
4228 gdbarch->gen_return_address (gdbarch, ax, value, scope);
4229 }
4230
4231 void
4232 set_gdbarch_gen_return_address (struct gdbarch *gdbarch,
4233 gdbarch_gen_return_address_ftype gen_return_address)
4234 {
4235 gdbarch->gen_return_address = gen_return_address;
4236 }
4237
4238 int
4239 gdbarch_info_proc_p (struct gdbarch *gdbarch)
4240 {
4241 gdb_assert (gdbarch != NULL);
4242 return gdbarch->info_proc != NULL;
4243 }
4244
4245 void
4246 gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
4247 {
4248 gdb_assert (gdbarch != NULL);
4249 gdb_assert (gdbarch->info_proc != NULL);
4250 if (gdbarch_debug >= 2)
4251 fprintf_unfiltered (gdb_stdlog, "gdbarch_info_proc called\n");
4252 gdbarch->info_proc (gdbarch, args, what);
4253 }
4254
4255 void
4256 set_gdbarch_info_proc (struct gdbarch *gdbarch,
4257 gdbarch_info_proc_ftype info_proc)
4258 {
4259 gdbarch->info_proc = info_proc;
4260 }
4261
4262 int
4263 gdbarch_core_info_proc_p (struct gdbarch *gdbarch)
4264 {
4265 gdb_assert (gdbarch != NULL);
4266 return gdbarch->core_info_proc != NULL;
4267 }
4268
4269 void
4270 gdbarch_core_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
4271 {
4272 gdb_assert (gdbarch != NULL);
4273 gdb_assert (gdbarch->core_info_proc != NULL);
4274 if (gdbarch_debug >= 2)
4275 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_info_proc called\n");
4276 gdbarch->core_info_proc (gdbarch, args, what);
4277 }
4278
4279 void
4280 set_gdbarch_core_info_proc (struct gdbarch *gdbarch,
4281 gdbarch_core_info_proc_ftype core_info_proc)
4282 {
4283 gdbarch->core_info_proc = core_info_proc;
4284 }
4285
4286 void
4287 gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile)
4288 {
4289 gdb_assert (gdbarch != NULL);
4290 gdb_assert (gdbarch->iterate_over_objfiles_in_search_order != NULL);
4291 if (gdbarch_debug >= 2)
4292 fprintf_unfiltered (gdb_stdlog, "gdbarch_iterate_over_objfiles_in_search_order called\n");
4293 gdbarch->iterate_over_objfiles_in_search_order (gdbarch, cb, cb_data, current_objfile);
4294 }
4295
4296 void
4297 set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch,
4298 gdbarch_iterate_over_objfiles_in_search_order_ftype iterate_over_objfiles_in_search_order)
4299 {
4300 gdbarch->iterate_over_objfiles_in_search_order = iterate_over_objfiles_in_search_order;
4301 }
4302
4303
4304 /* Keep a registry of per-architecture data-pointers required by GDB
4305 modules. */
4306
4307 struct gdbarch_data
4308 {
4309 unsigned index;
4310 int init_p;
4311 gdbarch_data_pre_init_ftype *pre_init;
4312 gdbarch_data_post_init_ftype *post_init;
4313 };
4314
4315 struct gdbarch_data_registration
4316 {
4317 struct gdbarch_data *data;
4318 struct gdbarch_data_registration *next;
4319 };
4320
4321 struct gdbarch_data_registry
4322 {
4323 unsigned nr;
4324 struct gdbarch_data_registration *registrations;
4325 };
4326
4327 struct gdbarch_data_registry gdbarch_data_registry =
4328 {
4329 0, NULL,
4330 };
4331
4332 static struct gdbarch_data *
4333 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
4334 gdbarch_data_post_init_ftype *post_init)
4335 {
4336 struct gdbarch_data_registration **curr;
4337
4338 /* Append the new registration. */
4339 for (curr = &gdbarch_data_registry.registrations;
4340 (*curr) != NULL;
4341 curr = &(*curr)->next);
4342 (*curr) = XMALLOC (struct gdbarch_data_registration);
4343 (*curr)->next = NULL;
4344 (*curr)->data = XMALLOC (struct gdbarch_data);
4345 (*curr)->data->index = gdbarch_data_registry.nr++;
4346 (*curr)->data->pre_init = pre_init;
4347 (*curr)->data->post_init = post_init;
4348 (*curr)->data->init_p = 1;
4349 return (*curr)->data;
4350 }
4351
4352 struct gdbarch_data *
4353 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
4354 {
4355 return gdbarch_data_register (pre_init, NULL);
4356 }
4357
4358 struct gdbarch_data *
4359 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
4360 {
4361 return gdbarch_data_register (NULL, post_init);
4362 }
4363
4364 /* Create/delete the gdbarch data vector. */
4365
4366 static void
4367 alloc_gdbarch_data (struct gdbarch *gdbarch)
4368 {
4369 gdb_assert (gdbarch->data == NULL);
4370 gdbarch->nr_data = gdbarch_data_registry.nr;
4371 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
4372 }
4373
4374 /* Initialize the current value of the specified per-architecture
4375 data-pointer. */
4376
4377 void
4378 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
4379 struct gdbarch_data *data,
4380 void *pointer)
4381 {
4382 gdb_assert (data->index < gdbarch->nr_data);
4383 gdb_assert (gdbarch->data[data->index] == NULL);
4384 gdb_assert (data->pre_init == NULL);
4385 gdbarch->data[data->index] = pointer;
4386 }
4387
4388 /* Return the current value of the specified per-architecture
4389 data-pointer. */
4390
4391 void *
4392 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
4393 {
4394 gdb_assert (data->index < gdbarch->nr_data);
4395 if (gdbarch->data[data->index] == NULL)
4396 {
4397 /* The data-pointer isn't initialized, call init() to get a
4398 value. */
4399 if (data->pre_init != NULL)
4400 /* Mid architecture creation: pass just the obstack, and not
4401 the entire architecture, as that way it isn't possible for
4402 pre-init code to refer to undefined architecture
4403 fields. */
4404 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
4405 else if (gdbarch->initialized_p
4406 && data->post_init != NULL)
4407 /* Post architecture creation: pass the entire architecture
4408 (as all fields are valid), but be careful to also detect
4409 recursive references. */
4410 {
4411 gdb_assert (data->init_p);
4412 data->init_p = 0;
4413 gdbarch->data[data->index] = data->post_init (gdbarch);
4414 data->init_p = 1;
4415 }
4416 else
4417 /* The architecture initialization hasn't completed - punt -
4418 hope that the caller knows what they are doing. Once
4419 deprecated_set_gdbarch_data has been initialized, this can be
4420 changed to an internal error. */
4421 return NULL;
4422 gdb_assert (gdbarch->data[data->index] != NULL);
4423 }
4424 return gdbarch->data[data->index];
4425 }
4426
4427
4428 /* Keep a registry of the architectures known by GDB. */
4429
4430 struct gdbarch_registration
4431 {
4432 enum bfd_architecture bfd_architecture;
4433 gdbarch_init_ftype *init;
4434 gdbarch_dump_tdep_ftype *dump_tdep;
4435 struct gdbarch_list *arches;
4436 struct gdbarch_registration *next;
4437 };
4438
4439 static struct gdbarch_registration *gdbarch_registry = NULL;
4440
4441 static void
4442 append_name (const char ***buf, int *nr, const char *name)
4443 {
4444 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4445 (*buf)[*nr] = name;
4446 *nr += 1;
4447 }
4448
4449 const char **
4450 gdbarch_printable_names (void)
4451 {
4452 /* Accumulate a list of names based on the registed list of
4453 architectures. */
4454 int nr_arches = 0;
4455 const char **arches = NULL;
4456 struct gdbarch_registration *rego;
4457
4458 for (rego = gdbarch_registry;
4459 rego != NULL;
4460 rego = rego->next)
4461 {
4462 const struct bfd_arch_info *ap;
4463 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4464 if (ap == NULL)
4465 internal_error (__FILE__, __LINE__,
4466 _("gdbarch_architecture_names: multi-arch unknown"));
4467 do
4468 {
4469 append_name (&arches, &nr_arches, ap->printable_name);
4470 ap = ap->next;
4471 }
4472 while (ap != NULL);
4473 }
4474 append_name (&arches, &nr_arches, NULL);
4475 return arches;
4476 }
4477
4478
4479 void
4480 gdbarch_register (enum bfd_architecture bfd_architecture,
4481 gdbarch_init_ftype *init,
4482 gdbarch_dump_tdep_ftype *dump_tdep)
4483 {
4484 struct gdbarch_registration **curr;
4485 const struct bfd_arch_info *bfd_arch_info;
4486
4487 /* Check that BFD recognizes this architecture */
4488 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4489 if (bfd_arch_info == NULL)
4490 {
4491 internal_error (__FILE__, __LINE__,
4492 _("gdbarch: Attempt to register "
4493 "unknown architecture (%d)"),
4494 bfd_architecture);
4495 }
4496 /* Check that we haven't seen this architecture before. */
4497 for (curr = &gdbarch_registry;
4498 (*curr) != NULL;
4499 curr = &(*curr)->next)
4500 {
4501 if (bfd_architecture == (*curr)->bfd_architecture)
4502 internal_error (__FILE__, __LINE__,
4503 _("gdbarch: Duplicate registration "
4504 "of architecture (%s)"),
4505 bfd_arch_info->printable_name);
4506 }
4507 /* log it */
4508 if (gdbarch_debug)
4509 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
4510 bfd_arch_info->printable_name,
4511 host_address_to_string (init));
4512 /* Append it */
4513 (*curr) = XMALLOC (struct gdbarch_registration);
4514 (*curr)->bfd_architecture = bfd_architecture;
4515 (*curr)->init = init;
4516 (*curr)->dump_tdep = dump_tdep;
4517 (*curr)->arches = NULL;
4518 (*curr)->next = NULL;
4519 }
4520
4521 void
4522 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4523 gdbarch_init_ftype *init)
4524 {
4525 gdbarch_register (bfd_architecture, init, NULL);
4526 }
4527
4528
4529 /* Look for an architecture using gdbarch_info. */
4530
4531 struct gdbarch_list *
4532 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4533 const struct gdbarch_info *info)
4534 {
4535 for (; arches != NULL; arches = arches->next)
4536 {
4537 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4538 continue;
4539 if (info->byte_order != arches->gdbarch->byte_order)
4540 continue;
4541 if (info->osabi != arches->gdbarch->osabi)
4542 continue;
4543 if (info->target_desc != arches->gdbarch->target_desc)
4544 continue;
4545 return arches;
4546 }
4547 return NULL;
4548 }
4549
4550
4551 /* Find an architecture that matches the specified INFO. Create a new
4552 architecture if needed. Return that new architecture. */
4553
4554 struct gdbarch *
4555 gdbarch_find_by_info (struct gdbarch_info info)
4556 {
4557 struct gdbarch *new_gdbarch;
4558 struct gdbarch_registration *rego;
4559
4560 /* Fill in missing parts of the INFO struct using a number of
4561 sources: "set ..."; INFOabfd supplied; and the global
4562 defaults. */
4563 gdbarch_info_fill (&info);
4564
4565 /* Must have found some sort of architecture. */
4566 gdb_assert (info.bfd_arch_info != NULL);
4567
4568 if (gdbarch_debug)
4569 {
4570 fprintf_unfiltered (gdb_stdlog,
4571 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4572 (info.bfd_arch_info != NULL
4573 ? info.bfd_arch_info->printable_name
4574 : "(null)"));
4575 fprintf_unfiltered (gdb_stdlog,
4576 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4577 info.byte_order,
4578 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4579 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4580 : "default"));
4581 fprintf_unfiltered (gdb_stdlog,
4582 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4583 info.osabi, gdbarch_osabi_name (info.osabi));
4584 fprintf_unfiltered (gdb_stdlog,
4585 "gdbarch_find_by_info: info.abfd %s\n",
4586 host_address_to_string (info.abfd));
4587 fprintf_unfiltered (gdb_stdlog,
4588 "gdbarch_find_by_info: info.tdep_info %s\n",
4589 host_address_to_string (info.tdep_info));
4590 }
4591
4592 /* Find the tdep code that knows about this architecture. */
4593 for (rego = gdbarch_registry;
4594 rego != NULL;
4595 rego = rego->next)
4596 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4597 break;
4598 if (rego == NULL)
4599 {
4600 if (gdbarch_debug)
4601 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4602 "No matching architecture\n");
4603 return 0;
4604 }
4605
4606 /* Ask the tdep code for an architecture that matches "info". */
4607 new_gdbarch = rego->init (info, rego->arches);
4608
4609 /* Did the tdep code like it? No. Reject the change and revert to
4610 the old architecture. */
4611 if (new_gdbarch == NULL)
4612 {
4613 if (gdbarch_debug)
4614 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4615 "Target rejected architecture\n");
4616 return NULL;
4617 }
4618
4619 /* Is this a pre-existing architecture (as determined by already
4620 being initialized)? Move it to the front of the architecture
4621 list (keeping the list sorted Most Recently Used). */
4622 if (new_gdbarch->initialized_p)
4623 {
4624 struct gdbarch_list **list;
4625 struct gdbarch_list *this;
4626 if (gdbarch_debug)
4627 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4628 "Previous architecture %s (%s) selected\n",
4629 host_address_to_string (new_gdbarch),
4630 new_gdbarch->bfd_arch_info->printable_name);
4631 /* Find the existing arch in the list. */
4632 for (list = &rego->arches;
4633 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4634 list = &(*list)->next);
4635 /* It had better be in the list of architectures. */
4636 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4637 /* Unlink THIS. */
4638 this = (*list);
4639 (*list) = this->next;
4640 /* Insert THIS at the front. */
4641 this->next = rego->arches;
4642 rego->arches = this;
4643 /* Return it. */
4644 return new_gdbarch;
4645 }
4646
4647 /* It's a new architecture. */
4648 if (gdbarch_debug)
4649 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
4650 "New architecture %s (%s) selected\n",
4651 host_address_to_string (new_gdbarch),
4652 new_gdbarch->bfd_arch_info->printable_name);
4653
4654 /* Insert the new architecture into the front of the architecture
4655 list (keep the list sorted Most Recently Used). */
4656 {
4657 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4658 this->next = rego->arches;
4659 this->gdbarch = new_gdbarch;
4660 rego->arches = this;
4661 }
4662
4663 /* Check that the newly installed architecture is valid. Plug in
4664 any post init values. */
4665 new_gdbarch->dump_tdep = rego->dump_tdep;
4666 verify_gdbarch (new_gdbarch);
4667 new_gdbarch->initialized_p = 1;
4668
4669 if (gdbarch_debug)
4670 gdbarch_dump (new_gdbarch, gdb_stdlog);
4671
4672 return new_gdbarch;
4673 }
4674
4675 /* Make the specified architecture current. */
4676
4677 void
4678 set_target_gdbarch (struct gdbarch *new_gdbarch)
4679 {
4680 gdb_assert (new_gdbarch != NULL);
4681 gdb_assert (new_gdbarch->initialized_p);
4682 current_inferior ()->gdbarch = new_gdbarch;
4683 observer_notify_architecture_changed (new_gdbarch);
4684 registers_changed ();
4685 }
4686
4687 /* Return the current inferior's arch. */
4688
4689 struct gdbarch *
4690 target_gdbarch (void)
4691 {
4692 return current_inferior ()->gdbarch;
4693 }
4694
4695 extern void _initialize_gdbarch (void);
4696
4697 void
4698 _initialize_gdbarch (void)
4699 {
4700 add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
4701 Set architecture debugging."), _("\
4702 Show architecture debugging."), _("\
4703 When non-zero, architecture debugging is enabled."),
4704 NULL,
4705 show_gdbarch_debug,
4706 &setdebuglist, &showdebuglist);
4707 }