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