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