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