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