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