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