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