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