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