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