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