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