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