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