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