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