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