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