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