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