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