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