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