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