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