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