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