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