Allow for the possibility that the local labels won't be in the objdump output.
[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.
338d7c5c 4 Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
c906108c 5
96baa820
JM
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
c906108c 12
96baa820
JM
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
c906108c 17
96baa820
JM
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
adf40b2e 22
104c1213
JM
23/* This file was created with the aid of ``gdbarch.sh''.
24
52204a0b 25 The Bourne shell script ``gdbarch.sh'' creates the files
104c1213
JM
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
28 being reported.
29
30 If editing this file, please also run gdbarch.sh and merge any
52204a0b 31 changes into that script. Conversely, when making sweeping changes
104c1213
JM
32 to this file, modifying gdbarch.sh and using its output may prove
33 easier. */
c906108c 34
c906108c
SS
35
36#include "defs.h"
1ad03bde 37#include "arch-utils.h"
c906108c 38
0f71a2f6
JM
39#if GDB_MULTI_ARCH
40#include "gdbcmd.h"
adf40b2e 41#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
0f71a2f6 42#else
7a292a7a
SS
43/* Just include everything in sight so that the every old definition
44 of macro is visible. */
45#include "gdb_string.h"
46#include <ctype.h>
47#include "symtab.h"
48#include "frame.h"
49#include "inferior.h"
50#include "breakpoint.h"
03f2053f 51#include "gdb_wait.h"
7a292a7a
SS
52#include "gdbcore.h"
53#include "gdbcmd.h"
54#include "target.h"
55#include "gdbthread.h"
56#include "annotate.h"
57#include "symfile.h" /* for overlay functions */
0f71a2f6 58#endif
7a292a7a 59#include "symcat.h"
c906108c 60
f0d4cc9e 61#include "floatformat.h"
c906108c 62
95160752
AC
63#include "gdb_assert.h"
64
104c1213
JM
65/* Static function declarations */
66
67static void verify_gdbarch (struct gdbarch *gdbarch);
95160752 68static void alloc_gdbarch_data (struct gdbarch *);
104c1213 69static void init_gdbarch_data (struct gdbarch *);
95160752 70static void free_gdbarch_data (struct gdbarch *);
104c1213
JM
71static void init_gdbarch_swap (struct gdbarch *);
72static void swapout_gdbarch_swap (struct gdbarch *);
73static void swapin_gdbarch_swap (struct gdbarch *);
74
0f71a2f6
JM
75/* Convenience macro for allocting typesafe memory. */
76
77#ifndef XMALLOC
78#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
79#endif
80
81
82/* Non-zero if we want to trace architecture code. */
83
84#ifndef GDBARCH_DEBUG
85#define GDBARCH_DEBUG 0
86#endif
87int gdbarch_debug = GDBARCH_DEBUG;
88
89
90/* Maintain the struct gdbarch object */
91
92struct gdbarch
adf40b2e
JM
93{
94 /* basic architectural information */
95 const struct bfd_arch_info * bfd_arch_info;
96 int byte_order;
0f71a2f6 97
adf40b2e
JM
98 /* target specific vector. */
99 struct gdbarch_tdep *tdep;
4b9b3959 100 gdbarch_dump_tdep_ftype *dump_tdep;
0f71a2f6 101
adf40b2e 102 /* per-architecture data-pointers */
95160752 103 unsigned nr_data;
adf40b2e 104 void **data;
0f71a2f6 105
adf40b2e
JM
106 /* per-architecture swap-regions */
107 struct gdbarch_swap *swap;
0f71a2f6 108
adf40b2e 109 /* Multi-arch values.
0f71a2f6 110
adf40b2e 111 When extending this structure you must:
0f71a2f6 112
adf40b2e 113 Add the field below.
0f71a2f6 114
adf40b2e
JM
115 Declare set/get functions and define the corresponding
116 macro in gdbarch.h.
0f71a2f6 117
adf40b2e
JM
118 gdbarch_alloc(): If zero/NULL is not a suitable default,
119 initialize the new field.
0f71a2f6 120
adf40b2e
JM
121 verify_gdbarch(): Confirm that the target updated the field
122 correctly.
0f71a2f6 123
7e73cedf 124 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
adf40b2e 125 field is dumped out
0f71a2f6 126
c0e8c252 127 ``startup_gdbarch()'': Append an initial value to the static
adf40b2e 128 variable (base values on the host's c-type system).
0f71a2f6 129
adf40b2e
JM
130 get_gdbarch(): Implement the set/get functions (probably using
131 the macro's as shortcuts).
0f71a2f6
JM
132
133 */
134
adf40b2e
JM
135 int short_bit;
136 int int_bit;
137 int long_bit;
138 int long_long_bit;
139 int float_bit;
140 int double_bit;
141 int long_double_bit;
66b43ecb 142 int ptr_bit;
52204a0b 143 int addr_bit;
66b43ecb 144 int bfd_vma_bit;
7355ddba 145 int ieee_float;
adf40b2e
JM
146 gdbarch_read_pc_ftype *read_pc;
147 gdbarch_write_pc_ftype *write_pc;
148 gdbarch_read_fp_ftype *read_fp;
149 gdbarch_write_fp_ftype *write_fp;
150 gdbarch_read_sp_ftype *read_sp;
151 gdbarch_write_sp_ftype *write_sp;
61a0eb5b
AC
152 gdbarch_register_read_ftype *register_read;
153 gdbarch_register_write_ftype *register_write;
adf40b2e 154 int num_regs;
0aba1244 155 int num_pseudo_regs;
adf40b2e
JM
156 int sp_regnum;
157 int fp_regnum;
158 int pc_regnum;
60054393 159 int fp0_regnum;
03863182
AC
160 int npc_regnum;
161 int nnpc_regnum;
88c72b7d
AC
162 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
163 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
164 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
165 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
166 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
adf40b2e
JM
167 gdbarch_register_name_ftype *register_name;
168 int register_size;
169 int register_bytes;
170 gdbarch_register_byte_ftype *register_byte;
171 gdbarch_register_raw_size_ftype *register_raw_size;
172 int max_register_raw_size;
173 gdbarch_register_virtual_size_ftype *register_virtual_size;
174 int max_register_virtual_size;
175 gdbarch_register_virtual_type_ftype *register_virtual_type;
666e11c5 176 gdbarch_do_registers_info_ftype *do_registers_info;
7c7651b2 177 gdbarch_register_sim_regno_ftype *register_sim_regno;
2649061d 178 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
adf40b2e
JM
179 int use_generic_dummy_frames;
180 int call_dummy_location;
181 gdbarch_call_dummy_address_ftype *call_dummy_address;
182 CORE_ADDR call_dummy_start_offset;
183 CORE_ADDR call_dummy_breakpoint_offset;
184 int call_dummy_breakpoint_offset_p;
185 int call_dummy_length;
186 gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
187 int call_dummy_p;
188 LONGEST * call_dummy_words;
189 int sizeof_call_dummy_words;
190 int call_dummy_stack_adjust_p;
191 int call_dummy_stack_adjust;
192 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
193 int believe_pcc_promotion;
194 int believe_pcc_promotion_type;
b9a8e3bf 195 gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
adf40b2e
JM
196 gdbarch_get_saved_register_ftype *get_saved_register;
197 gdbarch_register_convertible_ftype *register_convertible;
198 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
199 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
7f1b2585
EZ
200 gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
201 gdbarch_store_pseudo_register_ftype *store_pseudo_register;
4478b372
JB
202 gdbarch_pointer_to_address_ftype *pointer_to_address;
203 gdbarch_address_to_pointer_ftype *address_to_pointer;
71a9f22e 204 gdbarch_return_value_on_stack_ftype *return_value_on_stack;
adf40b2e
JM
205 gdbarch_extract_return_value_ftype *extract_return_value;
206 gdbarch_push_arguments_ftype *push_arguments;
207 gdbarch_push_dummy_frame_ftype *push_dummy_frame;
208 gdbarch_push_return_address_ftype *push_return_address;
209 gdbarch_pop_frame_ftype *pop_frame;
210 gdbarch_d10v_make_daddr_ftype *d10v_make_daddr;
211 gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
212 gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
213 gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
214 gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
215 gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
216 gdbarch_store_struct_return_ftype *store_struct_return;
217 gdbarch_store_return_value_ftype *store_return_value;
218 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
219 gdbarch_use_struct_convention_ftype *use_struct_convention;
220 gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
221 gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
222 gdbarch_skip_prologue_ftype *skip_prologue;
dad41f9a 223 gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
adf40b2e
JM
224 gdbarch_inner_than_ftype *inner_than;
225 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
917317f4
JM
226 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
227 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
adf40b2e
JM
228 CORE_ADDR decr_pc_after_break;
229 CORE_ADDR function_start_offset;
230 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
231 CORE_ADDR frame_args_skip;
232 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
233 gdbarch_frame_chain_ftype *frame_chain;
234 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
235 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
236 gdbarch_frame_args_address_ftype *frame_args_address;
237 gdbarch_frame_locals_address_ftype *frame_locals_address;
238 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
239 gdbarch_frame_num_args_ftype *frame_num_args;
2ada493a 240 gdbarch_stack_align_ftype *stack_align;
1dd4193b 241 int extra_stack_alignment_needed;
d03e67c9 242 gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
d1e3cf49 243 gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
58d5518e 244 int parm_boundary;
f0d4cc9e
AC
245 const struct floatformat * float_format;
246 const struct floatformat * double_format;
247 const struct floatformat * long_double_format;
f517ea4e 248 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
64c4637f 249 gdbarch_software_single_step_ftype *software_single_step;
adf40b2e 250};
0f71a2f6
JM
251
252
253/* The default architecture uses host values (for want of a better
254 choice). */
255
256extern const struct bfd_arch_info bfd_default_arch_struct;
257
4b9b3959
AC
258struct gdbarch startup_gdbarch =
259{
0f71a2f6
JM
260 /* basic architecture information */
261 &bfd_default_arch_struct,
262 BIG_ENDIAN,
4b9b3959
AC
263 /* target specific vector and its dump routine */
264 NULL, NULL,
0f71a2f6
JM
265 /*per-architecture data-pointers and swap regions */
266 0, NULL, NULL,
267 /* Multi-arch values */
0f71a2f6
JM
268 8 * sizeof (short),
269 8 * sizeof (int),
270 8 * sizeof (long),
271 8 * sizeof (LONGEST),
272 8 * sizeof (float),
273 8 * sizeof (double),
274 8 * sizeof (long double),
66b43ecb
AC
275 8 * sizeof (void*),
276 8 * sizeof (void*),
52204a0b 277 8 * sizeof (void*),
0f71a2f6
JM
278 0,
279 0,
280 0,
281 0,
282 0,
283 0,
284 0,
285 0,
286 0,
287 0,
288 0,
289 0,
290 0,
291 0,
292 0,
293 0,
294 0,
295 0,
296 0,
297 0,
298 0,
299 0,
300 0,
301 0,
302 0,
303 0,
304 0,
305 0,
306 0,
307 0,
308 0,
309 0,
310 0,
311 0,
312 0,
b9a8e3bf 313 0,
7355ddba 314 0,
03863182
AC
315 0,
316 0,
60054393 317 0,
0aba1244 318 0,
666e11c5 319 0,
7c7651b2 320 0,
88c72b7d
AC
321 0,
322 0,
323 0,
324 0,
325 0,
2649061d 326 0,
61a0eb5b
AC
327 0,
328 0,
0f71a2f6
JM
329 generic_get_saved_register,
330 0,
331 0,
332 0,
333 0,
334 0,
335 0,
336 0,
337 0,
338 0,
339 0,
340 0,
341 0,
342 0,
343 0,
344 0,
345 0,
346 0,
347 0,
348 0,
349 0,
350 0,
351 0,
352 0,
353 0,
354 0,
355 0,
356 0,
357 0,
358 0,
359 0,
360 0,
361 0,
362 0,
363 0,
364 0,
917317f4
JM
365 0,
366 0,
4478b372
JB
367 0,
368 0,
71a9f22e 369 0,
2ada493a 370 0,
d03e67c9 371 0,
dad41f9a 372 0,
d1e3cf49 373 0,
f0d4cc9e
AC
374 0,
375 0,
376 0,
7f1b2585
EZ
377 0,
378 0,
1dd4193b 379 0,
f517ea4e 380 0,
58d5518e 381 0,
64c4637f 382 0,
c0e8c252 383 /* startup_gdbarch() */
0f71a2f6 384};
4b9b3959 385
c0e8c252 386struct gdbarch *current_gdbarch = &startup_gdbarch;
0f71a2f6
JM
387
388
66b43ecb 389/* Create a new ``struct gdbarch'' based on information provided by
0f71a2f6
JM
390 ``struct gdbarch_info''. */
391
392struct gdbarch *
104c1213
JM
393gdbarch_alloc (const struct gdbarch_info *info,
394 struct gdbarch_tdep *tdep)
0f71a2f6
JM
395{
396 struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
397 memset (gdbarch, 0, sizeof (*gdbarch));
398
95160752
AC
399 alloc_gdbarch_data (gdbarch);
400
0f71a2f6
JM
401 gdbarch->tdep = tdep;
402
403 gdbarch->bfd_arch_info = info->bfd_arch_info;
404 gdbarch->byte_order = info->byte_order;
405
406 /* Force the explicit initialization of these. */
66b43ecb
AC
407 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
408 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
409 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
410 gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
411 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
412 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
413 gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
414 gdbarch->ptr_bit = TARGET_INT_BIT;
c4093a6a 415 gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
be8dfb87
AC
416 gdbarch->read_pc = generic_target_read_pc;
417 gdbarch->write_pc = generic_target_write_pc;
418 gdbarch->read_fp = generic_target_read_fp;
419 gdbarch->write_fp = generic_target_write_fp;
420 gdbarch->read_sp = generic_target_read_sp;
421 gdbarch->write_sp = generic_target_write_sp;
0f71a2f6
JM
422 gdbarch->num_regs = -1;
423 gdbarch->sp_regnum = -1;
424 gdbarch->fp_regnum = -1;
425 gdbarch->pc_regnum = -1;
60054393 426 gdbarch->fp0_regnum = -1;
03863182
AC
427 gdbarch->npc_regnum = -1;
428 gdbarch->nnpc_regnum = -1;
88c72b7d
AC
429 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
430 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
431 gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
432 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
433 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
c0e8c252 434 gdbarch->register_name = legacy_register_name;
0f71a2f6
JM
435 gdbarch->register_size = -1;
436 gdbarch->register_bytes = -1;
437 gdbarch->max_register_raw_size = -1;
438 gdbarch->max_register_virtual_size = -1;
666e11c5 439 gdbarch->do_registers_info = do_registers_info;
7c7651b2 440 gdbarch->register_sim_regno = default_register_sim_regno;
0f71a2f6
JM
441 gdbarch->use_generic_dummy_frames = -1;
442 gdbarch->call_dummy_start_offset = -1;
443 gdbarch->call_dummy_breakpoint_offset = -1;
444 gdbarch->call_dummy_breakpoint_offset_p = -1;
445 gdbarch->call_dummy_length = -1;
446 gdbarch->call_dummy_p = -1;
c0e8c252
AC
447 gdbarch->call_dummy_words = legacy_call_dummy_words;
448 gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
0f71a2f6 449 gdbarch->call_dummy_stack_adjust_p = -1;
b9a8e3bf 450 gdbarch->coerce_float_to_double = default_coerce_float_to_double;
c0e8c252 451 gdbarch->register_convertible = generic_register_convertible_not;
ac2e2ef7
AC
452 gdbarch->pointer_to_address = unsigned_pointer_to_address;
453 gdbarch->address_to_pointer = unsigned_address_to_pointer;
71a9f22e 454 gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
dad41f9a 455 gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
c0e8c252 456 gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
917317f4
JM
457 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
458 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
0f71a2f6
JM
459 gdbarch->decr_pc_after_break = -1;
460 gdbarch->function_start_offset = -1;
c0e8c252 461 gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
0f71a2f6 462 gdbarch->frame_args_skip = -1;
c0e8c252 463 gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
1dd4193b 464 gdbarch->extra_stack_alignment_needed = 1;
f517ea4e 465 gdbarch->convert_from_func_ptr_addr = default_convert_from_func_ptr_addr;
0f71a2f6
JM
466 /* gdbarch_alloc() */
467
468 return gdbarch;
469}
470
471
058f20d5
JB
472/* Free a gdbarch struct. This should never happen in normal
473 operation --- once you've created a gdbarch, you keep it around.
474 However, if an architecture's init function encounters an error
475 building the structure, it may need to clean up a partially
476 constructed gdbarch. */
4b9b3959 477
058f20d5
JB
478void
479gdbarch_free (struct gdbarch *arch)
480{
95160752
AC
481 gdb_assert (arch != NULL);
482 free_gdbarch_data (arch);
338d7c5c 483 xfree (arch);
058f20d5
JB
484}
485
486
0f71a2f6
JM
487/* Ensure that all values in a GDBARCH are reasonable. */
488
0f71a2f6 489static void
104c1213 490verify_gdbarch (struct gdbarch *gdbarch)
0f71a2f6
JM
491{
492 /* Only perform sanity checks on a multi-arch target. */
6166d547 493 if (!GDB_MULTI_ARCH)
0f71a2f6
JM
494 return;
495 /* fundamental */
496 if (gdbarch->byte_order == 0)
8e65ff28
AC
497 internal_error (__FILE__, __LINE__,
498 "verify_gdbarch: byte-order unset");
0f71a2f6 499 if (gdbarch->bfd_arch_info == NULL)
8e65ff28
AC
500 internal_error (__FILE__, __LINE__,
501 "verify_gdbarch: bfd_arch_info unset");
0f71a2f6 502 /* Check those that need to be defined for the given multi-arch level. */
66b43ecb
AC
503 /* Skip verify of short_bit, invalid_p == 0 */
504 /* Skip verify of int_bit, invalid_p == 0 */
505 /* Skip verify of long_bit, invalid_p == 0 */
506 /* Skip verify of long_long_bit, invalid_p == 0 */
507 /* Skip verify of float_bit, invalid_p == 0 */
508 /* Skip verify of double_bit, invalid_p == 0 */
509 /* Skip verify of long_double_bit, invalid_p == 0 */
510 /* Skip verify of ptr_bit, invalid_p == 0 */
52204a0b
DT
511 if (gdbarch->addr_bit == 0)
512 gdbarch->addr_bit = TARGET_PTR_BIT;
c0e8c252 513 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
7355ddba 514 /* Skip verify of ieee_float, invalid_p == 0 */
be8dfb87
AC
515 /* Skip verify of read_pc, invalid_p == 0 */
516 /* Skip verify of write_pc, invalid_p == 0 */
517 /* Skip verify of read_fp, invalid_p == 0 */
518 /* Skip verify of write_fp, invalid_p == 0 */
519 /* Skip verify of read_sp, invalid_p == 0 */
520 /* Skip verify of write_sp, invalid_p == 0 */
61a0eb5b
AC
521 /* Skip verify of register_read, has predicate */
522 /* Skip verify of register_write, has predicate */
0f71a2f6
JM
523 if ((GDB_MULTI_ARCH >= 2)
524 && (gdbarch->num_regs == -1))
8e65ff28
AC
525 internal_error (__FILE__, __LINE__,
526 "gdbarch: verify_gdbarch: num_regs invalid");
0aba1244 527 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
0f71a2f6
JM
528 if ((GDB_MULTI_ARCH >= 2)
529 && (gdbarch->sp_regnum == -1))
8e65ff28
AC
530 internal_error (__FILE__, __LINE__,
531 "gdbarch: verify_gdbarch: sp_regnum invalid");
0f71a2f6
JM
532 if ((GDB_MULTI_ARCH >= 2)
533 && (gdbarch->fp_regnum == -1))
8e65ff28
AC
534 internal_error (__FILE__, __LINE__,
535 "gdbarch: verify_gdbarch: fp_regnum invalid");
0f71a2f6
JM
536 if ((GDB_MULTI_ARCH >= 2)
537 && (gdbarch->pc_regnum == -1))
8e65ff28
AC
538 internal_error (__FILE__, __LINE__,
539 "gdbarch: verify_gdbarch: pc_regnum invalid");
60054393 540 /* Skip verify of fp0_regnum, invalid_p == 0 */
03863182
AC
541 /* Skip verify of npc_regnum, invalid_p == 0 */
542 /* Skip verify of nnpc_regnum, invalid_p == 0 */
88c72b7d
AC
543 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
544 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
545 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
546 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
547 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
c0e8c252 548 /* Skip verify of register_name, invalid_p == 0 */
0f71a2f6
JM
549 if ((GDB_MULTI_ARCH >= 2)
550 && (gdbarch->register_size == -1))
8e65ff28
AC
551 internal_error (__FILE__, __LINE__,
552 "gdbarch: verify_gdbarch: register_size invalid");
0f71a2f6
JM
553 if ((GDB_MULTI_ARCH >= 2)
554 && (gdbarch->register_bytes == -1))
8e65ff28
AC
555 internal_error (__FILE__, __LINE__,
556 "gdbarch: verify_gdbarch: register_bytes invalid");
0f71a2f6
JM
557 if ((GDB_MULTI_ARCH >= 2)
558 && (gdbarch->register_byte == 0))
8e65ff28
AC
559 internal_error (__FILE__, __LINE__,
560 "gdbarch: verify_gdbarch: register_byte invalid");
0f71a2f6
JM
561 if ((GDB_MULTI_ARCH >= 2)
562 && (gdbarch->register_raw_size == 0))
8e65ff28
AC
563 internal_error (__FILE__, __LINE__,
564 "gdbarch: verify_gdbarch: register_raw_size invalid");
0f71a2f6
JM
565 if ((GDB_MULTI_ARCH >= 2)
566 && (gdbarch->max_register_raw_size == -1))
8e65ff28
AC
567 internal_error (__FILE__, __LINE__,
568 "gdbarch: verify_gdbarch: max_register_raw_size invalid");
0f71a2f6
JM
569 if ((GDB_MULTI_ARCH >= 2)
570 && (gdbarch->register_virtual_size == 0))
8e65ff28
AC
571 internal_error (__FILE__, __LINE__,
572 "gdbarch: verify_gdbarch: register_virtual_size invalid");
0f71a2f6
JM
573 if ((GDB_MULTI_ARCH >= 2)
574 && (gdbarch->max_register_virtual_size == -1))
8e65ff28
AC
575 internal_error (__FILE__, __LINE__,
576 "gdbarch: verify_gdbarch: max_register_virtual_size invalid");
0f71a2f6
JM
577 if ((GDB_MULTI_ARCH >= 2)
578 && (gdbarch->register_virtual_type == 0))
8e65ff28
AC
579 internal_error (__FILE__, __LINE__,
580 "gdbarch: verify_gdbarch: register_virtual_type invalid");
666e11c5 581 /* Skip verify of do_registers_info, invalid_p == 0 */
7c7651b2 582 /* Skip verify of register_sim_regno, invalid_p == 0 */
2649061d 583 /* Skip verify of register_bytes_ok, has predicate */
0f71a2f6
JM
584 if ((GDB_MULTI_ARCH >= 1)
585 && (gdbarch->use_generic_dummy_frames == -1))
8e65ff28
AC
586 internal_error (__FILE__, __LINE__,
587 "gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
0f71a2f6
JM
588 if ((GDB_MULTI_ARCH >= 2)
589 && (gdbarch->call_dummy_location == 0))
8e65ff28
AC
590 internal_error (__FILE__, __LINE__,
591 "gdbarch: verify_gdbarch: call_dummy_location invalid");
0f71a2f6
JM
592 if ((GDB_MULTI_ARCH >= 2)
593 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
8e65ff28
AC
594 internal_error (__FILE__, __LINE__,
595 "gdbarch: verify_gdbarch: call_dummy_address invalid");
0f71a2f6
JM
596 if ((GDB_MULTI_ARCH >= 2)
597 && (gdbarch->call_dummy_start_offset == -1))
8e65ff28
AC
598 internal_error (__FILE__, __LINE__,
599 "gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
0f71a2f6
JM
600 if ((GDB_MULTI_ARCH >= 2)
601 && (gdbarch->call_dummy_breakpoint_offset == -1))
8e65ff28
AC
602 internal_error (__FILE__, __LINE__,
603 "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
0f71a2f6
JM
604 if ((GDB_MULTI_ARCH >= 1)
605 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
8e65ff28
AC
606 internal_error (__FILE__, __LINE__,
607 "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
0f71a2f6
JM
608 if ((GDB_MULTI_ARCH >= 2)
609 && (gdbarch->call_dummy_length == -1))
8e65ff28
AC
610 internal_error (__FILE__, __LINE__,
611 "gdbarch: verify_gdbarch: call_dummy_length invalid");
0f71a2f6
JM
612 if ((GDB_MULTI_ARCH >= 2)
613 && (gdbarch->pc_in_call_dummy == 0))
8e65ff28
AC
614 internal_error (__FILE__, __LINE__,
615 "gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
0f71a2f6
JM
616 if ((GDB_MULTI_ARCH >= 1)
617 && (gdbarch->call_dummy_p == -1))
8e65ff28
AC
618 internal_error (__FILE__, __LINE__,
619 "gdbarch: verify_gdbarch: call_dummy_p invalid");
c0e8c252
AC
620 /* Skip verify of call_dummy_words, invalid_p == 0 */
621 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
0f71a2f6
JM
622 if ((GDB_MULTI_ARCH >= 1)
623 && (gdbarch->call_dummy_stack_adjust_p == -1))
8e65ff28
AC
624 internal_error (__FILE__, __LINE__,
625 "gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
0f71a2f6
JM
626 if ((GDB_MULTI_ARCH >= 2)
627 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
8e65ff28
AC
628 internal_error (__FILE__, __LINE__,
629 "gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
0f71a2f6
JM
630 if ((GDB_MULTI_ARCH >= 2)
631 && (gdbarch->fix_call_dummy == 0))
8e65ff28
AC
632 internal_error (__FILE__, __LINE__,
633 "gdbarch: verify_gdbarch: fix_call_dummy invalid");
c0e8c252 634 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
0f71a2f6
JM
635 if ((GDB_MULTI_ARCH >= 1)
636 && (gdbarch->get_saved_register == 0))
8e65ff28
AC
637 internal_error (__FILE__, __LINE__,
638 "gdbarch: verify_gdbarch: get_saved_register invalid");
c0e8c252
AC
639 /* Skip verify of register_convertible, invalid_p == 0 */
640 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
641 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
7f1b2585
EZ
642 /* Skip verify of fetch_pseudo_register, invalid_p == 0 */
643 /* Skip verify of store_pseudo_register, invalid_p == 0 */
4478b372
JB
644 /* Skip verify of pointer_to_address, invalid_p == 0 */
645 /* Skip verify of address_to_pointer, invalid_p == 0 */
71a9f22e 646 /* Skip verify of return_value_on_stack, invalid_p == 0 */
0f71a2f6
JM
647 if ((GDB_MULTI_ARCH >= 2)
648 && (gdbarch->extract_return_value == 0))
8e65ff28
AC
649 internal_error (__FILE__, __LINE__,
650 "gdbarch: verify_gdbarch: extract_return_value invalid");
0f71a2f6
JM
651 if ((GDB_MULTI_ARCH >= 1)
652 && (gdbarch->push_arguments == 0))
8e65ff28
AC
653 internal_error (__FILE__, __LINE__,
654 "gdbarch: verify_gdbarch: push_arguments invalid");
0f71a2f6
JM
655 if ((GDB_MULTI_ARCH >= 2)
656 && (gdbarch->push_dummy_frame == 0))
8e65ff28
AC
657 internal_error (__FILE__, __LINE__,
658 "gdbarch: verify_gdbarch: push_dummy_frame invalid");
0f71a2f6
JM
659 if ((GDB_MULTI_ARCH >= 1)
660 && (gdbarch->push_return_address == 0))
8e65ff28
AC
661 internal_error (__FILE__, __LINE__,
662 "gdbarch: verify_gdbarch: push_return_address invalid");
0f71a2f6
JM
663 if ((GDB_MULTI_ARCH >= 2)
664 && (gdbarch->pop_frame == 0))
8e65ff28
AC
665 internal_error (__FILE__, __LINE__,
666 "gdbarch: verify_gdbarch: pop_frame invalid");
c0e8c252
AC
667 /* Skip verify of d10v_make_daddr, invalid_p == 0 */
668 /* Skip verify of d10v_make_iaddr, invalid_p == 0 */
06b8da7d
MS
669 /* Skip verify of d10v_daddr_p, invalid_p == 0 */
670 /* Skip verify of d10v_iaddr_p, invalid_p == 0 */
671 /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */
672 /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */
0f71a2f6
JM
673 if ((GDB_MULTI_ARCH >= 2)
674 && (gdbarch->store_struct_return == 0))
8e65ff28
AC
675 internal_error (__FILE__, __LINE__,
676 "gdbarch: verify_gdbarch: store_struct_return invalid");
0f71a2f6
JM
677 if ((GDB_MULTI_ARCH >= 2)
678 && (gdbarch->store_return_value == 0))
8e65ff28
AC
679 internal_error (__FILE__, __LINE__,
680 "gdbarch: verify_gdbarch: store_return_value invalid");
0f71a2f6
JM
681 if ((GDB_MULTI_ARCH >= 2)
682 && (gdbarch->extract_struct_value_address == 0))
8e65ff28
AC
683 internal_error (__FILE__, __LINE__,
684 "gdbarch: verify_gdbarch: extract_struct_value_address invalid");
0f71a2f6
JM
685 if ((GDB_MULTI_ARCH >= 2)
686 && (gdbarch->use_struct_convention == 0))
8e65ff28
AC
687 internal_error (__FILE__, __LINE__,
688 "gdbarch: verify_gdbarch: use_struct_convention invalid");
0f71a2f6
JM
689 if ((GDB_MULTI_ARCH >= 2)
690 && (gdbarch->frame_init_saved_regs == 0))
8e65ff28
AC
691 internal_error (__FILE__, __LINE__,
692 "gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
0f71a2f6
JM
693 if ((GDB_MULTI_ARCH >= 2)
694 && (gdbarch->init_extra_frame_info == 0))
8e65ff28
AC
695 internal_error (__FILE__, __LINE__,
696 "gdbarch: verify_gdbarch: init_extra_frame_info invalid");
0f71a2f6
JM
697 if ((GDB_MULTI_ARCH >= 2)
698 && (gdbarch->skip_prologue == 0))
8e65ff28
AC
699 internal_error (__FILE__, __LINE__,
700 "gdbarch: verify_gdbarch: skip_prologue invalid");
dad41f9a 701 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
0f71a2f6
JM
702 if ((GDB_MULTI_ARCH >= 2)
703 && (gdbarch->inner_than == 0))
8e65ff28
AC
704 internal_error (__FILE__, __LINE__,
705 "gdbarch: verify_gdbarch: inner_than invalid");
c0e8c252
AC
706 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
707 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
708 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
0f71a2f6
JM
709 if ((GDB_MULTI_ARCH >= 2)
710 && (gdbarch->decr_pc_after_break == -1))
8e65ff28
AC
711 internal_error (__FILE__, __LINE__,
712 "gdbarch: verify_gdbarch: decr_pc_after_break invalid");
0f71a2f6
JM
713 if ((GDB_MULTI_ARCH >= 2)
714 && (gdbarch->function_start_offset == -1))
8e65ff28
AC
715 internal_error (__FILE__, __LINE__,
716 "gdbarch: verify_gdbarch: function_start_offset invalid");
c0e8c252 717 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
0f71a2f6
JM
718 if ((GDB_MULTI_ARCH >= 2)
719 && (gdbarch->frame_args_skip == -1))
8e65ff28
AC
720 internal_error (__FILE__, __LINE__,
721 "gdbarch: verify_gdbarch: frame_args_skip invalid");
c0e8c252 722 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
0f71a2f6
JM
723 if ((GDB_MULTI_ARCH >= 2)
724 && (gdbarch->frame_chain == 0))
8e65ff28
AC
725 internal_error (__FILE__, __LINE__,
726 "gdbarch: verify_gdbarch: frame_chain invalid");
0f71a2f6
JM
727 if ((GDB_MULTI_ARCH >= 1)
728 && (gdbarch->frame_chain_valid == 0))
8e65ff28
AC
729 internal_error (__FILE__, __LINE__,
730 "gdbarch: verify_gdbarch: frame_chain_valid invalid");
0f71a2f6
JM
731 if ((GDB_MULTI_ARCH >= 2)
732 && (gdbarch->frame_saved_pc == 0))
8e65ff28
AC
733 internal_error (__FILE__, __LINE__,
734 "gdbarch: verify_gdbarch: frame_saved_pc invalid");
0f71a2f6
JM
735 if ((GDB_MULTI_ARCH >= 2)
736 && (gdbarch->frame_args_address == 0))
8e65ff28
AC
737 internal_error (__FILE__, __LINE__,
738 "gdbarch: verify_gdbarch: frame_args_address invalid");
0f71a2f6
JM
739 if ((GDB_MULTI_ARCH >= 2)
740 && (gdbarch->frame_locals_address == 0))
8e65ff28
AC
741 internal_error (__FILE__, __LINE__,
742 "gdbarch: verify_gdbarch: frame_locals_address invalid");
0f71a2f6
JM
743 if ((GDB_MULTI_ARCH >= 2)
744 && (gdbarch->saved_pc_after_call == 0))
8e65ff28
AC
745 internal_error (__FILE__, __LINE__,
746 "gdbarch: verify_gdbarch: saved_pc_after_call invalid");
0f71a2f6
JM
747 if ((GDB_MULTI_ARCH >= 2)
748 && (gdbarch->frame_num_args == 0))
8e65ff28
AC
749 internal_error (__FILE__, __LINE__,
750 "gdbarch: verify_gdbarch: frame_num_args invalid");
2ada493a 751 /* Skip verify of stack_align, has predicate */
1dd4193b 752 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
d03e67c9 753 /* Skip verify of reg_struct_has_addr, has predicate */
d1e3cf49 754 /* Skip verify of save_dummy_frame_tos, has predicate */
f0d4cc9e
AC
755 if (gdbarch->float_format == 0)
756 gdbarch->float_format = default_float_format (gdbarch);
757 if (gdbarch->double_format == 0)
758 gdbarch->double_format = default_double_format (gdbarch);
759 if (gdbarch->long_double_format == 0)
760 gdbarch->long_double_format = &floatformat_unknown;
f517ea4e 761 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
64c4637f 762 /* Skip verify of software_single_step, has predicate */
0f71a2f6
JM
763}
764
765
766/* Print out the details of the current architecture. */
767
4b9b3959
AC
768/* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
769 just happens to match the global variable ``current_gdbarch''. That
770 way macros refering to that variable get the local and not the global
771 version - ulgh. Once everything is parameterised with gdbarch, this
772 will go away. */
773
0f71a2f6 774void
4b9b3959 775gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
0f71a2f6 776{
4b9b3959
AC
777 fprintf_unfiltered (file,
778 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
779 GDB_MULTI_ARCH);
780#ifdef TARGET_ARCHITECTURE
781 fprintf_unfiltered (file,
782 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
783 XSTRING (TARGET_ARCHITECTURE));
784#endif
785#ifdef TARGET_BYTE_ORDER
786 fprintf_unfiltered (file,
787 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
788 XSTRING (TARGET_BYTE_ORDER));
789#endif
4b9b3959
AC
790#ifdef TARGET_SHORT_BIT
791 fprintf_unfiltered (file,
792 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
793 XSTRING (TARGET_SHORT_BIT));
794#endif
795#ifdef TARGET_INT_BIT
796 fprintf_unfiltered (file,
797 "gdbarch_dump: TARGET_INT_BIT # %s\n",
798 XSTRING (TARGET_INT_BIT));
799#endif
800#ifdef TARGET_LONG_BIT
801 fprintf_unfiltered (file,
802 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
803 XSTRING (TARGET_LONG_BIT));
804#endif
805#ifdef TARGET_LONG_LONG_BIT
806 fprintf_unfiltered (file,
807 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
808 XSTRING (TARGET_LONG_LONG_BIT));
809#endif
810#ifdef TARGET_FLOAT_BIT
811 fprintf_unfiltered (file,
812 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
813 XSTRING (TARGET_FLOAT_BIT));
814#endif
815#ifdef TARGET_DOUBLE_BIT
816 fprintf_unfiltered (file,
817 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
818 XSTRING (TARGET_DOUBLE_BIT));
819#endif
820#ifdef TARGET_LONG_DOUBLE_BIT
821 fprintf_unfiltered (file,
822 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
823 XSTRING (TARGET_LONG_DOUBLE_BIT));
824#endif
66b43ecb
AC
825#ifdef TARGET_PTR_BIT
826 fprintf_unfiltered (file,
827 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
828 XSTRING (TARGET_PTR_BIT));
829#endif
52204a0b
DT
830#ifdef TARGET_ADDR_BIT
831 fprintf_unfiltered (file,
832 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
833 XSTRING (TARGET_ADDR_BIT));
834#endif
66b43ecb
AC
835#ifdef TARGET_BFD_VMA_BIT
836 fprintf_unfiltered (file,
837 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
838 XSTRING (TARGET_BFD_VMA_BIT));
839#endif
4b9b3959
AC
840#ifdef IEEE_FLOAT
841 fprintf_unfiltered (file,
842 "gdbarch_dump: IEEE_FLOAT # %s\n",
843 XSTRING (IEEE_FLOAT));
844#endif
845#ifdef TARGET_READ_PC
846 fprintf_unfiltered (file,
847 "gdbarch_dump: %s # %s\n",
848 "TARGET_READ_PC(pid)",
849 XSTRING (TARGET_READ_PC (pid)));
850#endif
63e69063
AC
851#if defined (TARGET_WRITE_PC) && GDB_MULTI_ARCH
852 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
853 fprintf_unfiltered (file,
854 "gdbarch_dump: %s # %s\n",
855 "TARGET_WRITE_PC(val, pid)",
856 XSTRING (TARGET_WRITE_PC (val, pid)));
857#endif
858#ifdef TARGET_READ_FP
859 fprintf_unfiltered (file,
860 "gdbarch_dump: %s # %s\n",
861 "TARGET_READ_FP()",
862 XSTRING (TARGET_READ_FP ()));
863#endif
63e69063
AC
864#if defined (TARGET_WRITE_FP) && GDB_MULTI_ARCH
865 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
866 fprintf_unfiltered (file,
867 "gdbarch_dump: %s # %s\n",
868 "TARGET_WRITE_FP(val)",
869 XSTRING (TARGET_WRITE_FP (val)));
870#endif
871#ifdef TARGET_READ_SP
872 fprintf_unfiltered (file,
873 "gdbarch_dump: %s # %s\n",
874 "TARGET_READ_SP()",
875 XSTRING (TARGET_READ_SP ()));
876#endif
63e69063
AC
877#if defined (TARGET_WRITE_SP) && GDB_MULTI_ARCH
878 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
879 fprintf_unfiltered (file,
880 "gdbarch_dump: %s # %s\n",
881 "TARGET_WRITE_SP(val)",
882 XSTRING (TARGET_WRITE_SP (val)));
883#endif
884#ifdef NUM_REGS
885 fprintf_unfiltered (file,
886 "gdbarch_dump: NUM_REGS # %s\n",
887 XSTRING (NUM_REGS));
888#endif
0aba1244
EZ
889#ifdef NUM_PSEUDO_REGS
890 fprintf_unfiltered (file,
891 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
892 XSTRING (NUM_PSEUDO_REGS));
893#endif
4b9b3959
AC
894#ifdef SP_REGNUM
895 fprintf_unfiltered (file,
896 "gdbarch_dump: SP_REGNUM # %s\n",
897 XSTRING (SP_REGNUM));
898#endif
899#ifdef FP_REGNUM
900 fprintf_unfiltered (file,
901 "gdbarch_dump: FP_REGNUM # %s\n",
902 XSTRING (FP_REGNUM));
903#endif
904#ifdef PC_REGNUM
905 fprintf_unfiltered (file,
906 "gdbarch_dump: PC_REGNUM # %s\n",
907 XSTRING (PC_REGNUM));
908#endif
909#ifdef FP0_REGNUM
910 fprintf_unfiltered (file,
911 "gdbarch_dump: FP0_REGNUM # %s\n",
912 XSTRING (FP0_REGNUM));
913#endif
914#ifdef NPC_REGNUM
915 fprintf_unfiltered (file,
916 "gdbarch_dump: NPC_REGNUM # %s\n",
917 XSTRING (NPC_REGNUM));
918#endif
919#ifdef NNPC_REGNUM
920 fprintf_unfiltered (file,
921 "gdbarch_dump: NNPC_REGNUM # %s\n",
922 XSTRING (NNPC_REGNUM));
923#endif
88c72b7d
AC
924#ifdef STAB_REG_TO_REGNUM
925 fprintf_unfiltered (file,
926 "gdbarch_dump: %s # %s\n",
927 "STAB_REG_TO_REGNUM(stab_regnr)",
928 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
929#endif
930#ifdef ECOFF_REG_TO_REGNUM
931 fprintf_unfiltered (file,
932 "gdbarch_dump: %s # %s\n",
933 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
934 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
935#endif
936#ifdef DWARF_REG_TO_REGNUM
937 fprintf_unfiltered (file,
938 "gdbarch_dump: %s # %s\n",
939 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
940 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
941#endif
942#ifdef SDB_REG_TO_REGNUM
943 fprintf_unfiltered (file,
944 "gdbarch_dump: %s # %s\n",
945 "SDB_REG_TO_REGNUM(sdb_regnr)",
946 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
947#endif
948#ifdef DWARF2_REG_TO_REGNUM
949 fprintf_unfiltered (file,
950 "gdbarch_dump: %s # %s\n",
951 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
952 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
953#endif
4b9b3959
AC
954#ifdef REGISTER_NAME
955 fprintf_unfiltered (file,
956 "gdbarch_dump: %s # %s\n",
957 "REGISTER_NAME(regnr)",
958 XSTRING (REGISTER_NAME (regnr)));
959#endif
960#ifdef REGISTER_SIZE
961 fprintf_unfiltered (file,
962 "gdbarch_dump: REGISTER_SIZE # %s\n",
963 XSTRING (REGISTER_SIZE));
964#endif
965#ifdef REGISTER_BYTES
966 fprintf_unfiltered (file,
967 "gdbarch_dump: REGISTER_BYTES # %s\n",
968 XSTRING (REGISTER_BYTES));
969#endif
970#ifdef REGISTER_BYTE
971 fprintf_unfiltered (file,
972 "gdbarch_dump: %s # %s\n",
973 "REGISTER_BYTE(reg_nr)",
974 XSTRING (REGISTER_BYTE (reg_nr)));
975#endif
976#ifdef REGISTER_RAW_SIZE
977 fprintf_unfiltered (file,
978 "gdbarch_dump: %s # %s\n",
979 "REGISTER_RAW_SIZE(reg_nr)",
980 XSTRING (REGISTER_RAW_SIZE (reg_nr)));
981#endif
982#ifdef MAX_REGISTER_RAW_SIZE
983 fprintf_unfiltered (file,
984 "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
985 XSTRING (MAX_REGISTER_RAW_SIZE));
986#endif
987#ifdef REGISTER_VIRTUAL_SIZE
988 fprintf_unfiltered (file,
989 "gdbarch_dump: %s # %s\n",
990 "REGISTER_VIRTUAL_SIZE(reg_nr)",
991 XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
992#endif
993#ifdef MAX_REGISTER_VIRTUAL_SIZE
994 fprintf_unfiltered (file,
995 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
996 XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
997#endif
998#ifdef REGISTER_VIRTUAL_TYPE
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: %s # %s\n",
1001 "REGISTER_VIRTUAL_TYPE(reg_nr)",
1002 XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
1003#endif
666e11c5
EZ
1004#if defined (DO_REGISTERS_INFO) && GDB_MULTI_ARCH
1005 /* Macro might contain `[{}]' when not multi-arch */
1006 fprintf_unfiltered (file,
1007 "gdbarch_dump: %s # %s\n",
1008 "DO_REGISTERS_INFO(reg_nr, fpregs)",
1009 XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
1010#endif
7c7651b2
AC
1011#ifdef REGISTER_SIM_REGNO
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: %s # %s\n",
1014 "REGISTER_SIM_REGNO(reg_nr)",
1015 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1016#endif
2649061d
AC
1017#ifdef REGISTER_BYTES_OK
1018 fprintf_unfiltered (file,
1019 "gdbarch_dump: %s # %s\n",
1020 "REGISTER_BYTES_OK(nr_bytes)",
1021 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1022#endif
4b9b3959
AC
1023#ifdef USE_GENERIC_DUMMY_FRAMES
1024 fprintf_unfiltered (file,
1025 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
1026 XSTRING (USE_GENERIC_DUMMY_FRAMES));
1027#endif
1028#ifdef CALL_DUMMY_LOCATION
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
1031 XSTRING (CALL_DUMMY_LOCATION));
1032#endif
1033#ifdef CALL_DUMMY_ADDRESS
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: %s # %s\n",
1036 "CALL_DUMMY_ADDRESS()",
1037 XSTRING (CALL_DUMMY_ADDRESS ()));
1038#endif
1039#ifdef CALL_DUMMY_START_OFFSET
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
1042 XSTRING (CALL_DUMMY_START_OFFSET));
1043#endif
1044#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
1045 fprintf_unfiltered (file,
1046 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
1047 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
1048#endif
1049#ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
1052 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
1053#endif
1054#ifdef CALL_DUMMY_LENGTH
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
1057 XSTRING (CALL_DUMMY_LENGTH));
1058#endif
1059#ifdef PC_IN_CALL_DUMMY
1060 fprintf_unfiltered (file,
1061 "gdbarch_dump: %s # %s\n",
1062 "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
1063 XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
1064#endif
1065#ifdef CALL_DUMMY_P
1066 fprintf_unfiltered (file,
1067 "gdbarch_dump: CALL_DUMMY_P # %s\n",
1068 XSTRING (CALL_DUMMY_P));
1069#endif
1070#ifdef CALL_DUMMY_WORDS
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
1073 XSTRING (CALL_DUMMY_WORDS));
1074#endif
1075#ifdef SIZEOF_CALL_DUMMY_WORDS
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
1078 XSTRING (SIZEOF_CALL_DUMMY_WORDS));
1079#endif
1080#ifdef CALL_DUMMY_STACK_ADJUST_P
1081 fprintf_unfiltered (file,
1082 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
1083 XSTRING (CALL_DUMMY_STACK_ADJUST_P));
1084#endif
1085#ifdef CALL_DUMMY_STACK_ADJUST
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
1088 XSTRING (CALL_DUMMY_STACK_ADJUST));
1089#endif
63e69063
AC
1090#if defined (FIX_CALL_DUMMY) && GDB_MULTI_ARCH
1091 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: %s # %s\n",
1094 "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
1095 XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
1096#endif
1097#ifdef BELIEVE_PCC_PROMOTION
1098 fprintf_unfiltered (file,
1099 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
1100 XSTRING (BELIEVE_PCC_PROMOTION));
1101#endif
1102#ifdef BELIEVE_PCC_PROMOTION_TYPE
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
1105 XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
1106#endif
1107#ifdef COERCE_FLOAT_TO_DOUBLE
1108 fprintf_unfiltered (file,
1109 "gdbarch_dump: %s # %s\n",
1110 "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
1111 XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
1112#endif
63e69063
AC
1113#if defined (GET_SAVED_REGISTER) && GDB_MULTI_ARCH
1114 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: %s # %s\n",
1117 "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1118 XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1119#endif
1120#ifdef REGISTER_CONVERTIBLE
1121 fprintf_unfiltered (file,
1122 "gdbarch_dump: %s # %s\n",
1123 "REGISTER_CONVERTIBLE(nr)",
1124 XSTRING (REGISTER_CONVERTIBLE (nr)));
1125#endif
63e69063
AC
1126#if defined (REGISTER_CONVERT_TO_VIRTUAL) && GDB_MULTI_ARCH
1127 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1128 fprintf_unfiltered (file,
1129 "gdbarch_dump: %s # %s\n",
1130 "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
1131 XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
1132#endif
63e69063
AC
1133#if defined (REGISTER_CONVERT_TO_RAW) && GDB_MULTI_ARCH
1134 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: %s # %s\n",
1137 "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
1138 XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
1139#endif
7f1b2585
EZ
1140#if defined (FETCH_PSEUDO_REGISTER) && GDB_MULTI_ARCH
1141 /* Macro might contain `[{}]' when not multi-arch */
1142 fprintf_unfiltered (file,
1143 "gdbarch_dump: %s # %s\n",
1144 "FETCH_PSEUDO_REGISTER(regnum)",
1145 XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
1146#endif
1147#if defined (STORE_PSEUDO_REGISTER) && GDB_MULTI_ARCH
1148 /* Macro might contain `[{}]' when not multi-arch */
1149 fprintf_unfiltered (file,
1150 "gdbarch_dump: %s # %s\n",
1151 "STORE_PSEUDO_REGISTER(regnum)",
1152 XSTRING (STORE_PSEUDO_REGISTER (regnum)));
1153#endif
4b9b3959
AC
1154#ifdef POINTER_TO_ADDRESS
1155 fprintf_unfiltered (file,
1156 "gdbarch_dump: %s # %s\n",
1157 "POINTER_TO_ADDRESS(type, buf)",
1158 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1159#endif
63e69063
AC
1160#if defined (ADDRESS_TO_POINTER) && GDB_MULTI_ARCH
1161 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1162 fprintf_unfiltered (file,
1163 "gdbarch_dump: %s # %s\n",
1164 "ADDRESS_TO_POINTER(type, buf, addr)",
1165 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
1166#endif
1167#ifdef RETURN_VALUE_ON_STACK
1168 fprintf_unfiltered (file,
1169 "gdbarch_dump: %s # %s\n",
1170 "RETURN_VALUE_ON_STACK(type)",
1171 XSTRING (RETURN_VALUE_ON_STACK (type)));
1172#endif
63e69063
AC
1173#if defined (EXTRACT_RETURN_VALUE) && GDB_MULTI_ARCH
1174 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: %s # %s\n",
1177 "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
1178 XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
1179#endif
1180#ifdef PUSH_ARGUMENTS
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: %s # %s\n",
1183 "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1184 XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1185#endif
63e69063
AC
1186#if defined (PUSH_DUMMY_FRAME) && GDB_MULTI_ARCH
1187 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: %s # %s\n",
1190 "PUSH_DUMMY_FRAME(-)",
1191 XSTRING (PUSH_DUMMY_FRAME (-)));
1192#endif
1193#ifdef PUSH_RETURN_ADDRESS
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: %s # %s\n",
1196 "PUSH_RETURN_ADDRESS(pc, sp)",
1197 XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1198#endif
63e69063
AC
1199#if defined (POP_FRAME) && GDB_MULTI_ARCH
1200 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1201 fprintf_unfiltered (file,
1202 "gdbarch_dump: %s # %s\n",
1203 "POP_FRAME(-)",
1204 XSTRING (POP_FRAME (-)));
1205#endif
1206#ifdef D10V_MAKE_DADDR
1207 fprintf_unfiltered (file,
1208 "gdbarch_dump: %s # %s\n",
1209 "D10V_MAKE_DADDR(x)",
1210 XSTRING (D10V_MAKE_DADDR (x)));
1211#endif
1212#ifdef D10V_MAKE_IADDR
1213 fprintf_unfiltered (file,
1214 "gdbarch_dump: %s # %s\n",
1215 "D10V_MAKE_IADDR(x)",
1216 XSTRING (D10V_MAKE_IADDR (x)));
1217#endif
1218#ifdef D10V_DADDR_P
1219 fprintf_unfiltered (file,
1220 "gdbarch_dump: %s # %s\n",
1221 "D10V_DADDR_P(x)",
1222 XSTRING (D10V_DADDR_P (x)));
1223#endif
1224#ifdef D10V_IADDR_P
1225 fprintf_unfiltered (file,
1226 "gdbarch_dump: %s # %s\n",
1227 "D10V_IADDR_P(x)",
1228 XSTRING (D10V_IADDR_P (x)));
1229#endif
1230#ifdef D10V_CONVERT_DADDR_TO_RAW
1231 fprintf_unfiltered (file,
1232 "gdbarch_dump: %s # %s\n",
1233 "D10V_CONVERT_DADDR_TO_RAW(x)",
1234 XSTRING (D10V_CONVERT_DADDR_TO_RAW (x)));
1235#endif
1236#ifdef D10V_CONVERT_IADDR_TO_RAW
1237 fprintf_unfiltered (file,
1238 "gdbarch_dump: %s # %s\n",
1239 "D10V_CONVERT_IADDR_TO_RAW(x)",
1240 XSTRING (D10V_CONVERT_IADDR_TO_RAW (x)));
1241#endif
63e69063
AC
1242#if defined (STORE_STRUCT_RETURN) && GDB_MULTI_ARCH
1243 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1244 fprintf_unfiltered (file,
1245 "gdbarch_dump: %s # %s\n",
1246 "STORE_STRUCT_RETURN(addr, sp)",
1247 XSTRING (STORE_STRUCT_RETURN (addr, sp)));
1248#endif
63e69063
AC
1249#if defined (STORE_RETURN_VALUE) && GDB_MULTI_ARCH
1250 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: %s # %s\n",
1253 "STORE_RETURN_VALUE(type, valbuf)",
1254 XSTRING (STORE_RETURN_VALUE (type, valbuf)));
1255#endif
1256#ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1257 fprintf_unfiltered (file,
1258 "gdbarch_dump: %s # %s\n",
1259 "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1260 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1261#endif
1262#ifdef USE_STRUCT_CONVENTION
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: %s # %s\n",
1265 "USE_STRUCT_CONVENTION(gcc_p, value_type)",
1266 XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
1267#endif
63e69063
AC
1268#if defined (FRAME_INIT_SAVED_REGS) && GDB_MULTI_ARCH
1269 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1270 fprintf_unfiltered (file,
1271 "gdbarch_dump: %s # %s\n",
1272 "FRAME_INIT_SAVED_REGS(frame)",
1273 XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1274#endif
63e69063
AC
1275#if defined (INIT_EXTRA_FRAME_INFO) && GDB_MULTI_ARCH
1276 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1277 fprintf_unfiltered (file,
1278 "gdbarch_dump: %s # %s\n",
1279 "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1280 XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1281#endif
1282#ifdef SKIP_PROLOGUE
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: %s # %s\n",
1285 "SKIP_PROLOGUE(ip)",
1286 XSTRING (SKIP_PROLOGUE (ip)));
1287#endif
1288#ifdef PROLOGUE_FRAMELESS_P
1289 fprintf_unfiltered (file,
1290 "gdbarch_dump: %s # %s\n",
1291 "PROLOGUE_FRAMELESS_P(ip)",
1292 XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1293#endif
1294#ifdef INNER_THAN
1295 fprintf_unfiltered (file,
1296 "gdbarch_dump: %s # %s\n",
1297 "INNER_THAN(lhs, rhs)",
1298 XSTRING (INNER_THAN (lhs, rhs)));
1299#endif
1300#ifdef BREAKPOINT_FROM_PC
1301 fprintf_unfiltered (file,
1302 "gdbarch_dump: %s # %s\n",
1303 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
1304 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
1305#endif
1306#ifdef MEMORY_INSERT_BREAKPOINT
1307 fprintf_unfiltered (file,
1308 "gdbarch_dump: %s # %s\n",
1309 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1310 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1311#endif
1312#ifdef MEMORY_REMOVE_BREAKPOINT
1313 fprintf_unfiltered (file,
1314 "gdbarch_dump: %s # %s\n",
1315 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1316 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1317#endif
1318#ifdef DECR_PC_AFTER_BREAK
1319 fprintf_unfiltered (file,
1320 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1321 XSTRING (DECR_PC_AFTER_BREAK));
1322#endif
1323#ifdef FUNCTION_START_OFFSET
1324 fprintf_unfiltered (file,
1325 "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1326 XSTRING (FUNCTION_START_OFFSET));
1327#endif
63e69063
AC
1328#if defined (REMOTE_TRANSLATE_XFER_ADDRESS) && GDB_MULTI_ARCH
1329 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1330 fprintf_unfiltered (file,
1331 "gdbarch_dump: %s # %s\n",
1332 "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
1333 XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
1334#endif
1335#ifdef FRAME_ARGS_SKIP
1336 fprintf_unfiltered (file,
1337 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1338 XSTRING (FRAME_ARGS_SKIP));
1339#endif
1340#ifdef FRAMELESS_FUNCTION_INVOCATION
1341 fprintf_unfiltered (file,
1342 "gdbarch_dump: %s # %s\n",
1343 "FRAMELESS_FUNCTION_INVOCATION(fi)",
1344 XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1345#endif
1346#ifdef FRAME_CHAIN
1347 fprintf_unfiltered (file,
1348 "gdbarch_dump: %s # %s\n",
1349 "FRAME_CHAIN(frame)",
1350 XSTRING (FRAME_CHAIN (frame)));
1351#endif
1352#ifdef FRAME_CHAIN_VALID
1353 fprintf_unfiltered (file,
1354 "gdbarch_dump: %s # %s\n",
1355 "FRAME_CHAIN_VALID(chain, thisframe)",
1356 XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1357#endif
1358#ifdef FRAME_SAVED_PC
1359 fprintf_unfiltered (file,
1360 "gdbarch_dump: %s # %s\n",
1361 "FRAME_SAVED_PC(fi)",
1362 XSTRING (FRAME_SAVED_PC (fi)));
1363#endif
1364#ifdef FRAME_ARGS_ADDRESS
1365 fprintf_unfiltered (file,
1366 "gdbarch_dump: %s # %s\n",
1367 "FRAME_ARGS_ADDRESS(fi)",
1368 XSTRING (FRAME_ARGS_ADDRESS (fi)));
1369#endif
1370#ifdef FRAME_LOCALS_ADDRESS
1371 fprintf_unfiltered (file,
1372 "gdbarch_dump: %s # %s\n",
1373 "FRAME_LOCALS_ADDRESS(fi)",
1374 XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1375#endif
1376#ifdef SAVED_PC_AFTER_CALL
1377 fprintf_unfiltered (file,
1378 "gdbarch_dump: %s # %s\n",
1379 "SAVED_PC_AFTER_CALL(frame)",
1380 XSTRING (SAVED_PC_AFTER_CALL (frame)));
1381#endif
1382#ifdef FRAME_NUM_ARGS
1383 fprintf_unfiltered (file,
1384 "gdbarch_dump: %s # %s\n",
1385 "FRAME_NUM_ARGS(frame)",
1386 XSTRING (FRAME_NUM_ARGS (frame)));
1387#endif
1388#ifdef STACK_ALIGN
1389 fprintf_unfiltered (file,
1390 "gdbarch_dump: %s # %s\n",
1391 "STACK_ALIGN(sp)",
1392 XSTRING (STACK_ALIGN (sp)));
1393#endif
1dd4193b
AC
1394#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
1395 fprintf_unfiltered (file,
1396 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
1397 XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
1398#endif
4b9b3959
AC
1399#ifdef REG_STRUCT_HAS_ADDR
1400 fprintf_unfiltered (file,
1401 "gdbarch_dump: %s # %s\n",
1402 "REG_STRUCT_HAS_ADDR(gcc_p, type)",
1403 XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
1404#endif
63e69063
AC
1405#if defined (SAVE_DUMMY_FRAME_TOS) && GDB_MULTI_ARCH
1406 /* Macro might contain `[{}]' when not multi-arch */
4b9b3959
AC
1407 fprintf_unfiltered (file,
1408 "gdbarch_dump: %s # %s\n",
1409 "SAVE_DUMMY_FRAME_TOS(sp)",
1410 XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
1411#endif
58d5518e
ND
1412#ifdef PARM_BOUNDARY
1413 fprintf_unfiltered (file,
1414 "gdbarch_dump: PARM_BOUNDARY # %s\n",
1415 XSTRING (PARM_BOUNDARY));
1416#endif
4b9b3959
AC
1417#ifdef TARGET_FLOAT_FORMAT
1418 fprintf_unfiltered (file,
1419 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1420 XSTRING (TARGET_FLOAT_FORMAT));
1421#endif
1422#ifdef TARGET_DOUBLE_FORMAT
1423 fprintf_unfiltered (file,
1424 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1425 XSTRING (TARGET_DOUBLE_FORMAT));
1426#endif
1427#ifdef TARGET_LONG_DOUBLE_FORMAT
1428 fprintf_unfiltered (file,
1429 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1430 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1431#endif
f517ea4e
PS
1432#ifdef CONVERT_FROM_FUNC_PTR_ADDR
1433 fprintf_unfiltered (file,
1434 "gdbarch_dump: %s # %s\n",
1435 "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
1436 XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
1437#endif
64c4637f
AC
1438#if defined (SOFTWARE_SINGLE_STEP) && GDB_MULTI_ARCH
1439 /* Macro might contain `[{}]' when not multi-arch */
1440 fprintf_unfiltered (file,
1441 "gdbarch_dump: %s # %s\n",
1442 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1443 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1444#endif
381323f4 1445#ifdef TARGET_ARCHITECTURE
0f71a2f6 1446 if (TARGET_ARCHITECTURE != NULL)
4b9b3959
AC
1447 fprintf_unfiltered (file,
1448 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
adf40b2e 1449 TARGET_ARCHITECTURE->printable_name);
381323f4
AC
1450#endif
1451#ifdef TARGET_BYTE_ORDER
4b9b3959
AC
1452 fprintf_unfiltered (file,
1453 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
adf40b2e 1454 (long) TARGET_BYTE_ORDER);
381323f4 1455#endif
381323f4 1456#ifdef TARGET_SHORT_BIT
4b9b3959
AC
1457 fprintf_unfiltered (file,
1458 "gdbarch_dump: TARGET_SHORT_BIT = %ld\n",
adf40b2e 1459 (long) TARGET_SHORT_BIT);
381323f4
AC
1460#endif
1461#ifdef TARGET_INT_BIT
4b9b3959
AC
1462 fprintf_unfiltered (file,
1463 "gdbarch_dump: TARGET_INT_BIT = %ld\n",
adf40b2e 1464 (long) TARGET_INT_BIT);
381323f4
AC
1465#endif
1466#ifdef TARGET_LONG_BIT
4b9b3959
AC
1467 fprintf_unfiltered (file,
1468 "gdbarch_dump: TARGET_LONG_BIT = %ld\n",
adf40b2e 1469 (long) TARGET_LONG_BIT);
381323f4
AC
1470#endif
1471#ifdef TARGET_LONG_LONG_BIT
4b9b3959
AC
1472 fprintf_unfiltered (file,
1473 "gdbarch_dump: TARGET_LONG_LONG_BIT = %ld\n",
adf40b2e 1474 (long) TARGET_LONG_LONG_BIT);
381323f4
AC
1475#endif
1476#ifdef TARGET_FLOAT_BIT
4b9b3959
AC
1477 fprintf_unfiltered (file,
1478 "gdbarch_dump: TARGET_FLOAT_BIT = %ld\n",
adf40b2e 1479 (long) TARGET_FLOAT_BIT);
381323f4
AC
1480#endif
1481#ifdef TARGET_DOUBLE_BIT
4b9b3959
AC
1482 fprintf_unfiltered (file,
1483 "gdbarch_dump: TARGET_DOUBLE_BIT = %ld\n",
adf40b2e 1484 (long) TARGET_DOUBLE_BIT);
381323f4
AC
1485#endif
1486#ifdef TARGET_LONG_DOUBLE_BIT
4b9b3959
AC
1487 fprintf_unfiltered (file,
1488 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n",
adf40b2e 1489 (long) TARGET_LONG_DOUBLE_BIT);
381323f4 1490#endif
66b43ecb
AC
1491#ifdef TARGET_PTR_BIT
1492 fprintf_unfiltered (file,
1493 "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
1494 (long) TARGET_PTR_BIT);
1495#endif
52204a0b
DT
1496#ifdef TARGET_ADDR_BIT
1497 fprintf_unfiltered (file,
1498 "gdbarch_dump: TARGET_ADDR_BIT = %ld\n",
1499 (long) TARGET_ADDR_BIT);
1500#endif
66b43ecb
AC
1501#ifdef TARGET_BFD_VMA_BIT
1502 fprintf_unfiltered (file,
1503 "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
1504 (long) TARGET_BFD_VMA_BIT);
1505#endif
381323f4 1506#ifdef IEEE_FLOAT
4b9b3959
AC
1507 fprintf_unfiltered (file,
1508 "gdbarch_dump: IEEE_FLOAT = %ld\n",
7355ddba 1509 (long) IEEE_FLOAT);
381323f4
AC
1510#endif
1511#ifdef TARGET_READ_PC
4b9b3959
AC
1512 if (GDB_MULTI_ARCH)
1513 fprintf_unfiltered (file,
1514 "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
1515 (long) current_gdbarch->read_pc
1516 /*TARGET_READ_PC ()*/);
381323f4
AC
1517#endif
1518#ifdef TARGET_WRITE_PC
4b9b3959
AC
1519 if (GDB_MULTI_ARCH)
1520 fprintf_unfiltered (file,
1521 "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
1522 (long) current_gdbarch->write_pc
1523 /*TARGET_WRITE_PC ()*/);
381323f4
AC
1524#endif
1525#ifdef TARGET_READ_FP
4b9b3959
AC
1526 if (GDB_MULTI_ARCH)
1527 fprintf_unfiltered (file,
1528 "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
1529 (long) current_gdbarch->read_fp
1530 /*TARGET_READ_FP ()*/);
381323f4
AC
1531#endif
1532#ifdef TARGET_WRITE_FP
4b9b3959
AC
1533 if (GDB_MULTI_ARCH)
1534 fprintf_unfiltered (file,
1535 "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
1536 (long) current_gdbarch->write_fp
1537 /*TARGET_WRITE_FP ()*/);
381323f4
AC
1538#endif
1539#ifdef TARGET_READ_SP
4b9b3959
AC
1540 if (GDB_MULTI_ARCH)
1541 fprintf_unfiltered (file,
1542 "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
1543 (long) current_gdbarch->read_sp
1544 /*TARGET_READ_SP ()*/);
381323f4
AC
1545#endif
1546#ifdef TARGET_WRITE_SP
4b9b3959
AC
1547 if (GDB_MULTI_ARCH)
1548 fprintf_unfiltered (file,
1549 "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
1550 (long) current_gdbarch->write_sp
1551 /*TARGET_WRITE_SP ()*/);
381323f4 1552#endif
61a0eb5b
AC
1553 if (GDB_MULTI_ARCH)
1554 fprintf_unfiltered (file,
1555 "gdbarch_dump: register_read = 0x%08lx\n",
1556 (long) current_gdbarch->register_read);
1557 if (GDB_MULTI_ARCH)
1558 fprintf_unfiltered (file,
1559 "gdbarch_dump: register_write = 0x%08lx\n",
1560 (long) current_gdbarch->register_write);
381323f4 1561#ifdef NUM_REGS
4b9b3959
AC
1562 fprintf_unfiltered (file,
1563 "gdbarch_dump: NUM_REGS = %ld\n",
adf40b2e 1564 (long) NUM_REGS);
381323f4 1565#endif
0aba1244
EZ
1566#ifdef NUM_PSEUDO_REGS
1567 fprintf_unfiltered (file,
1568 "gdbarch_dump: NUM_PSEUDO_REGS = %ld\n",
1569 (long) NUM_PSEUDO_REGS);
1570#endif
381323f4 1571#ifdef SP_REGNUM
4b9b3959
AC
1572 fprintf_unfiltered (file,
1573 "gdbarch_dump: SP_REGNUM = %ld\n",
adf40b2e 1574 (long) SP_REGNUM);
381323f4
AC
1575#endif
1576#ifdef FP_REGNUM
4b9b3959
AC
1577 fprintf_unfiltered (file,
1578 "gdbarch_dump: FP_REGNUM = %ld\n",
adf40b2e 1579 (long) FP_REGNUM);
381323f4
AC
1580#endif
1581#ifdef PC_REGNUM
4b9b3959
AC
1582 fprintf_unfiltered (file,
1583 "gdbarch_dump: PC_REGNUM = %ld\n",
adf40b2e 1584 (long) PC_REGNUM);
381323f4
AC
1585#endif
1586#ifdef FP0_REGNUM
4b9b3959
AC
1587 fprintf_unfiltered (file,
1588 "gdbarch_dump: FP0_REGNUM = %ld\n",
60054393 1589 (long) FP0_REGNUM);
381323f4
AC
1590#endif
1591#ifdef NPC_REGNUM
4b9b3959
AC
1592 fprintf_unfiltered (file,
1593 "gdbarch_dump: NPC_REGNUM = %ld\n",
03863182 1594 (long) NPC_REGNUM);
381323f4
AC
1595#endif
1596#ifdef NNPC_REGNUM
4b9b3959
AC
1597 fprintf_unfiltered (file,
1598 "gdbarch_dump: NNPC_REGNUM = %ld\n",
03863182 1599 (long) NNPC_REGNUM);
381323f4 1600#endif
88c72b7d
AC
1601#ifdef STAB_REG_TO_REGNUM
1602 if (GDB_MULTI_ARCH)
1603 fprintf_unfiltered (file,
1604 "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n",
1605 (long) current_gdbarch->stab_reg_to_regnum
1606 /*STAB_REG_TO_REGNUM ()*/);
1607#endif
1608#ifdef ECOFF_REG_TO_REGNUM
1609 if (GDB_MULTI_ARCH)
1610 fprintf_unfiltered (file,
1611 "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
1612 (long) current_gdbarch->ecoff_reg_to_regnum
1613 /*ECOFF_REG_TO_REGNUM ()*/);
1614#endif
1615#ifdef DWARF_REG_TO_REGNUM
1616 if (GDB_MULTI_ARCH)
1617 fprintf_unfiltered (file,
1618 "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
1619 (long) current_gdbarch->dwarf_reg_to_regnum
1620 /*DWARF_REG_TO_REGNUM ()*/);
1621#endif
1622#ifdef SDB_REG_TO_REGNUM
1623 if (GDB_MULTI_ARCH)
1624 fprintf_unfiltered (file,
1625 "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n",
1626 (long) current_gdbarch->sdb_reg_to_regnum
1627 /*SDB_REG_TO_REGNUM ()*/);
1628#endif
1629#ifdef DWARF2_REG_TO_REGNUM
1630 if (GDB_MULTI_ARCH)
1631 fprintf_unfiltered (file,
1632 "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
1633 (long) current_gdbarch->dwarf2_reg_to_regnum
1634 /*DWARF2_REG_TO_REGNUM ()*/);
1635#endif
381323f4 1636#ifdef REGISTER_NAME
4b9b3959
AC
1637 if (GDB_MULTI_ARCH)
1638 fprintf_unfiltered (file,
1639 "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
1640 (long) current_gdbarch->register_name
1641 /*REGISTER_NAME ()*/);
381323f4
AC
1642#endif
1643#ifdef REGISTER_SIZE
4b9b3959
AC
1644 fprintf_unfiltered (file,
1645 "gdbarch_dump: REGISTER_SIZE = %ld\n",
adf40b2e 1646 (long) REGISTER_SIZE);
381323f4
AC
1647#endif
1648#ifdef REGISTER_BYTES
4b9b3959
AC
1649 fprintf_unfiltered (file,
1650 "gdbarch_dump: REGISTER_BYTES = %ld\n",
adf40b2e 1651 (long) REGISTER_BYTES);
381323f4
AC
1652#endif
1653#ifdef REGISTER_BYTE
4b9b3959
AC
1654 if (GDB_MULTI_ARCH)
1655 fprintf_unfiltered (file,
1656 "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
1657 (long) current_gdbarch->register_byte
1658 /*REGISTER_BYTE ()*/);
381323f4
AC
1659#endif
1660#ifdef REGISTER_RAW_SIZE
4b9b3959
AC
1661 if (GDB_MULTI_ARCH)
1662 fprintf_unfiltered (file,
1663 "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
1664 (long) current_gdbarch->register_raw_size
1665 /*REGISTER_RAW_SIZE ()*/);
381323f4
AC
1666#endif
1667#ifdef MAX_REGISTER_RAW_SIZE
4b9b3959
AC
1668 fprintf_unfiltered (file,
1669 "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %ld\n",
adf40b2e 1670 (long) MAX_REGISTER_RAW_SIZE);
381323f4
AC
1671#endif
1672#ifdef REGISTER_VIRTUAL_SIZE
4b9b3959
AC
1673 if (GDB_MULTI_ARCH)
1674 fprintf_unfiltered (file,
1675 "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
1676 (long) current_gdbarch->register_virtual_size
1677 /*REGISTER_VIRTUAL_SIZE ()*/);
381323f4
AC
1678#endif
1679#ifdef MAX_REGISTER_VIRTUAL_SIZE
4b9b3959
AC
1680 fprintf_unfiltered (file,
1681 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
adf40b2e 1682 (long) MAX_REGISTER_VIRTUAL_SIZE);
381323f4
AC
1683#endif
1684#ifdef REGISTER_VIRTUAL_TYPE
4b9b3959
AC
1685 if (GDB_MULTI_ARCH)
1686 fprintf_unfiltered (file,
1687 "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
1688 (long) current_gdbarch->register_virtual_type
1689 /*REGISTER_VIRTUAL_TYPE ()*/);
381323f4 1690#endif
666e11c5
EZ
1691#ifdef DO_REGISTERS_INFO
1692 if (GDB_MULTI_ARCH)
1693 fprintf_unfiltered (file,
1694 "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
1695 (long) current_gdbarch->do_registers_info
1696 /*DO_REGISTERS_INFO ()*/);
1697#endif
7c7651b2
AC
1698#ifdef REGISTER_SIM_REGNO
1699 if (GDB_MULTI_ARCH)
1700 fprintf_unfiltered (file,
1701 "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n",
1702 (long) current_gdbarch->register_sim_regno
1703 /*REGISTER_SIM_REGNO ()*/);
1704#endif
2649061d
AC
1705#ifdef REGISTER_BYTES_OK
1706 if (GDB_MULTI_ARCH)
1707 fprintf_unfiltered (file,
1708 "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n",
1709 (long) current_gdbarch->register_bytes_ok
1710 /*REGISTER_BYTES_OK ()*/);
1711#endif
381323f4 1712#ifdef USE_GENERIC_DUMMY_FRAMES
4b9b3959
AC
1713 fprintf_unfiltered (file,
1714 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
adf40b2e 1715 (long) USE_GENERIC_DUMMY_FRAMES);
381323f4
AC
1716#endif
1717#ifdef CALL_DUMMY_LOCATION
4b9b3959
AC
1718 fprintf_unfiltered (file,
1719 "gdbarch_dump: CALL_DUMMY_LOCATION = %ld\n",
adf40b2e 1720 (long) CALL_DUMMY_LOCATION);
381323f4
AC
1721#endif
1722#ifdef CALL_DUMMY_ADDRESS
4b9b3959
AC
1723 if (GDB_MULTI_ARCH)
1724 fprintf_unfiltered (file,
1725 "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
1726 (long) current_gdbarch->call_dummy_address
1727 /*CALL_DUMMY_ADDRESS ()*/);
381323f4
AC
1728#endif
1729#ifdef CALL_DUMMY_START_OFFSET
4b9b3959
AC
1730 fprintf_unfiltered (file,
1731 "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
adf40b2e 1732 (long) CALL_DUMMY_START_OFFSET);
381323f4
AC
1733#endif
1734#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
7861024d
JG
1735 if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
1736 fprintf_unfiltered (file,
1737 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
1738 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
381323f4
AC
1739#endif
1740#ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
4b9b3959
AC
1741 fprintf_unfiltered (file,
1742 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
adf40b2e 1743 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
381323f4
AC
1744#endif
1745#ifdef CALL_DUMMY_LENGTH
0f71a2f6 1746 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
4b9b3959
AC
1747 fprintf_unfiltered (file,
1748 "gdbarch_dump: CALL_DUMMY_LENGTH = %ld\n",
adf40b2e 1749 (long) CALL_DUMMY_LENGTH);
381323f4
AC
1750#endif
1751#ifdef PC_IN_CALL_DUMMY
4b9b3959
AC
1752 if (GDB_MULTI_ARCH)
1753 fprintf_unfiltered (file,
1754 "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
1755 (long) current_gdbarch->pc_in_call_dummy
1756 /*PC_IN_CALL_DUMMY ()*/);
381323f4
AC
1757#endif
1758#ifdef CALL_DUMMY_P
4b9b3959
AC
1759 fprintf_unfiltered (file,
1760 "gdbarch_dump: CALL_DUMMY_P = %ld\n",
adf40b2e 1761 (long) CALL_DUMMY_P);
381323f4
AC
1762#endif
1763#ifdef CALL_DUMMY_WORDS
4b9b3959
AC
1764 fprintf_unfiltered (file,
1765 "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
adf40b2e 1766 (long) CALL_DUMMY_WORDS);
381323f4
AC
1767#endif
1768#ifdef SIZEOF_CALL_DUMMY_WORDS
4b9b3959
AC
1769 fprintf_unfiltered (file,
1770 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
adf40b2e 1771 (long) SIZEOF_CALL_DUMMY_WORDS);
381323f4
AC
1772#endif
1773#ifdef CALL_DUMMY_STACK_ADJUST_P
4b9b3959
AC
1774 fprintf_unfiltered (file,
1775 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
adf40b2e 1776 (long) CALL_DUMMY_STACK_ADJUST_P);
381323f4
AC
1777#endif
1778#ifdef CALL_DUMMY_STACK_ADJUST
0f71a2f6 1779 if (CALL_DUMMY_STACK_ADJUST_P)
4b9b3959
AC
1780 fprintf_unfiltered (file,
1781 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
adf40b2e 1782 (long) CALL_DUMMY_STACK_ADJUST);
381323f4
AC
1783#endif
1784#ifdef FIX_CALL_DUMMY
4b9b3959
AC
1785 if (GDB_MULTI_ARCH)
1786 fprintf_unfiltered (file,
1787 "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1788 (long) current_gdbarch->fix_call_dummy
1789 /*FIX_CALL_DUMMY ()*/);
381323f4 1790#endif
0f71a2f6 1791#ifdef BELIEVE_PCC_PROMOTION
4b9b3959
AC
1792 fprintf_unfiltered (file,
1793 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n",
adf40b2e 1794 (long) BELIEVE_PCC_PROMOTION);
0f71a2f6
JM
1795#endif
1796#ifdef BELIEVE_PCC_PROMOTION_TYPE
4b9b3959
AC
1797 fprintf_unfiltered (file,
1798 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
adf40b2e 1799 (long) BELIEVE_PCC_PROMOTION_TYPE);
0f71a2f6 1800#endif
381323f4 1801#ifdef COERCE_FLOAT_TO_DOUBLE
4b9b3959
AC
1802 if (GDB_MULTI_ARCH)
1803 fprintf_unfiltered (file,
1804 "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
1805 (long) current_gdbarch->coerce_float_to_double
1806 /*COERCE_FLOAT_TO_DOUBLE ()*/);
381323f4
AC
1807#endif
1808#ifdef GET_SAVED_REGISTER
4b9b3959
AC
1809 if (GDB_MULTI_ARCH)
1810 fprintf_unfiltered (file,
1811 "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1812 (long) current_gdbarch->get_saved_register
1813 /*GET_SAVED_REGISTER ()*/);
381323f4
AC
1814#endif
1815#ifdef REGISTER_CONVERTIBLE
4b9b3959
AC
1816 if (GDB_MULTI_ARCH)
1817 fprintf_unfiltered (file,
1818 "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n",
1819 (long) current_gdbarch->register_convertible
1820 /*REGISTER_CONVERTIBLE ()*/);
381323f4
AC
1821#endif
1822#ifdef REGISTER_CONVERT_TO_VIRTUAL
4b9b3959
AC
1823 if (GDB_MULTI_ARCH)
1824 fprintf_unfiltered (file,
1825 "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
1826 (long) current_gdbarch->register_convert_to_virtual
1827 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
381323f4
AC
1828#endif
1829#ifdef REGISTER_CONVERT_TO_RAW
4b9b3959
AC
1830 if (GDB_MULTI_ARCH)
1831 fprintf_unfiltered (file,
1832 "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
1833 (long) current_gdbarch->register_convert_to_raw
1834 /*REGISTER_CONVERT_TO_RAW ()*/);
381323f4 1835#endif
7f1b2585
EZ
1836#ifdef FETCH_PSEUDO_REGISTER
1837 if (GDB_MULTI_ARCH)
1838 fprintf_unfiltered (file,
1839 "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
1840 (long) current_gdbarch->fetch_pseudo_register
1841 /*FETCH_PSEUDO_REGISTER ()*/);
1842#endif
1843#ifdef STORE_PSEUDO_REGISTER
1844 if (GDB_MULTI_ARCH)
1845 fprintf_unfiltered (file,
1846 "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
1847 (long) current_gdbarch->store_pseudo_register
1848 /*STORE_PSEUDO_REGISTER ()*/);
1849#endif
381323f4 1850#ifdef POINTER_TO_ADDRESS
4b9b3959
AC
1851 if (GDB_MULTI_ARCH)
1852 fprintf_unfiltered (file,
1853 "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
1854 (long) current_gdbarch->pointer_to_address
1855 /*POINTER_TO_ADDRESS ()*/);
381323f4
AC
1856#endif
1857#ifdef ADDRESS_TO_POINTER
4b9b3959
AC
1858 if (GDB_MULTI_ARCH)
1859 fprintf_unfiltered (file,
1860 "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
1861 (long) current_gdbarch->address_to_pointer
1862 /*ADDRESS_TO_POINTER ()*/);
381323f4
AC
1863#endif
1864#ifdef RETURN_VALUE_ON_STACK
4b9b3959
AC
1865 if (GDB_MULTI_ARCH)
1866 fprintf_unfiltered (file,
1867 "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
1868 (long) current_gdbarch->return_value_on_stack
1869 /*RETURN_VALUE_ON_STACK ()*/);
381323f4
AC
1870#endif
1871#ifdef EXTRACT_RETURN_VALUE
4b9b3959
AC
1872 if (GDB_MULTI_ARCH)
1873 fprintf_unfiltered (file,
1874 "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1875 (long) current_gdbarch->extract_return_value
1876 /*EXTRACT_RETURN_VALUE ()*/);
381323f4
AC
1877#endif
1878#ifdef PUSH_ARGUMENTS
4b9b3959
AC
1879 if (GDB_MULTI_ARCH)
1880 fprintf_unfiltered (file,
1881 "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
1882 (long) current_gdbarch->push_arguments
1883 /*PUSH_ARGUMENTS ()*/);
381323f4
AC
1884#endif
1885#ifdef PUSH_DUMMY_FRAME
4b9b3959
AC
1886 if (GDB_MULTI_ARCH)
1887 fprintf_unfiltered (file,
1888 "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
1889 (long) current_gdbarch->push_dummy_frame
1890 /*PUSH_DUMMY_FRAME ()*/);
381323f4
AC
1891#endif
1892#ifdef PUSH_RETURN_ADDRESS
4b9b3959
AC
1893 if (GDB_MULTI_ARCH)
1894 fprintf_unfiltered (file,
1895 "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
1896 (long) current_gdbarch->push_return_address
1897 /*PUSH_RETURN_ADDRESS ()*/);
381323f4
AC
1898#endif
1899#ifdef POP_FRAME
4b9b3959
AC
1900 if (GDB_MULTI_ARCH)
1901 fprintf_unfiltered (file,
1902 "gdbarch_dump: POP_FRAME = 0x%08lx\n",
1903 (long) current_gdbarch->pop_frame
1904 /*POP_FRAME ()*/);
381323f4
AC
1905#endif
1906#ifdef D10V_MAKE_DADDR
4b9b3959
AC
1907 if (GDB_MULTI_ARCH)
1908 fprintf_unfiltered (file,
1909 "gdbarch_dump: D10V_MAKE_DADDR = 0x%08lx\n",
1910 (long) current_gdbarch->d10v_make_daddr
1911 /*D10V_MAKE_DADDR ()*/);
381323f4
AC
1912#endif
1913#ifdef D10V_MAKE_IADDR
4b9b3959
AC
1914 if (GDB_MULTI_ARCH)
1915 fprintf_unfiltered (file,
1916 "gdbarch_dump: D10V_MAKE_IADDR = 0x%08lx\n",
1917 (long) current_gdbarch->d10v_make_iaddr
1918 /*D10V_MAKE_IADDR ()*/);
381323f4
AC
1919#endif
1920#ifdef D10V_DADDR_P
4b9b3959
AC
1921 if (GDB_MULTI_ARCH)
1922 fprintf_unfiltered (file,
1923 "gdbarch_dump: D10V_DADDR_P = 0x%08lx\n",
1924 (long) current_gdbarch->d10v_daddr_p
1925 /*D10V_DADDR_P ()*/);
381323f4
AC
1926#endif
1927#ifdef D10V_IADDR_P
4b9b3959
AC
1928 if (GDB_MULTI_ARCH)
1929 fprintf_unfiltered (file,
1930 "gdbarch_dump: D10V_IADDR_P = 0x%08lx\n",
1931 (long) current_gdbarch->d10v_iaddr_p
1932 /*D10V_IADDR_P ()*/);
381323f4
AC
1933#endif
1934#ifdef D10V_CONVERT_DADDR_TO_RAW
4b9b3959
AC
1935 if (GDB_MULTI_ARCH)
1936 fprintf_unfiltered (file,
1937 "gdbarch_dump: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
1938 (long) current_gdbarch->d10v_convert_daddr_to_raw
1939 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
381323f4
AC
1940#endif
1941#ifdef D10V_CONVERT_IADDR_TO_RAW
4b9b3959
AC
1942 if (GDB_MULTI_ARCH)
1943 fprintf_unfiltered (file,
1944 "gdbarch_dump: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
1945 (long) current_gdbarch->d10v_convert_iaddr_to_raw
1946 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
381323f4
AC
1947#endif
1948#ifdef STORE_STRUCT_RETURN
4b9b3959
AC
1949 if (GDB_MULTI_ARCH)
1950 fprintf_unfiltered (file,
1951 "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
1952 (long) current_gdbarch->store_struct_return
1953 /*STORE_STRUCT_RETURN ()*/);
381323f4
AC
1954#endif
1955#ifdef STORE_RETURN_VALUE
4b9b3959
AC
1956 if (GDB_MULTI_ARCH)
1957 fprintf_unfiltered (file,
1958 "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
1959 (long) current_gdbarch->store_return_value
1960 /*STORE_RETURN_VALUE ()*/);
381323f4
AC
1961#endif
1962#ifdef EXTRACT_STRUCT_VALUE_ADDRESS
4b9b3959
AC
1963 if (GDB_MULTI_ARCH)
1964 fprintf_unfiltered (file,
1965 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1966 (long) current_gdbarch->extract_struct_value_address
1967 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
381323f4
AC
1968#endif
1969#ifdef USE_STRUCT_CONVENTION
4b9b3959
AC
1970 if (GDB_MULTI_ARCH)
1971 fprintf_unfiltered (file,
1972 "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
1973 (long) current_gdbarch->use_struct_convention
1974 /*USE_STRUCT_CONVENTION ()*/);
381323f4
AC
1975#endif
1976#ifdef FRAME_INIT_SAVED_REGS
4b9b3959
AC
1977 if (GDB_MULTI_ARCH)
1978 fprintf_unfiltered (file,
1979 "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1980 (long) current_gdbarch->frame_init_saved_regs
1981 /*FRAME_INIT_SAVED_REGS ()*/);
381323f4
AC
1982#endif
1983#ifdef INIT_EXTRA_FRAME_INFO
4b9b3959
AC
1984 if (GDB_MULTI_ARCH)
1985 fprintf_unfiltered (file,
1986 "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1987 (long) current_gdbarch->init_extra_frame_info
1988 /*INIT_EXTRA_FRAME_INFO ()*/);
381323f4
AC
1989#endif
1990#ifdef SKIP_PROLOGUE
4b9b3959
AC
1991 if (GDB_MULTI_ARCH)
1992 fprintf_unfiltered (file,
1993 "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
1994 (long) current_gdbarch->skip_prologue
1995 /*SKIP_PROLOGUE ()*/);
381323f4
AC
1996#endif
1997#ifdef PROLOGUE_FRAMELESS_P
4b9b3959
AC
1998 if (GDB_MULTI_ARCH)
1999 fprintf_unfiltered (file,
2000 "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
2001 (long) current_gdbarch->prologue_frameless_p
2002 /*PROLOGUE_FRAMELESS_P ()*/);
381323f4
AC
2003#endif
2004#ifdef INNER_THAN
4b9b3959
AC
2005 if (GDB_MULTI_ARCH)
2006 fprintf_unfiltered (file,
2007 "gdbarch_dump: INNER_THAN = 0x%08lx\n",
2008 (long) current_gdbarch->inner_than
2009 /*INNER_THAN ()*/);
381323f4
AC
2010#endif
2011#ifdef BREAKPOINT_FROM_PC
4b9b3959
AC
2012 if (GDB_MULTI_ARCH)
2013 fprintf_unfiltered (file,
2014 "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
2015 (long) current_gdbarch->breakpoint_from_pc
2016 /*BREAKPOINT_FROM_PC ()*/);
381323f4
AC
2017#endif
2018#ifdef MEMORY_INSERT_BREAKPOINT
4b9b3959
AC
2019 if (GDB_MULTI_ARCH)
2020 fprintf_unfiltered (file,
2021 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
2022 (long) current_gdbarch->memory_insert_breakpoint
2023 /*MEMORY_INSERT_BREAKPOINT ()*/);
381323f4
AC
2024#endif
2025#ifdef MEMORY_REMOVE_BREAKPOINT
4b9b3959
AC
2026 if (GDB_MULTI_ARCH)
2027 fprintf_unfiltered (file,
2028 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
2029 (long) current_gdbarch->memory_remove_breakpoint
2030 /*MEMORY_REMOVE_BREAKPOINT ()*/);
381323f4
AC
2031#endif
2032#ifdef DECR_PC_AFTER_BREAK
4b9b3959
AC
2033 fprintf_unfiltered (file,
2034 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
adf40b2e 2035 (long) DECR_PC_AFTER_BREAK);
381323f4
AC
2036#endif
2037#ifdef FUNCTION_START_OFFSET
4b9b3959
AC
2038 fprintf_unfiltered (file,
2039 "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
adf40b2e 2040 (long) FUNCTION_START_OFFSET);
381323f4
AC
2041#endif
2042#ifdef REMOTE_TRANSLATE_XFER_ADDRESS
4b9b3959
AC
2043 if (GDB_MULTI_ARCH)
2044 fprintf_unfiltered (file,
2045 "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
2046 (long) current_gdbarch->remote_translate_xfer_address
2047 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
381323f4
AC
2048#endif
2049#ifdef FRAME_ARGS_SKIP
4b9b3959
AC
2050 fprintf_unfiltered (file,
2051 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
adf40b2e 2052 (long) FRAME_ARGS_SKIP);
381323f4
AC
2053#endif
2054#ifdef FRAMELESS_FUNCTION_INVOCATION
4b9b3959
AC
2055 if (GDB_MULTI_ARCH)
2056 fprintf_unfiltered (file,
2057 "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
2058 (long) current_gdbarch->frameless_function_invocation
2059 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
381323f4
AC
2060#endif
2061#ifdef FRAME_CHAIN
4b9b3959
AC
2062 if (GDB_MULTI_ARCH)
2063 fprintf_unfiltered (file,
2064 "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
2065 (long) current_gdbarch->frame_chain
2066 /*FRAME_CHAIN ()*/);
381323f4
AC
2067#endif
2068#ifdef FRAME_CHAIN_VALID
4b9b3959
AC
2069 if (GDB_MULTI_ARCH)
2070 fprintf_unfiltered (file,
2071 "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
2072 (long) current_gdbarch->frame_chain_valid
2073 /*FRAME_CHAIN_VALID ()*/);
381323f4
AC
2074#endif
2075#ifdef FRAME_SAVED_PC
4b9b3959
AC
2076 if (GDB_MULTI_ARCH)
2077 fprintf_unfiltered (file,
2078 "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
2079 (long) current_gdbarch->frame_saved_pc
2080 /*FRAME_SAVED_PC ()*/);
381323f4
AC
2081#endif
2082#ifdef FRAME_ARGS_ADDRESS
4b9b3959
AC
2083 if (GDB_MULTI_ARCH)
2084 fprintf_unfiltered (file,
2085 "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
2086 (long) current_gdbarch->frame_args_address
2087 /*FRAME_ARGS_ADDRESS ()*/);
381323f4
AC
2088#endif
2089#ifdef FRAME_LOCALS_ADDRESS
4b9b3959
AC
2090 if (GDB_MULTI_ARCH)
2091 fprintf_unfiltered (file,
2092 "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
2093 (long) current_gdbarch->frame_locals_address
2094 /*FRAME_LOCALS_ADDRESS ()*/);
381323f4
AC
2095#endif
2096#ifdef SAVED_PC_AFTER_CALL
4b9b3959
AC
2097 if (GDB_MULTI_ARCH)
2098 fprintf_unfiltered (file,
2099 "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
2100 (long) current_gdbarch->saved_pc_after_call
2101 /*SAVED_PC_AFTER_CALL ()*/);
381323f4
AC
2102#endif
2103#ifdef FRAME_NUM_ARGS
4b9b3959
AC
2104 if (GDB_MULTI_ARCH)
2105 fprintf_unfiltered (file,
2106 "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
2107 (long) current_gdbarch->frame_num_args
2108 /*FRAME_NUM_ARGS ()*/);
381323f4
AC
2109#endif
2110#ifdef STACK_ALIGN
4b9b3959
AC
2111 if (GDB_MULTI_ARCH)
2112 fprintf_unfiltered (file,
2113 "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
2114 (long) current_gdbarch->stack_align
2115 /*STACK_ALIGN ()*/);
381323f4 2116#endif
1dd4193b
AC
2117#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
2118 fprintf_unfiltered (file,
2119 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %ld\n",
2120 (long) EXTRA_STACK_ALIGNMENT_NEEDED);
2121#endif
381323f4 2122#ifdef REG_STRUCT_HAS_ADDR
4b9b3959
AC
2123 if (GDB_MULTI_ARCH)
2124 fprintf_unfiltered (file,
2125 "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
2126 (long) current_gdbarch->reg_struct_has_addr
2127 /*REG_STRUCT_HAS_ADDR ()*/);
d1e3cf49
AC
2128#endif
2129#ifdef SAVE_DUMMY_FRAME_TOS
4b9b3959
AC
2130 if (GDB_MULTI_ARCH)
2131 fprintf_unfiltered (file,
2132 "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
2133 (long) current_gdbarch->save_dummy_frame_tos
2134 /*SAVE_DUMMY_FRAME_TOS ()*/);
f0d4cc9e 2135#endif
58d5518e
ND
2136#ifdef PARM_BOUNDARY
2137 fprintf_unfiltered (file,
2138 "gdbarch_dump: PARM_BOUNDARY = %ld\n",
2139 (long) PARM_BOUNDARY);
2140#endif
f0d4cc9e 2141#ifdef TARGET_FLOAT_FORMAT
4b9b3959
AC
2142 fprintf_unfiltered (file,
2143 "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
f0d4cc9e
AC
2144 (long) TARGET_FLOAT_FORMAT);
2145#endif
2146#ifdef TARGET_DOUBLE_FORMAT
4b9b3959
AC
2147 fprintf_unfiltered (file,
2148 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
f0d4cc9e
AC
2149 (long) TARGET_DOUBLE_FORMAT);
2150#endif
2151#ifdef TARGET_LONG_DOUBLE_FORMAT
4b9b3959
AC
2152 fprintf_unfiltered (file,
2153 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
f0d4cc9e 2154 (long) TARGET_LONG_DOUBLE_FORMAT);
f517ea4e
PS
2155#endif
2156#ifdef CONVERT_FROM_FUNC_PTR_ADDR
2157 if (GDB_MULTI_ARCH)
2158 fprintf_unfiltered (file,
2159 "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
2160 (long) current_gdbarch->convert_from_func_ptr_addr
2161 /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
64c4637f
AC
2162#endif
2163#ifdef SOFTWARE_SINGLE_STEP
2164 if (GDB_MULTI_ARCH)
2165 fprintf_unfiltered (file,
2166 "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
2167 (long) current_gdbarch->software_single_step
2168 /*SOFTWARE_SINGLE_STEP ()*/);
381323f4 2169#endif
4b9b3959
AC
2170 if (current_gdbarch->dump_tdep != NULL)
2171 current_gdbarch->dump_tdep (current_gdbarch, file);
0f71a2f6
JM
2172}
2173
2174struct gdbarch_tdep *
104c1213 2175gdbarch_tdep (struct gdbarch *gdbarch)
0f71a2f6
JM
2176{
2177 if (gdbarch_debug >= 2)
0f71a2f6
JM
2178 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
2179 return gdbarch->tdep;
2180}
2181
2182
2183const struct bfd_arch_info *
104c1213 2184gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
0f71a2f6
JM
2185{
2186 if (gdbarch_debug >= 2)
0f71a2f6
JM
2187 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
2188 return gdbarch->bfd_arch_info;
2189}
2190
2191int
104c1213 2192gdbarch_byte_order (struct gdbarch *gdbarch)
0f71a2f6
JM
2193{
2194 if (gdbarch_debug >= 2)
0f71a2f6
JM
2195 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
2196 return gdbarch->byte_order;
2197}
2198
0f71a2f6 2199int
104c1213 2200gdbarch_short_bit (struct gdbarch *gdbarch)
0f71a2f6 2201{
66b43ecb 2202 /* Skip verify of short_bit, invalid_p == 0 */
0f71a2f6 2203 if (gdbarch_debug >= 2)
0f71a2f6
JM
2204 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
2205 return gdbarch->short_bit;
2206}
2207
2208void
104c1213
JM
2209set_gdbarch_short_bit (struct gdbarch *gdbarch,
2210 int short_bit)
0f71a2f6
JM
2211{
2212 gdbarch->short_bit = short_bit;
2213}
2214
2215int
104c1213 2216gdbarch_int_bit (struct gdbarch *gdbarch)
0f71a2f6 2217{
66b43ecb 2218 /* Skip verify of int_bit, invalid_p == 0 */
0f71a2f6 2219 if (gdbarch_debug >= 2)
0f71a2f6
JM
2220 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
2221 return gdbarch->int_bit;
2222}
2223
2224void
104c1213
JM
2225set_gdbarch_int_bit (struct gdbarch *gdbarch,
2226 int int_bit)
0f71a2f6
JM
2227{
2228 gdbarch->int_bit = int_bit;
2229}
2230
2231int
104c1213 2232gdbarch_long_bit (struct gdbarch *gdbarch)
0f71a2f6 2233{
66b43ecb 2234 /* Skip verify of long_bit, invalid_p == 0 */
0f71a2f6 2235 if (gdbarch_debug >= 2)
0f71a2f6
JM
2236 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
2237 return gdbarch->long_bit;
2238}
2239
2240void
104c1213
JM
2241set_gdbarch_long_bit (struct gdbarch *gdbarch,
2242 int long_bit)
0f71a2f6
JM
2243{
2244 gdbarch->long_bit = long_bit;
2245}
2246
2247int
104c1213 2248gdbarch_long_long_bit (struct gdbarch *gdbarch)
0f71a2f6 2249{
66b43ecb 2250 /* Skip verify of long_long_bit, invalid_p == 0 */
0f71a2f6 2251 if (gdbarch_debug >= 2)
0f71a2f6
JM
2252 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
2253 return gdbarch->long_long_bit;
2254}
2255
2256void
104c1213
JM
2257set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
2258 int long_long_bit)
0f71a2f6
JM
2259{
2260 gdbarch->long_long_bit = long_long_bit;
2261}
2262
2263int
104c1213 2264gdbarch_float_bit (struct gdbarch *gdbarch)
0f71a2f6 2265{
66b43ecb 2266 /* Skip verify of float_bit, invalid_p == 0 */
0f71a2f6 2267 if (gdbarch_debug >= 2)
0f71a2f6
JM
2268 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
2269 return gdbarch->float_bit;
2270}
2271
2272void
104c1213
JM
2273set_gdbarch_float_bit (struct gdbarch *gdbarch,
2274 int float_bit)
0f71a2f6
JM
2275{
2276 gdbarch->float_bit = float_bit;
2277}
2278
2279int
104c1213 2280gdbarch_double_bit (struct gdbarch *gdbarch)
0f71a2f6 2281{
66b43ecb 2282 /* Skip verify of double_bit, invalid_p == 0 */
0f71a2f6 2283 if (gdbarch_debug >= 2)
0f71a2f6
JM
2284 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2285 return gdbarch->double_bit;
2286}
2287
2288void
104c1213
JM
2289set_gdbarch_double_bit (struct gdbarch *gdbarch,
2290 int double_bit)
0f71a2f6
JM
2291{
2292 gdbarch->double_bit = double_bit;
2293}
2294
2295int
104c1213 2296gdbarch_long_double_bit (struct gdbarch *gdbarch)
0f71a2f6 2297{
66b43ecb 2298 /* Skip verify of long_double_bit, invalid_p == 0 */
0f71a2f6 2299 if (gdbarch_debug >= 2)
0f71a2f6
JM
2300 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2301 return gdbarch->long_double_bit;
2302}
2303
2304void
104c1213
JM
2305set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2306 int long_double_bit)
0f71a2f6
JM
2307{
2308 gdbarch->long_double_bit = long_double_bit;
2309}
2310
66b43ecb
AC
2311int
2312gdbarch_ptr_bit (struct gdbarch *gdbarch)
2313{
2314 /* Skip verify of ptr_bit, invalid_p == 0 */
2315 if (gdbarch_debug >= 2)
2316 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2317 return gdbarch->ptr_bit;
2318}
2319
2320void
2321set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2322 int ptr_bit)
2323{
2324 gdbarch->ptr_bit = ptr_bit;
2325}
2326
52204a0b
DT
2327int
2328gdbarch_addr_bit (struct gdbarch *gdbarch)
2329{
2330 if (gdbarch->addr_bit == 0)
8e65ff28
AC
2331 internal_error (__FILE__, __LINE__,
2332 "gdbarch: gdbarch_addr_bit invalid");
52204a0b
DT
2333 if (gdbarch_debug >= 2)
2334 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2335 return gdbarch->addr_bit;
2336}
2337
2338void
2339set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2340 int addr_bit)
2341{
2342 gdbarch->addr_bit = addr_bit;
2343}
2344
66b43ecb
AC
2345int
2346gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2347{
2348 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2349 if (gdbarch_debug >= 2)
2350 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2351 return gdbarch->bfd_vma_bit;
2352}
2353
2354void
2355set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2356 int bfd_vma_bit)
2357{
2358 gdbarch->bfd_vma_bit = bfd_vma_bit;
2359}
2360
7355ddba
JB
2361int
2362gdbarch_ieee_float (struct gdbarch *gdbarch)
2363{
2364 /* Skip verify of ieee_float, invalid_p == 0 */
2365 if (gdbarch_debug >= 2)
2366 fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n");
2367 return gdbarch->ieee_float;
2368}
2369
2370void
2371set_gdbarch_ieee_float (struct gdbarch *gdbarch,
2372 int ieee_float)
2373{
2374 gdbarch->ieee_float = ieee_float;
2375}
2376
0f71a2f6
JM
2377CORE_ADDR
2378gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
2379{
2380 if (gdbarch->read_pc == 0)
8e65ff28
AC
2381 internal_error (__FILE__, __LINE__,
2382 "gdbarch: gdbarch_read_pc invalid");
0f71a2f6 2383 if (gdbarch_debug >= 2)
0f71a2f6
JM
2384 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2385 return gdbarch->read_pc (pid);
2386}
2387
2388void
104c1213
JM
2389set_gdbarch_read_pc (struct gdbarch *gdbarch,
2390 gdbarch_read_pc_ftype read_pc)
0f71a2f6
JM
2391{
2392 gdbarch->read_pc = read_pc;
2393}
2394
2395void
2396gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
2397{
2398 if (gdbarch->write_pc == 0)
8e65ff28
AC
2399 internal_error (__FILE__, __LINE__,
2400 "gdbarch: gdbarch_write_pc invalid");
0f71a2f6 2401 if (gdbarch_debug >= 2)
0f71a2f6
JM
2402 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2403 gdbarch->write_pc (val, pid);
2404}
2405
2406void
104c1213
JM
2407set_gdbarch_write_pc (struct gdbarch *gdbarch,
2408 gdbarch_write_pc_ftype write_pc)
0f71a2f6
JM
2409{
2410 gdbarch->write_pc = write_pc;
2411}
2412
2413CORE_ADDR
2414gdbarch_read_fp (struct gdbarch *gdbarch)
2415{
2416 if (gdbarch->read_fp == 0)
8e65ff28
AC
2417 internal_error (__FILE__, __LINE__,
2418 "gdbarch: gdbarch_read_fp invalid");
0f71a2f6 2419 if (gdbarch_debug >= 2)
0f71a2f6
JM
2420 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2421 return gdbarch->read_fp ();
2422}
2423
2424void
104c1213
JM
2425set_gdbarch_read_fp (struct gdbarch *gdbarch,
2426 gdbarch_read_fp_ftype read_fp)
0f71a2f6
JM
2427{
2428 gdbarch->read_fp = read_fp;
2429}
2430
2431void
2432gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
2433{
2434 if (gdbarch->write_fp == 0)
8e65ff28
AC
2435 internal_error (__FILE__, __LINE__,
2436 "gdbarch: gdbarch_write_fp invalid");
0f71a2f6 2437 if (gdbarch_debug >= 2)
0f71a2f6
JM
2438 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
2439 gdbarch->write_fp (val);
2440}
2441
2442void
104c1213
JM
2443set_gdbarch_write_fp (struct gdbarch *gdbarch,
2444 gdbarch_write_fp_ftype write_fp)
0f71a2f6
JM
2445{
2446 gdbarch->write_fp = write_fp;
2447}
2448
2449CORE_ADDR
2450gdbarch_read_sp (struct gdbarch *gdbarch)
2451{
2452 if (gdbarch->read_sp == 0)
8e65ff28
AC
2453 internal_error (__FILE__, __LINE__,
2454 "gdbarch: gdbarch_read_sp invalid");
0f71a2f6 2455 if (gdbarch_debug >= 2)
0f71a2f6
JM
2456 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2457 return gdbarch->read_sp ();
2458}
2459
2460void
104c1213
JM
2461set_gdbarch_read_sp (struct gdbarch *gdbarch,
2462 gdbarch_read_sp_ftype read_sp)
0f71a2f6
JM
2463{
2464 gdbarch->read_sp = read_sp;
2465}
2466
2467void
2468gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2469{
2470 if (gdbarch->write_sp == 0)
8e65ff28
AC
2471 internal_error (__FILE__, __LINE__,
2472 "gdbarch: gdbarch_write_sp invalid");
0f71a2f6 2473 if (gdbarch_debug >= 2)
0f71a2f6
JM
2474 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2475 gdbarch->write_sp (val);
2476}
2477
2478void
104c1213
JM
2479set_gdbarch_write_sp (struct gdbarch *gdbarch,
2480 gdbarch_write_sp_ftype write_sp)
0f71a2f6
JM
2481{
2482 gdbarch->write_sp = write_sp;
2483}
2484
61a0eb5b
AC
2485int
2486gdbarch_register_read_p (struct gdbarch *gdbarch)
2487{
2488 return gdbarch->register_read != 0;
2489}
2490
2491void
2492gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
2493{
2494 if (gdbarch->register_read == 0)
2495 internal_error (__FILE__, __LINE__,
2496 "gdbarch: gdbarch_register_read invalid");
2497 if (gdbarch_debug >= 2)
2498 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_read called\n");
2499 gdbarch->register_read (gdbarch, regnum, buf);
2500}
2501
2502void
2503set_gdbarch_register_read (struct gdbarch *gdbarch,
2504 gdbarch_register_read_ftype register_read)
2505{
2506 gdbarch->register_read = register_read;
2507}
2508
2509int
2510gdbarch_register_write_p (struct gdbarch *gdbarch)
2511{
2512 return gdbarch->register_write != 0;
2513}
2514
2515void
2516gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
2517{
2518 if (gdbarch->register_write == 0)
2519 internal_error (__FILE__, __LINE__,
2520 "gdbarch: gdbarch_register_write invalid");
2521 if (gdbarch_debug >= 2)
2522 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_write called\n");
2523 gdbarch->register_write (gdbarch, regnum, buf);
2524}
2525
2526void
2527set_gdbarch_register_write (struct gdbarch *gdbarch,
2528 gdbarch_register_write_ftype register_write)
2529{
2530 gdbarch->register_write = register_write;
2531}
2532
0f71a2f6 2533int
104c1213 2534gdbarch_num_regs (struct gdbarch *gdbarch)
0f71a2f6
JM
2535{
2536 if (gdbarch->num_regs == -1)
8e65ff28
AC
2537 internal_error (__FILE__, __LINE__,
2538 "gdbarch: gdbarch_num_regs invalid");
0f71a2f6 2539 if (gdbarch_debug >= 2)
0f71a2f6
JM
2540 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2541 return gdbarch->num_regs;
2542}
2543
2544void
104c1213
JM
2545set_gdbarch_num_regs (struct gdbarch *gdbarch,
2546 int num_regs)
0f71a2f6
JM
2547{
2548 gdbarch->num_regs = num_regs;
2549}
2550
0aba1244
EZ
2551int
2552gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2553{
2554 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2555 if (gdbarch_debug >= 2)
2556 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2557 return gdbarch->num_pseudo_regs;
2558}
2559
2560void
2561set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2562 int num_pseudo_regs)
2563{
2564 gdbarch->num_pseudo_regs = num_pseudo_regs;
2565}
2566
0f71a2f6 2567int
104c1213 2568gdbarch_sp_regnum (struct gdbarch *gdbarch)
0f71a2f6
JM
2569{
2570 if (gdbarch->sp_regnum == -1)
8e65ff28
AC
2571 internal_error (__FILE__, __LINE__,
2572 "gdbarch: gdbarch_sp_regnum invalid");
0f71a2f6 2573 if (gdbarch_debug >= 2)
0f71a2f6
JM
2574 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2575 return gdbarch->sp_regnum;
2576}
2577
2578void
104c1213
JM
2579set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2580 int sp_regnum)
0f71a2f6
JM
2581{
2582 gdbarch->sp_regnum = sp_regnum;
2583}
2584
2585int
104c1213 2586gdbarch_fp_regnum (struct gdbarch *gdbarch)
0f71a2f6
JM
2587{
2588 if (gdbarch->fp_regnum == -1)
8e65ff28
AC
2589 internal_error (__FILE__, __LINE__,
2590 "gdbarch: gdbarch_fp_regnum invalid");
0f71a2f6 2591 if (gdbarch_debug >= 2)
0f71a2f6
JM
2592 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
2593 return gdbarch->fp_regnum;
2594}
2595
2596void
104c1213
JM
2597set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
2598 int fp_regnum)
0f71a2f6
JM
2599{
2600 gdbarch->fp_regnum = fp_regnum;
2601}
2602
2603int
104c1213 2604gdbarch_pc_regnum (struct gdbarch *gdbarch)
0f71a2f6
JM
2605{
2606 if (gdbarch->pc_regnum == -1)
8e65ff28
AC
2607 internal_error (__FILE__, __LINE__,
2608 "gdbarch: gdbarch_pc_regnum invalid");
0f71a2f6 2609 if (gdbarch_debug >= 2)
0f71a2f6
JM
2610 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2611 return gdbarch->pc_regnum;
2612}
2613
2614void
104c1213
JM
2615set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2616 int pc_regnum)
0f71a2f6
JM
2617{
2618 gdbarch->pc_regnum = pc_regnum;
2619}
2620
60054393
MS
2621int
2622gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2623{
2624 /* Skip verify of fp0_regnum, invalid_p == 0 */
2625 if (gdbarch_debug >= 2)
2626 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2627 return gdbarch->fp0_regnum;
2628}
2629
2630void
2631set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2632 int fp0_regnum)
2633{
2634 gdbarch->fp0_regnum = fp0_regnum;
2635}
2636
03863182
AC
2637int
2638gdbarch_npc_regnum (struct gdbarch *gdbarch)
2639{
2640 /* Skip verify of npc_regnum, invalid_p == 0 */
2641 if (gdbarch_debug >= 2)
2642 fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
2643 return gdbarch->npc_regnum;
2644}
2645
2646void
2647set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
2648 int npc_regnum)
2649{
2650 gdbarch->npc_regnum = npc_regnum;
2651}
2652
2653int
2654gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
2655{
2656 /* Skip verify of nnpc_regnum, invalid_p == 0 */
2657 if (gdbarch_debug >= 2)
2658 fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
2659 return gdbarch->nnpc_regnum;
2660}
2661
2662void
2663set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
2664 int nnpc_regnum)
2665{
2666 gdbarch->nnpc_regnum = nnpc_regnum;
2667}
2668
88c72b7d
AC
2669int
2670gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2671{
2672 if (gdbarch->stab_reg_to_regnum == 0)
8e65ff28
AC
2673 internal_error (__FILE__, __LINE__,
2674 "gdbarch: gdbarch_stab_reg_to_regnum invalid");
88c72b7d
AC
2675 if (gdbarch_debug >= 2)
2676 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2677 return gdbarch->stab_reg_to_regnum (stab_regnr);
2678}
2679
2680void
2681set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2682 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2683{
2684 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2685}
2686
2687int
2688gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2689{
2690 if (gdbarch->ecoff_reg_to_regnum == 0)
8e65ff28
AC
2691 internal_error (__FILE__, __LINE__,
2692 "gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
88c72b7d
AC
2693 if (gdbarch_debug >= 2)
2694 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2695 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2696}
2697
2698void
2699set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2700 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2701{
2702 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2703}
2704
2705int
2706gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2707{
2708 if (gdbarch->dwarf_reg_to_regnum == 0)
8e65ff28
AC
2709 internal_error (__FILE__, __LINE__,
2710 "gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
88c72b7d
AC
2711 if (gdbarch_debug >= 2)
2712 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2713 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2714}
2715
2716void
2717set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2718 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2719{
2720 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2721}
2722
2723int
2724gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2725{
2726 if (gdbarch->sdb_reg_to_regnum == 0)
8e65ff28
AC
2727 internal_error (__FILE__, __LINE__,
2728 "gdbarch: gdbarch_sdb_reg_to_regnum invalid");
88c72b7d
AC
2729 if (gdbarch_debug >= 2)
2730 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2731 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2732}
2733
2734void
2735set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2736 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2737{
2738 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2739}
2740
2741int
2742gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2743{
2744 if (gdbarch->dwarf2_reg_to_regnum == 0)
8e65ff28
AC
2745 internal_error (__FILE__, __LINE__,
2746 "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
88c72b7d
AC
2747 if (gdbarch_debug >= 2)
2748 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2749 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2750}
2751
2752void
2753set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2754 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2755{
2756 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2757}
2758
0f71a2f6
JM
2759char *
2760gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2761{
7be570e7 2762 if (gdbarch->register_name == 0)
8e65ff28
AC
2763 internal_error (__FILE__, __LINE__,
2764 "gdbarch: gdbarch_register_name invalid");
0f71a2f6 2765 if (gdbarch_debug >= 2)
0f71a2f6
JM
2766 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2767 return gdbarch->register_name (regnr);
2768}
2769
2770void
104c1213
JM
2771set_gdbarch_register_name (struct gdbarch *gdbarch,
2772 gdbarch_register_name_ftype register_name)
0f71a2f6
JM
2773{
2774 gdbarch->register_name = register_name;
2775}
2776
2777int
104c1213 2778gdbarch_register_size (struct gdbarch *gdbarch)
0f71a2f6
JM
2779{
2780 if (gdbarch->register_size == -1)
8e65ff28
AC
2781 internal_error (__FILE__, __LINE__,
2782 "gdbarch: gdbarch_register_size invalid");
0f71a2f6 2783 if (gdbarch_debug >= 2)
0f71a2f6
JM
2784 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
2785 return gdbarch->register_size;
2786}
2787
2788void
104c1213
JM
2789set_gdbarch_register_size (struct gdbarch *gdbarch,
2790 int register_size)
0f71a2f6
JM
2791{
2792 gdbarch->register_size = register_size;
2793}
2794
2795int
104c1213 2796gdbarch_register_bytes (struct gdbarch *gdbarch)
0f71a2f6
JM
2797{
2798 if (gdbarch->register_bytes == -1)
8e65ff28
AC
2799 internal_error (__FILE__, __LINE__,
2800 "gdbarch: gdbarch_register_bytes invalid");
0f71a2f6 2801 if (gdbarch_debug >= 2)
0f71a2f6
JM
2802 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
2803 return gdbarch->register_bytes;
2804}
2805
2806void
104c1213
JM
2807set_gdbarch_register_bytes (struct gdbarch *gdbarch,
2808 int register_bytes)
0f71a2f6
JM
2809{
2810 gdbarch->register_bytes = register_bytes;
2811}
2812
2813int
2814gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
2815{
2816 if (gdbarch->register_byte == 0)
8e65ff28
AC
2817 internal_error (__FILE__, __LINE__,
2818 "gdbarch: gdbarch_register_byte invalid");
0f71a2f6 2819 if (gdbarch_debug >= 2)
0f71a2f6
JM
2820 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
2821 return gdbarch->register_byte (reg_nr);
2822}
2823
2824void
104c1213
JM
2825set_gdbarch_register_byte (struct gdbarch *gdbarch,
2826 gdbarch_register_byte_ftype register_byte)
0f71a2f6
JM
2827{
2828 gdbarch->register_byte = register_byte;
2829}
2830
2831int
2832gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
2833{
2834 if (gdbarch->register_raw_size == 0)
8e65ff28
AC
2835 internal_error (__FILE__, __LINE__,
2836 "gdbarch: gdbarch_register_raw_size invalid");
0f71a2f6 2837 if (gdbarch_debug >= 2)
0f71a2f6
JM
2838 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
2839 return gdbarch->register_raw_size (reg_nr);
2840}
2841
2842void
104c1213
JM
2843set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
2844 gdbarch_register_raw_size_ftype register_raw_size)
0f71a2f6
JM
2845{
2846 gdbarch->register_raw_size = register_raw_size;
2847}
2848
2849int
104c1213 2850gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
0f71a2f6
JM
2851{
2852 if (gdbarch->max_register_raw_size == -1)
8e65ff28
AC
2853 internal_error (__FILE__, __LINE__,
2854 "gdbarch: gdbarch_max_register_raw_size invalid");
0f71a2f6 2855 if (gdbarch_debug >= 2)
0f71a2f6
JM
2856 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
2857 return gdbarch->max_register_raw_size;
2858}
2859
2860void
104c1213
JM
2861set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
2862 int max_register_raw_size)
0f71a2f6
JM
2863{
2864 gdbarch->max_register_raw_size = max_register_raw_size;
2865}
2866
2867int
2868gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
2869{
2870 if (gdbarch->register_virtual_size == 0)
8e65ff28
AC
2871 internal_error (__FILE__, __LINE__,
2872 "gdbarch: gdbarch_register_virtual_size invalid");
0f71a2f6 2873 if (gdbarch_debug >= 2)
0f71a2f6
JM
2874 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
2875 return gdbarch->register_virtual_size (reg_nr);
2876}
2877
2878void
104c1213
JM
2879set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
2880 gdbarch_register_virtual_size_ftype register_virtual_size)
0f71a2f6
JM
2881{
2882 gdbarch->register_virtual_size = register_virtual_size;
2883}
2884
2885int
104c1213 2886gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
0f71a2f6
JM
2887{
2888 if (gdbarch->max_register_virtual_size == -1)
8e65ff28
AC
2889 internal_error (__FILE__, __LINE__,
2890 "gdbarch: gdbarch_max_register_virtual_size invalid");
0f71a2f6 2891 if (gdbarch_debug >= 2)
0f71a2f6
JM
2892 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
2893 return gdbarch->max_register_virtual_size;
2894}
2895
2896void
104c1213
JM
2897set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
2898 int max_register_virtual_size)
0f71a2f6
JM
2899{
2900 gdbarch->max_register_virtual_size = max_register_virtual_size;
2901}
2902
2903struct type *
2904gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
2905{
2906 if (gdbarch->register_virtual_type == 0)
8e65ff28
AC
2907 internal_error (__FILE__, __LINE__,
2908 "gdbarch: gdbarch_register_virtual_type invalid");
0f71a2f6 2909 if (gdbarch_debug >= 2)
0f71a2f6
JM
2910 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
2911 return gdbarch->register_virtual_type (reg_nr);
2912}
2913
2914void
104c1213
JM
2915set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
2916 gdbarch_register_virtual_type_ftype register_virtual_type)
0f71a2f6
JM
2917{
2918 gdbarch->register_virtual_type = register_virtual_type;
2919}
2920
666e11c5
EZ
2921void
2922gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
2923{
2924 if (gdbarch->do_registers_info == 0)
8e65ff28
AC
2925 internal_error (__FILE__, __LINE__,
2926 "gdbarch: gdbarch_do_registers_info invalid");
666e11c5
EZ
2927 if (gdbarch_debug >= 2)
2928 fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
2929 gdbarch->do_registers_info (reg_nr, fpregs);
2930}
2931
2932void
2933set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
2934 gdbarch_do_registers_info_ftype do_registers_info)
2935{
2936 gdbarch->do_registers_info = do_registers_info;
2937}
2938
7c7651b2
AC
2939int
2940gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2941{
2942 if (gdbarch->register_sim_regno == 0)
8e65ff28
AC
2943 internal_error (__FILE__, __LINE__,
2944 "gdbarch: gdbarch_register_sim_regno invalid");
7c7651b2
AC
2945 if (gdbarch_debug >= 2)
2946 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2947 return gdbarch->register_sim_regno (reg_nr);
2948}
2949
2950void
2951set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2952 gdbarch_register_sim_regno_ftype register_sim_regno)
2953{
2954 gdbarch->register_sim_regno = register_sim_regno;
2955}
2956
2649061d
AC
2957int
2958gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2959{
2960 return gdbarch->register_bytes_ok != 0;
2961}
2962
2963int
2964gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2965{
2966 if (gdbarch->register_bytes_ok == 0)
8e65ff28
AC
2967 internal_error (__FILE__, __LINE__,
2968 "gdbarch: gdbarch_register_bytes_ok invalid");
2649061d
AC
2969 if (gdbarch_debug >= 2)
2970 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2971 return gdbarch->register_bytes_ok (nr_bytes);
2972}
2973
2974void
2975set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2976 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2977{
2978 gdbarch->register_bytes_ok = register_bytes_ok;
2979}
2980
0f71a2f6 2981int
104c1213 2982gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
0f71a2f6
JM
2983{
2984 if (gdbarch->use_generic_dummy_frames == -1)
8e65ff28
AC
2985 internal_error (__FILE__, __LINE__,
2986 "gdbarch: gdbarch_use_generic_dummy_frames invalid");
0f71a2f6 2987 if (gdbarch_debug >= 2)
0f71a2f6
JM
2988 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
2989 return gdbarch->use_generic_dummy_frames;
2990}
2991
2992void
104c1213
JM
2993set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
2994 int use_generic_dummy_frames)
0f71a2f6
JM
2995{
2996 gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
2997}
2998
2999int
104c1213 3000gdbarch_call_dummy_location (struct gdbarch *gdbarch)
0f71a2f6
JM
3001{
3002 if (gdbarch->call_dummy_location == 0)
8e65ff28
AC
3003 internal_error (__FILE__, __LINE__,
3004 "gdbarch: gdbarch_call_dummy_location invalid");
0f71a2f6 3005 if (gdbarch_debug >= 2)
0f71a2f6
JM
3006 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
3007 return gdbarch->call_dummy_location;
3008}
3009
3010void
104c1213
JM
3011set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
3012 int call_dummy_location)
0f71a2f6
JM
3013{
3014 gdbarch->call_dummy_location = call_dummy_location;
3015}
3016
3017CORE_ADDR
3018gdbarch_call_dummy_address (struct gdbarch *gdbarch)
3019{
3020 if (gdbarch->call_dummy_address == 0)
8e65ff28
AC
3021 internal_error (__FILE__, __LINE__,
3022 "gdbarch: gdbarch_call_dummy_address invalid");
0f71a2f6 3023 if (gdbarch_debug >= 2)
0f71a2f6
JM
3024 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
3025 return gdbarch->call_dummy_address ();
3026}
3027
3028void
104c1213
JM
3029set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
3030 gdbarch_call_dummy_address_ftype call_dummy_address)
0f71a2f6
JM
3031{
3032 gdbarch->call_dummy_address = call_dummy_address;
3033}
3034
3035CORE_ADDR
104c1213 3036gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
0f71a2f6
JM
3037{
3038 if (gdbarch->call_dummy_start_offset == -1)
8e65ff28
AC
3039 internal_error (__FILE__, __LINE__,
3040 "gdbarch: gdbarch_call_dummy_start_offset invalid");
0f71a2f6 3041 if (gdbarch_debug >= 2)
0f71a2f6
JM
3042 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
3043 return gdbarch->call_dummy_start_offset;
3044}
3045
3046void
104c1213
JM
3047set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
3048 CORE_ADDR call_dummy_start_offset)
0f71a2f6
JM
3049{
3050 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
3051}
3052
3053CORE_ADDR
104c1213 3054gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
0f71a2f6
JM
3055{
3056 if (gdbarch->call_dummy_breakpoint_offset == -1)
8e65ff28
AC
3057 internal_error (__FILE__, __LINE__,
3058 "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
0f71a2f6 3059 if (gdbarch_debug >= 2)
0f71a2f6
JM
3060 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
3061 return gdbarch->call_dummy_breakpoint_offset;
3062}
3063
3064void
104c1213
JM
3065set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
3066 CORE_ADDR call_dummy_breakpoint_offset)
0f71a2f6
JM
3067{
3068 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
3069}
3070
3071int
104c1213 3072gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
0f71a2f6
JM
3073{
3074 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
8e65ff28
AC
3075 internal_error (__FILE__, __LINE__,
3076 "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
0f71a2f6 3077 if (gdbarch_debug >= 2)
0f71a2f6
JM
3078 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
3079 return gdbarch->call_dummy_breakpoint_offset_p;
3080}
3081
3082void
104c1213
JM
3083set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
3084 int call_dummy_breakpoint_offset_p)
0f71a2f6
JM
3085{
3086 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
3087}
3088
3089int
104c1213 3090gdbarch_call_dummy_length (struct gdbarch *gdbarch)
0f71a2f6
JM
3091{
3092 if (gdbarch->call_dummy_length == -1)
8e65ff28
AC
3093 internal_error (__FILE__, __LINE__,
3094 "gdbarch: gdbarch_call_dummy_length invalid");
0f71a2f6 3095 if (gdbarch_debug >= 2)
0f71a2f6
JM
3096 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
3097 return gdbarch->call_dummy_length;
3098}
3099
3100void
104c1213
JM
3101set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
3102 int call_dummy_length)
0f71a2f6
JM
3103{
3104 gdbarch->call_dummy_length = call_dummy_length;
3105}
3106
3107int
3108gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
3109{
3110 if (gdbarch->pc_in_call_dummy == 0)
8e65ff28
AC
3111 internal_error (__FILE__, __LINE__,
3112 "gdbarch: gdbarch_pc_in_call_dummy invalid");
0f71a2f6 3113 if (gdbarch_debug >= 2)
0f71a2f6
JM
3114 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
3115 return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
3116}
3117
3118void
104c1213
JM
3119set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
3120 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
0f71a2f6
JM
3121{
3122 gdbarch->pc_in_call_dummy = pc_in_call_dummy;
3123}
3124
3125int
104c1213 3126gdbarch_call_dummy_p (struct gdbarch *gdbarch)
0f71a2f6
JM
3127{
3128 if (gdbarch->call_dummy_p == -1)
8e65ff28
AC
3129 internal_error (__FILE__, __LINE__,
3130 "gdbarch: gdbarch_call_dummy_p invalid");
0f71a2f6 3131 if (gdbarch_debug >= 2)
0f71a2f6
JM
3132 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
3133 return gdbarch->call_dummy_p;
3134}
3135
3136void
104c1213
JM
3137set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
3138 int call_dummy_p)
0f71a2f6
JM
3139{
3140 gdbarch->call_dummy_p = call_dummy_p;
3141}
3142
3143LONGEST *
104c1213 3144gdbarch_call_dummy_words (struct gdbarch *gdbarch)
0f71a2f6 3145{
c0e8c252 3146 /* Skip verify of call_dummy_words, invalid_p == 0 */
0f71a2f6 3147 if (gdbarch_debug >= 2)
0f71a2f6
JM
3148 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
3149 return gdbarch->call_dummy_words;
3150}
3151
3152void
104c1213
JM
3153set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
3154 LONGEST * call_dummy_words)
0f71a2f6
JM
3155{
3156 gdbarch->call_dummy_words = call_dummy_words;
3157}
3158
3159int
104c1213 3160gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
0f71a2f6 3161{
c0e8c252 3162 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
0f71a2f6 3163 if (gdbarch_debug >= 2)
0f71a2f6
JM
3164 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
3165 return gdbarch->sizeof_call_dummy_words;
3166}
3167
3168void
104c1213
JM
3169set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
3170 int sizeof_call_dummy_words)
0f71a2f6
JM
3171{
3172 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
3173}
3174
3175int
104c1213 3176gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
0f71a2f6
JM
3177{
3178 if (gdbarch->call_dummy_stack_adjust_p == -1)
8e65ff28
AC
3179 internal_error (__FILE__, __LINE__,
3180 "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
0f71a2f6 3181 if (gdbarch_debug >= 2)
0f71a2f6
JM
3182 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
3183 return gdbarch->call_dummy_stack_adjust_p;
3184}
3185
3186void
104c1213
JM
3187set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
3188 int call_dummy_stack_adjust_p)
0f71a2f6
JM
3189{
3190 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
3191}
3192
3193int
104c1213 3194gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
0f71a2f6
JM
3195{
3196 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
8e65ff28
AC
3197 internal_error (__FILE__, __LINE__,
3198 "gdbarch: gdbarch_call_dummy_stack_adjust invalid");
0f71a2f6 3199 if (gdbarch_debug >= 2)
0f71a2f6
JM
3200 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
3201 return gdbarch->call_dummy_stack_adjust;
3202}
3203
3204void
104c1213
JM
3205set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
3206 int call_dummy_stack_adjust)
0f71a2f6
JM
3207{
3208 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
3209}
3210
3211void
3212gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
3213{
3214 if (gdbarch->fix_call_dummy == 0)
8e65ff28
AC
3215 internal_error (__FILE__, __LINE__,
3216 "gdbarch: gdbarch_fix_call_dummy invalid");
0f71a2f6 3217 if (gdbarch_debug >= 2)
0f71a2f6
JM
3218 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
3219 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
3220}
3221
3222void
104c1213
JM
3223set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
3224 gdbarch_fix_call_dummy_ftype fix_call_dummy)
0f71a2f6
JM
3225{
3226 gdbarch->fix_call_dummy = fix_call_dummy;
3227}
3228
3229int
104c1213 3230gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
0f71a2f6
JM
3231{
3232 if (gdbarch_debug >= 2)
0f71a2f6
JM
3233 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
3234 return gdbarch->believe_pcc_promotion;
3235}
3236
3237void
104c1213
JM
3238set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
3239 int believe_pcc_promotion)
0f71a2f6
JM
3240{
3241 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
3242}
3243
3244int
104c1213 3245gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
0f71a2f6
JM
3246{
3247 if (gdbarch_debug >= 2)
0f71a2f6
JM
3248 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
3249 return gdbarch->believe_pcc_promotion_type;
3250}
3251
3252void
104c1213
JM
3253set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
3254 int believe_pcc_promotion_type)
0f71a2f6
JM
3255{
3256 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
3257}
3258
b9a8e3bf
JB
3259int
3260gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
3261{
3262 if (gdbarch->coerce_float_to_double == 0)
8e65ff28
AC
3263 internal_error (__FILE__, __LINE__,
3264 "gdbarch: gdbarch_coerce_float_to_double invalid");
b9a8e3bf 3265 if (gdbarch_debug >= 2)
b9a8e3bf
JB
3266 fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
3267 return gdbarch->coerce_float_to_double (formal, actual);
3268}
3269
3270void
3271set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
3272 gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
3273{
3274 gdbarch->coerce_float_to_double = coerce_float_to_double;
3275}
3276
0f71a2f6 3277void
adf40b2e 3278gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
0f71a2f6
JM
3279{
3280 if (gdbarch->get_saved_register == 0)
8e65ff28
AC
3281 internal_error (__FILE__, __LINE__,
3282 "gdbarch: gdbarch_get_saved_register invalid");
0f71a2f6 3283 if (gdbarch_debug >= 2)
0f71a2f6
JM
3284 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
3285 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
3286}
3287
3288void
104c1213
JM
3289set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
3290 gdbarch_get_saved_register_ftype get_saved_register)
0f71a2f6
JM
3291{
3292 gdbarch->get_saved_register = get_saved_register;
3293}
3294
3295int
3296gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
3297{
3298 if (gdbarch->register_convertible == 0)
8e65ff28
AC
3299 internal_error (__FILE__, __LINE__,
3300 "gdbarch: gdbarch_register_convertible invalid");
0f71a2f6 3301 if (gdbarch_debug >= 2)
0f71a2f6
JM
3302 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
3303 return gdbarch->register_convertible (nr);
3304}
3305
3306void
104c1213
JM
3307set_gdbarch_register_convertible (struct gdbarch *gdbarch,
3308 gdbarch_register_convertible_ftype register_convertible)
0f71a2f6
JM
3309{
3310 gdbarch->register_convertible = register_convertible;
3311}
3312
3313void
3314gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
3315{
3316 if (gdbarch->register_convert_to_virtual == 0)
8e65ff28
AC
3317 internal_error (__FILE__, __LINE__,
3318 "gdbarch: gdbarch_register_convert_to_virtual invalid");
0f71a2f6 3319 if (gdbarch_debug >= 2)
0f71a2f6
JM
3320 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
3321 gdbarch->register_convert_to_virtual (regnum, type, from, to);
3322}
3323
3324void
104c1213
JM
3325set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
3326 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
0f71a2f6
JM
3327{
3328 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
3329}
3330
3331void
3332gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
3333{
3334 if (gdbarch->register_convert_to_raw == 0)
8e65ff28
AC
3335 internal_error (__FILE__, __LINE__,
3336 "gdbarch: gdbarch_register_convert_to_raw invalid");
0f71a2f6 3337 if (gdbarch_debug >= 2)
0f71a2f6
JM
3338 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
3339 gdbarch->register_convert_to_raw (type, regnum, from, to);
3340}
3341
3342void
104c1213
JM
3343set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
3344 gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
0f71a2f6
JM
3345{
3346 gdbarch->register_convert_to_raw = register_convert_to_raw;
3347}
3348
7f1b2585
EZ
3349void
3350gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
3351{
3352 if (gdbarch->fetch_pseudo_register == 0)
8e65ff28
AC
3353 internal_error (__FILE__, __LINE__,
3354 "gdbarch: gdbarch_fetch_pseudo_register invalid");
7f1b2585
EZ
3355 if (gdbarch_debug >= 2)
3356 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
3357 gdbarch->fetch_pseudo_register (regnum);
3358}
3359
3360void
3361set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
3362 gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
3363{
3364 gdbarch->fetch_pseudo_register = fetch_pseudo_register;
3365}
3366
3367void
3368gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
3369{
3370 if (gdbarch->store_pseudo_register == 0)
8e65ff28
AC
3371 internal_error (__FILE__, __LINE__,
3372 "gdbarch: gdbarch_store_pseudo_register invalid");
7f1b2585
EZ
3373 if (gdbarch_debug >= 2)
3374 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
3375 gdbarch->store_pseudo_register (regnum);
3376}
3377
3378void
3379set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
3380 gdbarch_store_pseudo_register_ftype store_pseudo_register)
3381{
3382 gdbarch->store_pseudo_register = store_pseudo_register;
3383}
3384
4478b372 3385CORE_ADDR
ac2e2ef7 3386gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
4478b372
JB
3387{
3388 if (gdbarch->pointer_to_address == 0)
8e65ff28
AC
3389 internal_error (__FILE__, __LINE__,
3390 "gdbarch: gdbarch_pointer_to_address invalid");
4478b372
JB
3391 if (gdbarch_debug >= 2)
3392 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
3393 return gdbarch->pointer_to_address (type, buf);
3394}
3395
3396void
3397set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
3398 gdbarch_pointer_to_address_ftype pointer_to_address)
3399{
3400 gdbarch->pointer_to_address = pointer_to_address;
3401}
3402
3403void
ac2e2ef7 3404gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
4478b372
JB
3405{
3406 if (gdbarch->address_to_pointer == 0)
8e65ff28
AC
3407 internal_error (__FILE__, __LINE__,
3408 "gdbarch: gdbarch_address_to_pointer invalid");
4478b372
JB
3409 if (gdbarch_debug >= 2)
3410 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
3411 gdbarch->address_to_pointer (type, buf, addr);
3412}
3413
3414void
3415set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
3416 gdbarch_address_to_pointer_ftype address_to_pointer)
3417{
3418 gdbarch->address_to_pointer = address_to_pointer;
3419}
3420
71a9f22e
JB
3421int
3422gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
3423{
71a9f22e 3424 if (gdbarch->return_value_on_stack == 0)
8e65ff28
AC
3425 internal_error (__FILE__, __LINE__,
3426 "gdbarch: gdbarch_return_value_on_stack invalid");
71a9f22e
JB
3427 if (gdbarch_debug >= 2)
3428 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
3429 return gdbarch->return_value_on_stack (type);
3430}
3431
3432void
3433set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
3434 gdbarch_return_value_on_stack_ftype return_value_on_stack)
3435{
3436 gdbarch->return_value_on_stack = return_value_on_stack;
3437}
3438
0f71a2f6
JM
3439void
3440gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3441{
3442 if (gdbarch->extract_return_value == 0)
8e65ff28
AC
3443 internal_error (__FILE__, __LINE__,
3444 "gdbarch: gdbarch_extract_return_value invalid");
0f71a2f6 3445 if (gdbarch_debug >= 2)
0f71a2f6
JM
3446 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3447 gdbarch->extract_return_value (type, regbuf, valbuf);
3448}
3449
3450void
104c1213
JM
3451set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3452 gdbarch_extract_return_value_ftype extract_return_value)
0f71a2f6
JM
3453{
3454 gdbarch->extract_return_value = extract_return_value;
3455}
3456
3457CORE_ADDR
3458gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
3459{
3460 if (gdbarch->push_arguments == 0)
8e65ff28
AC
3461 internal_error (__FILE__, __LINE__,
3462 "gdbarch: gdbarch_push_arguments invalid");
0f71a2f6 3463 if (gdbarch_debug >= 2)
0f71a2f6
JM
3464 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
3465 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
3466}
3467
3468void
104c1213
JM
3469set_gdbarch_push_arguments (struct gdbarch *gdbarch,
3470 gdbarch_push_arguments_ftype push_arguments)
0f71a2f6
JM
3471{
3472 gdbarch->push_arguments = push_arguments;
3473}
3474
3475void
3476gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
3477{
3478 if (gdbarch->push_dummy_frame == 0)
8e65ff28
AC
3479 internal_error (__FILE__, __LINE__,
3480 "gdbarch: gdbarch_push_dummy_frame invalid");
0f71a2f6 3481 if (gdbarch_debug >= 2)
0f71a2f6
JM
3482 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
3483 gdbarch->push_dummy_frame ();
3484}
3485
3486void
104c1213
JM
3487set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
3488 gdbarch_push_dummy_frame_ftype push_dummy_frame)
0f71a2f6
JM
3489{
3490 gdbarch->push_dummy_frame = push_dummy_frame;
3491}
3492
3493CORE_ADDR
3494gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
3495{
3496 if (gdbarch->push_return_address == 0)
8e65ff28
AC
3497 internal_error (__FILE__, __LINE__,
3498 "gdbarch: gdbarch_push_return_address invalid");
0f71a2f6 3499 if (gdbarch_debug >= 2)
0f71a2f6
JM
3500 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
3501 return gdbarch->push_return_address (pc, sp);
3502}
3503
3504void
104c1213
JM
3505set_gdbarch_push_return_address (struct gdbarch *gdbarch,
3506 gdbarch_push_return_address_ftype push_return_address)
0f71a2f6
JM
3507{
3508 gdbarch->push_return_address = push_return_address;
3509}
3510
3511void
3512gdbarch_pop_frame (struct gdbarch *gdbarch)
3513{
3514 if (gdbarch->pop_frame == 0)
8e65ff28
AC
3515 internal_error (__FILE__, __LINE__,
3516 "gdbarch: gdbarch_pop_frame invalid");
0f71a2f6 3517 if (gdbarch_debug >= 2)
0f71a2f6
JM
3518 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
3519 gdbarch->pop_frame ();
3520}
3521
3522void
104c1213
JM
3523set_gdbarch_pop_frame (struct gdbarch *gdbarch,
3524 gdbarch_pop_frame_ftype pop_frame)
0f71a2f6
JM
3525{
3526 gdbarch->pop_frame = pop_frame;
3527}
3528
3529CORE_ADDR
3530gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
3531{
3532 if (gdbarch->d10v_make_daddr == 0)
8e65ff28
AC
3533 internal_error (__FILE__, __LINE__,
3534 "gdbarch: gdbarch_d10v_make_daddr invalid");
0f71a2f6 3535 if (gdbarch_debug >= 2)
0f71a2f6
JM
3536 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
3537 return gdbarch->d10v_make_daddr (x);
3538}
3539
3540void
104c1213
JM
3541set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch,
3542 gdbarch_d10v_make_daddr_ftype d10v_make_daddr)
0f71a2f6
JM
3543{
3544 gdbarch->d10v_make_daddr = d10v_make_daddr;
3545}
3546
3547CORE_ADDR
3548gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
3549{
3550 if (gdbarch->d10v_make_iaddr == 0)
8e65ff28
AC
3551 internal_error (__FILE__, __LINE__,
3552 "gdbarch: gdbarch_d10v_make_iaddr invalid");
0f71a2f6 3553 if (gdbarch_debug >= 2)
0f71a2f6
JM
3554 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
3555 return gdbarch->d10v_make_iaddr (x);
3556}
3557
3558void
104c1213
JM
3559set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch,
3560 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr)
0f71a2f6
JM
3561{
3562 gdbarch->d10v_make_iaddr = d10v_make_iaddr;
3563}
3564
3565int
3566gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
3567{
3568 if (gdbarch->d10v_daddr_p == 0)
8e65ff28
AC
3569 internal_error (__FILE__, __LINE__,
3570 "gdbarch: gdbarch_d10v_daddr_p invalid");
0f71a2f6 3571 if (gdbarch_debug >= 2)
0f71a2f6
JM
3572 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
3573 return gdbarch->d10v_daddr_p (x);
3574}
3575
3576void
104c1213
JM
3577set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch,
3578 gdbarch_d10v_daddr_p_ftype d10v_daddr_p)
0f71a2f6
JM
3579{
3580 gdbarch->d10v_daddr_p = d10v_daddr_p;
3581}
3582
3583int
3584gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
3585{
3586 if (gdbarch->d10v_iaddr_p == 0)
8e65ff28
AC
3587 internal_error (__FILE__, __LINE__,
3588 "gdbarch: gdbarch_d10v_iaddr_p invalid");
0f71a2f6 3589 if (gdbarch_debug >= 2)
0f71a2f6
JM
3590 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
3591 return gdbarch->d10v_iaddr_p (x);
3592}
3593
3594void
104c1213
JM
3595set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch,
3596 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p)
0f71a2f6
JM
3597{
3598 gdbarch->d10v_iaddr_p = d10v_iaddr_p;
3599}
3600
3601CORE_ADDR
3602gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
3603{
3604 if (gdbarch->d10v_convert_daddr_to_raw == 0)
8e65ff28
AC
3605 internal_error (__FILE__, __LINE__,
3606 "gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
0f71a2f6 3607 if (gdbarch_debug >= 2)
0f71a2f6
JM
3608 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
3609 return gdbarch->d10v_convert_daddr_to_raw (x);
3610}
3611
3612void
104c1213
JM
3613set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch,
3614 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw)
0f71a2f6
JM
3615{
3616 gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
3617}
3618
3619CORE_ADDR
3620gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
3621{
3622 if (gdbarch->d10v_convert_iaddr_to_raw == 0)
8e65ff28
AC
3623 internal_error (__FILE__, __LINE__,
3624 "gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
0f71a2f6 3625 if (gdbarch_debug >= 2)
0f71a2f6
JM
3626 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
3627 return gdbarch->d10v_convert_iaddr_to_raw (x);
3628}
3629
3630void
104c1213
JM
3631set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch,
3632 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw)
0f71a2f6
JM
3633{
3634 gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
3635}
3636
3637void
3638gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
3639{
3640 if (gdbarch->store_struct_return == 0)
8e65ff28
AC
3641 internal_error (__FILE__, __LINE__,
3642 "gdbarch: gdbarch_store_struct_return invalid");
0f71a2f6 3643 if (gdbarch_debug >= 2)
0f71a2f6
JM
3644 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3645 gdbarch->store_struct_return (addr, sp);
3646}
3647
3648void
104c1213
JM
3649set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3650 gdbarch_store_struct_return_ftype store_struct_return)
0f71a2f6
JM
3651{
3652 gdbarch->store_struct_return = store_struct_return;
3653}
3654
3655void
3656gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3657{
3658 if (gdbarch->store_return_value == 0)
8e65ff28
AC
3659 internal_error (__FILE__, __LINE__,
3660 "gdbarch: gdbarch_store_return_value invalid");
0f71a2f6 3661 if (gdbarch_debug >= 2)
0f71a2f6
JM
3662 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3663 gdbarch->store_return_value (type, valbuf);
3664}
3665
3666void
104c1213
JM
3667set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3668 gdbarch_store_return_value_ftype store_return_value)
0f71a2f6
JM
3669{
3670 gdbarch->store_return_value = store_return_value;
3671}
3672
3673CORE_ADDR
3674gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
3675{
3676 if (gdbarch->extract_struct_value_address == 0)
8e65ff28
AC
3677 internal_error (__FILE__, __LINE__,
3678 "gdbarch: gdbarch_extract_struct_value_address invalid");
0f71a2f6 3679 if (gdbarch_debug >= 2)
0f71a2f6
JM
3680 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
3681 return gdbarch->extract_struct_value_address (regbuf);
3682}
3683
3684void
104c1213
JM
3685set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
3686 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
0f71a2f6
JM
3687{
3688 gdbarch->extract_struct_value_address = extract_struct_value_address;
3689}
3690
3691int
3692gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3693{
3694 if (gdbarch->use_struct_convention == 0)
8e65ff28
AC
3695 internal_error (__FILE__, __LINE__,
3696 "gdbarch: gdbarch_use_struct_convention invalid");
0f71a2f6 3697 if (gdbarch_debug >= 2)
0f71a2f6
JM
3698 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3699 return gdbarch->use_struct_convention (gcc_p, value_type);
3700}
3701
3702void
104c1213
JM
3703set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
3704 gdbarch_use_struct_convention_ftype use_struct_convention)
0f71a2f6
JM
3705{
3706 gdbarch->use_struct_convention = use_struct_convention;
3707}
3708
3709void
3710gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3711{
3712 if (gdbarch->frame_init_saved_regs == 0)
8e65ff28
AC
3713 internal_error (__FILE__, __LINE__,
3714 "gdbarch: gdbarch_frame_init_saved_regs invalid");
0f71a2f6 3715 if (gdbarch_debug >= 2)
0f71a2f6
JM
3716 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
3717 gdbarch->frame_init_saved_regs (frame);
3718}
3719
3720void
104c1213
JM
3721set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
3722 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
0f71a2f6
JM
3723{
3724 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
3725}
3726
3727void
3728gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3729{
3730 if (gdbarch->init_extra_frame_info == 0)
8e65ff28
AC
3731 internal_error (__FILE__, __LINE__,
3732 "gdbarch: gdbarch_init_extra_frame_info invalid");
0f71a2f6 3733 if (gdbarch_debug >= 2)
0f71a2f6
JM
3734 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
3735 gdbarch->init_extra_frame_info (fromleaf, frame);
3736}
3737
3738void
104c1213
JM
3739set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
3740 gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
0f71a2f6
JM
3741{
3742 gdbarch->init_extra_frame_info = init_extra_frame_info;
3743}
3744
3745CORE_ADDR
3746gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3747{
3748 if (gdbarch->skip_prologue == 0)
8e65ff28
AC
3749 internal_error (__FILE__, __LINE__,
3750 "gdbarch: gdbarch_skip_prologue invalid");
0f71a2f6 3751 if (gdbarch_debug >= 2)
0f71a2f6
JM
3752 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3753 return gdbarch->skip_prologue (ip);
3754}
3755
3756void
104c1213
JM
3757set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3758 gdbarch_skip_prologue_ftype skip_prologue)
0f71a2f6
JM
3759{
3760 gdbarch->skip_prologue = skip_prologue;
3761}
3762
dad41f9a
AC
3763int
3764gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
3765{
dad41f9a 3766 if (gdbarch->prologue_frameless_p == 0)
8e65ff28
AC
3767 internal_error (__FILE__, __LINE__,
3768 "gdbarch: gdbarch_prologue_frameless_p invalid");
dad41f9a
AC
3769 if (gdbarch_debug >= 2)
3770 fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
3771 return gdbarch->prologue_frameless_p (ip);
3772}
3773
3774void
3775set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
3776 gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
3777{
3778 gdbarch->prologue_frameless_p = prologue_frameless_p;
3779}
3780
0f71a2f6
JM
3781int
3782gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3783{
3784 if (gdbarch->inner_than == 0)
8e65ff28
AC
3785 internal_error (__FILE__, __LINE__,
3786 "gdbarch: gdbarch_inner_than invalid");
0f71a2f6 3787 if (gdbarch_debug >= 2)
0f71a2f6
JM
3788 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3789 return gdbarch->inner_than (lhs, rhs);
3790}
3791
3792void
104c1213
JM
3793set_gdbarch_inner_than (struct gdbarch *gdbarch,
3794 gdbarch_inner_than_ftype inner_than)
0f71a2f6
JM
3795{
3796 gdbarch->inner_than = inner_than;
3797}
3798
3799unsigned char *
adf40b2e 3800gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
0f71a2f6
JM
3801{
3802 if (gdbarch->breakpoint_from_pc == 0)
8e65ff28
AC
3803 internal_error (__FILE__, __LINE__,
3804 "gdbarch: gdbarch_breakpoint_from_pc invalid");
0f71a2f6 3805 if (gdbarch_debug >= 2)
0f71a2f6
JM
3806 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3807 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3808}
3809
3810void
104c1213
JM
3811set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3812 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
0f71a2f6
JM
3813{
3814 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3815}
3816
917317f4
JM
3817int
3818gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3819{
3820 if (gdbarch->memory_insert_breakpoint == 0)
8e65ff28
AC
3821 internal_error (__FILE__, __LINE__,
3822 "gdbarch: gdbarch_memory_insert_breakpoint invalid");
917317f4 3823 if (gdbarch_debug >= 2)
917317f4
JM
3824 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3825 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3826}
3827
3828void
3829set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3830 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3831{
3832 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3833}
3834
3835int
3836gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3837{
3838 if (gdbarch->memory_remove_breakpoint == 0)
8e65ff28
AC
3839 internal_error (__FILE__, __LINE__,
3840 "gdbarch: gdbarch_memory_remove_breakpoint invalid");
917317f4 3841 if (gdbarch_debug >= 2)
917317f4
JM
3842 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3843 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3844}
3845
3846void
3847set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3848 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3849{
3850 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3851}
3852
0f71a2f6 3853CORE_ADDR
104c1213 3854gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
0f71a2f6
JM
3855{
3856 if (gdbarch->decr_pc_after_break == -1)
8e65ff28
AC
3857 internal_error (__FILE__, __LINE__,
3858 "gdbarch: gdbarch_decr_pc_after_break invalid");
0f71a2f6 3859 if (gdbarch_debug >= 2)
0f71a2f6
JM
3860 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3861 return gdbarch->decr_pc_after_break;
3862}
3863
3864void
104c1213
JM
3865set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3866 CORE_ADDR decr_pc_after_break)
0f71a2f6
JM
3867{
3868 gdbarch->decr_pc_after_break = decr_pc_after_break;
3869}
3870
3871CORE_ADDR
104c1213 3872gdbarch_function_start_offset (struct gdbarch *gdbarch)
0f71a2f6
JM
3873{
3874 if (gdbarch->function_start_offset == -1)
8e65ff28
AC
3875 internal_error (__FILE__, __LINE__,
3876 "gdbarch: gdbarch_function_start_offset invalid");
0f71a2f6 3877 if (gdbarch_debug >= 2)
0f71a2f6
JM
3878 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
3879 return gdbarch->function_start_offset;
3880}
3881
3882void
104c1213
JM
3883set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
3884 CORE_ADDR function_start_offset)
0f71a2f6
JM
3885{
3886 gdbarch->function_start_offset = function_start_offset;
3887}
3888
3889void
adf40b2e 3890gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
0f71a2f6
JM
3891{
3892 if (gdbarch->remote_translate_xfer_address == 0)
8e65ff28
AC
3893 internal_error (__FILE__, __LINE__,
3894 "gdbarch: gdbarch_remote_translate_xfer_address invalid");
0f71a2f6 3895 if (gdbarch_debug >= 2)
0f71a2f6
JM
3896 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3897 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
3898}
3899
3900void
104c1213
JM
3901set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3902 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
0f71a2f6
JM
3903{
3904 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3905}
3906
3907CORE_ADDR
104c1213 3908gdbarch_frame_args_skip (struct gdbarch *gdbarch)
0f71a2f6
JM
3909{
3910 if (gdbarch->frame_args_skip == -1)
8e65ff28
AC
3911 internal_error (__FILE__, __LINE__,
3912 "gdbarch: gdbarch_frame_args_skip invalid");
0f71a2f6 3913 if (gdbarch_debug >= 2)
0f71a2f6
JM
3914 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3915 return gdbarch->frame_args_skip;
3916}
3917
3918void
104c1213
JM
3919set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3920 CORE_ADDR frame_args_skip)
0f71a2f6
JM
3921{
3922 gdbarch->frame_args_skip = frame_args_skip;
3923}
3924
3925int
3926gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
3927{
3928 if (gdbarch->frameless_function_invocation == 0)
8e65ff28
AC
3929 internal_error (__FILE__, __LINE__,
3930 "gdbarch: gdbarch_frameless_function_invocation invalid");
0f71a2f6 3931 if (gdbarch_debug >= 2)
0f71a2f6
JM
3932 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
3933 return gdbarch->frameless_function_invocation (fi);
3934}
3935
3936void
104c1213
JM
3937set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
3938 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
0f71a2f6
JM
3939{
3940 gdbarch->frameless_function_invocation = frameless_function_invocation;
3941}
3942
3943CORE_ADDR
3944gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3945{
3946 if (gdbarch->frame_chain == 0)
8e65ff28
AC
3947 internal_error (__FILE__, __LINE__,
3948 "gdbarch: gdbarch_frame_chain invalid");
0f71a2f6 3949 if (gdbarch_debug >= 2)
0f71a2f6
JM
3950 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
3951 return gdbarch->frame_chain (frame);
3952}
3953
3954void
104c1213
JM
3955set_gdbarch_frame_chain (struct gdbarch *gdbarch,
3956 gdbarch_frame_chain_ftype frame_chain)
0f71a2f6
JM
3957{
3958 gdbarch->frame_chain = frame_chain;
3959}
3960
3961int
3962gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3963{
3964 if (gdbarch->frame_chain_valid == 0)
8e65ff28
AC
3965 internal_error (__FILE__, __LINE__,
3966 "gdbarch: gdbarch_frame_chain_valid invalid");
0f71a2f6 3967 if (gdbarch_debug >= 2)
0f71a2f6
JM
3968 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
3969 return gdbarch->frame_chain_valid (chain, thisframe);
3970}
3971
3972void
104c1213
JM
3973set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
3974 gdbarch_frame_chain_valid_ftype frame_chain_valid)
0f71a2f6
JM
3975{
3976 gdbarch->frame_chain_valid = frame_chain_valid;
3977}
3978
3979CORE_ADDR
3980gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3981{
3982 if (gdbarch->frame_saved_pc == 0)
8e65ff28
AC
3983 internal_error (__FILE__, __LINE__,
3984 "gdbarch: gdbarch_frame_saved_pc invalid");
0f71a2f6 3985 if (gdbarch_debug >= 2)
0f71a2f6
JM
3986 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
3987 return gdbarch->frame_saved_pc (fi);
3988}
3989
3990void
104c1213
JM
3991set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
3992 gdbarch_frame_saved_pc_ftype frame_saved_pc)
0f71a2f6
JM
3993{
3994 gdbarch->frame_saved_pc = frame_saved_pc;
3995}
3996
3997CORE_ADDR
3998gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3999{
4000 if (gdbarch->frame_args_address == 0)
8e65ff28
AC
4001 internal_error (__FILE__, __LINE__,
4002 "gdbarch: gdbarch_frame_args_address invalid");
0f71a2f6 4003 if (gdbarch_debug >= 2)
0f71a2f6
JM
4004 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
4005 return gdbarch->frame_args_address (fi);
4006}
4007
4008void
104c1213
JM
4009set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
4010 gdbarch_frame_args_address_ftype frame_args_address)
0f71a2f6
JM
4011{
4012 gdbarch->frame_args_address = frame_args_address;
4013}
4014
4015CORE_ADDR
4016gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
4017{
4018 if (gdbarch->frame_locals_address == 0)
8e65ff28
AC
4019 internal_error (__FILE__, __LINE__,
4020 "gdbarch: gdbarch_frame_locals_address invalid");
0f71a2f6 4021 if (gdbarch_debug >= 2)
0f71a2f6
JM
4022 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
4023 return gdbarch->frame_locals_address (fi);
4024}
4025
4026void
104c1213
JM
4027set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
4028 gdbarch_frame_locals_address_ftype frame_locals_address)
0f71a2f6
JM
4029{
4030 gdbarch->frame_locals_address = frame_locals_address;
4031}
4032
4033CORE_ADDR
4034gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
4035{
4036 if (gdbarch->saved_pc_after_call == 0)
8e65ff28
AC
4037 internal_error (__FILE__, __LINE__,
4038 "gdbarch: gdbarch_saved_pc_after_call invalid");
0f71a2f6 4039 if (gdbarch_debug >= 2)
0f71a2f6
JM
4040 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
4041 return gdbarch->saved_pc_after_call (frame);
4042}
4043
4044void
104c1213
JM
4045set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
4046 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
0f71a2f6
JM
4047{
4048 gdbarch->saved_pc_after_call = saved_pc_after_call;
4049}
4050
4051int
4052gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
4053{
4054 if (gdbarch->frame_num_args == 0)
8e65ff28
AC
4055 internal_error (__FILE__, __LINE__,
4056 "gdbarch: gdbarch_frame_num_args invalid");
0f71a2f6 4057 if (gdbarch_debug >= 2)
0f71a2f6
JM
4058 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
4059 return gdbarch->frame_num_args (frame);
4060}
4061
4062void
104c1213
JM
4063set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
4064 gdbarch_frame_num_args_ftype frame_num_args)
0f71a2f6
JM
4065{
4066 gdbarch->frame_num_args = frame_num_args;
4067}
4068
2ada493a
AC
4069int
4070gdbarch_stack_align_p (struct gdbarch *gdbarch)
4071{
4072 return gdbarch->stack_align != 0;
4073}
4074
4075CORE_ADDR
4076gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
4077{
4078 if (gdbarch->stack_align == 0)
8e65ff28
AC
4079 internal_error (__FILE__, __LINE__,
4080 "gdbarch: gdbarch_stack_align invalid");
2ada493a
AC
4081 if (gdbarch_debug >= 2)
4082 fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
4083 return gdbarch->stack_align (sp);
4084}
4085
4086void
4087set_gdbarch_stack_align (struct gdbarch *gdbarch,
4088 gdbarch_stack_align_ftype stack_align)
4089{
4090 gdbarch->stack_align = stack_align;
4091}
4092
1dd4193b
AC
4093int
4094gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
4095{
4096 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
4097 if (gdbarch_debug >= 2)
4098 fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
4099 return gdbarch->extra_stack_alignment_needed;
4100}
4101
4102void
4103set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
4104 int extra_stack_alignment_needed)
4105{
4106 gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
4107}
4108
d03e67c9
AC
4109int
4110gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
4111{
4112 return gdbarch->reg_struct_has_addr != 0;
4113}
4114
4115int
4116gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
4117{
4118 if (gdbarch->reg_struct_has_addr == 0)
8e65ff28
AC
4119 internal_error (__FILE__, __LINE__,
4120 "gdbarch: gdbarch_reg_struct_has_addr invalid");
d03e67c9
AC
4121 if (gdbarch_debug >= 2)
4122 fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
4123 return gdbarch->reg_struct_has_addr (gcc_p, type);
4124}
4125
4126void
4127set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
4128 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
4129{
4130 gdbarch->reg_struct_has_addr = reg_struct_has_addr;
4131}
4132
d1e3cf49
AC
4133int
4134gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
4135{
4136 return gdbarch->save_dummy_frame_tos != 0;
4137}
4138
4139void
4140gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
4141{
4142 if (gdbarch->save_dummy_frame_tos == 0)
8e65ff28
AC
4143 internal_error (__FILE__, __LINE__,
4144 "gdbarch: gdbarch_save_dummy_frame_tos invalid");
d1e3cf49
AC
4145 if (gdbarch_debug >= 2)
4146 fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
4147 gdbarch->save_dummy_frame_tos (sp);
4148}
4149
4150void
4151set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
4152 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
4153{
4154 gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
4155}
4156
58d5518e
ND
4157int
4158gdbarch_parm_boundary (struct gdbarch *gdbarch)
4159{
4160 if (gdbarch_debug >= 2)
4161 fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
4162 return gdbarch->parm_boundary;
4163}
4164
4165void
4166set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
4167 int parm_boundary)
4168{
4169 gdbarch->parm_boundary = parm_boundary;
4170}
4171
f0d4cc9e
AC
4172const struct floatformat *
4173gdbarch_float_format (struct gdbarch *gdbarch)
4174{
4175 if (gdbarch_debug >= 2)
4176 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
4177 return gdbarch->float_format;
4178}
4179
4180void
4181set_gdbarch_float_format (struct gdbarch *gdbarch,
4182 const struct floatformat * float_format)
4183{
4184 gdbarch->float_format = float_format;
4185}
4186
4187const struct floatformat *
4188gdbarch_double_format (struct gdbarch *gdbarch)
4189{
4190 if (gdbarch_debug >= 2)
4191 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
4192 return gdbarch->double_format;
4193}
4194
4195void
4196set_gdbarch_double_format (struct gdbarch *gdbarch,
4197 const struct floatformat * double_format)
4198{
4199 gdbarch->double_format = double_format;
4200}
4201
4202const struct floatformat *
4203gdbarch_long_double_format (struct gdbarch *gdbarch)
4204{
4205 if (gdbarch_debug >= 2)
4206 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
4207 return gdbarch->long_double_format;
4208}
4209
4210void
4211set_gdbarch_long_double_format (struct gdbarch *gdbarch,
4212 const struct floatformat * long_double_format)
4213{
4214 gdbarch->long_double_format = long_double_format;
4215}
4216
f517ea4e
PS
4217CORE_ADDR
4218gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
4219{
4220 if (gdbarch->convert_from_func_ptr_addr == 0)
8e65ff28
AC
4221 internal_error (__FILE__, __LINE__,
4222 "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
f517ea4e
PS
4223 if (gdbarch_debug >= 2)
4224 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
4225 return gdbarch->convert_from_func_ptr_addr (addr);
4226}
4227
4228void
4229set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
4230 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
4231{
4232 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
4233}
4234
64c4637f
AC
4235int
4236gdbarch_software_single_step_p (struct gdbarch *gdbarch)
4237{
4238 return gdbarch->software_single_step != 0;
4239}
4240
4241void
4242gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
4243{
4244 if (gdbarch->software_single_step == 0)
4245 internal_error (__FILE__, __LINE__,
4246 "gdbarch: gdbarch_software_single_step invalid");
4247 if (gdbarch_debug >= 2)
4248 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
4249 gdbarch->software_single_step (sig, insert_breakpoints_p);
4250}
4251
4252void
4253set_gdbarch_software_single_step (struct gdbarch *gdbarch,
4254 gdbarch_software_single_step_ftype software_single_step)
4255{
4256 gdbarch->software_single_step = software_single_step;
4257}
4258
0f71a2f6 4259
be5a57e1 4260/* Keep a registry of per-architecture data-pointers required by GDB
0f71a2f6
JM
4261 modules. */
4262
4263struct gdbarch_data
4264{
95160752
AC
4265 unsigned index;
4266 gdbarch_data_init_ftype *init;
4267 gdbarch_data_free_ftype *free;
0f71a2f6
JM
4268};
4269
4270struct gdbarch_data_registration
adf40b2e 4271{
adf40b2e
JM
4272 struct gdbarch_data *data;
4273 struct gdbarch_data_registration *next;
4274};
0f71a2f6 4275
be5a57e1 4276struct gdbarch_data_registry
adf40b2e 4277{
95160752 4278 unsigned nr;
adf40b2e
JM
4279 struct gdbarch_data_registration *registrations;
4280};
0f71a2f6 4281
be5a57e1 4282struct gdbarch_data_registry gdbarch_data_registry =
0f71a2f6
JM
4283{
4284 0, NULL,
4285};
4286
4287struct gdbarch_data *
95160752
AC
4288register_gdbarch_data (gdbarch_data_init_ftype *init,
4289 gdbarch_data_free_ftype *free)
0f71a2f6
JM
4290{
4291 struct gdbarch_data_registration **curr;
be5a57e1 4292 for (curr = &gdbarch_data_registry.registrations;
0f71a2f6
JM
4293 (*curr) != NULL;
4294 curr = &(*curr)->next);
4295 (*curr) = XMALLOC (struct gdbarch_data_registration);
4296 (*curr)->next = NULL;
0f71a2f6 4297 (*curr)->data = XMALLOC (struct gdbarch_data);
be5a57e1 4298 (*curr)->data->index = gdbarch_data_registry.nr++;
95160752
AC
4299 (*curr)->data->init = init;
4300 (*curr)->data->free = free;
0f71a2f6
JM
4301 return (*curr)->data;
4302}
4303
4304
4305/* Walk through all the registered users initializing each in turn. */
4306
0f71a2f6 4307static void
104c1213 4308init_gdbarch_data (struct gdbarch *gdbarch)
0f71a2f6
JM
4309{
4310 struct gdbarch_data_registration *rego;
be5a57e1 4311 for (rego = gdbarch_data_registry.registrations;
0f71a2f6
JM
4312 rego != NULL;
4313 rego = rego->next)
4314 {
95160752
AC
4315 struct gdbarch_data *data = rego->data;
4316 gdb_assert (data->index < gdbarch->nr_data);
4317 if (data->init != NULL)
4318 {
4319 void *pointer = data->init (gdbarch);
4320 set_gdbarch_data (gdbarch, data, pointer);
4321 }
4322 }
4323}
4324
4325/* Create/delete the gdbarch data vector. */
4326
4327static void
4328alloc_gdbarch_data (struct gdbarch *gdbarch)
4329{
4330 gdb_assert (gdbarch->data == NULL);
4331 gdbarch->nr_data = gdbarch_data_registry.nr;
4332 gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
4333}
4334
4335static void
4336free_gdbarch_data (struct gdbarch *gdbarch)
4337{
4338 struct gdbarch_data_registration *rego;
4339 gdb_assert (gdbarch->data != NULL);
4340 for (rego = gdbarch_data_registry.registrations;
4341 rego != NULL;
4342 rego = rego->next)
4343 {
4344 struct gdbarch_data *data = rego->data;
4345 gdb_assert (data->index < gdbarch->nr_data);
4346 if (data->free != NULL && gdbarch->data[data->index] != NULL)
4347 {
4348 data->free (gdbarch, gdbarch->data[data->index]);
4349 gdbarch->data[data->index] = NULL;
4350 }
0f71a2f6 4351 }
95160752
AC
4352 xfree (gdbarch->data);
4353 gdbarch->data = NULL;
0f71a2f6
JM
4354}
4355
4356
95160752
AC
4357/* Initialize the current value of thee specified per-architecture
4358 data-pointer. */
4359
4360void
4361set_gdbarch_data (struct gdbarch *gdbarch,
4362 struct gdbarch_data *data,
4363 void *pointer)
4364{
4365 gdb_assert (data->index < gdbarch->nr_data);
4366 if (data->free != NULL && gdbarch->data[data->index] != NULL)
4367 data->free (gdbarch, gdbarch->data[data->index]);
4368 gdbarch->data[data->index] = pointer;
4369}
4370
0f71a2f6
JM
4371/* Return the current value of the specified per-architecture
4372 data-pointer. */
4373
4374void *
7c7651b2 4375gdbarch_data (struct gdbarch_data *data)
0f71a2f6 4376{
95160752 4377 gdb_assert (data->index < current_gdbarch->nr_data);
0f71a2f6
JM
4378 return current_gdbarch->data[data->index];
4379}
4380
4381
4382
be5a57e1 4383/* Keep a registry of swapped data required by GDB modules. */
0f71a2f6
JM
4384
4385struct gdbarch_swap
4386{
4387 void *swap;
4388 struct gdbarch_swap_registration *source;
4389 struct gdbarch_swap *next;
4390};
4391
4392struct gdbarch_swap_registration
adf40b2e
JM
4393{
4394 void *data;
4395 unsigned long sizeof_data;
4396 gdbarch_swap_ftype *init;
4397 struct gdbarch_swap_registration *next;
4398};
0f71a2f6 4399
be5a57e1 4400struct gdbarch_swap_registry
adf40b2e
JM
4401{
4402 int nr;
4403 struct gdbarch_swap_registration *registrations;
4404};
0f71a2f6 4405
be5a57e1 4406struct gdbarch_swap_registry gdbarch_swap_registry =
0f71a2f6
JM
4407{
4408 0, NULL,
4409};
4410
4411void
104c1213
JM
4412register_gdbarch_swap (void *data,
4413 unsigned long sizeof_data,
4414 gdbarch_swap_ftype *init)
0f71a2f6
JM
4415{
4416 struct gdbarch_swap_registration **rego;
be5a57e1 4417 for (rego = &gdbarch_swap_registry.registrations;
0f71a2f6
JM
4418 (*rego) != NULL;
4419 rego = &(*rego)->next);
4420 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4421 (*rego)->next = NULL;
4422 (*rego)->init = init;
4423 (*rego)->data = data;
4424 (*rego)->sizeof_data = sizeof_data;
4425}
4426
4427
0f71a2f6 4428static void
104c1213 4429init_gdbarch_swap (struct gdbarch *gdbarch)
0f71a2f6
JM
4430{
4431 struct gdbarch_swap_registration *rego;
4432 struct gdbarch_swap **curr = &gdbarch->swap;
be5a57e1 4433 for (rego = gdbarch_swap_registry.registrations;
0f71a2f6
JM
4434 rego != NULL;
4435 rego = rego->next)
4436 {
4437 if (rego->data != NULL)
4438 {
4439 (*curr) = XMALLOC (struct gdbarch_swap);
4440 (*curr)->source = rego;
4441 (*curr)->swap = xmalloc (rego->sizeof_data);
4442 (*curr)->next = NULL;
4443 memset (rego->data, 0, rego->sizeof_data);
4444 curr = &(*curr)->next;
4445 }
4446 if (rego->init != NULL)
4447 rego->init ();
4448 }
4449}
4450
0f71a2f6 4451static void
104c1213 4452swapout_gdbarch_swap (struct gdbarch *gdbarch)
0f71a2f6
JM
4453{
4454 struct gdbarch_swap *curr;
4455 for (curr = gdbarch->swap;
4456 curr != NULL;
4457 curr = curr->next)
4458 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
4459}
4460
0f71a2f6 4461static void
104c1213 4462swapin_gdbarch_swap (struct gdbarch *gdbarch)
0f71a2f6
JM
4463{
4464 struct gdbarch_swap *curr;
4465 for (curr = gdbarch->swap;
4466 curr != NULL;
4467 curr = curr->next)
4468 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
4469}
4470
4471
be5a57e1 4472/* Keep a registry of the architectures known by GDB. */
0f71a2f6 4473
4b9b3959 4474struct gdbarch_registration
0f71a2f6
JM
4475{
4476 enum bfd_architecture bfd_architecture;
4477 gdbarch_init_ftype *init;
4b9b3959 4478 gdbarch_dump_tdep_ftype *dump_tdep;
0f71a2f6 4479 struct gdbarch_list *arches;
4b9b3959 4480 struct gdbarch_registration *next;
0f71a2f6
JM
4481};
4482
be5a57e1 4483static struct gdbarch_registration *gdbarch_registry = NULL;
0f71a2f6 4484
b4a20239
AC
4485static void
4486append_name (const char ***buf, int *nr, const char *name)
4487{
4488 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4489 (*buf)[*nr] = name;
4490 *nr += 1;
4491}
4492
4493const char **
4494gdbarch_printable_names (void)
4495{
4496 if (GDB_MULTI_ARCH)
4497 {
4498 /* Accumulate a list of names based on the registed list of
4499 architectures. */
4500 enum bfd_architecture a;
4501 int nr_arches = 0;
4502 const char **arches = NULL;
4b9b3959 4503 struct gdbarch_registration *rego;
be5a57e1 4504 for (rego = gdbarch_registry;
b4a20239
AC
4505 rego != NULL;
4506 rego = rego->next)
4507 {
4508 const struct bfd_arch_info *ap;
4509 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4510 if (ap == NULL)
8e65ff28
AC
4511 internal_error (__FILE__, __LINE__,
4512 "gdbarch_architecture_names: multi-arch unknown");
b4a20239
AC
4513 do
4514 {
4515 append_name (&arches, &nr_arches, ap->printable_name);
4516 ap = ap->next;
4517 }
4518 while (ap != NULL);
4519 }
4520 append_name (&arches, &nr_arches, NULL);
4521 return arches;
4522 }
4523 else
4524 /* Just return all the architectures that BFD knows. Assume that
4525 the legacy architecture framework supports them. */
4526 return bfd_arch_list ();
4527}
4528
4529
0f71a2f6 4530void
4b9b3959
AC
4531gdbarch_register (enum bfd_architecture bfd_architecture,
4532 gdbarch_init_ftype *init,
4533 gdbarch_dump_tdep_ftype *dump_tdep)
0f71a2f6 4534{
4b9b3959 4535 struct gdbarch_registration **curr;
0f71a2f6 4536 const struct bfd_arch_info *bfd_arch_info;
ec3d358c 4537 /* Check that BFD recognizes this architecture */
0f71a2f6
JM
4538 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4539 if (bfd_arch_info == NULL)
4540 {
8e65ff28
AC
4541 internal_error (__FILE__, __LINE__,
4542 "gdbarch: Attempt to register unknown architecture (%d)",
4543 bfd_architecture);
0f71a2f6
JM
4544 }
4545 /* Check that we haven't seen this architecture before */
be5a57e1 4546 for (curr = &gdbarch_registry;
0f71a2f6
JM
4547 (*curr) != NULL;
4548 curr = &(*curr)->next)
4549 {
4550 if (bfd_architecture == (*curr)->bfd_architecture)
8e65ff28
AC
4551 internal_error (__FILE__, __LINE__,
4552 "gdbarch: Duplicate registraration of architecture (%s)",
4553 bfd_arch_info->printable_name);
0f71a2f6
JM
4554 }
4555 /* log it */
4556 if (gdbarch_debug)
4557 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4558 bfd_arch_info->printable_name,
4559 (long) init);
4560 /* Append it */
4b9b3959 4561 (*curr) = XMALLOC (struct gdbarch_registration);
0f71a2f6
JM
4562 (*curr)->bfd_architecture = bfd_architecture;
4563 (*curr)->init = init;
4b9b3959 4564 (*curr)->dump_tdep = dump_tdep;
0f71a2f6
JM
4565 (*curr)->arches = NULL;
4566 (*curr)->next = NULL;
8e1a459b
C
4567 /* When non- multi-arch, install whatever target dump routine we've
4568 been provided - hopefully that routine has been written correctly
4b9b3959
AC
4569 and works regardless of multi-arch. */
4570 if (!GDB_MULTI_ARCH && dump_tdep != NULL
4571 && startup_gdbarch.dump_tdep == NULL)
4572 startup_gdbarch.dump_tdep = dump_tdep;
4573}
4574
4575void
4576register_gdbarch_init (enum bfd_architecture bfd_architecture,
4577 gdbarch_init_ftype *init)
4578{
4579 gdbarch_register (bfd_architecture, init, NULL);
0f71a2f6 4580}
0f71a2f6
JM
4581
4582
4583/* Look for an architecture using gdbarch_info. Base search on only
4584 BFD_ARCH_INFO and BYTE_ORDER. */
4585
4586struct gdbarch_list *
104c1213
JM
4587gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4588 const struct gdbarch_info *info)
0f71a2f6
JM
4589{
4590 for (; arches != NULL; arches = arches->next)
4591 {
4592 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4593 continue;
4594 if (info->byte_order != arches->gdbarch->byte_order)
4595 continue;
4596 return arches;
4597 }
4598 return NULL;
4599}
4600
4601
4602/* Update the current architecture. Return ZERO if the update request
4603 failed. */
4604
4605int
16f33e29 4606gdbarch_update_p (struct gdbarch_info info)
0f71a2f6
JM
4607{
4608 struct gdbarch *new_gdbarch;
4609 struct gdbarch_list **list;
4b9b3959 4610 struct gdbarch_registration *rego;
0f71a2f6
JM
4611
4612 /* Fill in any missing bits. Most important is the bfd_architecture
4613 which is used to select the target architecture. */
4614 if (info.bfd_architecture == bfd_arch_unknown)
4615 {
4616 if (info.bfd_arch_info != NULL)
4617 info.bfd_architecture = info.bfd_arch_info->arch;
4618 else if (info.abfd != NULL)
4619 info.bfd_architecture = bfd_get_arch (info.abfd);
4620 /* FIXME - should query BFD for its default architecture. */
4621 else
4622 info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
4623 }
4624 if (info.bfd_arch_info == NULL)
4625 {
4626 if (target_architecture_auto && info.abfd != NULL)
4627 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
4628 else
4629 info.bfd_arch_info = current_gdbarch->bfd_arch_info;
4630 }
4631 if (info.byte_order == 0)
4632 {
4633 if (target_byte_order_auto && info.abfd != NULL)
4634 info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
4635 : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
4636 : 0);
4637 else
4638 info.byte_order = current_gdbarch->byte_order;
4639 /* FIXME - should query BFD for its default byte-order. */
4640 }
4641 /* A default for abfd? */
4642
4643 /* Find the target that knows about this architecture. */
be5a57e1 4644 for (rego = gdbarch_registry;
4b9b3959
AC
4645 rego != NULL;
4646 rego = rego->next)
4647 if (rego->bfd_architecture == info.bfd_architecture)
4648 break;
0f71a2f6
JM
4649 if (rego == NULL)
4650 {
4651 if (gdbarch_debug)
4652 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
4653 return 0;
4654 }
4655
4656 if (gdbarch_debug)
4657 {
4658 fprintf_unfiltered (gdb_stdlog,
4659 "gdbarch_update: info.bfd_architecture %d (%s)\n",
4660 info.bfd_architecture,
adf40b2e 4661 bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
0f71a2f6
JM
4662 fprintf_unfiltered (gdb_stdlog,
4663 "gdbarch_update: info.bfd_arch_info %s\n",
4664 (info.bfd_arch_info != NULL
4665 ? info.bfd_arch_info->printable_name
4666 : "(null)"));
4667 fprintf_unfiltered (gdb_stdlog,
4668 "gdbarch_update: info.byte_order %d (%s)\n",
4669 info.byte_order,
4670 (info.byte_order == BIG_ENDIAN ? "big"
4671 : info.byte_order == LITTLE_ENDIAN ? "little"
4672 : "default"));
4673 fprintf_unfiltered (gdb_stdlog,
4674 "gdbarch_update: info.abfd 0x%lx\n",
4675 (long) info.abfd);
4676 fprintf_unfiltered (gdb_stdlog,
4677 "gdbarch_update: info.tdep_info 0x%lx\n",
4678 (long) info.tdep_info);
4679 }
4680
4681 /* Ask the target for a replacement architecture. */
4682 new_gdbarch = rego->init (info, rego->arches);
4683
4684 /* Did the target like it? No. Reject the change. */
4685 if (new_gdbarch == NULL)
4686 {
4687 if (gdbarch_debug)
4688 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
4689 return 0;
4690 }
4691
4692 /* Did the architecture change? No. Do nothing. */
4693 if (current_gdbarch == new_gdbarch)
4694 {
4695 if (gdbarch_debug)
4696 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
4697 (long) new_gdbarch,
4698 new_gdbarch->bfd_arch_info->printable_name);
4699 return 1;
4700 }
4701
4702 /* Swap all data belonging to the old target out */
4703 swapout_gdbarch_swap (current_gdbarch);
4704
4705 /* Is this a pre-existing architecture? Yes. Swap it in. */
4706 for (list = &rego->arches;
4707 (*list) != NULL;
4708 list = &(*list)->next)
4709 {
4710 if ((*list)->gdbarch == new_gdbarch)
4711 {
4712 if (gdbarch_debug)
4b9b3959
AC
4713 fprintf_unfiltered (gdb_stdlog,
4714 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
0f71a2f6
JM
4715 (long) new_gdbarch,
4716 new_gdbarch->bfd_arch_info->printable_name);
4717 current_gdbarch = new_gdbarch;
4718 swapin_gdbarch_swap (new_gdbarch);
4719 return 1;
4720 }
4721 }
4b9b3959 4722
0f71a2f6
JM
4723 /* Append this new architecture to this targets list. */
4724 (*list) = XMALLOC (struct gdbarch_list);
4725 (*list)->next = NULL;
4726 (*list)->gdbarch = new_gdbarch;
4727
4728 /* Switch to this new architecture. Dump it out. */
4729 current_gdbarch = new_gdbarch;
4730 if (gdbarch_debug)
4731 {
4732 fprintf_unfiltered (gdb_stdlog,
adf40b2e 4733 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
0f71a2f6
JM
4734 (long) new_gdbarch,
4735 new_gdbarch->bfd_arch_info->printable_name);
0f71a2f6 4736 }
adf40b2e 4737
4b9b3959
AC
4738 /* Check that the newly installed architecture is valid. Plug in
4739 any post init values. */
4740 new_gdbarch->dump_tdep = rego->dump_tdep;
0f71a2f6
JM
4741 verify_gdbarch (new_gdbarch);
4742
4743 /* Initialize the per-architecture memory (swap) areas.
4744 CURRENT_GDBARCH must be update before these modules are
4745 called. */
4746 init_gdbarch_swap (new_gdbarch);
adf40b2e 4747
0f71a2f6
JM
4748 /* Initialize the per-architecture data-pointer of all parties that
4749 registered an interest in this architecture. CURRENT_GDBARCH
4750 must be updated before these modules are called. */
4751 init_gdbarch_data (new_gdbarch);
adf40b2e 4752
4b9b3959
AC
4753 if (gdbarch_debug)
4754 gdbarch_dump (current_gdbarch, gdb_stdlog);
4755
0f71a2f6
JM
4756 return 1;
4757}
c906108c 4758
c906108c 4759
c906108c
SS
4760/* Disassembler */
4761
4762/* Pointer to the target-dependent disassembly function. */
104c1213 4763int (*tm_print_insn) (bfd_vma, disassemble_info *);
c906108c
SS
4764disassemble_info tm_print_insn_info;
4765
4766
104c1213 4767extern void _initialize_gdbarch (void);
b4a20239 4768
c906108c 4769void
7c7651b2 4770_initialize_gdbarch (void)
c906108c 4771{
5d161b24
DB
4772 struct cmd_list_element *c;
4773
adf40b2e 4774 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
c906108c
SS
4775 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
4776 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
4777 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
4778 tm_print_insn_info.print_address_func = dis_asm_print_address;
4779
5d161b24 4780 add_show_from_set (add_set_cmd ("arch",
c906108c
SS
4781 class_maintenance,
4782 var_zinteger,
adf40b2e 4783 (char *)&gdbarch_debug,
c906108c 4784 "Set architecture debugging.\n\
5d161b24
DB
4785When non-zero, architecture debugging is enabled.", &setdebuglist),
4786 &showdebuglist);
59233f88
AC
4787 c = add_set_cmd ("archdebug",
4788 class_maintenance,
4789 var_zinteger,
4790 (char *)&gdbarch_debug,
4791 "Set architecture debugging.\n\
5d161b24
DB
4792When non-zero, architecture debugging is enabled.", &setlist);
4793
59233f88
AC
4794 deprecate_cmd (c, "set debug arch");
4795 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
c906108c 4796}
This page took 0.53005 seconds and 4 git commands to generate.