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