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