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